forked from bazelbuild/bazel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify visibility() arg parsing logic, support visibility("//foo")
BazelBuildApiGlobals: - An arg of "some_string" is treated as syntactic sugar for ["some_string"]. This supports args of form "//foo". - Deleted special casing for "public" and "private". These are now handled by the sugar and by the new PackageSpecification syntax added in unknown commit. BzlLoadFunctionTest: - Add tests for `visibility([])`, `visibility("//foo")`, and the unsupported case of negated package specs BzlVisibility: - Add interning of special public/private cases; lift construction to factory method. - Rename PackageListBzlVisibility since it's really package specifications, not packages being listed. Make private since users don't need direct access to it. (Kept PUBLIC/PRIVATE singletons as public since it's reasonable for client code to directly refer to those.) Since it's likely we won't support negation, we could even eliminate the BzlVisibility class altogether in favor of lists of PackageSpecifications. This would simplify interning of public/private (but complicate any hypothetical future interning of non-trivial allowlists). But having a separate class is more convenient/readable for the bzl machinery. StarlarkBuildApiGlobals: - Move description of valid visibility() arg values to the arg's doc. - Condense the mention of the distinction between bzl-visibility and target visibility. - Mention behavior relative to --incompatible_fix_package_group_reporoot_syntax. Work toward bazelbuild#11261. PiperOrigin-RevId: 479369691 Change-Id: Ib9b2844abc03b0596399cc3fe09e9b89c6416e90
- Loading branch information
Showing
4 changed files
with
143 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters