Skip to content

Commit 5648245

Browse files
committed
Refactor jit pipeline
1 parent 359926c commit 5648245

File tree

1 file changed

+70
-55
lines changed

1 file changed

+70
-55
lines changed

.github/workflows/jit.yml

Lines changed: 70 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ concurrency:
3131
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
3232
cancel-in-progress: true
3333

34+
env:
35+
LLVM: 19
36+
3437
jobs:
3538
interpreter:
3639
name: Interpreter (Debug)
@@ -45,89 +48,105 @@ jobs:
4548
- name: Test tier two interpreter
4649
run: |
4750
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
48-
jit:
49-
name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }})
51+
52+
jit-windows:
53+
name: Windows (${{ matrix.arch }}, ${{ matrix.debug && 'Debug' || 'Release' }})
5054
needs: interpreter
51-
runs-on: ${{ matrix.runner }}
55+
runs-on: windows-latest
5256
timeout-minutes: 90
5357
strategy:
5458
fail-fast: false
5559
matrix:
56-
target:
57-
- i686-pc-windows-msvc/msvc
58-
- x86_64-pc-windows-msvc/msvc
59-
- aarch64-pc-windows-msvc/msvc
60-
- x86_64-apple-darwin/clang
61-
- aarch64-apple-darwin/clang
62-
- x86_64-unknown-linux-gnu/gcc
63-
- aarch64-unknown-linux-gnu/gcc
60+
arch:
61+
- x64
62+
- Win32
63+
- ARM64
6464
debug:
6565
- true
6666
- false
67-
llvm:
68-
- 19
69-
include:
70-
- target: i686-pc-windows-msvc/msvc
71-
architecture: Win32
72-
runner: windows-latest
73-
- target: x86_64-pc-windows-msvc/msvc
74-
architecture: x64
75-
runner: windows-latest
76-
- target: aarch64-pc-windows-msvc/msvc
77-
architecture: ARM64
78-
runner: windows-latest
79-
- target: x86_64-apple-darwin/clang
80-
architecture: x86_64
81-
runner: macos-13
82-
- target: aarch64-apple-darwin/clang
83-
architecture: aarch64
84-
runner: macos-14
85-
- target: x86_64-unknown-linux-gnu/gcc
86-
architecture: x86_64
87-
runner: ubuntu-24.04
88-
- target: aarch64-unknown-linux-gnu/gcc
89-
architecture: aarch64
90-
runner: ubuntu-24.04-aarch64
9167
steps:
9268
- uses: actions/checkout@v4
9369
- uses: actions/setup-python@v5
9470
with:
9571
python-version: '3.11'
9672

9773
- name: Native Windows
98-
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
74+
if: matrix.arch != 'ARM64'
9975
run: |
100-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
101-
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
102-
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
76+
choco install llvm --allow-downgrade --no-progress --version ${{ env.LLVM }}.1.0
77+
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.arch }}
78+
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.arch }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
10379
10480
# No tests (yet):
10581
- name: Emulated Windows
106-
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
82+
if: matrix.arch == 'ARM64'
10783
run: |
108-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
109-
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
84+
choco install llvm --allow-downgrade --no-progress --version ${{ env.LLVM }}.1.0
85+
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.arch }}
11086
87+
jit-mac:
88+
name: macOS (${{ matrix.os }}, ${{ matrix.debug && 'Debug' || 'Release' }})
89+
needs: interpreter
90+
runs-on: ${{ matrix.os }}
91+
timeout-minutes: 90
92+
strategy:
93+
fail-fast: false
94+
matrix:
95+
# macos-14 are M1, macos-13 are default GHA Intel.
96+
os:
97+
- macos-14
98+
- macos-13
99+
debug:
100+
- true
101+
- false
102+
steps:
103+
- uses: actions/checkout@v4
104+
- uses: actions/setup-python@v5
105+
with:
106+
python-version: '3.11'
111107
# The `find` line is required as a result of https://github.com/actions/runner-images/issues/9966.
112108
# This is a bug in the macOS runner image where the pre-installed Python is installed in the same
113109
# directory as the Homebrew Python, which causes the build to fail for macos-13. This line removes
114110
# the symlink to the pre-installed Python so that the Homebrew Python is used instead.
115-
- name: Native macOS
116-
if: runner.os == 'macOS'
111+
- name: ${{ runner.os }} (${{ runner.arch }})
117112
run: |
118113
brew update
119114
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
120-
brew install llvm@${{ matrix.llvm }}
115+
brew install llvm@${{ env.LLVM }}
121116
export SDKROOT="$(xcrun --show-sdk-path)"
122117
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '' }}
123118
make all --jobs 4
124119
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
125120
126-
- name: Native Linux
127-
if: runner.os == 'Linux'
121+
jit-ubuntu:
122+
name: Ubuntu (${{ matrix.os }}, ${{ matrix.debug && 'Debug' || 'Release' }})
123+
needs: interpreter
124+
runs-on: ${{ matrix.os }}
125+
timeout-minutes: 90
126+
strategy:
127+
fail-fast: false
128+
matrix:
129+
os:
130+
- ubuntu-24.04
131+
- ubuntu-24.04-aarch64
132+
debug:
133+
- true
134+
- false
135+
is-fork: # only used for the exclusion trick
136+
- ${{ github.repository_owner != 'python' }}
137+
exclude:
138+
- os: ubuntu-24.04-aarch64
139+
is-fork: true
140+
steps:
141+
- uses: actions/checkout@v4
142+
- uses: actions/setup-python@v5
143+
with:
144+
python-version: '3.11'
145+
146+
- name: ${{ runner.os }} (${{ runner.arch }})
128147
run: |
129-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
130-
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
148+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ env.LLVM }}
149+
export PATH="$(llvm-config-${{ env.llvm }} --bindir):$PATH"
131150
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '' }}
132151
make all --jobs 4
133152
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
@@ -136,19 +155,15 @@ jobs:
136155
name: Free-Threaded (Debug)
137156
needs: interpreter
138157
runs-on: ubuntu-24.04
139-
strategy:
140-
matrix:
141-
llvm:
142-
- 19
143158
steps:
144159
- uses: actions/checkout@v4
145160
- uses: actions/setup-python@v5
146161
with:
147162
python-version: '3.11'
148163
- name: Build with JIT enabled and GIL disabled
149164
run: |
150-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
151-
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
165+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ env.LLVM }}
166+
export PATH="$(llvm-config-${{ env.llvm }} --bindir):$PATH"
152167
./configure --enable-experimental-jit --with-pydebug --disable-gil
153168
make all --jobs 4
154169
- name: Run tests

0 commit comments

Comments
 (0)