-
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
Label behaves differently between WORKSPACE
and bzlmod build
#14590
Comments
Changing this particular label to the str(Label(...)) pattern does not behave as expected (bazelbuild/bazel#14590).
Changing this particular label to the str(Label(...)) pattern does not behave as expected (bazelbuild/bazel#14590). It is thus safer to revert back to the old form for now and instead rely on patches in a future renaming of io_bazel_rules_go to rules_go for the BCR.
Changing this particular label to the str(Label(...)) pattern does not behave as expected (bazelbuild/bazel#14590). It is thus safer to revert back to the old form for now and instead rely on patches in a future renaming of io_bazel_rules_go to rules_go for the BCR.
I believe this is an unfortunate interaction between several factors in play:
Hopefully this sheds some light on why you might run into the problem you noticed. As for how this should fixed, I have no idea :) One thing that could be done is to use Label objects directly instead of their serialized forms, but I realize that's not always possible. |
With the recent fixes around repo mapping (especially #14852), the first bullet point above should be less of a problem ( |
Description of the problem / feature request:
In some situations, the value of a string constant constructed via
str(Label(...))
will be absolute without--experimental_enable_bzlmod
, but relative with the flag enabled.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I haven't been able to produce a truly minimized reproducer, but at least have a fully reproducible one:
The reproducer differs from
rules_go
upstream only in fmeum/rules_go@661366a.Note that I added the
str(Label(...))
construction in https://github.com/bazelbuild/rules_go/blob/979c3c634682c7bfda33bae44df4ea1c0ab2d624/go/private/nogo.bzl#L15 only recently in an effort to use repo-relative labels wherever possible. It did work withWORKSPACE
builds, but I am now seeing it fail with bzlmod.What operating system are you running Bazel on?
Linux
What's the output of
bazel info release
?development version
If
bazel info release
returns "development version" or "(@non-git)", tell us how you built Bazel.Bazelisk's last_green
What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?20d8807
I expect this to reproduce with 5.0.0, but haven't been able to verify since my reproducer triggers the bug fixed in 48a0fc5 first.
Have you found anything relevant by searching the web?
Any other information, logs, or outputs that you want to share?
The text was updated successfully, but these errors were encountered: