Skip to content

do not leak PATH, LD_LIBRARY_PATH, and TMPDIR into the shell environment by default #2574

@benjaminp

Description

@benjaminp

BazelConfiguration.setupShellEnvironement makes the default shell environment inherit the PATH, LD_LIBRARY_PATH, and TMPDIR environmental variables from the server environment (i.e., what they are at server startup time). I can see why this might be useful, but I don't think it should be the default behavior. I observed that this behavior was a source of indeterminism when building the same code on different machines; the build products were the same, but as environment affects the action key, remote caching across the machines didn't work. Why not be hermetic by default and have users who need to change these variables pass, e.g., --action_env=PATH?

If the behavior can't be changed, I would at least like a way to unset those environmental variables in the shell environment from the command line. AFAICT, with --action_env currently, the best you can do is set them to an empty string.

Metadata

Metadata

Assignees

Labels

P1I'll work on this now. (Assignee required)type: bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions