From 5f978c71ca40f05c8a65bea577794ec312b38a81 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 19 Aug 2026 16:21:59 -0400 Subject: [PATCH] Detect Windows-on-ARM in dir_build under an emulated shell The GitHub runner image installs the x64 build of Git for Windows, so its bash and everything run from it execute under x64 emulation on Windows on ARM, where uname -m reports x86_64 and the staged build got the wrong architecture. uname -s still reports the machine, as MINGW64_NT-10.0-26200-ARM64, so use that instead. If the image ever installs a native arm64 Git for Windows, uname -m will be correct and this can go. --- app/scripts/dir_build | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/scripts/dir_build b/app/scripts/dir_build index 4a815f2ed1..20f5ef0590 100755 --- a/app/scripts/dir_build +++ b/app/scripts/dir_build @@ -76,10 +76,17 @@ if [[ $platform = "m" ]]; then else # Windows / Linux: derive arch if not supplied if [[ -z $arch ]]; then - case "$(uname -m)" in - arm64|aarch64) arch="arm64" ;; - x86_64) arch="x64" ;; - esac + # An x64 build of Git for Windows runs emulated on Windows on ARM, where it + # reports x86_64 from `uname -m`, while `uname -s` reports the native + # architecture + if [[ $platform = "w" && "$(uname -s)" == *ARM64* ]]; then + arch="arm64" + else + case "$(uname -m)" in + arm64|aarch64) arch="arm64" ;; + x86_64) arch="x64" ;; + esac + fi fi fi