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

flag_alias with special boolean syntax breaks various Bazel commands #14269

Closed
uhthomas opened this issue Nov 13, 2021 · 5 comments
Closed

flag_alias with special boolean syntax breaks various Bazel commands #14269

uhthomas opened this issue Nov 13, 2021 · 5 comments
Assignees
Labels
team-Configurability platforms, toolchains, cquery, select(), config transitions type: bug
Milestone

Comments

@uhthomas
Copy link
Contributor

uhthomas commented Nov 13, 2021

Description of the problem / feature request:

Various Bazel commands do not work when using a flag alias with special boolean syntax.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

BUILD.bazel

load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")

bool_flag(
    name = "fips",
    build_setting_default = True,
)

config_setting(
    name = "use_fips",
    flag_values = {":fips": "True"},
)

.bazelrc

build --flag_alias=nofips=no//:fips
build --nofips

Run bazel clean, or bazel info.

What operating system are you running Bazel on?

❯ uname -mrs
Darwin 20.6.0 x86_64

What's the output of bazel info release?

❯ bazel info release
(06:44:10) INFO: Invocation ID: ede2dd6e-56fe-43f6-8929-3cb5b6330818
release: release 4.2.1
(06:44:10) ERROR: unknown key(s): '--no//:fips'

Have you found anything relevant by searching the web?

No.

Any other information, logs, or outputs that you want to share?

❯ bazel clean
(06:45:39) INFO: Invocation ID: 8a46aebd-ca5c-463f-a6e2-8e534a02d9f5
(06:45:39) ERROR: Unrecognized arguments: --no//tools/config:fips
❯ bazel info
(06:45:43) INFO: Invocation ID: 7cb3b3fe-9ca0-47f3-bd68-46e5f537879f
(06:45:43) ERROR: unknown key(s): '--no//tools/config:fips'
@gregestren gregestren added team-Configurability platforms, toolchains, cquery, select(), config transitions untriaged type: bug labels Nov 18, 2021
@aranguyen
Copy link
Contributor

Have you tried using later releases? I'm using 6.0.0-pre.20211101.2 with the same example you provided and did not see the same error.

@aiuto aiuto added this to the flags cleanup milestone Dec 10, 2021
@gregestren
Copy link
Contributor

@aranguyen - since we expect this work and this is a pretty old bug now, let's close it. @uhthomas feel free to re-open if the suggestion above doesn't work.

@uhthomas
Copy link
Contributor Author

The commands seem to work okay now, though there is excessive noise.

(00:03:47) WARNING: Blaze clean does not support starlark options. Ignoring options: [--@io_bazel_rules_go//go/config:linkmode=pie]

What makes this a warning? Can this be silenced?

@gregestren
Copy link
Contributor

See #13473 (comment) and above discussion.

Maybe it can? Someone would have to review the history of the rationale behind the warning. My comment there suggests the warning is meaningful to bazel info. Maybe not bazel clean?

@aranguyen
Copy link
Contributor

Please see here for the rational behind the WARNING for both commands info and clean when Starlark options are provided #11506.

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

No branches or pull requests

4 participants