|
| 1 | +name: JIT |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + paths: |
| 5 | + - '**jit**' |
| 6 | + - 'Python/bytecodes.c' |
| 7 | + - 'Python/optimizer*.c' |
| 8 | + - '!Python/perf_jit_trampoline.c' |
| 9 | + - '!**/*.md' |
| 10 | + - '!**/*.ini' |
| 11 | + push: |
| 12 | + paths: |
| 13 | + - '**jit**' |
| 14 | + - 'Python/bytecodes.c' |
| 15 | + - 'Python/optimizer*.c' |
| 16 | + - '!Python/perf_jit_trampoline.c' |
| 17 | + - '!**/*.md' |
| 18 | + - '!**/*.ini' |
| 19 | + workflow_dispatch: |
| 20 | + |
| 21 | +permissions: |
| 22 | + contents: read |
| 23 | + |
| 24 | +concurrency: |
| 25 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 26 | + cancel-in-progress: true |
| 27 | + |
| 28 | +env: |
| 29 | + FORCE_COLOR: 1 |
| 30 | + |
| 31 | +jobs: |
| 32 | + interpreter: |
| 33 | + name: Interpreter (Debug) |
| 34 | + runs-on: ubuntu-24.04 |
| 35 | + timeout-minutes: 90 |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v4 |
| 38 | + with: |
| 39 | + persist-credentials: false |
| 40 | + - name: Build tier two interpreter |
| 41 | + run: | |
| 42 | + ./configure --enable-experimental-jit=interpreter --with-pydebug |
| 43 | + make all --jobs 4 |
| 44 | + - name: Test tier two interpreter |
| 45 | + run: | |
| 46 | + ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3 |
| 47 | + jit: |
| 48 | + name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }}) |
| 49 | + needs: interpreter |
| 50 | + runs-on: ${{ matrix.runner }} |
| 51 | + timeout-minutes: 90 |
| 52 | + strategy: |
| 53 | + fail-fast: false |
| 54 | + matrix: |
| 55 | + target: |
| 56 | + - i686-pc-windows-msvc/msvc |
| 57 | + - x86_64-pc-windows-msvc/msvc |
| 58 | + - aarch64-pc-windows-msvc/msvc |
| 59 | + - x86_64-apple-darwin/clang |
| 60 | + - aarch64-apple-darwin/clang |
| 61 | + - x86_64-unknown-linux-gnu/gcc |
| 62 | + - aarch64-unknown-linux-gnu/gcc |
| 63 | + debug: |
| 64 | + - true |
| 65 | + - false |
| 66 | + llvm: |
| 67 | + - 19 |
| 68 | + include: |
| 69 | + - target: i686-pc-windows-msvc/msvc |
| 70 | + architecture: Win32 |
| 71 | + runner: windows-latest |
| 72 | + - target: x86_64-pc-windows-msvc/msvc |
| 73 | + architecture: x64 |
| 74 | + runner: windows-latest |
| 75 | + - target: aarch64-pc-windows-msvc/msvc |
| 76 | + architecture: ARM64 |
| 77 | + runner: windows-latest |
| 78 | + - target: x86_64-apple-darwin/clang |
| 79 | + architecture: x86_64 |
| 80 | + runner: macos-13 |
| 81 | + - target: aarch64-apple-darwin/clang |
| 82 | + architecture: aarch64 |
| 83 | + runner: macos-14 |
| 84 | + - target: x86_64-unknown-linux-gnu/gcc |
| 85 | + architecture: x86_64 |
| 86 | + runner: ubuntu-24.04 |
| 87 | + - target: aarch64-unknown-linux-gnu/gcc |
| 88 | + architecture: aarch64 |
| 89 | + runner: ubuntu-24.04-arm |
| 90 | + steps: |
| 91 | + - uses: actions/checkout@v4 |
| 92 | + with: |
| 93 | + persist-credentials: false |
| 94 | + - uses: actions/setup-python@v5 |
| 95 | + with: |
| 96 | + python-version: '3.11' |
| 97 | + |
| 98 | + - name: Native Windows |
| 99 | + if: runner.os == 'Windows' && matrix.architecture != 'ARM64' |
| 100 | + run: | |
| 101 | + choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0 |
| 102 | + ./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} |
| 103 | + ./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3 |
| 104 | +
|
| 105 | + # No tests (yet): |
| 106 | + - name: Emulated Windows |
| 107 | + if: runner.os == 'Windows' && matrix.architecture == 'ARM64' |
| 108 | + run: | |
| 109 | + choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0 |
| 110 | + ./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} |
| 111 | +
|
| 112 | + # The `find` line is required as a result of https://github.com/actions/runner-images/issues/9966. |
| 113 | + # This is a bug in the macOS runner image where the pre-installed Python is installed in the same |
| 114 | + # directory as the Homebrew Python, which causes the build to fail for macos-13. This line removes |
| 115 | + # the symlink to the pre-installed Python so that the Homebrew Python is used instead. |
| 116 | + - name: Native macOS |
| 117 | + if: runner.os == 'macOS' |
| 118 | + run: | |
| 119 | + brew update |
| 120 | + find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete |
| 121 | + brew install llvm@${{ matrix.llvm }} |
| 122 | + export SDKROOT="$(xcrun --show-sdk-path)" |
| 123 | + ./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '' }} |
| 124 | + make all --jobs 4 |
| 125 | + ./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3 |
| 126 | +
|
| 127 | + - name: Native Linux |
| 128 | + if: runner.os == 'Linux' |
| 129 | + run: | |
| 130 | + sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }} |
| 131 | + export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH" |
| 132 | + ./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '' }} |
| 133 | + make all --jobs 4 |
| 134 | + ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3 |
| 135 | +
|
| 136 | + jit-with-disabled-gil: |
| 137 | + name: Free-Threaded (Debug) |
| 138 | + needs: interpreter |
| 139 | + runs-on: ubuntu-24.04 |
| 140 | + strategy: |
| 141 | + matrix: |
| 142 | + llvm: |
| 143 | + - 19 |
| 144 | + steps: |
| 145 | + - uses: actions/checkout@v4 |
| 146 | + with: |
| 147 | + persist-credentials: false |
| 148 | + - uses: actions/setup-python@v5 |
| 149 | + with: |
| 150 | + python-version: '3.11' |
| 151 | + - name: Build with JIT enabled and GIL disabled |
| 152 | + run: | |
| 153 | + sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }} |
| 154 | + export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH" |
| 155 | + ./configure --enable-experimental-jit --with-pydebug --disable-gil |
| 156 | + make all --jobs 4 |
| 157 | + - name: Run tests |
| 158 | + run: | |
| 159 | + ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3 |
0 commit comments