My team's bazel setup involves invoking a script for --workspace_status_command (this flag is defined in our bazelrc).
The script in question invokes dirname, which is a common utility under /usr/bin.
This operates correctly using Bazel, because the PATH in the environment for our Bazel invocation includes /usr/bin.
When using bazelisk, this script fails because the env value of PATH in this invocation is only ~/.cache/bazelisk/downloads/bazelbuild/bazel-${commithash}-linux-x86_64/bin, which does not contain dirname.
My team's bazel setup involves invoking a script for
--workspace_status_command
(this flag is defined in our bazelrc).The script in question invokes
dirname
, which is a common utility under/usr/bin
.This operates correctly using Bazel, because the
PATH
in the environment for our Bazel invocation includes/usr/bin
. When usingbazelisk
, this script fails because the env value ofPATH
in this invocation is only~/.cache/bazelisk/downloads/bazelbuild/bazel-${commithash}-linux-x86_64/bin
, which does not containdirname
.