Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dgp1130/bazel-config-setting-visibility-bug
https://github.com/dgp1130/bazel-config-setting-visibility-bug
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dgp1130/bazel-config-setting-visibility-bug
- Owner: dgp1130
- Created: 2023-07-29T04:57:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-29T05:20:26.000Z (over 1 year ago)
- Last Synced: 2024-10-06T02:01:52.968Z (about 1 month ago)
- Language: Starlark
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bazel Visibility Bug
Bug report: https://github.com/bazelbuild/bazel/issues/19126
```
$ bazel build //:my_target
ERROR: /home/doug/Source/bazel_visibility/BUILD.bazel:3:8: in my_rule rule //:my_target: target '//config_setting:my_setting' is not visible from target '//build_defs:defs.bzl'. Check the visibility declaration of the former target if you think the dependency is legitimate
ERROR: /home/doug/Source/bazel_visibility/BUILD.bazel:3:8: Analysis of target '//:my_target' failed
ERROR: Analysis of target '//:my_target' failed; build aborted:
INFO: Elapsed time: 0.064s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (2 packages loaded, 2 targets configured)
```This bug appears to reproduce in the combination of:
1. A target which depends on a `config_setting` from a different package
through a `select` key.
1. The target is an instance of a rule from a another package which does _not_
have visibility into the `config_setting`.
1. `--incompatible_visibility_private_attributes_at_definition`.
* Set in the `.bazelrc`.This appears to confuse Bazel, which treats the `config_setting` as an implicit
dependency of the rule which defined the target depending on it. This does not
make logical sense as the `config_setting` is not an implicit dependency and
should not need to be visible to the rule.