//python:py_exec_tools_toolchain.bzl
Toolchain for build-time tools.
- rulepy_exec_tools_toolchain(name,exec_interpreter='@rules_python//python/private:current_interpreter_executable',precompiler=None)
Provides a toolchain for build time tools.
This provides
ToolchainInfowith the following attributes:exec_tools:PyExecToolsInfotoolchain_label:Labelonly present when--visibile_for_testing=Truefor internal testing. The rule’s label; this allows identifying what toolchainimplmentation was selected for testing purposes.
- Attributes:
A unique name for this target.
mandatory
exec_interpreter–(label)(default“@rules_python//python/private:current_interpreter_executable”)An interpreter that is directly usable in the exec configuration
If not specified, the interpreter from
//python:toolchain_typewillbe used.To disable, specify the special target
//python:none; the raw valueNonewill use the default.Note
This is only useful for
ctx.actions.runcalls thatdirectly invoke theinterpreter, which is fairly uncommon and low level. It is better to use acfg="exec"attribute that points to apy_binaryrule instead, which willhandle all the necessary transitions and runtime setup to invoke a program.See
PyExecToolsInfo.exec_interpreterfor further docs.Changed in version 1.4.0:From now on the provided target also needs to provide
platform_common.ToolchainInfoso that the toolchainpy_runtimefield can be correctly forwarded.optional
Required providers:[
DefaultInfo,ToolchainInfo]precompiler–(label)(defaultNone)See
PyExecToolsInfo.precompileroptional