Enable Windows on Arm GitHub runners (#131994)

This commit is contained in:
Diego Russo 2025-04-03 21:32:29 +01:00 committed by GitHub
parent b6c92ec419
commit 0dbaeb94a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 34 additions and 21 deletions

View file

@ -164,10 +164,12 @@ jobs:
- false
- true
include:
- os: windows-latest # FIXME(diegorusso): change to os: windows-aarch64
# Forks don't have access to Windows on Arm runners. These jobs are skipped below:
- os: ${{ github.repository_owner == 'python' && 'windows-aarch64' || 'windows-latest' }}
arch: arm64
free-threading: false
- os: windows-latest # FIXME(diegorusso): change to os: windows-aarch64
# Forks don't have access to Windows on Arm runners. These jobs are skipped below:
- os: ${{ github.repository_owner == 'python' && 'windows-aarch64' || 'windows-latest' }}
arch: arm64
free-threading: true
- os: windows-latest
@ -187,12 +189,18 @@ jobs:
strategy:
fail-fast: false
matrix:
os:
- windows-latest
arch:
- x86
- x64
- arm64
include:
# Forks don't have access to Windows on Arm runners. These jobs are skipped below:
- os: ${{ github.repository_owner == 'python' && 'windows-aarch64' || 'windows-latest' }}
arch: arm64
uses: ./.github/workflows/reusable-windows-msi.yml
with:
os: ${{ matrix.os }}
arch: ${{ matrix.arch }}
build-macos:

View file

@ -74,7 +74,8 @@ jobs:
runner: windows-latest
- target: aarch64-pc-windows-msvc/msvc
architecture: ARM64
runner: windows-latest
# Forks don't have access to Windows on Arm runners. These jobs are skipped below:
runner: ${{ github.repository_owner == 'python' && 'windows-aarch64' || 'windows-latest' }}
- target: x86_64-apple-darwin/clang
architecture: x86_64
runner: macos-13
@ -95,25 +96,19 @@ jobs:
with:
python-version: '3.11'
- name: Native Windows
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
- name: Windows
# Forks don't have access to Windows on Arm runners. Skip those:
if: runner.os == 'Windows' && (matrix.architecture != 'ARM64' || github.repository_owner == 'python')
run: |
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
# No tests (yet):
- name: Emulated Windows
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
run: |
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
# The `find` line is required as a result of https://github.com/actions/runner-images/issues/9966.
# This is a bug in the macOS runner image where the pre-installed Python is installed in the same
# directory as the Homebrew Python, which causes the build to fail for macos-13. This line removes
# the symlink to the pre-installed Python so that the Homebrew Python is used instead.
- name: Native macOS
- name: macOS
if: runner.os == 'macOS'
run: |
brew update
@ -124,7 +119,7 @@ jobs:
make all --jobs 4
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
- name: Native Linux
- name: Linux
if: runner.os == 'Linux'
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}

View file

@ -3,6 +3,10 @@ name: Reusable Windows MSI
on:
workflow_call:
inputs:
os:
description: OS to run on
required: true
type: string
arch:
description: CPU architecture
required: true
@ -17,7 +21,7 @@ env:
jobs:
build:
name: installer for ${{ inputs.arch }}
runs-on: windows-latest
runs-on: ${{ inputs.os }}
timeout-minutes: 60
env:
ARCH: ${{ inputs.arch }}
@ -27,5 +31,7 @@ jobs:
with:
persist-credentials: false
- name: Build CPython installer
# Forks don't have access to Windows on Arm runners. Skip those:
if: inputs.arch != 'arm64' || github.repository_owner == 'python'
run: ./Tools/msi/build.bat --doc -"${ARCH}"
shell: bash

View file

@ -24,7 +24,7 @@ env:
jobs:
build:
name: ${{ inputs.arch == 'arm64' && 'build' || 'build and test' }} (${{ inputs.arch }})
name: Build and test (${{ inputs.arch }})
runs-on: ${{ inputs.os }}
timeout-minutes: 60
env:
@ -37,17 +37,21 @@ jobs:
if: inputs.arch != 'Win32'
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
- name: Build CPython
# Forks don't have access to Windows on Arm runners. Skip those:
if: inputs.arch != 'arm64' || github.repository_owner == 'python'
run: >-
.\\PCbuild\\build.bat
-e -d -v
-p "${ARCH}"
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
shell: bash
- name: Display build info # FIXME(diegorusso): remove the `if`
if: inputs.arch != 'arm64'
- name: Display build info
# Forks don't have access to Windows on Arm runners. Skip those:
if: inputs.arch != 'arm64' || github.repository_owner == 'python'
run: .\\python.bat -m test.pythoninfo
- name: Tests # FIXME(diegorusso): remove the `if`
if: inputs.arch != 'arm64'
- name: Tests
# Forks don't have access to Windows on Arm runners. Skip those:
if: inputs.arch != 'arm64' || github.repository_owner == 'python'
run: >-
.\\PCbuild\\rt.bat
-p "${ARCH}"