refactor: use centralized NOT_ACTUALLY_PUBLIC across internal targets#3920
Conversation
Currently, several internal macros, toolchain definitions, and config settings either hardcode ["//visibility:public"] or define private copies like _NOT_ACTUALLY_PUBLIC. This scatters visibility workarounds and makes intention unclear. To clean this up, transition internal rules and helper targets in python/private to use the centralized NOT_ACTUALLY_PUBLIC constant from python/private/visibility.bzl and ensure bzl_library dependencies accurately reflect the load graph.
There was a problem hiding this comment.
Code Review
This pull request replaces hardcoded public visibility lists with a centralized NOT_ACTUALLY_PUBLIC visibility constant imported from :visibility.bzl across multiple Bazel build files and templates. The reviewer feedback suggests avoiding a cross-repository load of the private visibility file in generated toolchain content to prevent package boundary violations, and recommends updating adjacent bootstrap template targets in python/private/BUILD.bazel to use the new constant for consistency.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Revert _HOST_TOOLCHAIN_BUILD_CONTENT visibility in toolchains_repo.bzl to avoid cross-repo load violations and update adjacent bootstrap template targets in python/private/BUILD.bazel to NOT_ACTUALLY_PUBLIC for consistency.
Some targets in config_settings, local_runtime_repo_setup, and runtime_env_toolchain require standard public visibility rather than NOT_ACTUALLY_PUBLIC. To fix, revert local_runtime_repo_setup.bzl and runtime_env_toolchain.bzl to regular public visibility, restore regular public on specified targets in config_settings.bzl, and update corresponding bzl_library dependencies.
Multiple internal targets across config_settings, python/private, and internal tools set public visibility accompanied by comments noting they are only public for implicit dependencies or cross-repo references. To clean this up, transition those targets to use NOT_ACTUALLY_PUBLIC from python/private/visibility.bzl, and introduce a self-contained visibility constant inside sphinxdocs to maintain strict project boundaries.
|
/review |
Currently, several internal macros, toolchain definitions, and
config settings either hardcode `["//visibility:public"]` or define
private copies like `_NOT_ACTUALLY_PUBLIC`. This scatters visibility
workarounds across the codebase and makes developer intent unclear.
To clean this up, transition internal rules across `python/private` to
use `NOT_ACTUALLY_PUBLIC` from `python/private/visibility.bzl`, and
update corresponding `bzl_library` dependencies to match.