feat: add //command_line_option:extra_toolchains pseudo-flag#3810
feat: add //command_line_option:extra_toolchains pseudo-flag#3810rickeylev wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for the Bazel-builtin --extra_toolchains flag via a pseudo-flag //command_line_option:extra_toolchains. It includes parsing logic to convert a comma-separated string into a list of toolchains, updates transition labels, and adds documentation and tests. The feedback suggests using the newly defined labels.EXTRA_TOOLCHAINS constant in python/private/transition_labels.bzl instead of a hardcoded string literal to maintain 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.
Add support for transitioning on the //command_line_option:extra_toolchains built-in flag using py_binary.config_settings. Note that, unlike the normal Bazel built-in flag, it must be specified as a simple comma-separated string when set using config_settings, which is then parsed as a CSV string. This is implemented by: - Adding an alias extra_toolchains in command_line_option/BUILD.bazel. - Adding //command_line_option:extra_toolchains to TRANSITION_LABELS so that it is inherited by all transition-using rules (py_wheel, py_zipapp, etc). - Updating apply_config_settings_attr in python/private/attributes.bzl to parse the extra_toolchains CSV string into a list of strings when set via config_settings. - Adding a test case and updating documentation.
f2c6037 to
7121412
Compare
Configure AI agents to never amend or rebase PRs after creation, and use new commits instead.
Add support for transitioning on the //command_line_option:extra_toolchains built-in flag using py_binary.config_settings.
Note that, unlike the normal Bazel built-in flag, it must be specified as a simple comma-separated string when set using config_settings, which is then parsed as a CSV string.
This is to make it easier to, on a per-target basis, such as with a zipapp or wheels,
change the Python toolchains used.