-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
bazelrc, --announce_rc, --enable_platform_specific_config disagree on precedence of platform-specific flags #10781
Comments
Assigning to @meteorcloudy for triage / prioritization, who I believed touched this code last. |
@kevingessner Thanks for reporting this bug and providing the reproduce case. I'll look into this. |
Hi @kevingessner , I did some investigation on this. It seems like the problem has nothing to do with If you replace Bazel always expands |
Since this is not a Bazel bug, I'll close it now :) |
Description of the problem:
--announce_rc
prints the flags that are being applied from bazelrc files and the command line. The order isn't documented in the bazel docs but the command parsing blog post says "Use --announce_rc to see the order used!". So I expect the order the flags are announced to be their precedence: last announced flag wins.When
--enable_platform_specific_config
is used, the order is wrong: the platform-specific flags are always announced last, even though they do not take priority. Instead, it appears that the platform-specific flags are expanded at the point of--enable_platform_specific_config
earlier in the announcement, not the order of the bazelrc nor of the announcement.The log should be fixed to announce the flags in the correct place in the order. Alternatively,
enable_platform_specific_config
's behavior should be changed to apply those flags last, matching the announcement -- this would make platform-specific configs more useful as predictable flag overrides (though this would be a breaking change).In either case, the documentation should be updated to reflect the true priority of platform-specific configs.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
bazel build --announce_rc :env
-- note that the platform specific override ofMY_OPTION
is announced after--action_env=MY_OPTION=global
cat bazel-bin/env.txt
-- note that it contains theglobal
value, not the platform-specific one.What operating system are you running Bazel on?
centos and macos
What's the output of
bazel info release
?repro'd on 2.0.0 and 2.1.0
Have you found anything relevant by searching the web?
The text was updated successfully, but these errors were encountered: