@@ -45,21 +45,20 @@ load("@bazel_skylib//lib:shell.bzl", "shell")
4545load ("@bazel_skylib//rules:expand_template.bzl" , "expand_template" )
4646load ("//python:py_binary.bzl" , "py_binary" )
4747load ("//python/private:bzlmod_enabled.bzl" , "BZLMOD_ENABLED" ) # buildifier: disable=bzl-visibility
48+ load ("//python/private:toolchain_types.bzl" , "TARGET_TOOLCHAIN_TYPE" ) # buildifier: disable=bzl-visibility
49+ load (":toolchain_types.bzl" , "UV_TOOLCHAIN_TYPE" )
4850
4951visibility (["//..." ])
5052
51- _uv_toolchain = Label ("//python/uv:uv_toolchain_type" )
52- _py_toolchain = Label ("//python:toolchain_type" )
53-
5453_RunLockInfo = provider (
5554 doc = "" ,
5655 fields = {
57- "args" : "" ,
58- "env" : "" ,
59- "py" : "" ,
60- "srcs" : "" ,
61- "template" : "" ,
62- "uv" : "" ,
56+ "args" : "The args passed to the `uv` by default when running the runnable target. " ,
57+ "env" : "The env passed to the execution. " ,
58+ "py" : "The python runtime " ,
59+ "srcs" : "Source files " ,
60+ "template" : "The template to use for the script. " ,
61+ "uv" : "The path to the uv binary. " ,
6362 },
6463)
6564
@@ -69,10 +68,10 @@ def _lock_impl(ctx):
6968 existing_output = ctx .files .existing_output
7069 output = ctx .actions .declare_file (ctx .label .name + ".out" )
7170
72- toolchain_info = ctx .toolchains [_uv_toolchain ]
71+ toolchain_info = ctx .toolchains [UV_TOOLCHAIN_TYPE ]
7372 uv = toolchain_info .uv_toolchain_info .uv [DefaultInfo ].files_to_run .executable
7473
75- py_runtime = ctx .toolchains [_py_toolchain ].py3_runtime
74+ py_runtime = ctx .toolchains [TARGET_TOOLCHAIN_TYPE ].py3_runtime
7675
7776 cmd = ctx .actions .declare_file (ctx .label .name )
7877 ctx .actions .expand_template (
@@ -216,8 +215,9 @@ script depending on what the target platform is executed on.
216215 ),
217216 },
218217 toolchains = [
219- _uv_toolchain ,
220- _py_toolchain ,
218+ UV_TOOLCHAIN_TYPE ,
219+ # FIXME @aignas 2025-03-17: should this be instead EXEC_TOOLCHAIN_TYPE?
220+ TARGET_TOOLCHAIN_TYPE ,
221221 ],
222222)
223223
0 commit comments