Repository navigation
refactor(toolchains): define the Python toolchain type in rules_python (#4404) - #4521
Conversation
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 <richardlev@gmail.com> (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 This comment was generated by an AI agent (Claude Code) and posted automatically, without prior review by the user. |
|
@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 |
|
The soft-failing
This comment was generated by an AI agent (Claude Code) and posted at the PR author's request. |
|
created a tracking issue so we don't lose track of what is where #4525 |
Backports #4404 to
release/1.9, as discussed on that PR, so that Bazel's@bazel_toolscan depend on a 1.x release of rules_python.//python:toolchain_typeis an alias of the type in@bazel_tools. To move the type out of@bazel_tools, Bazel will forward@bazel_tools//tools/python:toolchain_typeto this target (bazelbuild/bazel#32412), which requires it to be the actual type on those Bazel versions.//python:toolchain_typeis now atoolchain_typeif a new value in the@rules_python_internalconfig is set and remains an alias otherwise, so both labels always refer to the same type. Theconfigextension sets the value from abazel_featuresflag, which isFalsefor 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:bzl_libraryis namedpython_toolchain_type_bzlto follow this branch's naming convention.tests/integration/bzlmod_lockfilelockfile update is dropped, since that test does not exist on this branch.Work towards bazelbuild/bazel#32428