Open keith opened 2 years ago
cc @gregestren
Interestingly adding --incompatible_config_setting_private_default_visibility
fixes this.
shouldn't that be the same behavior as what we're getting with the default in this case?
https://github.com/bazelbuild/bazel/blob/9ba1adab83703ca756ff05d1298e511dc8e09320/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java#L1751-L1760 shows the intention.
So --incompatible_enforce_config_setting_visibility=1 --incompatible_config_setting_private_default_visibility=0
invokes non-standard that skips the alias' independent visibility setting in the interest of an easier migration. Which obviously doesn't serve this case.
Unfortunately it's proving cumbersome to also land --incompatible_config_setting_private_default_visibility=1
for Bazel 6.0, which would resolve this. I haven't considered that a release-blocking problem. If you do we could adjust priority. Landing --incompatible_config_setting_private_default_visibility=1
is just a matter of getting new releases on various downstream projects in Bazel's CI (like rules_go).
Looks like some recent progress on flipping --incompatible_config_setting_private_default_visibility
: https://github.com/bazelbuild/bazel/issues/12933.
I think it's marked for Bazel 7.0? (but no Github tags confirm that). If so, I think we can just sit back and wait. This doesn't help Bazel 6.0 users though. Maybe enough downstream projects will be updated that 6.0 users can just manually trigger --incompatible_config_setting_private_default_visibility
?
As of https://github.com/bazelbuild/bazel/issues/12932, using
selects.config_setting_group
produces unexpected results because of how it uses an underlying alias to surface the settings. For example if you have:And from another package you depend on this with:
You see this error:
The macro generates:
So this makes sense, since aliases propagate visibility, but I think it's a bit unexpected in this case. Maybe there's another solution to how this could be written to allow having private settings.