From 34eaea3b905fcc3891cc67484bf287c9a3b08863 Mon Sep 17 00:00:00 2001 From: "ren.ji" Date: Thu, 8 Oct 2026 09:41:07 +0800 Subject: [PATCH] Refresh Windows ARM64 CI toolchain pins --- .github/workflows/architectures.yml | 2 +- CHANGELOG.md | 2 ++ rivet-cli/windows-tools.rkt | 23 +++++++++++++++++++---- tests/windows-tools.rkt | 19 ++++++++++++++++--- 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/.github/workflows/architectures.yml b/.github/workflows/architectures.yml index 67521b7..e600e88 100644 --- a/.github/workflows/architectures.yml +++ b/.github/workflows/architectures.yml @@ -29,7 +29,7 @@ jobs: -Uri 'https://download.racket-lang.org/installers/9.3/racket-9.3-arm64-win32-cs.exe' ` -OutFile $installer $hash = (Get-FileHash $installer -Algorithm SHA256).Hash.ToLowerInvariant() - if ($hash -ne 'fcccd112afd3c8fecfdaf56d2a2fc3213fe006d8e4eac525ceaee56f10628a01') { + if ($hash -ne '15cd4ace652427465c7c576bad4aede2b8519cb6b59b190c9a22862cf57e7924') { throw "Racket 9.3 arm64 installer checksum mismatch: $hash" } # NSIS silent install; /D must be last and unquoted. On Windows the diff --git a/CHANGELOG.md b/CHANGELOG.md index e1cf315..5cc693c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- Prefer native 64-bit MSBuild when discovering Visual Studio, preventing the + 32-bit host compiler from exhausting its address space on WinUI ARM64 builds. - Add the Linux tray contract: `rivet::system::TrayIcon` hosts an org.kde.StatusNotifierItem with a com.canonical.dbusmenu menu over the session bus (GDBus), the pairing every desktop watcher serves (GNOME via diff --git a/rivet-cli/windows-tools.rkt b/rivet-cli/windows-tools.rkt index 5b5731f..92a1449 100644 --- a/rivet-cli/windows-tools.rkt +++ b/rivet-cli/windows-tools.rkt @@ -66,13 +66,25 @@ #:key path->string) '())) +(define (prefer-64-bit-msbuild executable) + (and executable + (or (existing-file + (build-path (path-only executable) "amd64" "MSBuild.exe")) + executable))) + (define (msbuild-in-installation root) (and root (let ([msbuild-root (build-path root "MSBuild")]) - (or (existing-file - (build-path msbuild-root "Current" "Bin" "MSBuild.exe")) + (define (in-bin bin) + ;; The native 64-bit MSBuild selects Hostx64 compiler tools for + ;; cross-targets. The generic executable can select HostX86 even + ;; when PreferredToolArchitecture=x64 is passed, exhausting its + ;; address space while compiling WinUI generated sources. + (or (existing-file (build-path bin "amd64" "MSBuild.exe")) + (existing-file (build-path bin "MSBuild.exe")))) + (or (in-bin (build-path msbuild-root "Current" "Bin")) (for/or ([entry (in-list (sorted-child-directories msbuild-root))]) - (existing-file (build-path entry "Bin" "MSBuild.exe"))))))) + (in-bin (build-path entry "Bin"))))))) (define (vc-toolset-in-installation root) (and root @@ -101,7 +113,9 @@ (define (discover-windows-toolchain) (define vswhere (candidate-vswhere)) - (define path-msbuild (existing-file (find-executable-path "MSBuild.exe"))) + (define path-msbuild + (prefer-64-bit-msbuild + (existing-file (find-executable-path "MSBuild.exe")))) (define path-cl (existing-file (find-executable-path "cl.exe"))) (define path-lib (existing-file (find-executable-path "lib.exe"))) (define path-dumpbin (existing-file (find-executable-path "dumpbin.exe"))) @@ -149,5 +163,6 @@ (module+ test-support (provide msbuild-in-installation + prefer-64-bit-msbuild vc-toolset-in-installation sorted-child-directories)) diff --git a/tests/windows-tools.rkt b/tests/windows-tools.rkt index 093d92e..3e205c2 100644 --- a/tests/windows-tools.rkt +++ b/tests/windows-tools.rkt @@ -41,17 +41,30 @@ (touch (build-path unexpected "dumpbin.exe")) (check-equal? (vc-toolset-in-installation temp-root) expected-vc) - ;; Prefer Visual Studio's stable Current alias for MSBuild. + ;; Prefer the native 64-bit executable under Visual Studio's stable + ;; Current alias; the generic executable can select HostX86 tools. + (touch (build-path temp-root "MSBuild" "Current" "Bin" "MSBuild.exe")) (define current-msbuild - (touch (build-path temp-root "MSBuild" "Current" "Bin" "MSBuild.exe"))) + (touch + (build-path temp-root "MSBuild" "Current" "Bin" "amd64" "MSBuild.exe"))) (touch (build-path temp-root "MSBuild" "18.0" "Bin" "MSBuild.exe")) (check-equal? (msbuild-in-installation temp-root) current-msbuild) + ;; Apply the same upgrade when a generic MSBuild executable is already on + ;; PATH, instead of letting PATH bypass installation discovery. + (define path-bin (build-path temp-root "path-bin")) + (define path-msbuild (touch (build-path path-bin "MSBuild.exe"))) + (define path-amd64-msbuild + (touch (build-path path-bin "amd64" "MSBuild.exe"))) + (check-equal? (prefer-64-bit-msbuild path-msbuild) path-amd64-msbuild) + ;; Without Current, choose the newest bounded MSBuild directory. (define fallback-root (build-path temp-root "fallback")) (touch (build-path fallback-root "MSBuild" "17.0" "Bin" "MSBuild.exe")) + (touch (build-path fallback-root "MSBuild" "18.0" "Bin" "MSBuild.exe")) (define newest-msbuild - (touch (build-path fallback-root "MSBuild" "18.0" "Bin" "MSBuild.exe"))) + (touch + (build-path fallback-root "MSBuild" "18.0" "Bin" "amd64" "MSBuild.exe"))) (check-equal? (msbuild-in-installation fallback-root) newest-msbuild) (define children