Skip to content
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

"bazel clean" failure when Starlark options present in "build" lines in .bazelrc #12808

Closed
stefanbucur opened this issue Jan 11, 2021 · 11 comments
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Configurability platforms, toolchains, cquery, select(), config transitions type: bug

Comments

@stefanbucur
Copy link

Description 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 [email protected]: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

@aiuto aiuto added team-Configurability platforms, toolchains, cquery, select(), config transitions untriaged labels Jan 12, 2021
@aiuto
Copy link
Contributor

aiuto commented Jan 12, 2021

Only sending to configurability because of command line parsing, but I think any team could do this.

@Yannic
Copy link
Contributor

Yannic commented Jan 12, 2021

Looks like this was previously fixed in #11506 (and I think I remember it working correctly).

/cc @juliexxia @katre

@stefanbucur
Copy link
Author

I've just checked, and Bazel does indeed display a warning when using --//fuzzing:cc_engine_sanitizer, which is a string-typed flag. However, it triggers an error for --//fuzzing:cc_engine, which is a label-typed flag. So maybe this case was not handled in #11506?

@juliexxia
Copy link
Contributor

(Context: I'm moving on from Bazel on friday and spending some time triaging all bugs assigned to me before unassigning myself)

Just tried the repro with release bazel and got the described error, but tried with bazel built at head and got the expected warning. I haven't tried to figure out what change resulted in that but I'd request trying this again when the new release comes out and see if it's still an issue.

@juliexxia juliexxia removed their assignment Feb 4, 2021
@aiuto aiuto added the P2 We'll consider working on this in future. (Assignee optional) label Feb 17, 2021
@gregestren
Copy link
Contributor

Status: let's wait until the next Bazel release to verify the issue, as @juliexxia suggested.

After that point if anyone still sees the problem please ping this thread.

@gregestren
Copy link
Contributor

This fails for me with bazel 4.1.0. I'll look further.

@gregestren gregestren added P1 I'll work on this now. (Assignee required) and removed P2 We'll consider working on this in future. (Assignee optional) labels May 26, 2021
@gregestren gregestren self-assigned this May 26, 2021
@gregestren
Copy link
Contributor

Dug in and I'm confused. :(

This works for me with bazel@head. But not bazel 4.1.0.

What would be different between 4.1.0 and head, then?

Something is not adding up here.

@gregestren
Copy link
Contributor

gregestren commented May 26, 2021

CleanCommand at the 4.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:

Event.warn(
"Blaze clean does not support starlark options. Ignoring options: "
+ removedStarlarkOptions));

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

@gregestren
Copy link
Contributor

git bisect led me to 64157a5 from Dec 22, 2020. We can request this as a cherrypick for 4.2.0.

@gregestren gregestren added P2 We'll consider working on this in future. (Assignee optional) and removed P1 I'll work on this now. (Assignee required) labels Jun 8, 2021
@gregestren
Copy link
Contributor

Closing this bug, now that it's been cherrypick-requested for 4.2.0.

@CareF
Copy link

CareF commented Oct 26, 2022

Still get a warning message of this for bazel 5.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Configurability platforms, toolchains, cquery, select(), config transitions type: bug
Projects
None yet
Development

No branches or pull requests

6 participants