bazelbuild / bazelisk

A user-friendly launcher for Bazel.
Apache License 2.0
1.96k stars 302 forks source link

bazelisk has different PATH for workspace_status_command #471

Open c-parsons opened 1 year ago

c-parsons commented 1 year ago

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.