Enabling --incompatible_strict_action_env without providing an explicit --action_env causes PATH to default to /bin:/usr/bin.
|
if (strictActionEnv) { |
|
env.put("PATH", pathOrDefault(os, null, shellExecutable)); |
|
} else if (os == OS.WINDOWS) { |
|
// TODO(ulfjack): The default PATH should be set from the exec platform, which may be different |
|
// from the local machine. For now, this can be overridden with --action_env=PATH=<value>, so |
|
// at least there's a workaround. |
|
if (os != OS.WINDOWS) { |
|
return "/bin:/usr/bin"; |
|
} |
On our Mac CI workers, python3 is installed via Homebrew in /usr/local/bin. I expect other Mac users would have similar configurations.
This causes downstream failures in my presubmit to flip --incompatible_use_python_toolchains for Bazel 0.27. The flag is being flipped anyway. I expect those projects will have to either modify their --action_env or somehow modify their buildkite CI to add a custom Python toolchain.
+cc @philwo for CI, @buchgr for strict action env.
Enabling
--incompatible_strict_action_envwithout providing an explicit--action_envcausesPATHto default to/bin:/usr/bin.bazel/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
Lines 169 to 171 in e495e6b
bazel/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
Lines 449 to 454 in e495e6b
On our Mac CI workers,
python3is installed via Homebrew in/usr/local/bin. I expect other Mac users would have similar configurations.This causes downstream failures in my presubmit to flip
--incompatible_use_python_toolchainsfor Bazel 0.27. The flag is being flipped anyway. I expect those projects will have to either modify their--action_envor somehow modify their buildkite CI to add a custom Python toolchain.+cc @philwo for CI, @buchgr for strict action env.