[6.0.0] Config setting's visibility propagates through aliases
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the bug:
If you create a config setting that is passed through an alias to another target, bazel will complain about visibility of the config setting if the config setting is not visible to the target depending on it through the alias. This was not happening on bazel 5.x.x.
### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Repository with code to repro the issue https://github.com/exoson/visibility_repro.
```
$ bazel build //:files
ERROR: /data/repos/visibility_repro/BUILD:1:10: in filegroup rule //:files: target '//private:_private_config_setting' is not visible from target '//:files'. Check the visibility declaration of the former target if you think the dependency is legitimate
ERROR: /data/repos/visibility_repro/BUILD:1:10: Analysis of target '//:files' failed
ERROR: Analysis of target '//:files' failed; build aborted:
INFO: Elapsed time: 0.040s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
```
### Which operating system are you running Bazel on?
linux
### What is the output of `bazel info release`?
development version
### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.
bazel build //src:bazel-bin inside bazel git repo
### What's the output of `git remote get-url origin; git rev-parse master; git rev-parse HEAD` ?
```text
https://github.com/bazelbuild/bazel.git
19b8d24531fb728701a85ec050361d434600b5d2
7ccc66108f08f7b6c6f6e5229f70f29962ea19ce
```
### Have you found anything relevant by searching the web?
_No response_
### Any other information, logs, or outputs that you want to share?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.