From a590cfcc93f5ec1f9498e4b100f10172da537a1f Mon Sep 17 00:00:00 2001 From: Jordan Mele Date: Thu, 21 Nov 2024 11:08:16 -0800 Subject: [PATCH] Get `--repo_env=NAME` value from client environment (not server). Fixes issue where server process would "cache" environment variables. Broken since 3ebf658cba43bbab1efc36518f0795a7d65e2d46 (v5). Closes #24433. PiperOrigin-RevId: 698847238 Change-Id: I51d4ec811ee9d78717ff816d9988b4ad0f533265 --- .../google/devtools/build/lib/runtime/CommandEnvironment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 6cb683e2d0fabd..e3c896c8fb4955 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 @@ -340,7 +340,7 @@ public void exit(AbruptExitException exception) { String name = entry.getKey(); String value = entry.getValue(); if (value == null) { - value = System.getenv(name); + value = clientEnv.get(name); } if (value != null) { repoEnv.put(name, value);