Skip to content

dgp1130/bazel-config-setting-visibility-bug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bazel Visibility Bug

Bug report: bazelbuild/bazel#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.
  2. The target is an instance of a rule from a another package which does not have visibility into the config_setting.
  3. --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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published