-
-
Notifications
You must be signed in to change notification settings - Fork 591
refactor: make bzlmod create host repos for toolchains #2888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
refactor: make bzlmod create host repos for toolchains #2888
Conversation
1e70b1e
to
47b115e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I like the host_compatible solution you did here a lot!
name = toolchain_info.name, | ||
_internal_bzlmod_toolchain_call = True, | ||
**kwargs | ||
) | ||
loaded_platforms[full_python_version] = toolchain_registered_platforms | ||
host_compatible = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
@@ -375,6 +375,8 @@ def _host_toolchain_impl(rctx): | |||
if not rctx.delete(python_tester): | |||
fail("Failed to delete the python tester") | |||
|
|||
# NOTE: The term "toolchain" is a misnomer for this rule. This doesn't define | |||
# a repo with toolchains or toolchain implementations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we rename it to host_compatible_python_repo
?
# Repo rules can't accept dict[str, bool], so encode them as a string value. | ||
toolchain_set_python_version_constraints[key] = ( | ||
"True" if entry.set_python_version_constraint else "False" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below here, the host_compatible toolchain list should be passed to the pythons_hub
so that we keep the right contents in the interpreters.bzl
.
This moves the creation of the host_toolchain repos into the bzlmod phase.
This is to facilitate future work to allow for when a a particular version
doesn't provide a host-compatible variant
DO NOT MERGE:
Work towards #2081