Skip to content

Commit d3ff7a6

Browse files
committed
wip: bzlmod workspace interop
1 parent 83eb5e8 commit d3ff7a6

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

python/private/python.bzl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,11 @@ def _python_impl(module_ctx):
228228
kwargs.update(py.config.kwargs.get(toolchain_info.python_version, {}))
229229
kwargs.update(py.config.kwargs.get(full_python_version, {}))
230230
kwargs.update(py.config.default)
231-
python_register_toolchains(name = toolchain_info.name, **kwargs)
231+
python_register_toolchains(
232+
name = toolchain_info.name,
233+
_internal_bzlmod_toolchain_call = True,
234+
**kwargs
235+
)
232236

233237
# Create the pythons_hub repo for the interpreter meta data and the
234238
# the various toolchains.

python/private/python_register_toolchains.bzl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@ def python_register_toolchains(
7575
version.
7676
**kwargs: passed to each {obj}`python_repository` call.
7777
"""
78-
79-
if BZLMOD_ENABLED:
80-
# you cannot used native.register_toolchains when using bzlmod.
78+
bzlmod_toolchain_call = kwargs.pop("_internal_bzlmod_toolchain_call", False)
79+
if bzlmod_toolchain_call:
8180
register_toolchains = False
8281

8382
base_url = kwargs.pop("base_url", DEFAULT_RELEASE_BASE_URL)
@@ -169,7 +168,7 @@ def python_register_toolchains(
169168
)
170169

171170
# in bzlmod we write out our own toolchain repos
172-
if BZLMOD_ENABLED:
171+
if bzlmod_toolchain_call:
173172
return
174173

175174
toolchains_repo(

0 commit comments

Comments
 (0)