From 94d8f4e9c8c8757aa7ab7c1a7c3e9afb34039127 Mon Sep 17 00:00:00 2001 From: Laszlo Csomor Date: Tue, 7 Mar 2017 11:47:23 +0000 Subject: 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 --- .../com/google/devtools/build/lib/runtime/CommandEnvironment.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java') 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> clientEnvList, boolean ignoreClientEnv) { + void updateClientEnv(List> clientEnvList) { Preconditions.checkState(clientEnv.isEmpty()); - Collection> env = - ignoreClientEnv ? System.getenv().entrySet() : clientEnvList; + Collection> env = clientEnvList; for (Map.Entry 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); -- cgit v1.2.3