aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java
diff options
context:
space:
mode:
authorGravatar Laszlo Csomor <laszlocsomor@google.com>2017-03-07 11:47:23 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2017-03-07 12:55:53 +0000
commit94d8f4e9c8c8757aa7ab7c1a7c3e9afb34039127 (patch)
tree9d5b0c41cd3b73835af38dc1222765ad9db33ee2 /src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java
parent70cbebe66037b31512c0fb3b2367ce3e98ea8fb1 (diff)
Env.vars: server won't ignore the client env
Make the --ignore_client_env flag a no-op. The client will pass --client_env flags to the server even in --batch mode. This simplifies the code as well as ensuring that the server always uses the up-do-date client environment. We'll gradually get rid of all System.getenv calls in the server, because the server should always respect the client env. -- PiperOrigin-RevId: 149403129 MOS_MIGRATED_REVID=149403129
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java b/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java
index f981715f8a..84d5a20825 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java
@@ -206,11 +206,10 @@ public final class CommandEnvironment {
}
@VisibleForTesting
- void updateClientEnv(List<Map.Entry<String, String>> clientEnvList, boolean ignoreClientEnv) {
+ void updateClientEnv(List<Map.Entry<String, String>> clientEnvList) {
Preconditions.checkState(clientEnv.isEmpty());
- Collection<Map.Entry<String, String>> env =
- ignoreClientEnv ? System.getenv().entrySet() : clientEnvList;
+ Collection<Map.Entry<String, String>> env = clientEnvList;
for (Map.Entry<String, String> entry : env) {
clientEnv.put(entry.getKey(), entry.getValue());
}
@@ -557,7 +556,7 @@ public final class CommandEnvironment {
this.relativeWorkingDirectory = workingDirectory.relativeTo(workspace);
this.workingDirectory = workingDirectory;
- updateClientEnv(options.clientEnv, options.ignoreClientEnv);
+ updateClientEnv(options.clientEnv);
// Fail fast in the case where a Blaze command forgets to install the package path correctly.
skyframeExecutor.setActive(false);