From 97e352bf30d8fa9f916ec3773350044b74246279 Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Thu, 29 Oct 2026 14:03:09 -0400 Subject: [PATCH] ci: add windows gnullvm aarch64 build targets (#2290) Adds Windows gnnllvm aarch64 build targets in CI. This applies to the MSI wix build and the normal binary. This also fixes that we weren't specifying the wix build target technically (wasn't a problem though since it was previously just using the default). --- .github/workflows/build_releases.yml | 24 ++++++++++++++++++++++-- scripts/ci/setup_windows_gnullvm.ps1 | 21 +++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 scripts/ci/setup_windows_gnullvm.ps1 diff --git a/.github/workflows/build_releases.yml b/.github/workflows/build_releases.yml index 101f6c52..5bbb18e9 100644 --- a/.github/workflows/build_releases.yml +++ b/.github/workflows/build_releases.yml @@ -151,12 +151,17 @@ jobs: cross: true, } - # Windows ARM, may promote to official. + # Windows ARM; may promote to official. - { target: "aarch64-pc-windows-msvc", os: "windows-11-arm", cross: false, } + - { + target: "aarch64-pc-windows-gnullvm", + os: "windows-11-arm", + cross: false, + } # FreeBSD - { @@ -175,6 +180,11 @@ jobs: fetch-depth: 1 persist-credentials: false + - name: Install Windows ARM64 GNU toolchain + if: matrix.info.target == 'aarch64-pc-windows-gnullvm' + shell: pwsh + run: ./scripts/ci/setup_windows_gnullvm.ps1 + # TODO: Make this and the toolchain step a separate wrapper action? - name: Read Rust version shell: bash @@ -342,6 +352,11 @@ jobs: target: "aarch64-pc-windows-msvc", output: "bottom_aarch64_installer.msi", } + - { + os: "windows-11-arm", + target: "aarch64-pc-windows-gnullvm", + output: "bottom_aarch64_gnullvm_installer.msi", + } runs-on: ${{ matrix.info.os }} steps: - name: Checkout repository @@ -350,6 +365,11 @@ jobs: fetch-depth: 1 persist-credentials: false + - name: Install Windows ARM64 GNU toolchain + if: matrix.info.target == 'aarch64-pc-windows-gnullvm' + shell: pwsh + run: ./scripts/ci/setup_windows_gnullvm.ps1 + - name: Install Net-Framework-Core shell: powershell run: | @@ -386,7 +406,7 @@ jobs: env: BTM_GENERATE: true run: | - cargo wix --toolset modern --nocapture + cargo wix --toolset modern --target ${{ matrix.info.target }} --nocapture mv bottom_installer.msi ${{ matrix.info.output }} - name: Generate artifact attestation for file diff --git a/scripts/ci/setup_windows_gnullvm.ps1 b/scripts/ci/setup_windows_gnullvm.ps1 new file mode 100644 index 00000000..29096d11 --- /dev/null +++ b/scripts/ci/setup_windows_gnullvm.ps1 @@ -0,0 +1,21 @@ +$ErrorActionPreference = 'Stop' + +$msys2 = 'C:\msys64' +$package = 'mingw-w64-clang-aarch64-clang=23.1.4-1' +& "$msys2\usr\bin\bash.exe" -lc 'pacman --noconfirm -Sy' +if ($LASTEXITCODE -ne 0) { + throw 'Failed to synchronize the MSYS2 package databases' +} +& "$msys2\usr\bin\bash.exe" -lc "pacman --noconfirm -S --needed '$package'" +if ($LASTEXITCODE -ne 0) { + throw 'Failed to install the CLANGARM64 toolchain' +} + +$bin = "$msys2\clangarm64\bin" +$compiler = "$bin\aarch64-w64-mingw32-clang.exe" +if (-not (Test-Path $compiler)) { + throw "The CLANGARM64 compiler was not found at $compiler" +} + +$bin >> $env:GITHUB_PATH +& $compiler --version