diff -Naur a/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java b/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java --- a/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java 2019-06-12 20:39:37.538708196 -0700 +++ b/src/main/java/com/google/devtools/build/lib/shell/JavaSubprocessFactory.java 2019-06-12 20:44:18.863429602 -0700 @@ -146,7 +146,6 @@ ProcessBuilder builder = new ProcessBuilder(); builder.command(params.getArgv()); if (params.getEnv() != null) { - builder.environment().clear(); builder.environment().putAll(params.getEnv()); }