bazelbuild / bazelbuild/bazelisk

bazelisk has different PATH for workspace_status_command

Open
#471 0 comments 0 reactions 0 assignees View on GitHub
P2 type:bug
Dominant language
Go
Stars
2.7k
Forks
424
PR merge metrics
No merged PRs in 30d

Description

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`.

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by tracing how Bazelisk constructs the environment for the Bazel invocation and how it handles --workspace_status_command; compare that PATH with a direct Bazel invocation. Done means the workspace status script can resolve dirname and other standard utilities when run through Bazelisk, with a regression test covering the environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.