11name : Tail calling interpreter
22on :
33 pull_request :
4- paths :
4+ paths : &paths
55 - ' .github/workflows/tail-call.yml'
66 - ' Python/bytecodes.c'
77 - ' Python/ceval.c'
88 - ' Python/ceval_macros.h'
99 - ' Python/generated_cases.c.h'
1010 push :
11- paths :
12- - ' .github/workflows/tail-call.yml'
13- - ' Python/bytecodes.c'
14- - ' Python/ceval.c'
15- - ' Python/ceval_macros.h'
16- - ' Python/generated_cases.c.h'
11+ paths : *paths
1712 workflow_dispatch :
1813
1914permissions :
@@ -25,108 +20,107 @@ concurrency:
2520
2621env :
2722 FORCE_COLOR : 1
23+ LLVM_VERSION : 20
2824
2925jobs :
30- tail-call :
26+ windows :
3127 name : ${{ matrix.target }}
3228 runs-on : ${{ matrix.runner }}
33- timeout-minutes : 90
29+ timeout-minutes : 60
3430 strategy :
3531 fail-fast : false
3632 matrix :
37- target :
38- # Un-comment as we add support for more platforms for tail-calling interpreters.
39- # - i686-pc-windows-msvc/msvc
40- - x86_64-pc-windows-msvc/msvc
41- # - aarch64-pc-windows-msvc/msvc
42- - x86_64-apple-darwin/clang
43- - aarch64-apple-darwin/clang
44- - x86_64-unknown-linux-gnu/gcc
45- - aarch64-unknown-linux-gnu/gcc
46- - free-threading
47- llvm :
48- - 20
4933 include :
50- # - target: i686-pc-windows-msvc/msvc
51- # architecture: Win32
52- # runner: windows-2022
5334 - target : x86_64-pc-windows-msvc/msvc
5435 architecture : x64
5536 runner : windows-2022
56- # - target: aarch64-pc-windows-msvc/msvc
57- # architecture: ARM64
58- # runner: windows-2022
59- - target : x86_64-apple-darwin/clang
60- architecture : x86_64
61- runner : macos-15-intel
62- - target : aarch64-apple-darwin/clang
63- architecture : aarch64
64- runner : macos-14
65- - target : x86_64-unknown-linux-gnu/gcc
66- architecture : x86_64
67- runner : ubuntu-24.04
68- - target : aarch64-unknown-linux-gnu/gcc
69- architecture : aarch64
70- runner : ubuntu-24.04-arm
71- - target : free-threading
72- architecture : x86_64
73- runner : ubuntu-24.04
37+ build_flags : " "
38+ run_tests : true
7439 steps :
7540 - uses : actions/checkout@v6
7641 with :
7742 persist-credentials : false
7843 - uses : actions/setup-python@v6
7944 with :
8045 python-version : ' 3.11'
81-
82- - name : Native Windows (debug)
83- if : runner.os == 'Windows' && matrix.architecture != 'ARM64'
46+ - name : Build
8447 shell : pwsh
8548 run : |
86- choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
49+ choco install llvm --allow-downgrade --no-progress --version ${{ env.LLVM_VERSION }}.1.0
8750 $env:PlatformToolset = "clangcl"
88- $env:LLVMToolsVersion = "${{ matrix.llvm }}.1.0"
51+ $env:LLVMToolsVersion = "${{ env.LLVM_VERSION }}.1.0"
8952 $env:LLVMInstallDir = "C:\Program Files\LLVM"
90- ./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
91- ./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
92-
93- # No tests (yet):
94- - name : Emulated Windows (release)
95- if : runner.os == 'Windows' && matrix.architecture == 'ARM64'
53+ ./PCbuild/build.bat --tail-call-interp ${{ matrix.build_flags }} -c Release -p ${{ matrix.architecture }}
54+ - name : Test
55+ if : matrix.run_tests
9656 shell : pwsh
9757 run : |
98- choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
99- $env:PlatformToolset = "clangcl"
100- $env:LLVMToolsVersion = "${{ matrix.llvm }}.1.0"
101- $env:LLVMInstallDir = "C:\Program Files\LLVM"
102- ./PCbuild/build.bat --tail-call-interp -p ${{ matrix.architecture }}
58+ ./PCbuild/rt.bat -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
10359
104- - name : Native macOS (release)
105- if : runner.os == 'macOS'
60+ macos :
61+ name : ${{ matrix.target }}
62+ runs-on : ${{ matrix.runner }}
63+ timeout-minutes : 60
64+ strategy :
65+ fail-fast : false
66+ matrix :
67+ include :
68+ - target : x86_64-apple-darwin/clang
69+ runner : macos-15-intel
70+ - target : aarch64-apple-darwin/clang
71+ runner : macos-14
72+ steps :
73+ - uses : actions/checkout@v6
74+ with :
75+ persist-credentials : false
76+ - uses : actions/setup-python@v6
77+ with :
78+ python-version : ' 3.11'
79+ - name : Install dependencies
10680 run : |
10781 brew update
108- brew install llvm@${{ matrix.llvm }}
82+ brew install llvm@${{ env.LLVM_VERSION }}
83+ - name : Build
84+ run : |
10985 export SDKROOT="$(xcrun --show-sdk-path)"
110- export PATH="/usr/local/opt/llvm@${{ matrix.llvm }}/bin:$PATH"
111- export PATH="/opt/homebrew/opt/llvm@${{ matrix.llvm }}/bin:$PATH"
112- CC=clang-20 ./configure --with-tail-call-interp
86+ export PATH="/usr/local/opt/llvm@${{ env.LLVM_VERSION }}/bin:$PATH"
87+ export PATH="/opt/homebrew/opt/llvm@${{ env.LLVM_VERSION }}/bin:$PATH"
88+ CC=clang-${{ env.LLVM_VERSION }} ./configure --with-tail-call-interp
11389 make all --jobs 4
90+ - name : Test
91+ run : |
11492 ./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
11593
116- - name : Native Linux (debug)
117- if : runner.os == 'Linux' && matrix.target != 'free-threading'
94+ linux :
95+ name : ${{ matrix.target }}
96+ runs-on : ${{ matrix.runner }}
97+ timeout-minutes : 60
98+ strategy :
99+ fail-fast : false
100+ matrix :
101+ include :
102+ - target : x86_64-unknown-linux-gnu/gcc
103+ runner : ubuntu-24.04
104+ configure_flags : --with-pydebug
105+ - target : x86_64-unknown-linux-gnu/gcc-free-threading
106+ runner : ubuntu-24.04
107+ configure_flags : --disable-gil
108+ - target : aarch64-unknown-linux-gnu/gcc
109+ runner : ubuntu-24.04-arm
110+ configure_flags : --with-pydebug
111+ steps :
112+ - uses : actions/checkout@v6
113+ with :
114+ persist-credentials : false
115+ - uses : actions/setup-python@v6
116+ with :
117+ python-version : ' 3.11'
118+ - name : Build
118119 run : |
119- sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
120- export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
121- CC=clang-20 . /configure --with-tail-call-interp --with-pydebug
120+ sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ env.LLVM_VERSION }}
121+ export PATH="$(llvm-config-${{ env.LLVM_VERSION }} --bindir):$PATH"
122+ CC=clang-${{ env.LLVM_VERSION }} . /configure --with-tail-call-interp ${{ matrix.configure_flags }}
122123 make all --jobs 4
123- ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
124-
125- - name : Native Linux with free-threading (release)
126- if : matrix.target == 'free-threading'
124+ - name : Test
127125 run : |
128- sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
129- export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
130- CC=clang-20 ./configure --with-tail-call-interp --disable-gil
131- make all --jobs 4
132126 ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
0 commit comments