Skip to content

Enable Windows on Arm GitHub runners #131994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 3, 2025
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
14 changes: 11 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
19 changes: 7 additions & 12 deletions .github/workflows/jit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 }}
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/reusable-windows-msi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand All @@ -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
14 changes: 9 additions & 5 deletions .github/workflows/reusable-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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}"
Expand Down
Loading