Skip to content

Commit 9f06b4e

Browse files
committed
feat(bzlmod): use X.Y to search for toolchain duplicates
1 parent 93995a5 commit 9f06b4e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/extensions/python.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
load("//python:repositories.bzl", "python_register_toolchains")
1818
load("//python/extensions/private:pythons_hub.bzl", "hub_repo")
19+
load("//python/private:full_version.bzl", "full_version")
1920
load("//python/private:toolchains_repo.bzl", "multi_toolchain_aliases")
2021

2122
# This limit can be increased essentially arbitrarily, but doing so will cause a rebuild of all
@@ -74,7 +75,7 @@ def _python_impl(module_ctx):
7475
module_toolchain_versions = []
7576

7677
for toolchain_attr in mod.tags.toolchain:
77-
toolchain_version = toolchain_attr.python_version
78+
toolchain_version, _, _ = full_version(toolchain_attr.python_version).rpartition(".")
7879
toolchain_name = "python_" + toolchain_version.replace(".", "_")
7980

8081
# Duplicate versions within a module indicate a misconfigured module.

0 commit comments

Comments
 (0)