Skip to content

Commit 549813b

Browse files
committed
fix(toolchains): correctly register musl/freethreaded toolchains for workspace
1 parent 6d1c1fa commit 549813b

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ END_UNRELEASED_TEMPLATE
8484
([#3204](https://github.com/bazel-contrib/rules_python/issues/3204)).
8585
* (uv) {obj}`//python/uv:lock.bzl%lock` now works with a local platform
8686
runtime.
87+
* (toolchains) WORKSPACE builds now correctly register musl and freethreaded
88+
variants. Setting {obj}`--py_linux_libc=musl` and `--py_freethreaded=yes` now
89+
activate them, respectively.
90+
([#3262](https://github.com/bazel-contrib/rules_python/issues/3262)).
8791

8892
{#v0-0-0-added}
8993
### Added

python/private/toolchains_repo.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def python_toolchain_build_file_content(
214214
user_repository_name = "{}_{}".format(user_repository_name, platform),
215215
python_version = python_version,
216216
set_python_version_constraint = set_python_version_constraint,
217-
target_settings = [],
217+
target_settings = meta.target_settings,
218218
))
219219
return "\n\n".join(entries)
220220

tests/toolchains/multi_platform_resolution/resolution_tests.bzl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,6 @@ def _test_toolchains(name):
141141
if runtime.libc:
142142
config_settings[labels.PY_LINUX_LIBC] = runtime.libc
143143

144-
# TODO: Workspace isn't correctly registering musl and freethreaded
145-
# toolchains, so skip them for now.
146-
target_compatible_with = []
147-
if not BZLMOD_ENABLED and (runtime.libc == "musl" or
148-
runtime.freethreaded == "yes"):
149-
target_compatible_with = ["@platforms//:incompatible"]
150-
151144
analysis_test(
152145
name = test_name,
153146
target = name + "_current_toolchain",

0 commit comments

Comments
 (0)