Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ END_UNRELEASED_TEMPLATE
([#3204](https://github.com/bazel-contrib/rules_python/issues/3204)).
* (uv) {obj}`//python/uv:lock.bzl%lock` now works with a local platform
runtime.
* (toolchains) WORKSPACE builds now correctly register musl and freethreaded
variants. Setting {obj}`--py_linux_libc=musl` and `--py_freethreaded=yes` now
activate them, respectively.
([#3262](https://github.com/bazel-contrib/rules_python/issues/3262)).

{#v0-0-0-added}
### Added
Expand Down
2 changes: 1 addition & 1 deletion python/private/toolchains_repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def python_toolchain_build_file_content(
user_repository_name = "{}_{}".format(user_repository_name, platform),
python_version = python_version,
set_python_version_constraint = set_python_version_constraint,
target_settings = [],
target_settings = meta.target_settings,
))
return "\n\n".join(entries)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ load("@bazel_skylib//lib:structs.bzl", "structs")
load("@rules_testing//lib:analysis_test.bzl", "analysis_test")
load("@rules_testing//lib:test_suite.bzl", "test_suite")
load("//python:versions.bzl", "TOOL_VERSIONS")
load("//python/private:bzlmod_enabled.bzl", "BZLMOD_ENABLED") # buildifier: disable=bzl-visibility
load("//python/private:common_labels.bzl", "labels") # buildifier: disable=bzl-visibility
load("//python/private:toolchain_types.bzl", "TARGET_TOOLCHAIN_TYPE") # buildifier: disable=bzl-visibility
load("//python/private:version.bzl", "version") # buildifier: disable=bzl-visibility
Expand Down Expand Up @@ -141,13 +140,6 @@ def _test_toolchains(name):
if runtime.libc:
config_settings[labels.PY_LINUX_LIBC] = runtime.libc

# TODO: Workspace isn't correctly registering musl and freethreaded
# toolchains, so skip them for now.
target_compatible_with = []
if not BZLMOD_ENABLED and (runtime.libc == "musl" or
runtime.freethreaded == "yes"):
target_compatible_with = ["@platforms//:incompatible"]

analysis_test(
name = test_name,
target = name + "_current_toolchain",
Expand All @@ -165,7 +157,6 @@ def _test_toolchains(name):
"os={}".format(runtime.os),
"arch={}".format(runtime.arch),
],
"target_compatible_with": target_compatible_with,
},
)

Expand Down
Loading