Skip to content

Commit 71e86a6

Browse files
committed
fix(smoke/install): pass explicit CBM_ARCH to install.ps1 (arm64 Phase 13)
install.ps1 kept detecting arch=amd64 on windows-11-arm because it runs under x64 emulation, where neither $env:PROCESSOR_ARCHITECTURE nor .NET OSArchitecture (on Windows PowerShell 5.1) reports the real Arm64. Add a CBM_ARCH env override to install.ps1 (wins over auto-detect; also a genuine escape hatch for emulated invocations) and have smoke Phase 13 pass the authoritative DL_ARCH. Deterministic -- no reliance on in-process detection under emulation. Same emulated-arch class as DeusData#907 (uname) and DeusData#908. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 8e798ff commit 71e86a6

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

install.ps1

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,20 @@ foreach ($arg in $args) {
3636
# unlike $env:PROCESSOR_ARCHITECTURE, which reports the emulated "AMD64", and
3737
# PROCESSOR_ARCHITEW6432, which is unset for 64-bit emulated processes. Fall back
3838
# to the env vars only if the .NET API is somehow unavailable.
39-
try {
40-
$osArch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
41-
$Arch = if ($osArch -eq 'Arm64') { "arm64" } else { "amd64" }
42-
} catch {
43-
if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64" -or $env:PROCESSOR_ARCHITEW6432 -eq "ARM64") {
44-
$Arch = "arm64"
45-
} else {
46-
$Arch = "amd64"
39+
if ($env:CBM_ARCH) {
40+
# Explicit override wins — used by CI/tests, and an escape hatch under x64
41+
# emulation on ARM64 where no in-process detection is reliable.
42+
$Arch = $env:CBM_ARCH
43+
} else {
44+
try {
45+
$osArch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
46+
$Arch = if ($osArch -eq 'Arm64') { "arm64" } else { "amd64" }
47+
} catch {
48+
if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64" -or $env:PROCESSOR_ARCHITEW6432 -eq "ARM64") {
49+
$Arch = "arm64"
50+
} else {
51+
$Arch = "amd64"
52+
}
4753
}
4854
}
4955

scripts/smoke-test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,9 @@ elif [ -f "$REPO_ROOT/install.ps1" ] && command -v powershell.exe &>/dev/null; t
17781778
fi
17791779

17801780
# 13f: run install.ps1
1781-
HOME="$PS1_TEST_HOME" CBM_DOWNLOAD_URL="$WIN_URL" \
1781+
# Pass the known-correct arch: powershell runs under x64 emulation on ARM64, so
1782+
# install.ps1's own detection can't tell it's arm64. DL_ARCH is authoritative here.
1783+
HOME="$PS1_TEST_HOME" CBM_DOWNLOAD_URL="$WIN_URL" CBM_ARCH="$DL_ARCH" \
17821784
powershell.exe -ExecutionPolicy ByPass -File "$WIN_SCRIPT" "--dir=$WIN_DIR" 2>&1 || true
17831785

17841786
# 13g: binary placed

0 commit comments

Comments
 (0)