-
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
Support --no@//:bool_flag
on the command line.
#13418
Conversation
This applies label canonicalization to starlark flags having a `--no` prefix.
Oh, nice! While I like this contribution, I vaguely recall some effort to move away from the I may be wrong on that, so as next step let me dig into discussion history and see if I can confirm/deny my claim. |
Aha, good to know. Thanks for looking into it! FYI, without this we can crash Bazel (even at master/HEAD) by mixing $ bazelisk build --no//:bool_flag --no@//:bool_flag
INFO: Invocation ID: 960e93ef-d3ac-416d-8fb8-b53d90d430ff
WARNING: Usage: bazel build <options> <targets>.
Invoke `bazel help build` for full description of usage and options.
Your request is correct, but requested an empty set of targets. Nothing will be built.
FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.IllegalStateException: Duplicate key //:bool_flag (attempted merging values false and false)
at java.base/java.util.stream.Collectors.duplicateKeyException(Unknown Source)
at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Unknown Source)
at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(Unknown Source)
at com.google.common.collect.CollectSpliterators$1WithCharacteristics.lambda$forEachRemaining$1(CollectSpliterators.java:67)
at java.base/java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Unknown Source)
at com.google.common.collect.CollectSpliterators$1WithCharacteristics.forEachRemaining(CollectSpliterators.java:67)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
at com.google.devtools.build.lib.analysis.config.BuildOptions.labelizeStarlarkOptions(BuildOptions.java:85)
at com.google.devtools.build.lib.analysis.config.BuildOptions.of(BuildOptions.java:147)
at com.google.devtools.build.lib.analysis.ConfiguredRuleClassProvider.createBuildOptions(ConfiguredRuleClassProvider.java:726)
at com.google.devtools.build.lib.runtime.BlazeRuntime.createBuildOptions(BlazeRuntime.java:749)
at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:136)
at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:401)
at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:97)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:579)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:231)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:543)
at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$1(GrpcServerImpl.java:606)
at io.grpc.Context$1.run(Context.java:579)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source) |
Okay, so this simply extend the existing My comments about There was also discussion about extra subtleties in the Starlark vs. native flag parser. Julie Xia, who best knew this and has since moved onto other things, wrote:
That led to 28442ae. If I'm understanding this correctly, that means |
This applies label canonicalization to starlark flags having a
--no
prefix.
Relates to #11128.