bazelbuild / bazelbuild/bazelisk

Bazelisk corrupts `PATH` if it contains `=`

Open
#435 1 comment 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

I've just found out that if `PATH` contains `=` (which in my case was due to some corruption in my `~/.profile`), `bazelisk` will cause `bazel` to run with an almost empty `PATH` (it will only contain the `bazelisk` cache path), causing `bazel` to fail in horrible ways.

I've double-checked that calling the `bazel` binary directly will have the `PATH` variable correctly passed around, while having it called wrapped by bazelisk is broken. To reproduce, just
```bash
export PATH=$PATH:/=
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported failure with `export PATH=$PATH:/=` and compare Bazelisk-wrapped execution with calling the Bazel binary directly. Trace Bazelisk's PATH handling; done when a PATH containing `=` is passed to Bazel intact rather than reduced to the cache path.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.