-
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
config_setting
incorrectly treated as implicit dependency by --incompatible_visibility_private_attributes_at_definition
#19126
Labels
team-Loading-API
BUILD file and macro processing: labels, package(), visibility, glob
type: bug
untriaged
Comments
Pavank1992
added
the
team-Loading-API
BUILD file and macro processing: labels, package(), visibility, glob
label
Jul 31, 2023
@bazel-io flag |
bazel-io
added
the
potential release blocker
Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone
label
Aug 4, 2023
@bazel-io fork 6.4.0 |
bazel-io
removed
the
potential release blocker
Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone
label
Aug 4, 2023
iancha1992
pushed a commit
to iancha1992/bazel
that referenced
this issue
Aug 7, 2023
All dependencies for `select` expressions are collected in an implicit `$config_dependencies` attribute. Even with `--incompatible_visibility_private_attributes_at_definition`, visibility for this attribute is now checked relative to the use rather than the definition of the rule. Fixes bazelbuild#19126 Closes bazelbuild#19139. PiperOrigin-RevId: 553830083 Change-Id: Ic4af0f5ad9a0c627c973cd5ce88dd1e1bf51474e
iancha1992
pushed a commit
to iancha1992/bazel
that referenced
this issue
Aug 7, 2023
All dependencies for `select` expressions are collected in an implicit `$config_dependencies` attribute. Even with `--incompatible_visibility_private_attributes_at_definition`, visibility for this attribute is now checked relative to the use rather than the definition of the rule. Fixes bazelbuild#19126 Closes bazelbuild#19139. PiperOrigin-RevId: 553830083 Change-Id: Ic4af0f5ad9a0c627c973cd5ce88dd1e1bf51474e
iancha1992
pushed a commit
to iancha1992/bazel
that referenced
this issue
Aug 7, 2023
All dependencies for `select` expressions are collected in an implicit `$config_dependencies` attribute. Even with `--incompatible_visibility_private_attributes_at_definition`, visibility for this attribute is now checked relative to the use rather than the definition of the rule. Fixes bazelbuild#19126 Closes bazelbuild#19139. PiperOrigin-RevId: 553830083 Change-Id: Ic4af0f5ad9a0c627c973cd5ce88dd1e1bf51474e
iancha1992
added a commit
that referenced
this issue
Aug 7, 2023
All dependencies for `select` expressions are collected in an implicit `$config_dependencies` attribute. Even with `--incompatible_visibility_private_attributes_at_definition`, visibility for this attribute is now checked relative to the use rather than the definition of the rule. Fixes #19126 Closes #19139. PiperOrigin-RevId: 553830083 Change-Id: Ic4af0f5ad9a0c627c973cd5ce88dd1e1bf51474e Co-authored-by: Fabian Meumertzheim <[email protected]>
A fix for this issue has been included in Bazel 6.4.0 RC1. Please test out the release candidate and report any issues as soon as possible. Thanks! |
I gave 6.4.0rc1 a quick test and confirmed that it does fix the issue in my actual repository, so everything looks good here! 😁 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
team-Loading-API
BUILD file and macro processing: labels, package(), visibility, glob
type: bug
untriaged
Description of the bug:
When explicitly depending on a
config_setting
and enabling--incompatible_visibility_private_attributes_at_definition
, the setting is incorrectly treated as an implicit dependency which must be visible to the dependent's rule definition, which doesn't make logical sense. The full set of conditions from my understanding is:config_setting
from a different package through aselect
key.config_setting
.--incompatible_visibility_private_attributes_at_definition
.When all three happen it throws an error like this:
This doesn't make sense:
target '//config_setting:my_setting' is not visible from target '//build_defs:defs.bzl'
. This should not be required, as the config setting is not an implicit dependency.What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Minimal reproduction here: https://github.com/dgp1130/bazel-config-setting-visibility-bug/
It does rely on Skylib which probably isn't necessary but I figured that wasn't too significant and I didn't want to try and figure out how to define flags manually.
Which operating system are you running Bazel on?
Ubuntu on WSL
What is the output of
bazel info release
?release 6.3.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
I don't know, however I initially reproduced on version 6.0.0 before upgrading to 6.3.0 to confirm it was still present on latest. The bug is at least that old.
Have you found anything relevant by searching the web?
#12932 feels like it might be relevant, however I found that
--incompatible_enforce_config_setting_visibility
had no effect, so it could be nothing.Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: