refactor: make python extension generate platform toolchains #2875
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.
This makes the python bzlmod extension handle generating the platform-specific toolchain
entries ("python_3_10_{platform}"). This is to eventually allow adding additional
toolchains that aren't part of the PLATFORMS mapping in versions.bzl and have
their own custom constraints.
The main things this refactor does are:
to create (previously, it relied on
hub_repo
to generate the implementationnames).
it (the py_toolchain_suite.user_repository_repo arg) are separate. This allows
future work to mixin toolchains that point to arbitrary repos.
flag values. This allows more arbitrary target settings. For now, flag values
on the platform metadata is still looked for because it's known that users
patch python/versions.bzl.
Along the way:
are public visibility, but actually internal.
Work towards #2081