Skip to content

Commit

Permalink
actions: don't add the server's TMPDIR to the env
Browse files Browse the repository at this point in the history
The BazelConfiguration no longer adds the Bazel
server process' TMPDIR/TMP/TEMP environment
variables.

I added that code before having implemented always
creating a temp directory for actions:
bazelbuild@cfccdf1

See bazelbuild#4376

Change-Id: I8ba63d6120a0aa849997b274fb2d68ad50b2285c
PiperOrigin-RevId: 181134179
  • Loading branch information
laszlocsomor authored and George Gensure committed Mar 2, 2018
1 parent c25199c commit 19f1c37
Showing 1 changed file with 0 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,27 +144,10 @@ public void setupActionEnvironment(Map<String, String> builder) {
// TODO(ulfjack): Avoid using System.getenv; it's the wrong environment!
builder.put("PATH", pathOrDefault(os, System.getenv("PATH"), getShellExecutable()));

// TODO(laszlocsomor): Remove setting TMP/TEMP here, and set a meaningful value just before
// executing the action.
// Setting TMP=null, TEMP=null has the effect of copying the client's TMP/TEMP to the action's
// environment. This is a short-term workaround to get temp-requiring actions working on
// Windows. Its detrimental effect is that the client's TMP/TEMP becomes part of the actions's
// key. Yet, we need this for now to build Android programs, because the Android BusyBox is
// written in Java and tries to create temp directories using
// java.nio.file.Files.createTempDirectory, which needs TMP or TEMP (or USERPROFILE) on
// Windows, otherwise they return c:\windows which is non-writable.
builder.put("TMP", null);
builder.put("TEMP", null);

String ldLibraryPath = System.getenv("LD_LIBRARY_PATH");
if (ldLibraryPath != null) {
builder.put("LD_LIBRARY_PATH", ldLibraryPath);
}

String tmpdir = System.getenv("TMPDIR");
if (tmpdir != null) {
builder.put("TMPDIR", tmpdir);
}
}
}

Expand Down

0 comments on commit 19f1c37

Please sign in to comment.