GeezerVison is showing github.com — refactor(toolchains): define the Python toolchain type in rules_python (#4404) by fmeum · Pull Request #4521 · bazel-contrib/rules_python
Conversation
fmeum
commented
Nov 17, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Backports #4404 to release/1.9, as discussed on that PR, so that Bazel's @bazel_tools can depend on a 1.x release of rules_python.
//python:toolchain_type is an alias of the type in @bazel_tools. To move the type out of @bazel_tools, Bazel will forward @bazel_tools//tools/python:toolchain_type to this target (bazelbuild/bazel#32412), which requires it to be the actual type on those Bazel versions.
//python:toolchain_type is now a toolchain_type if a new value in the @rules_python_internal config is set and remains an alias otherwise, so both labels always refer to the same type. The config extension sets the value from a bazel_features flag, which is False for now, so nothing changes yet. WORKSPACE builds leave it unset, as Bazel versions that forward the type no longer support WORKSPACE.
Differences from the commit on main:
- The new
bzl_library is named python_toolchain_type_bzl to follow this branch's naming convention.
- The
tests/integration/bzlmod_lockfile lockfile update is dropped, since that test does not exist on this branch.
Work towards bazelbuild/bazel#32428
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
bazel-contrib#4404)
`//python:toolchain_type` is an alias of the type in `@bazel_tools`. To
move the type out of `@bazel_tools`, Bazel will forward
`@bazel_tools//tools/python:toolchain_type` to this target
(bazelbuild/bazel#32412), which requires it to be the actual type on
those Bazel versions.
`//python:toolchain_type` is now a `toolchain_type` if a new value in
the `@rules_python_internal` config is set and remains an alias
otherwise, so both labels always refer to the same type. The `config`
extension sets the value from a `bazel_features` flag, which is `False`
for now, so nothing changes yet. WORKSPACE builds leave it unset, as
Bazel versions that forward the type no longer support WORKSPACE. This
also avoids requiring `bazel_features` in WORKSPACE builds.
Work towards bazelbuild/bazel#32428
---------
Co-authored-by: Richard Levasseur <[email protected]>
(cherry picked from commit 1bf79e9)
|
This backport was prepared with Claude Code at the request of the PR author. The cherry-pick conflicts were limited to context lines missing on release/1.9. No agent is monitoring this PR to reply automatically; the PR author will handle review comments directly.
This comment was generated by an AI agent (Claude Code) and posted automatically, without prior review by the user.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@rickeylev @aignas When this has been merged, it would be really helpful if you could cut new releases so that Bazel 10 has enough time to adopt and test them. The switch won't go live until a new bazel_features release, so we have a way of gating it behind a flag of sorts.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
fmeum
commented
Nov 17, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
The soft-failing Default: Ubuntu, upcoming Bazel and Default: Ubuntu, rolling Bazel jobs fail these tests, which also fail on release/1.9 without this change (reproduced locally with rolling Bazel):
//tests/toolchains/transitions:test_minor_versions
//tests/toolchains/transitions:test_full_version
//tests/exec_toolchain_matching:test_exec_matches_target_python_version
This comment was generated by an AI agent (Claude Code) and posted at the PR author's request.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
created a tracking issue so we don't lose track of what is where #4525
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 18, 2026
rickeylev
added a commit
to rickeylev/rules_python
that referenced
this pull request
Nov 18, 2026
Documents the 1.9.3 patch release (bazel-contrib#4521) in CHANGELOG.md on the release/1.9 branch.
rickeylev
added a commit
that referenced
this pull request
Nov 18, 2026
Syncs the 1.9.2 and 1.9.3 patch release entries into main's
CHANGELOG.md so the main changelog includes all released 1.9.x
versions.
1.9.2 (#3970) and 1.9.3 (#4521) were released from the release/1.9
branch without updating main's CHANGELOG.md.
Work towards #4525
rickeylev
added a commit
that referenced
this pull request
Nov 18, 2026
Documents the 1.9.3 patch release (#4521) in CHANGELOG.md on the
release/1.9 branch.
Work towards #4525
Reviewers
rickeylev
Awaiting requested review from rickeylev
rickeylev is a code owner
aignas
Awaiting requested review from aignas
aignas is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|