Fix $HOME rewriting on M1 Macs (#1467)
Progress towards
https://github.com/bazelbuild/continuous-integration/issues/1371
This change also fixes a similar bug on Windows ARM64.
diff --git a/buildkite/bazelci.py b/buildkite/bazelci.py
index f75c580..c4491f4 100755
--- a/buildkite/bazelci.py
+++ b/buildkite/bazelci.py
@@ -919,6 +919,10 @@
return os.name == "nt"
+def is_mac():
+ return platform.system() == "Darwin"
+
+
def gsutil_command():
return "gsutil.cmd" if is_windows() else "gsutil"
@@ -1947,12 +1951,12 @@
for i, flag in enumerate(aggregated_flags):
if "$HOME" in flag:
- if platform == "windows":
+ if is_windows():
if os.path.exists("D:/"):
home = "D:"
else:
home = "C:/b"
- elif platform == "macos":
+ elif is_mac():
home = "/Users/buildkite"
else:
home = "/var/lib/buildkite-agent"