-
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
'bazel info' reports 'unknown key' error for .bazelrc with Starlark flag #11301
Labels
P2
We'll consider working on this in future. (Assignee optional)
team-Configurability
platforms, toolchains, cquery, select(), config transitions
type: bug
Comments
jin
added
team-Configurability
platforms, toolchains, cquery, select(), config transitions
type: bug
untriaged
labels
May 7, 2020
gregestren
added
P2
We'll consider working on this in future. (Assignee optional)
and removed
untriaged
labels
May 18, 2020
@juliexxia is investigating. We believe there's a fast fix for this. |
It seems like bazel info doesn't need to know about build settings at all, so working on a change to ignore them for the info command. |
This was referenced Dec 7, 2020
apattidb
pushed a commit
to databricks/bazel
that referenced
this issue
Dec 8, 2020
Related: bazelbuild#11301 (Fixed in bazelbuild@2ec58f6) Motivation: `StarlarkOptionsParser.removeStarlarkOptions()` doesn't take the case into account where the specified Starlark option has a value, e.g. `--//my_rules/custom_flags:foo=bar`. Modifications: - Do not pass a Starlark flag value when validating the flag name. Result: `bazel info` does not fail anymore when `.bazelrc` contains a statement like the following: build --//my_rules/custom_flags:foo=bar
bazel-io
pushed a commit
that referenced
this issue
Dec 22, 2020
Related: #11301 (Partially fixed in 2ec58f6) Motivation: `StarlarkOptionsParser.removeStarlarkOptions()` doesn't take the case into account where the specified Starlark option has a value, e.g. `--//my_rules/custom_flags:foo=bar`. Modifications: - Do not pass a Starlark flag value when validating the flag name. Result: `bazel info` does not fail anymore when `.bazelrc` contains a statement like the following: build --//my_rules/custom_flags:foo=bar Closes #12648. PiperOrigin-RevId: 348676049
katre
pushed a commit
that referenced
this issue
Jul 12, 2021
Related: #11301 (Partially fixed in 2ec58f6) Motivation: `StarlarkOptionsParser.removeStarlarkOptions()` doesn't take the case into account where the specified Starlark option has a value, e.g. `--//my_rules/custom_flags:foo=bar`. Modifications: - Do not pass a Starlark flag value when validating the flag name. Result: `bazel info` does not fail anymore when `.bazelrc` contains a statement like the following: build --//my_rules/custom_flags:foo=bar Closes #12648. PiperOrigin-RevId: 348676049
katre
pushed a commit
to katre/bazel
that referenced
this issue
Jul 13, 2021
Related: bazelbuild#11301 (Partially fixed in bazelbuild@2ec58f6) Motivation: `StarlarkOptionsParser.removeStarlarkOptions()` doesn't take the case into account where the specified Starlark option has a value, e.g. `--//my_rules/custom_flags:foo=bar`. Modifications: - Do not pass a Starlark flag value when validating the flag name. Result: `bazel info` does not fail anymore when `.bazelrc` contains a statement like the following: build --//my_rules/custom_flags:foo=bar Closes bazelbuild#12648. PiperOrigin-RevId: 348676049
katre
pushed a commit
to katre/bazel
that referenced
this issue
Jul 13, 2021
Related: bazelbuild#11301 (Partially fixed in bazelbuild@2ec58f6) Motivation: `StarlarkOptionsParser.removeStarlarkOptions()` doesn't take the case into account where the specified Starlark option has a value, e.g. `--//my_rules/custom_flags:foo=bar`. Modifications: - Do not pass a Starlark flag value when validating the flag name. Result: `bazel info` does not fail anymore when `.bazelrc` contains a statement like the following: build --//my_rules/custom_flags:foo=bar Closes bazelbuild#12648. PiperOrigin-RevId: 348676049
katre
pushed a commit
to katre/bazel
that referenced
this issue
Jul 13, 2021
Related: bazelbuild#11301 (Partially fixed in bazelbuild@2ec58f6) Motivation: `StarlarkOptionsParser.removeStarlarkOptions()` doesn't take the case into account where the specified Starlark option has a value, e.g. `--//my_rules/custom_flags:foo=bar`. Modifications: - Do not pass a Starlark flag value when validating the flag name. Result: `bazel info` does not fail anymore when `.bazelrc` contains a statement like the following: build --//my_rules/custom_flags:foo=bar Closes bazelbuild#12648. PiperOrigin-RevId: 348676049
luca-digrazia
pushed a commit
to luca-digrazia/DatasetCommitsDiffSearch
that referenced
this issue
Sep 4, 2022
Related: bazelbuild/bazel#11301 (Partially fixed in bazelbuild/bazel@2ec58f6) Motivation: `StarlarkOptionsParser.removeStarlarkOptions()` doesn't take the case into account where the specified Starlark option has a value, e.g. `--//my_rules/custom_flags:foo=bar`. Modifications: - Do not pass a Starlark flag value when validating the flag name. Result: `bazel info` does not fail anymore when `.bazelrc` contains a statement like the following: build --//my_rules/custom_flags:foo=bar Closes #12648. PiperOrigin-RevId: 348676049
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
Description of the problem / feature request:
If the workspace's
.bazelrc
has a flag that sets a build setting defined in Starlark,bazel info
fails withERROR: unknown key
. Ifbazel info
is given an argument, it fails withat most one key may be specified
.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
In the example workspace below, run
bazel info
orbazel info output_base
.What operating system are you running Bazel on?
macOS / amd64 10.15.4
What's the output of
bazel info release
?If the .bazelrc file is removed or commented:
Any other information, logs, or outputs that you want to share?
Originally reported in bazel-contrib/rules_go#2475.
I switched rules_go's static analysis framework to using Starlark flags and configuration transitions. I'd like to recommend that users put the default static analysis binary in .bazelrc:
cc @katre @gregestren @juliexxia
The text was updated successfully, but these errors were encountered: