fixup! bazel_7: backport bazel_6 bash fixes for remote execution

-42
-42
pkgs/development/tools/build-managers/bazel/bazel_7/actions_path.patch
··· 1 - diff --git a/src/main/java/com/google/devtools/build/lib/exec/local/PosixLocalEnvProvider.java b/src/main/java/com/google/devtools/build/lib/exec/local/PosixLocalEnvProvider.java 2 - index 8284eff943..a820037968 100644 3 - --- a/src/main/java/com/google/devtools/build/lib/exec/local/PosixLocalEnvProvider.java 4 - +++ b/src/main/java/com/google/devtools/build/lib/exec/local/PosixLocalEnvProvider.java 5 - @@ -47,6 +47,16 @@ public final class PosixLocalEnvProvider implements LocalEnvProvider { 6 - Map<String, String> env, BinTools binTools, String fallbackTmpDir) { 7 - ImmutableMap.Builder<String, String> result = ImmutableMap.builder(); 8 - result.putAll(Maps.filterKeys(env, k -> !k.equals("TMPDIR"))); 9 - + 10 - + // In case we are running on NixOS. 11 - + // If bash is called with an unset PATH on this platform, 12 - + // it will set it to /no-such-path and default tools will be missings. 13 - + // See, https://github.com/NixOS/nixpkgs/issues/94222 14 - + // So we ensure that minimal dependencies are present. 15 - + if (!env.containsKey("PATH")){ 16 - + result.put("PATH", "@actionsPathPatch@"); 17 - + } 18 - + 19 - String p = clientEnv.get("TMPDIR"); 20 - if (Strings.isNullOrEmpty(p)) { 21 - // Do not use `fallbackTmpDir`, use `/tmp` instead. This way if the user didn't export TMPDIR 22 - diff --git a/src/main/java/com/google/devtools/build/lib/exec/local/XcodeLocalEnvProvider.java b/src/main/java/com/google/devtools/build/lib/exec/local/XcodeLocalEnvProvider.java 23 - index 8f230b1b1d..2e4c7d26b7 100644 24 - --- a/src/main/java/com/google/devtools/build/lib/exec/local/XcodeLocalEnvProvider.java 25 - +++ b/src/main/java/com/google/devtools/build/lib/exec/local/XcodeLocalEnvProvider.java 26 - @@ -75,6 +75,16 @@ public final class XcodeLocalEnvProvider implements LocalEnvProvider { 27 - 28 - ImmutableMap.Builder<String, String> newEnvBuilder = ImmutableMap.builder(); 29 - newEnvBuilder.putAll(Maps.filterKeys(env, k -> !k.equals("TMPDIR"))); 30 - + 31 - + // In case we are running on NixOS. 32 - + // If bash is called with an unset PATH on this platform, 33 - + // it will set it to /no-such-path and default tools will be missings. 34 - + // See, https://github.com/NixOS/nixpkgs/issues/94222 35 - + // So we ensure that minimal dependencies are present. 36 - + if (!env.containsKey("PATH")){ 37 - + newEnvBuilder.put("PATH", "@actionsPathPatch@"); 38 - + } 39 - + 40 - String p = clientEnv.get("TMPDIR"); 41 - if (Strings.isNullOrEmpty(p)) { 42 - // Do not use `fallbackTmpDir`, use `/tmp` instead. This way if the user didn't export TMPDIR
···