load("@bazel_env.bzl", "bazel_env")
bazel_env(name, tools, toolchains, kwargs)
Makes Bazel-managed tools and toolchains available under stable paths.
Build this target to make the given tools and toolchains available under stable,
platform-independent paths:
- tools are staged in
bazel-out/bazel_env-opt/bin/path/to/pkg/name/bin
- toolchains are staged in
bazel-out/bazel_env-opt/bin/path/to/pkg/name/toolchains
Run this target with bazel run
for instructions on how to make the tools available on PATH
using direnv
. This also prints a list of all tools and toolchains as
well as cleans up stale tools.
PARAMETERS
Name |
Description |
Default Value |
name |
The name of the rule. |
none |
tools |
A dictionary mapping tool names to their targets or paths. The name is used as the basename of the tool in the bin directory and will be available on PATH .
If a target is provided, the corresponding executable is staged in the bin directory together with its runfiles.
If a path is provided, Make variables provided by toolchains are expanded in it and all the files of referenced toolchains are staged as runfiles. |
{} |
toolchains |
A dictionary mapping toolchain names to their targets. The name is used as the basename of the toolchain directory in the toolchains directory. The directory is a symlink to the repository root of the (single) repository containing the toolchain. |
{} |
kwargs |
Additional arguments to pass to the main bazel_env target. It is usually not necessary to provide any and the target should have private visibility. |
none |