Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/architectures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 19 additions & 4 deletions rivet-cli/windows-tools.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")))
Expand Down Expand Up @@ -149,5 +163,6 @@

(module+ test-support
(provide msbuild-in-installation
prefer-64-bit-msbuild
vc-toolset-in-installation
sorted-child-directories))
19 changes: 16 additions & 3 deletions tests/windows-tools.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading