Skip to content

Commit 73a636f

Browse files
committed
fix(smoke): derive arch from CI matrix, not emulated uname (arm64 12a)
The persistent windows-11-arm smoke Phase 12a failure was a 404, not a network error: it requested codebase-memory-mcp-windows-amd64.zip on the arm64 leg. Cause: DL_ARCH came from `uname -m`, which on windows-11-arm is an emulated x86_64 MSYS2 uname reporting "x86_64" -> wrong (amd64) archive -> 404 (server has arm64). Phase 14 worked because the binary's own detect_arch() is native. Prefer SMOKE_ARCH (passed from the smoke workflow's matrix.arch) over uname; fall back to uname for local runs. This is the real cause the earlier curl/proxy/ipv4 attempts masked -- the 404 was swallowed by 2>/dev/null until #905 surfaced it. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 955f0cc commit 73a636f

2 files changed

Lines changed: 21 additions & 12 deletions

File tree

.github/workflows/_smoke.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ jobs:
235235
run: scripts/smoke-test.sh ./codebase-memory-mcp.exe
236236
env:
237237
SMOKE_DOWNLOAD_URL: http://127.0.0.1:18080
238+
SMOKE_ARCH: ${{ matrix.arch }}
238239

239240
- name: Security audits
240241
shell: msys2 {0}

scripts/smoke-test.sh

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,18 +1570,26 @@ DL_OS=$(uname -s | tr 'A-Z' 'a-z')
15701570
case "$DL_OS" in
15711571
mingw*|msys*) DL_OS="windows" ;;
15721572
esac
1573-
DL_ARCH=$(uname -m)
1574-
case "$DL_ARCH" in
1575-
aarch64) DL_ARCH="arm64" ;;
1576-
x86_64)
1577-
# Rosetta detection
1578-
if [ "$DL_OS" = "darwin" ] && sysctl -n machdep.cpu.brand_string 2>/dev/null | grep -qi apple; then
1579-
DL_ARCH="arm64"
1580-
else
1581-
DL_ARCH="amd64"
1582-
fi
1583-
;;
1584-
esac
1573+
# Prefer a CI-provided SMOKE_ARCH over `uname -m`: on windows-11-arm the base
1574+
# MSYS2 `uname` is an emulated x86_64 binary that reports "x86_64", so uname would
1575+
# request the amd64 archive and 404. The smoke workflow passes the true matrix
1576+
# arch (arm64/amd64). Fall back to uname when SMOKE_ARCH is unset (local runs).
1577+
if [ -n "${SMOKE_ARCH:-}" ]; then
1578+
DL_ARCH="$SMOKE_ARCH"
1579+
else
1580+
DL_ARCH=$(uname -m)
1581+
case "$DL_ARCH" in
1582+
aarch64) DL_ARCH="arm64" ;;
1583+
x86_64)
1584+
# Rosetta detection
1585+
if [ "$DL_OS" = "darwin" ] && sysctl -n machdep.cpu.brand_string 2>/dev/null | grep -qi apple; then
1586+
DL_ARCH="arm64"
1587+
else
1588+
DL_ARCH="amd64"
1589+
fi
1590+
;;
1591+
esac
1592+
fi
15851593

15861594
if [ "$DL_OS" = "darwin" ] || [ "$DL_OS" = "linux" ]; then
15871595
DL_EXT="tar.gz"

0 commit comments

Comments
 (0)