-
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
workspace name in local aspect hides rule providers #11734
Comments
This is very likely a repo-renaming issue, where we're failing to recognize that One of my wishlist items for this year is to reexamine the semantics of repo renaming. The outcome would inform how we handle avoiding this whole class of bugs. |
We just encountered the same in Rules Rust (bazelbuild/rules_rust#749). |
Just for data to help prioritizing, we hit another instance of this bug in bazelbuild/rules_rust#1010. |
I did some digging in another issue (#10590 (comment)) and I believe I understand this issue now. It should only appear when the aspect is named on the command line, since that doesn't go through repo mapping. The eventual fix would be a "delayed label" type thing where we can make command-line labels go through repo mapping. |
For the record, fixing this issue is on our radar for the mid term, as we'd need it before Bzlmod is officially launched. |
Could I kindly ask for status update? It seems bzlmod is moving forward, was this issue maybe already fixed? |
Dupe of #15989 (already fixed) |
Description of the problem:
Invoking an aspect that is defined in the local workspace but called by prefixing the workspace name (
@workspace
) will hide providers returned by rule the implementation from the aspect implementation. I.e. this breaks the following sentence from the aspect documentationThis seems to be another instance of #11128
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Create the following project
WORKSPACE
repro.bzl
BUILD.bazel
First invoke the aspect as follows and observe the expected output:
Then invoke the aspect prefixed by the workspace name and observe the unexpected output:
Note how the boolean value is
False
even though the providerRuleProvider
is still listed on the textual target description.Side note, the expected output is produced in both cases of:
What operating system are you running Bazel on?
Ubuntu 19.10
What's the output of
bazel info release
?release 3.3.1
(Also observed on 2.1.0)
Have you found anything relevant by searching the web?
#11128 bundles issues of this type.
The text was updated successfully, but these errors were encountered: