-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate --config=foo produces a seemingly pointless warning #11592
Comments
In most cases, it's safe to have the same flag multiple times. The only (?) case where flags can produce unexpected results if expanded multiple times are 'list' options, such as |
Right, that makes sense for |
is not equivalent to:
You also have to take into account that configs can include each other, like so:
|
Ahh... I actually don't really grok how that works to be honest. I've seen something about "in-place expansion" in the documentation too, but it still left me confused even though I've read it several times. Would you mind giving a concrete example to show how the end result might differ? |
Sure:
FWIW, I think this warning could be made less noisy, e.g., by filtering out non-list flags. That said, you should be able to arrange your config sections so you don't see the warning (although sometimes it may be inconvenient to do so). |
Oh wow I see. So Is this actually useful, or is it just an implementation quirk? Do people depend on duplication behavior like this for correctness? |
The original implementation didn't inline in-place, but did something more complex that also involved de-duplicating the configs. Unfortunately, it was confusing people more than it was helping and there were numerous bug reports about it - that's why it was changed. Dumb is good. |
As of Bazel 3.2.0, if you have
build --config=foo
in multiple places (like.bazelrc
and~/.bazelrc
),bazel build
produces the following warning:It's not clear under which scenario
--config=foo
may be "repeatable" or produce "unexpected behavior". To my understanding, such a thing cannot happen, and hence the warning seems like a bug. There does not appear to be any conflict in the requested flags. Could the warning be removed?The text was updated successfully, but these errors were encountered: