Skip to content

Bazel 7 PATH issues #289505

@layus

Description

@layus

This issue is here to discuss issues with PATH when using bazel 7 as packaged in nix.

When packaging bazel_7, I removed the (action_path patch)[https://github.com/NixOS/nixpkgs/blob/1012b2a368b12c3c5751b06123214de202e28778/pkgs/development/tools/build-managers/bazel/bazel_6/actions_path.patch] from bazel_6, because it did not make sense to have it.

But removing that patch has consequences. Some actions now run with no PATH at all. What I am unable to figure right now is how to fix that.

  1. Does it also fail with vanilla bazel (I think not)
  2. Why does it work with vanilla bazel (probably /usr/bin:/bin/, etc gets used by default by the system or the system shell)
  3. Introduce a fix that is as close as possible to what vanilla bazel users may expect.

It would be nice to setup a MWE to test it on several machines.

AFAIU the issue arises when you run a binary process (that needs no PATH set to run) but that binary ends up running system commands (using system() or calling a bash script) which then fails to find it's dependencies.

As mentioned in some places, we may want to tweak that path without having to recompile bazel.

See
#262152
#285544
https://github.com/sourcegraph/sourcegraph/pull/59359
and possibly some more I have forgotten.

/cc @malt3 @uri-canva @Strum355 @flurie @boltzmannrain @rickvanprim as you might be interested in this discussion.

Metadata

Metadata

Assignees

Labels

0.kind: questionRequests for a specific question to be answered2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: best practicesDocumentation and discussion around best practices for Nixpkgs development
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions