do not leak PATH, LD_LIBRARY_PATH, and TMPDIR into the shell environment by default
See original GitHub issueBazelConfiguration.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.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:7
- Comments:47 (42 by maintainers)
I’ve just fixed a number of cases where --action_env did not properly apply. I think we might want to wait for another release before we flip the default.
This has been enabled in Bazel 0.22