From 40ffbd5093d6f9a6ea584c01aedb40c87231abdd Mon Sep 17 00:00:00 2001 From: Elliot Michlin <31219104+theelliotm@users.noreply.github.com> Date: Mon, 21 Sep 2026 12:03:43 -0700 Subject: [PATCH 1/3] wslc scripts now check for ARM target on ARM systems --- scripts/setup-wslc.ps1 | 6 +++++- tests/scripts/run_wslc_all_tests.ps1 | 11 ++++++++--- tests/scripts/run_wslc_denied_masking_test.ps1 | 9 +++++++-- tests/scripts/run_wslc_dotdot_alias_test.ps1 | 9 +++++++-- tests/scripts/run_wslc_most_specific_test.ps1 | 9 +++++++-- tests/scripts/run_wslc_object_test.ps1 | 9 +++++++-- tests/scripts/run_wslc_proxy_test.ps1 | 9 +++++++-- tests/scripts/run_wslc_state_aware_tests.ps1 | 8 +++++++- 8 files changed, 55 insertions(+), 15 deletions(-) diff --git a/scripts/setup-wslc.ps1 b/scripts/setup-wslc.ps1 index e37e79046..f931bafd7 100644 --- a/scripts/setup-wslc.ps1 +++ b/scripts/setup-wslc.ps1 @@ -66,7 +66,11 @@ $ErrorActionPreference = "Stop" $RepoRoot = Split-Path -Parent $PSScriptRoot # Discover wxc-exec.exe -- prefer explicit path, then probe target dirs. -$Target = "x86_64-pc-windows-msvc" +$Target = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { + 'aarch64-pc-windows-msvc' +} else { + 'x86_64-pc-windows-msvc' +} if ($WxcExecPath) { $WxcExec = $WxcExecPath } else { diff --git a/tests/scripts/run_wslc_all_tests.ps1 b/tests/scripts/run_wslc_all_tests.ps1 index 586ec6200..a8a5d4351 100644 --- a/tests/scripts/run_wslc_all_tests.ps1 +++ b/tests/scripts/run_wslc_all_tests.ps1 @@ -46,8 +46,13 @@ $ErrorActionPreference = "Stop" $RepoRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) $TestConfigs = Join-Path $RepoRoot "tests\configs" -# Find binary -- prefer explicit path, then probe target-specific and default dirs. -$Target = "x86_64-pc-windows-msvc" +# Find binary -- prefer explicit path, then probe target-specific and default +# dirs. Use the host arch to determine which target to use. +$Target = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { + 'aarch64-pc-windows-msvc' +} else { + 'x86_64-pc-windows-msvc' +} $Profile = if ($Debug) { "debug" } else { "release" } if ($WxcExecPath) { @@ -64,7 +69,7 @@ if (-not $WxcExec -or -not (Test-Path $WxcExec)) { Write-Host "ERROR: wxc-exec.exe not found." -ForegroundColor Red Write-Host "Searched:" -ForegroundColor Yellow foreach ($p in $CandidatePaths) { Write-Host " - $p" -ForegroundColor Yellow } - Write-Host "Build with: cargo build --features wslc $(if (-not $Debug) { '--release ' })--target $Target" -ForegroundColor Yellow + Write-Host "Build with: cargo build --features wslc $(if (-not $Debug) { '--release ' })--target $HostTarget" -ForegroundColor Yellow Write-Host "Or pass -WxcExecPath explicitly." -ForegroundColor Yellow exit 1 } diff --git a/tests/scripts/run_wslc_denied_masking_test.ps1 b/tests/scripts/run_wslc_denied_masking_test.ps1 index 8ff54ef74..70c3954e9 100644 --- a/tests/scripts/run_wslc_denied_masking_test.ps1 +++ b/tests/scripts/run_wslc_denied_masking_test.ps1 @@ -30,8 +30,13 @@ $ErrorActionPreference = "Stop" $RepoRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) $ConfigPath = Join-Path $RepoRoot "tests\configs\wslc_denied_masking.json" -# Resolve the binary: explicit path, then target-specific and default dirs. -$Target = "x86_64-pc-windows-msvc" +# Find binary -- prefer explicit path, then probe target-specific and default +# dirs. Use the host arch to determine which target to use. +$Target = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { + 'aarch64-pc-windows-msvc' +} else { + 'x86_64-pc-windows-msvc' +} $Profile = if ($Debug) { "debug" } else { "release" } if ($WxcExecPath) { $WxcExec = $WxcExecPath diff --git a/tests/scripts/run_wslc_dotdot_alias_test.ps1 b/tests/scripts/run_wslc_dotdot_alias_test.ps1 index de3aa3a0e..83e5286bb 100644 --- a/tests/scripts/run_wslc_dotdot_alias_test.ps1 +++ b/tests/scripts/run_wslc_dotdot_alias_test.ps1 @@ -32,8 +32,13 @@ $ErrorActionPreference = "Stop" $RepoRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) $ConfigPath = Join-Path $RepoRoot "tests\configs\wslc_denied_dotdot_alias.json" -# Resolve the binary: explicit path, then target-specific and default dirs. -$Target = "x86_64-pc-windows-msvc" +# Find binary -- prefer explicit path, then probe target-specific and default +# dirs. Use the host arch to determine which target to use. +$Target = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { + 'aarch64-pc-windows-msvc' +} else { + 'x86_64-pc-windows-msvc' +} $Profile = if ($Debug) { "debug" } else { "release" } if ($WxcExecPath) { $WxcExec = $WxcExecPath diff --git a/tests/scripts/run_wslc_most_specific_test.ps1 b/tests/scripts/run_wslc_most_specific_test.ps1 index 9fec04434..4b8618403 100644 --- a/tests/scripts/run_wslc_most_specific_test.ps1 +++ b/tests/scripts/run_wslc_most_specific_test.ps1 @@ -27,8 +27,13 @@ $ErrorActionPreference = "Stop" $RepoRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) $ConfigPath = Join-Path $RepoRoot "tests\configs\wslc_most_specific_denied_parent.json" -# Resolve the binary: explicit path, then target-specific and default dirs. -$Target = "x86_64-pc-windows-msvc" +# Find binary -- prefer explicit path, then probe target-specific and default +# dirs. Use the host arch to determine which target to use. +$Target = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { + 'aarch64-pc-windows-msvc' +} else { + 'x86_64-pc-windows-msvc' +} $Profile = if ($Debug) { "debug" } else { "release" } if ($WxcExecPath) { $WxcExec = $WxcExecPath diff --git a/tests/scripts/run_wslc_object_test.ps1 b/tests/scripts/run_wslc_object_test.ps1 index b6b909acd..2dab253bb 100644 --- a/tests/scripts/run_wslc_object_test.ps1 +++ b/tests/scripts/run_wslc_object_test.ps1 @@ -28,8 +28,13 @@ $ErrorActionPreference = "Stop" $RepoRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) $ConfigPath = Join-Path $RepoRoot "tests\configs\wslc_filesystem_object.json" -# Resolve the binary: explicit path, then target-specific and default dirs. -$Target = "x86_64-pc-windows-msvc" +# Find binary -- prefer explicit path, then probe target-specific and default +# dirs. Use the host arch to determine which target to use. +$Target = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { + 'aarch64-pc-windows-msvc' +} else { + 'x86_64-pc-windows-msvc' +} $Profile = if ($Debug) { "debug" } else { "release" } if ($WxcExecPath) { $WxcExec = $WxcExecPath diff --git a/tests/scripts/run_wslc_proxy_test.ps1 b/tests/scripts/run_wslc_proxy_test.ps1 index d7f9ffbf0..92b6282c4 100644 --- a/tests/scripts/run_wslc_proxy_test.ps1 +++ b/tests/scripts/run_wslc_proxy_test.ps1 @@ -37,8 +37,13 @@ $ErrorActionPreference = "Stop" $RepoRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) $ConfigPath = Join-Path $RepoRoot "tests\configs\wslc_network_proxy.json" -# Resolve the binary: explicit path, then target-specific and default dirs. -$Target = "x86_64-pc-windows-msvc" +# Find binary -- prefer explicit path, then probe target-specific and default +# dirs. Use the host arch to determine which target to use. +$Target = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { + 'aarch64-pc-windows-msvc' +} else { + 'x86_64-pc-windows-msvc' +} $Profile = if ($Debug) { "debug" } else { "release" } if ($WxcExecPath) { $WxcExec = $WxcExecPath diff --git a/tests/scripts/run_wslc_state_aware_tests.ps1 b/tests/scripts/run_wslc_state_aware_tests.ps1 index 6b95515d1..f1642b2bb 100644 --- a/tests/scripts/run_wslc_state_aware_tests.ps1 +++ b/tests/scripts/run_wslc_state_aware_tests.ps1 @@ -66,7 +66,13 @@ $RepoRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) # ---------------- Locate wxc-exec.exe + daemon ---------------- -$Target = "x86_64-pc-windows-msvc" +# Find binary -- prefer explicit path, then probe target-specific and default +# dirs. Use the host arch to determine which target to use. +$Target = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { + 'aarch64-pc-windows-msvc' +} else { + 'x86_64-pc-windows-msvc' +} $Prof = if ($Debug) { "debug" } else { "release" } if ($WxcExecPath) { From cef5e60eec6cfc9c0a0f338229fea61d445ccb67 Mon Sep 17 00:00:00 2001 From: Elliot Michlin <31219104+theelliotm@users.noreply.github.com> Date: Mon, 21 Sep 2026 12:12:00 -0700 Subject: [PATCH 2/3] Correct documentation --- docs/wsl/wsl-container-getting-started.md | 5 +++++ docs/wsl/wslc-sdk-bindings.md | 2 +- tests/scripts/run_wslc_all_tests.ps1 | 4 ++-- tests/scripts/run_wslc_state_aware_tests.ps1 | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/wsl/wsl-container-getting-started.md b/docs/wsl/wsl-container-getting-started.md index a4a1943c2..8fca81e32 100644 --- a/docs/wsl/wsl-container-getting-started.md +++ b/docs/wsl/wsl-container-getting-started.md @@ -101,6 +101,11 @@ Verify the binary starts without errors: .\src\target\x86_64-pc-windows-msvc\release\wxc-exec.exe --help ``` +> **Note:** paths in this guide use the x64 target directory. On an ARM64 host +> `build.bat` targets `aarch64-pc-windows-msvc`, so substitute that directory. +> The WSLC scripts under `scripts\` and `tests\scripts\` pick the host-arch +> directory themselves. + > **Note:** `wxc-exec.exe` does **not** require `wslcsdk.dll` at startup. The > DLL is loaded at runtime only when the WSLC backend is invoked. All other > backends (Process Container, Windows Sandbox) work without it. diff --git a/docs/wsl/wslc-sdk-bindings.md b/docs/wsl/wslc-sdk-bindings.md index 9858cc5c6..a7c375182 100644 --- a/docs/wsl/wslc-sdk-bindings.md +++ b/docs/wsl/wslc-sdk-bindings.md @@ -108,7 +108,7 @@ match the pinned SDK. staged next to `wxc-exec.exe`, then: ```powershell - cargo build -p wxc --features wslc --release --target x86_64-pc-windows-msvc + cargo build -p wxc --features wslc --release --target x86_64-pc-windows-msvc # aarch64-pc-windows-msvc on ARM64 .\tests\scripts\run_wslc_all_tests.ps1 ``` diff --git a/tests/scripts/run_wslc_all_tests.ps1 b/tests/scripts/run_wslc_all_tests.ps1 index a8a5d4351..db29d7a29 100644 --- a/tests/scripts/run_wslc_all_tests.ps1 +++ b/tests/scripts/run_wslc_all_tests.ps1 @@ -47,7 +47,7 @@ $RepoRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) $TestConfigs = Join-Path $RepoRoot "tests\configs" # Find binary -- prefer explicit path, then probe target-specific and default -# dirs. Use the host arch to determine which target to use. +# dirs. Use the host arch to determine which target to use. $Target = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { 'aarch64-pc-windows-msvc' } else { @@ -69,7 +69,7 @@ if (-not $WxcExec -or -not (Test-Path $WxcExec)) { Write-Host "ERROR: wxc-exec.exe not found." -ForegroundColor Red Write-Host "Searched:" -ForegroundColor Yellow foreach ($p in $CandidatePaths) { Write-Host " - $p" -ForegroundColor Yellow } - Write-Host "Build with: cargo build --features wslc $(if (-not $Debug) { '--release ' })--target $HostTarget" -ForegroundColor Yellow + Write-Host "Build with: cargo build --features wslc $(if (-not $Debug) { '--release ' })--target $Target" -ForegroundColor Yellow Write-Host "Or pass -WxcExecPath explicitly." -ForegroundColor Yellow exit 1 } diff --git a/tests/scripts/run_wslc_state_aware_tests.ps1 b/tests/scripts/run_wslc_state_aware_tests.ps1 index f1642b2bb..965f49ecd 100644 --- a/tests/scripts/run_wslc_state_aware_tests.ps1 +++ b/tests/scripts/run_wslc_state_aware_tests.ps1 @@ -37,7 +37,7 @@ provision so the spawned daemon inherits them. .PARAMETER WxcExecPath - Path to wxc-exec.exe. Default probes the x64 target release/debug dirs. + Path to wxc-exec.exe. Default probes the host-arch target release/debug dirs. .PARAMETER ConfigDir Directory holding the state-aware request fixtures. Defaults to From 24f0049faaac06e927b1d2281d3352a3f4e4f50b Mon Sep 17 00:00:00 2001 From: Elliot Michlin <31219104+theelliotm@users.noreply.github.com> Date: Mon, 21 Sep 2026 16:49:12 -0700 Subject: [PATCH 3/3] WSLC in CI no longer blocks ARM either --- scripts/ci/run_backend_validation_tests.ps1 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/ci/run_backend_validation_tests.ps1 b/scripts/ci/run_backend_validation_tests.ps1 index 66caf27d3..830f31ad1 100644 --- a/scripts/ci/run_backend_validation_tests.ps1 +++ b/scripts/ci/run_backend_validation_tests.ps1 @@ -217,10 +217,6 @@ switch ($Backend) { } } 'wslc' { - # The current WSLC helper hardcodes the x64 target when locating assets. - if ($Architecture -ne 'x64') { - throw 'The existing WSLC test harness is not architecture-portable yet.' - } Invoke-TestScript -Path (Join-Path $testScriptRoot 'run_wslc_all_tests.ps1') -Arguments @{ WxcExecPath = $wxc }