question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:47 (42 by maintainers)

github_iconTop GitHub Comments

1reaction
ulfjackcommented, May 23, 2018

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.

0reactions
buchgrcommented, Jan 16, 2019

This has been enabled in Bazel 0.22

Read more comments on GitHub >

github_iconTop Results From Across the Web

LD_LIBRARY_PATH and TMPDIR environment variables are ...
The values of the TMPDIR and LD_LIBRARY_PATH environment variables are not accessible via the OS-GETENV command.
Read more >
EnvironmentVariables - Community Help Wiki
Environment variables provide a way to influence the behaviour of software on the system. For example, the "LANG" environment variable ...
Read more >
Env Variables - AFLplusplus
TMPDIR is used by afl-as for temporary files; if this variable is not set, the tool defaults to /tmp. 2) Settings for LLVM...
Read more >
Environment Variables Understood by Glibc Toolchains
LOCPATH Set locale data path, not for suid or sgid programs ... LD_LIBRARY_PATH A colon-separated list of directories in which to search for...
Read more >
How to set the environmental variable LD_LIBRARY_PATH in ...
You should add more details about your distribution, for example under Ubuntu the right way to do this is to add a custom...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found