forked from bazelbuild/bazel
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic bzl visibility functionality
This adds a `visibility()` callable to .bzl files, to be used during top-level evaluation (and ideally, immediately after `load()` statements at the top of the file). `visibility("public")` declares the .bzl to be loadable by anyone (the default), while `visibility("private")` ensures it can only be loaded by BUILD/.bzl files in the same package. A follow-up CL will add the ability to allowlist package paths. This API is not final, and is guarded behind two experimental flags: --experimental_bzl_visibility to guard the feature overall, and --experimental_bzl_visibility_allowlist to only permit certain packages to declare a visibility. (For technical reasons the `visibility()` builtin itself is available unconditionally even though it can only be successfully called when those flag checks are satisfied.) The allowlist implementation does not handle repository remapping correctly and therefore may not work in bzlmod. Our plan is to prototype the feature within Google and then remove allowlisting altogether, rather than fix the allowlisting to accommodate repository remapping. Work towards bazelbuild#11261. PiperOrigin-RevId: 458528142 Change-Id: I3d15d902edf10f6676eac08ebb1e02f6451f5c26
- Loading branch information
1 parent
ccebb62
commit 24a4941
Showing
17 changed files
with
640 additions
and
45 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
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
Oops, something went wrong.