From 43abc0b3800d03b13c6bb225bad23fcfad600176 Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Wed, 12 Jun 2024 09:36:34 -0700 Subject: [PATCH] DRAFT: Add an aarch64-msvc build running on ARM64 Windows --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++---- src/ci/github-actions/jobs.yml | 18 ++++++++---------- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 521f8ef0f5ae5..26c4bfacf855c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,10 +81,12 @@ jobs: include: ${{ fromJSON(needs.calculate_matrix.outputs.jobs) }} steps: - if: contains(matrix.os, 'windows') - uses: msys2/setup-msys2@v2.22.0 + uses: msys2/setup-msys2@v2.21.0 with: - # i686 jobs use mingw32. x86_64 and cross-compile jobs use mingw64. - msystem: ${{ contains(matrix.name, 'i686') && 'mingw32' || 'mingw64' }} + # i686 jobs use mingw32. + # aarch64 runners use clangarm64. + # x86_64 and cross-compile jobs use mingw64. + msystem: ${{ contains(matrix.name, 'i686') && 'mingw32' || contains(matrix.os, 'arm64') && 'clangarm64' || 'mingw64' }} # don't try to download updates for already installed packages update: false # don't try to use the msys that comes built-in to the github runner, @@ -98,8 +100,32 @@ jobs: dos2unix diffutils + - if: contains(matrix.os, 'windows') && contains(matrix.os, 'arm64') + name: install Git on Windows Arm64 + shell: powershell + run: | + Invoke-WebRequest -Uri https://github.com/git-for-windows/git/releases/download/v2.45.2.windows.1/Git-2.45.2-64-bit.exe -OutFile '${{ runner.temp }}\gitinstaller.exe' + &'${{ runner.temp }}\gitinstaller.exe' /SP- /VERYSILENT /SUPPRESSMSGBOXES /NOCANCEL /NORESTART /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /o:PathOption=CmdTools /o:BashTerminalOption=ConHost /o:EnableSymlinks=Enabled + $currentPath = [System.Environment]::GetEnvironmentVariable("PATH", "Machine") + $newPath = 'C:\Program Files\Git\bin;' + $currentPath + [Environment]::SetEnvironmentVariable("PATH", $newPath, "Machine") + + - if: contains(matrix.os, 'windows') && contains(matrix.os, 'arm64') + name: add git to bath PATH + run: export PATH="/c/Program Files/Git/bin":$PATH + + # - if: contains(matrix.os, 'windows') && contains(matrix.os, 'arm64') + # name: install VS on Windows Arm64 + # shell: powershell + # run: | + # Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile '${{ runner.temp }}\vs_buildtools.exe' + # cmd /c "${{ runner.temp }}\vs_buildtools.exe --quiet --norestart --wait --nocache --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.Windows11SDK.22621" + - name: disable git crlf conversion - run: git config --global core.autocrlf false + run: | + echo $PATH + ls "/c/Program Files/Git/bin" + git config --global core.autocrlf false - name: checkout the source code uses: actions/checkout@v4 diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index 1db763735e6ed..98b5d0c91b151 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -32,6 +32,10 @@ runners: os: windows-2022-16core-64gb <<: *base-job + - &job-windows-aarch64 + os: windows-11-arm64-8core-32gb + <<: *base-job + - &job-aarch64-linux os: ubuntu-22.04-arm64-8core-32gb @@ -80,17 +84,11 @@ envs: # These jobs automatically inherit envs.pr, to avoid repeating # it in each job definition. pr: - - image: mingw-check - <<: *job-linux-4c - - image: mingw-check-tidy - continue_on_error: true - <<: *job-linux-4c - - image: x86_64-gnu-llvm-17 + - image: aarch64-msvc env: - ENABLE_GCC_CODEGEN: "1" - <<: *job-linux-16c - - image: x86_64-gnu-tools - <<: *job-linux-16c + RUST_CONFIGURE_ARGS: --build=aarch64-pc-windows-msvc + SCRIPT: make ci-msvc + <<: *job-windows-aarch64 # Jobs that run when you perform a try build (@bors try) # These jobs automatically inherit envs.try, to avoid repeating