-
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
Passing bool_flag
to analysistest.make
infers wrong label for the given string
#19286
Comments
Wrapping all keys into |
@rickeylev I would assume but haven't verified that rules_testing is also affected by this. |
That doesn't work, because they get resolved against the main repo, so get a string of Am I recalling correctly @keith? |
That seems to work in my repro case here but not the real case bazelbuild/rules_apple#2130, maybe because of the extra level of indirection there? |
This used to be the case, but @Wyverald fixed this for Bazel 6. |
With bzlmod enabled, errors like the following would occur: Error in analysis_test_transition: invalid transition output '@[unknown repo '' requested from @bazel_skylib~1.3.0]//:clippy_flags': no repo visible as @ from repository '@bazel_skylib~1.3.0' To resolve this, use str(Label("...")) to get the canonical label to use as the key in config_settings. Related issues: bazelbuild#2181, bazelbuild/bazel#19286
With bzlmod enabled, errors like the following would occur: ``` Error in analysis_test_transition: invalid transition output '@[unknown repo '' requested from @bazel_skylib~1.3.0]//:clippy_flags': no repo visible as @ from repository '@bazel_skylib~1.3.0' ``` To resolve this, use str(Label("...")) to get the canonical label to use as the key in config_settings. Related issues: #2181, bazelbuild/bazel#19286 --------- Co-authored-by: UebelAndre <[email protected]>
Description of the bug:
When creating a custom analysistest to set specific config_settings like this:
Where
some_setting
is a simplebool_flag
:You get this error:
This appears to be because skylib is inferring
some_setting
in the context of its own repo. If you prefix//:some_setting
with@//:some_setting
it works in this case, but if the label lives in a ruleset that might not work for other tests that run in the context of a test workspace.It seems that skylib should accept labels here instead, but with some quick tests locally that doesn't work either.
Which category does this issue belong to?
No response
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
In this project: skylibrepro.zip run
bazel test test
Which operating system are you running Bazel on?
macOS
What is the output of
bazel info release
?cc5889c
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.bazelisk last_green
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: