"bazel clean" failure when Starlark options present in "build" lines in .bazelrc
See original GitHub issueDescription of the problem / feature request:
When I use a label-typed Bazel option on a build
line in a .bazelrc
file, Bazel fails with an error:
# .bazelrc file
build --//fuzzing:cc_engine=//fuzzing/engines:libfuzzer
$ bazel clean
ERROR: Unrecognized arguments: --//fuzzing:cc_engine=//fuzzing/engines:libfuzzer
This is quite problematic for us, because we offer this option in a library, and developers are expected to be able to override the option in their own workspaces.
Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
$ git clone git@github.com:bazelbuild/rules_fuzzing.git
$ cd rules_fuzzing
$ [edit the .bazelrc file and add the "build --//fuzzing:cc_engine=//fuzzing/engines:libfuzzer" snippet]
$ bazel clean
What operating system are you running Bazel on?
Debian
What’s the output of bazel info release
?
release 3.7.2
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (9 by maintainers)
Top Results From Across the Web
Commands and Options | Bazel
These options control Bazel's error-checking and/or warnings. ... or cc_binary build rules are placed on the compiler command line after these options.
Read more >Command-Line Reference - Bazel
Canonicalizes a list of bazel options. clean, Removes output files and optionally stops the server. coverage, Generates code coverage report for specified test ......
Read more >bazelrc - Google Git
For projects which use TensorFlow as part of a Bazel build process, putting ... Default options should come above this line. # Allow...
Read more >README.md - Aspect's Bazel Documentation
This project extends Bazel with build rules for Haskell. Get started building your own ... You can learn more about Bazel's command line...
Read more >Bazel 0.18.0 release candidate 6 is available for testing
New bazelrc file list. - Adds --incompatible_expand_directories to automatically expand directories in skylark command lines. Design doc:
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
CleanCommand
at the4.1.0
tag: https://github.com/bazelbuild/bazel/blob/4.1.0/src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java. I see the relevant code:https://github.com/bazelbuild/bazel/blob/c4975efdd7ede7b46637bf353209d9ac371181a5/src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java#L133-L135
And I don’t see any interesting changes to the file since: https://github.com/bazelbuild/bazel/commits/master/src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java
Still get a warning message of this for bazel 5.1.0