User defined build setting value is ignored when the setting is referenced using its own workspace name
See original GitHub issueDescription of the problem / feature request:
User defined build setting specified on the command line is silently ignored (and default value of the setting is used instead) when the setting target label explicitly includes its workspace name.
Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I have setup a minimal repro here.
This works as expected:
bazel build first --//:first_flag=ff1
bazel build first --@//:first_flag=ff1
But the next variant is broken:
bazel build first --@first//:first_flag=ff1
What is given after the equal sign is ignored and the value of the flag is ALWAYS what is specified as build_setting_default.
Using explicit workspace name from ANOTHER workspace works again:
bazel build @second//:second --@second//:second_flag=sf1
What operating system are you running Bazel on?
Mac, Linux, Windows
What’s the output of bazel info release
?
4.0.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
How to create variables for use in Xcode build settings values?
Select your project or target from the left side of the editor. Click the Build Settings button at the top of the editor....
Read more >User and Workspace Settings - Visual Studio Code
The first time you open a workspace that defines any of these settings, VS Code will warn you and then always ignore the...
Read more >Build settings reference | Apple Developer Documentation
A detailed list of individual Xcode build settings that control or change the way a target is built.
Read more >Configuring build settings - AWS Amplify Hosting
If your project doesn't have an amplify folder in your repository, Amplify ignores the value of the AMPLIFY_DIFF_BACKEND environment variable. If you currently ......
Read more >Configuration options | Yarn - Package Manager
Environment variables can be accessed from setting definitions by using the ${NAME} syntax when defining the values. By default Yarn will require the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Similarly, Bazel fails to de-dupe the equivalent keys. After adding
ff3
as another allowed value, I can make Bazel 4 crash like so:bazel build first --//:first_flag=ff1 --@//first_flag=ff3
.PR hopefully coming shortly.
Yes, the problem is verified fixed in 5.0.