diff --git a/.github/workflows/apple.yml b/.github/workflows/apple.yml index e13d6701..f3ceb232 100644 --- a/.github/workflows/apple.yml +++ b/.github/workflows/apple.yml @@ -2,12 +2,17 @@ name: MacOS Python build on: push: + branches: [main] pull_request: - schedule: - - cron: '13 11 * * *' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + jobs: pythonbuild: - runs-on: 'macos-13' + runs-on: "macos-13" steps: - uses: actions/checkout@v4 @@ -43,138 +48,164 @@ jobs: fail-fast: false matrix: build: - - target_triple: 'aarch64-apple-darwin' + - target_triple: "aarch64-apple-darwin" + runner: macos-14 + py: "cpython-3.8" + optimizations: "debug" + - target_triple: "aarch64-apple-darwin" + runner: macos-14 + py: "cpython-3.8" + optimizations: "pgo" + - target_triple: "aarch64-apple-darwin" + runner: macos-14 + py: "cpython-3.8" + optimizations: "pgo+lto" + + - target_triple: "aarch64-apple-darwin" runner: macos-14 - py: 'cpython-3.8' - optimizations: 'debug' - - target_triple: 'aarch64-apple-darwin' + py: "cpython-3.9" + optimizations: "debug" + - target_triple: "aarch64-apple-darwin" runner: macos-14 - py: 'cpython-3.8' - optimizations: 'pgo' - - target_triple: 'aarch64-apple-darwin' + py: "cpython-3.9" + optimizations: "pgo" + - target_triple: "aarch64-apple-darwin" runner: macos-14 - py: 'cpython-3.8' - optimizations: 'pgo+lto' + py: "cpython-3.9" + optimizations: "pgo+lto" - - target_triple: 'aarch64-apple-darwin' + - target_triple: "aarch64-apple-darwin" runner: macos-14 - py: 'cpython-3.9' - optimizations: 'debug' - - target_triple: 'aarch64-apple-darwin' + py: "cpython-3.10" + optimizations: "debug" + - target_triple: "aarch64-apple-darwin" runner: macos-14 - py: 'cpython-3.9' - optimizations: 'pgo' - - target_triple: 'aarch64-apple-darwin' + py: "cpython-3.10" + optimizations: "pgo" + - target_triple: "aarch64-apple-darwin" runner: macos-14 - py: 'cpython-3.9' - optimizations: 'pgo+lto' + py: "cpython-3.10" + optimizations: "pgo+lto" - - target_triple: 'aarch64-apple-darwin' + - target_triple: "aarch64-apple-darwin" runner: macos-14 - py: 'cpython-3.10' - optimizations: 'debug' - - target_triple: 'aarch64-apple-darwin' + py: "cpython-3.11" + optimizations: "debug" + - target_triple: "aarch64-apple-darwin" runner: macos-14 - py: 'cpython-3.10' - optimizations: 'pgo' - - target_triple: 'aarch64-apple-darwin' + py: "cpython-3.11" + optimizations: "pgo" + - target_triple: "aarch64-apple-darwin" runner: macos-14 - py: 'cpython-3.10' - optimizations: 'pgo+lto' + py: "cpython-3.11" + optimizations: "pgo+lto" - - target_triple: 'aarch64-apple-darwin' + - target_triple: "aarch64-apple-darwin" runner: macos-14 - py: 'cpython-3.11' - optimizations: 'debug' - - target_triple: 'aarch64-apple-darwin' + py: "cpython-3.12" + optimizations: "debug" + - target_triple: "aarch64-apple-darwin" runner: macos-14 - py: 'cpython-3.11' - optimizations: 'pgo' - - target_triple: 'aarch64-apple-darwin' + py: "cpython-3.12" + optimizations: "pgo" + - target_triple: "aarch64-apple-darwin" runner: macos-14 - py: 'cpython-3.11' - optimizations: 'pgo+lto' + py: "cpython-3.12" + optimizations: "pgo+lto" - - target_triple: 'aarch64-apple-darwin' + - target_triple: "aarch64-apple-darwin" runner: macos-14 - py: 'cpython-3.12' - optimizations: 'debug' - - target_triple: 'aarch64-apple-darwin' + py: "cpython-3.13" + optimizations: "debug" + - target_triple: "aarch64-apple-darwin" runner: macos-14 - py: 'cpython-3.12' - optimizations: 'pgo' - - target_triple: 'aarch64-apple-darwin' + py: "cpython-3.13" + optimizations: "pgo" + - target_triple: "aarch64-apple-darwin" runner: macos-14 - py: 'cpython-3.12' - optimizations: 'pgo+lto' + py: "cpython-3.13" + optimizations: "pgo+lto" # macOS on Intel hardware. This is pretty straightforward. We exclude # noopt because it doesn't provide any compelling advantages over PGO # or LTO builds. - - target_triple: 'x86_64-apple-darwin' + - target_triple: "x86_64-apple-darwin" + runner: macos-13 + py: "cpython-3.8" + optimizations: "debug" + - target_triple: "x86_64-apple-darwin" + runner: macos-13 + py: "cpython-3.8" + optimizations: "pgo" + - target_triple: "x86_64-apple-darwin" + runner: macos-13 + py: "cpython-3.8" + optimizations: "pgo+lto" + + - target_triple: "x86_64-apple-darwin" runner: macos-13 - py: 'cpython-3.8' - optimizations: 'debug' - - target_triple: 'x86_64-apple-darwin' + py: "cpython-3.9" + optimizations: "debug" + - target_triple: "x86_64-apple-darwin" runner: macos-13 - py: 'cpython-3.8' - optimizations: 'pgo' - - target_triple: 'x86_64-apple-darwin' + py: "cpython-3.9" + optimizations: "pgo" + - target_triple: "x86_64-apple-darwin" runner: macos-13 - py: 'cpython-3.8' - optimizations: 'pgo+lto' + py: "cpython-3.9" + optimizations: "pgo+lto" - - target_triple: 'x86_64-apple-darwin' + - target_triple: "x86_64-apple-darwin" runner: macos-13 - py: 'cpython-3.9' - optimizations: 'debug' - - target_triple: 'x86_64-apple-darwin' + py: "cpython-3.10" + optimizations: "debug" + - target_triple: "x86_64-apple-darwin" runner: macos-13 - py: 'cpython-3.9' - optimizations: 'pgo' - - target_triple: 'x86_64-apple-darwin' + py: "cpython-3.10" + optimizations: "pgo" + - target_triple: "x86_64-apple-darwin" runner: macos-13 - py: 'cpython-3.9' - optimizations: 'pgo+lto' + py: "cpython-3.10" + optimizations: "pgo+lto" - - target_triple: 'x86_64-apple-darwin' + - target_triple: "x86_64-apple-darwin" runner: macos-13 - py: 'cpython-3.10' - optimizations: 'debug' - - target_triple: 'x86_64-apple-darwin' + py: "cpython-3.11" + optimizations: "debug" + - target_triple: "x86_64-apple-darwin" runner: macos-13 - py: 'cpython-3.10' - optimizations: 'pgo' - - target_triple: 'x86_64-apple-darwin' + py: "cpython-3.11" + optimizations: "pgo" + - target_triple: "x86_64-apple-darwin" runner: macos-13 - py: 'cpython-3.10' - optimizations: 'pgo+lto' + py: "cpython-3.11" + optimizations: "pgo+lto" - - target_triple: 'x86_64-apple-darwin' + - target_triple: "x86_64-apple-darwin" runner: macos-13 - py: 'cpython-3.11' - optimizations: 'debug' - - target_triple: 'x86_64-apple-darwin' + py: "cpython-3.12" + optimizations: "debug" + - target_triple: "x86_64-apple-darwin" runner: macos-13 - py: 'cpython-3.11' - optimizations: 'pgo' - - target_triple: 'x86_64-apple-darwin' + py: "cpython-3.12" + optimizations: "pgo" + - target_triple: "x86_64-apple-darwin" runner: macos-13 - py: 'cpython-3.11' - optimizations: 'pgo+lto' + py: "cpython-3.12" + optimizations: "pgo+lto" - - target_triple: 'x86_64-apple-darwin' + - target_triple: "x86_64-apple-darwin" runner: macos-13 - py: 'cpython-3.12' - optimizations: 'debug' - - target_triple: 'x86_64-apple-darwin' + py: "cpython-3.13" + optimizations: "debug" + - target_triple: "x86_64-apple-darwin" runner: macos-13 - py: 'cpython-3.12' - optimizations: 'pgo' - - target_triple: 'x86_64-apple-darwin' + py: "cpython-3.13" + optimizations: "pgo" + - target_triple: "x86_64-apple-darwin" runner: macos-13 - py: 'cpython-3.12' - optimizations: 'pgo+lto' + py: "cpython-3.13" + optimizations: "pgo+lto" needs: - pythonbuild runs-on: ${{ matrix.build.runner }} @@ -186,7 +217,7 @@ jobs: - name: Install Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: "3.11" - name: Download pythonbuild uses: actions/download-artifact@v4 @@ -215,7 +246,7 @@ jobs: - uses: actions/checkout@v4 with: - repository: 'phracker/MacOSX-SDKs' + repository: "phracker/MacOSX-SDKs" ref: master path: macosx-sdks diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index d8710952..b232e241 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -2,9 +2,14 @@ name: Linux Python build on: push: + branches: [main] pull_request: - schedule: - - cron: '13 11 * * *' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + jobs: pythonbuild: runs-on: ubuntu-22.04 @@ -62,7 +67,7 @@ jobs: - name: Install Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: "3.11" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -119,723 +124,891 @@ jobs: matrix: build: # Cross-compiles can't do PGO. - - target_triple: 'aarch64-unknown-linux-gnu' - py: 'cpython-3.8' - optimizations: 'debug' - - target_triple: 'aarch64-unknown-linux-gnu' - py: 'cpython-3.8' - optimizations: 'noopt' - - target_triple: 'aarch64-unknown-linux-gnu' - py: 'cpython-3.8' - optimizations: 'lto' - - - target_triple: 'aarch64-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'debug' - - target_triple: 'aarch64-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'noopt' - - target_triple: 'aarch64-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'lto' - - - target_triple: 'aarch64-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'debug' - - target_triple: 'aarch64-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'noopt' - - target_triple: 'aarch64-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'lto' - - - target_triple: 'aarch64-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'debug' - - target_triple: 'aarch64-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'noopt' - - target_triple: 'aarch64-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'lto' - - - target_triple: 'aarch64-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'debug' - - target_triple: 'aarch64-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'noopt' - - target_triple: 'aarch64-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'lto' - - # Cross-compiles can't do PGO and require Python 3.9. - - target_triple: 'armv7-unknown-linux-gnueabi' - py: 'cpython-3.9' - optimizations: 'debug' - - target_triple: 'armv7-unknown-linux-gnueabi' - py: 'cpython-3.9' - optimizations: 'noopt' - - target_triple: 'armv7-unknown-linux-gnueabi' - py: 'cpython-3.9' - optimizations: 'lto' - - - target_triple: 'armv7-unknown-linux-gnueabi' - py: 'cpython-3.10' - optimizations: 'debug' - - target_triple: 'armv7-unknown-linux-gnueabi' - py: 'cpython-3.10' - optimizations: 'noopt' - - target_triple: 'armv7-unknown-linux-gnueabi' - py: 'cpython-3.10' - optimizations: 'lto' - - - target_triple: 'armv7-unknown-linux-gnueabi' - py: 'cpython-3.11' - optimizations: 'debug' - - target_triple: 'armv7-unknown-linux-gnueabi' - py: 'cpython-3.11' - optimizations: 'noopt' - - target_triple: 'armv7-unknown-linux-gnueabi' - py: 'cpython-3.11' - optimizations: 'lto' - - - target_triple: 'armv7-unknown-linux-gnueabi' - py: 'cpython-3.12' - optimizations: 'debug' - - target_triple: 'armv7-unknown-linux-gnueabi' - py: 'cpython-3.12' - optimizations: 'noopt' - - target_triple: 'armv7-unknown-linux-gnueabi' - py: 'cpython-3.12' - optimizations: 'lto' - - # Cross-compiles can't do PGO and require Python 3.9. - - target_triple: 'armv7-unknown-linux-gnueabihf' - py: 'cpython-3.9' - optimizations: 'debug' - - target_triple: 'armv7-unknown-linux-gnueabihf' - py: 'cpython-3.9' - optimizations: 'noopt' - - target_triple: 'armv7-unknown-linux-gnueabihf' - py: 'cpython-3.9' - optimizations: 'lto' - - - target_triple: 'armv7-unknown-linux-gnueabihf' - py: 'cpython-3.10' - optimizations: 'debug' - - target_triple: 'armv7-unknown-linux-gnueabihf' - py: 'cpython-3.10' - optimizations: 'noopt' - - target_triple: 'armv7-unknown-linux-gnueabihf' - py: 'cpython-3.10' - optimizations: 'lto' - - - target_triple: 'armv7-unknown-linux-gnueabihf' - py: 'cpython-3.11' - optimizations: 'debug' - - target_triple: 'armv7-unknown-linux-gnueabihf' - py: 'cpython-3.11' - optimizations: 'noopt' - - target_triple: 'armv7-unknown-linux-gnueabihf' - py: 'cpython-3.11' - optimizations: 'lto' - - - target_triple: 'armv7-unknown-linux-gnueabihf' - py: 'cpython-3.12' - optimizations: 'debug' - - target_triple: 'armv7-unknown-linux-gnueabihf' - py: 'cpython-3.12' - optimizations: 'noopt' - - target_triple: 'armv7-unknown-linux-gnueabihf' - py: 'cpython-3.12' - optimizations: 'lto' - - # Cross-compiles can't do PGO and require Python 3.9. - - target_triple: 'mips-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'debug' - - target_triple: 'mips-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'noopt' - - target_triple: 'mips-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'lto' - - - target_triple: 'mips-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'debug' - - target_triple: 'mips-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'noopt' - - target_triple: 'mips-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'lto' - - - target_triple: 'mips-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'debug' - - target_triple: 'mips-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'noopt' - - target_triple: 'mips-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'lto' - - - target_triple: 'mips-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'debug' - - target_triple: 'mips-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'noopt' - - target_triple: 'mips-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'lto' + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.8" + # optimizations: "debug" + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.8" + # optimizations: "noopt" + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.8" + # optimizations: "lto" + + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "debug" + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "noopt" + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "lto" + + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "debug" + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "noopt" + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "lto" + + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "debug" + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "noopt" + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "lto" + + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "debug" + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "noopt" + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "lto" + + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.13" + # optimizations: "debug" + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.13" + # optimizations: "noopt" + # - target_triple: "aarch64-unknown-linux-gnu" + # py: "cpython-3.13" + # optimizations: "lto" + + # # Cross-compiles can't do PGO and require Python 3.9. + # - target_triple: "armv7-unknown-linux-gnueabi" + # py: "cpython-3.9" + # optimizations: "debug" + # - target_triple: "armv7-unknown-linux-gnueabi" + # py: "cpython-3.9" + # optimizations: "noopt" + # - target_triple: "armv7-unknown-linux-gnueabi" + # py: "cpython-3.9" + # optimizations: "lto" + + # - target_triple: "armv7-unknown-linux-gnueabi" + # py: "cpython-3.10" + # optimizations: "debug" + # - target_triple: "armv7-unknown-linux-gnueabi" + # py: "cpython-3.10" + # optimizations: "noopt" + # - target_triple: "armv7-unknown-linux-gnueabi" + # py: "cpython-3.10" + # optimizations: "lto" + + # - target_triple: "armv7-unknown-linux-gnueabi" + # py: "cpython-3.11" + # optimizations: "debug" + # - target_triple: "armv7-unknown-linux-gnueabi" + # py: "cpython-3.11" + # optimizations: "noopt" + # - target_triple: "armv7-unknown-linux-gnueabi" + # py: "cpython-3.11" + # optimizations: "lto" + + # - target_triple: "armv7-unknown-linux-gnueabi" + # py: "cpython-3.12" + # optimizations: "debug" + # - target_triple: "armv7-unknown-linux-gnueabi" + # py: "cpython-3.12" + # optimizations: "noopt" + # - target_triple: "armv7-unknown-linux-gnueabi" + # py: "cpython-3.12" + # optimizations: "lto" + + # - target_triple: "armv7-unknown-linux-gnueabi" + # py: "cpython-3.13" + # optimizations: "debug" + # - target_triple: "armv7-unknown-linux-gnueabi" + # py: "cpython-3.13" + # optimizations: "noopt" + # - target_triple: "armv7-unknown-linux-gnueabi" + # py: "cpython-3.13" + # optimizations: "lto" + + # # Cross-compiles can't do PGO and require Python 3.9. + # - target_triple: "armv7-unknown-linux-gnueabihf" + # py: "cpython-3.9" + # optimizations: "debug" + # - target_triple: "armv7-unknown-linux-gnueabihf" + # py: "cpython-3.9" + # optimizations: "noopt" + # - target_triple: "armv7-unknown-linux-gnueabihf" + # py: "cpython-3.9" + # optimizations: "lto" + + # - target_triple: "armv7-unknown-linux-gnueabihf" + # py: "cpython-3.10" + # optimizations: "debug" + # - target_triple: "armv7-unknown-linux-gnueabihf" + # py: "cpython-3.10" + # optimizations: "noopt" + # - target_triple: "armv7-unknown-linux-gnueabihf" + # py: "cpython-3.10" + # optimizations: "lto" + + # - target_triple: "armv7-unknown-linux-gnueabihf" + # py: "cpython-3.11" + # optimizations: "debug" + # - target_triple: "armv7-unknown-linux-gnueabihf" + # py: "cpython-3.11" + # optimizations: "noopt" + # - target_triple: "armv7-unknown-linux-gnueabihf" + # py: "cpython-3.11" + # optimizations: "lto" + + # - target_triple: "armv7-unknown-linux-gnueabihf" + # py: "cpython-3.12" + # optimizations: "debug" + # - target_triple: "armv7-unknown-linux-gnueabihf" + # py: "cpython-3.12" + # optimizations: "noopt" + # - target_triple: "armv7-unknown-linux-gnueabihf" + # py: "cpython-3.12" + # optimizations: "lto" + + - target_triple: "armv7-unknown-linux-gnueabihf" + py: "cpython-3.13" + optimizations: "debug" + - target_triple: "armv7-unknown-linux-gnueabihf" + py: "cpython-3.13" + optimizations: "noopt" + - target_triple: "armv7-unknown-linux-gnueabihf" + py: "cpython-3.13" + optimizations: "lto" # Cross-compiles can't do PGO and require Python 3.9. - - target_triple: 'mipsel-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'debug' - - target_triple: 'mipsel-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'noopt' - - target_triple: 'mipsel-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'lto' - - - target_triple: 'mipsel-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'debug' - - target_triple: 'mipsel-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'noopt' - - target_triple: 'mipsel-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'lto' - - - target_triple: 'mipsel-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'debug' - - target_triple: 'mipsel-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'noopt' - - target_triple: 'mipsel-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'lto' - - - target_triple: 'mipsel-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'debug' - - target_triple: 'mipsel-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'noopt' - - target_triple: 'mipsel-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'lto' + # - target_triple: "mips-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "debug" + # - target_triple: "mips-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "noopt" + # - target_triple: "mips-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "lto" + + # - target_triple: "mips-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "debug" + # - target_triple: "mips-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "noopt" + # - target_triple: "mips-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "lto" + + # - target_triple: "mips-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "debug" + # - target_triple: "mips-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "noopt" + # - target_triple: "mips-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "lto" + + # - target_triple: "mips-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "debug" + # - target_triple: "mips-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "noopt" + # - target_triple: "mips-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "lto" + + # - target_triple: "mips-unknown-linux-gnu" + # py: "cpython-3.13" + # optimizations: "debug" + # - target_triple: "mips-unknown-linux-gnu" + # py: "cpython-3.13" + # optimizations: "noopt" + # - target_triple: "mips-unknown-linux-gnu" + # py: "cpython-3.13" + # optimizations: "lto" + + # # Cross-compiles can't do PGO and require Python 3.9. + # - target_triple: "mipsel-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "debug" + # - target_triple: "mipsel-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "noopt" + # - target_triple: "mipsel-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "lto" + + # - target_triple: "mipsel-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "debug" + # - target_triple: "mipsel-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "noopt" + # - target_triple: "mipsel-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "lto" + + # - target_triple: "mipsel-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "debug" + # - target_triple: "mipsel-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "noopt" + # - target_triple: "mipsel-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "lto" + + # - target_triple: "mipsel-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "debug" + # - target_triple: "mipsel-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "noopt" + # - target_triple: "mipsel-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "lto" + + - target_triple: "mipsel-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "debug" + - target_triple: "mipsel-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "noopt" + - target_triple: "mipsel-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "lto" # Cross-compiles can't do PGO and require Python 3.9. - - target_triple: 's390x-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'debug' - - target_triple: 's390x-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'noopt' - - target_triple: 's390x-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'lto' - - - target_triple: 's390x-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'debug' - - target_triple: 's390x-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'noopt' - - target_triple: 's390x-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'lto' - - - target_triple: 's390x-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'debug' - - target_triple: 's390x-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'noopt' - - target_triple: 's390x-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'lto' - - - target_triple: 's390x-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'debug' - - target_triple: 's390x-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'noopt' - - target_triple: 's390x-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'lto' - - # Cross-compiles can't do PGO and require Python 3.9. - - target_triple: 'ppc64le-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'debug' - - target_triple: 'ppc64le-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'noopt' - - target_triple: 'ppc64le-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'lto' - - - target_triple: 'ppc64le-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'debug' - - target_triple: 'ppc64le-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'noopt' - - target_triple: 'ppc64le-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'lto' - - - target_triple: 'ppc64le-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'debug' - - target_triple: 'ppc64le-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'noopt' - - target_triple: 'ppc64le-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'lto' - - - target_triple: 'ppc64le-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'debug' - - target_triple: 'ppc64le-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'noopt' - - target_triple: 'ppc64le-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'lto' - - # We don't publish noopt builds when PGO is available. - - target_triple: 'x86_64-unknown-linux-gnu' - py: 'cpython-3.8' - optimizations: 'debug' - run: true - - target_triple: 'x86_64-unknown-linux-gnu' - py: 'cpython-3.8' - optimizations: 'pgo' - run: true - - target_triple: 'x86_64-unknown-linux-gnu' - py: 'cpython-3.8' - optimizations: 'pgo+lto' - run: true - - - target_triple: 'x86_64-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'debug' - run: true - - target_triple: 'x86_64-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'pgo' - run: true - - target_triple: 'x86_64-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'pgo+lto' - run: true - - - target_triple: 'x86_64-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'debug' - run: true - - target_triple: 'x86_64-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'pgo' - run: true - - target_triple: 'x86_64-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'pgo+lto' - run: true - - - target_triple: 'x86_64-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'debug' - run: true - - target_triple: 'x86_64-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'pgo' - run: true - - target_triple: 'x86_64-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'pgo+lto' - run: true - - - target_triple: 'x86_64-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'debug' - run: true - - target_triple: 'x86_64-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'pgo' - run: true - - target_triple: 'x86_64-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'pgo+lto' - run: true - - - target_triple: 'x86_64_v2-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'debug' - run: true - - target_triple: 'x86_64_v2-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'pgo' - run: true - - target_triple: 'x86_64_v2-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'pgo+lto' - run: true - - - target_triple: 'x86_64_v2-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'debug' - run: true - - target_triple: 'x86_64_v2-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'pgo' - run: true - - target_triple: 'x86_64_v2-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'pgo+lto' - run: true - - - target_triple: 'x86_64_v2-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'debug' - run: true - - target_triple: 'x86_64_v2-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'pgo' - run: true - - target_triple: 'x86_64_v2-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'pgo+lto' - run: true - - - target_triple: 'x86_64_v2-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'debug' - run: true - - target_triple: 'x86_64_v2-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'pgo' - run: true - - target_triple: 'x86_64_v2-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'pgo+lto' - run: true - - - target_triple: 'x86_64_v3-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'debug' - run: true - - target_triple: 'x86_64_v3-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'pgo' - run: true - - target_triple: 'x86_64_v3-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'pgo+lto' - run: true - - - target_triple: 'x86_64_v3-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'debug' - run: true - - target_triple: 'x86_64_v3-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'pgo' - run: true - - target_triple: 'x86_64_v3-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'pgo+lto' - run: true - - - target_triple: 'x86_64_v3-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'debug' - run: true - - target_triple: 'x86_64_v3-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'pgo' - run: true - - target_triple: 'x86_64_v3-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'pgo+lto' - run: true - - - target_triple: 'x86_64_v3-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'debug' - run: true - - target_triple: 'x86_64_v3-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'pgo' - run: true - - target_triple: 'x86_64_v3-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'pgo+lto' - run: true - - # GitHub Actions runners don't support x86-64-v4 so we can't PGO. - - target_triple: 'x86_64_v4-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'debug' - - target_triple: 'x86_64_v4-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'noopt' - - target_triple: 'x86_64_v4-unknown-linux-gnu' - py: 'cpython-3.9' - optimizations: 'lto' - - # GitHub Actions runners don't support x86-64-v4 so we can't PGO. - - target_triple: 'x86_64_v4-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'debug' - - target_triple: 'x86_64_v4-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'noopt' - - target_triple: 'x86_64_v4-unknown-linux-gnu' - py: 'cpython-3.10' - optimizations: 'lto' - - - target_triple: 'x86_64_v4-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'debug' - - target_triple: 'x86_64_v4-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'noopt' - - target_triple: 'x86_64_v4-unknown-linux-gnu' - py: 'cpython-3.11' - optimizations: 'lto' - - - target_triple: 'x86_64_v4-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'debug' - - target_triple: 'x86_64_v4-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'noopt' - - target_triple: 'x86_64_v4-unknown-linux-gnu' - py: 'cpython-3.12' - optimizations: 'lto' + # - target_triple: "s390x-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "debug" + # - target_triple: "s390x-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "noopt" + # - target_triple: "s390x-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "lto" + + # - target_triple: "s390x-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "debug" + # - target_triple: "s390x-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "noopt" + # - target_triple: "s390x-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "lto" + + # - target_triple: "s390x-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "debug" + # - target_triple: "s390x-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "noopt" + # - target_triple: "s390x-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "lto" + + # - target_triple: "s390x-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "debug" + # - target_triple: "s390x-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "noopt" + # - target_triple: "s390x-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "lto" + + # - target_triple: "s390x-unknown-linux-gnu" + # py: "cpython-3.13" + # optimizations: "debug" + # - target_triple: "s390x-unknown-linux-gnu" + # py: "cpython-3.13" + # optimizations: "noopt" + # - target_triple: "s390x-unknown-linux-gnu" + # py: "cpython-3.13" + # optimizations: "lto" + + # # Cross-compiles can't do PGO and require Python 3.9. + # - target_triple: "ppc64le-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "debug" + # - target_triple: "ppc64le-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "noopt" + # - target_triple: "ppc64le-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "lto" + + # - target_triple: "ppc64le-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "debug" + # - target_triple: "ppc64le-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "noopt" + # - target_triple: "ppc64le-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "lto" + + # - target_triple: "ppc64le-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "debug" + # - target_triple: "ppc64le-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "noopt" + # - target_triple: "ppc64le-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "lto" + + # - target_triple: "ppc64le-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "debug" + # - target_triple: "ppc64le-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "noopt" + # - target_triple: "ppc64le-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "lto" + + - target_triple: "ppc64le-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "debug" + - target_triple: "ppc64le-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "noopt" + - target_triple: "ppc64le-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "lto" + + # # We don't publish noopt builds when PGO is available. + # - target_triple: "x86_64-unknown-linux-gnu" + # py: "cpython-3.8" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64-unknown-linux-gnu" + # py: "cpython-3.8" + # optimizations: "pgo" + # run: true + # - target_triple: "x86_64-unknown-linux-gnu" + # py: "cpython-3.8" + # optimizations: "pgo+lto" + # run: true + + # - target_triple: "x86_64-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "pgo" + # run: true + # - target_triple: "x86_64-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "pgo+lto" + # run: true + + # - target_triple: "x86_64-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "pgo" + # run: true + # - target_triple: "x86_64-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "pgo+lto" + # run: true + + # - target_triple: "x86_64-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "pgo" + # run: true + # - target_triple: "x86_64-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "pgo+lto" + # run: true + + # - target_triple: "x86_64-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "pgo" + # run: true + # - target_triple: "x86_64-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "pgo+lto" + # run: true + + - target_triple: "x86_64-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "debug" + run: true + - target_triple: "x86_64-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "pgo" + run: true + - target_triple: "x86_64-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "pgo+lto" + run: true + + # - target_triple: "x86_64_v2-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64_v2-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "pgo" + # run: true + # - target_triple: "x86_64_v2-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "pgo+lto" + # run: true + + # - target_triple: "x86_64_v2-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64_v2-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "pgo" + # run: true + # - target_triple: "x86_64_v2-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "pgo+lto" + # run: true + + # - target_triple: "x86_64_v2-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64_v2-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "pgo" + # run: true + # - target_triple: "x86_64_v2-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "pgo+lto" + # run: true + + # - target_triple: "x86_64_v2-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64_v2-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "pgo" + # run: true + # - target_triple: "x86_64_v2-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "pgo+lto" + # run: true + + - target_triple: "x86_64_v2-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "debug" + run: true + - target_triple: "x86_64_v2-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "pgo" + run: true + - target_triple: "x86_64_v2-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "pgo+lto" + run: true + + # - target_triple: "x86_64_v3-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64_v3-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "pgo" + # run: true + # - target_triple: "x86_64_v3-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "pgo+lto" + # run: true + + # - target_triple: "x86_64_v3-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64_v3-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "pgo" + # run: true + # - target_triple: "x86_64_v3-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "pgo+lto" + # run: true + + # - target_triple: "x86_64_v3-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64_v3-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "pgo" + # run: true + # - target_triple: "x86_64_v3-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "pgo+lto" + # run: true + + # - target_triple: "x86_64_v3-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64_v3-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "pgo" + # run: true + # - target_triple: "x86_64_v3-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "pgo+lto" + # run: true + + - target_triple: "x86_64_v3-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "debug" + run: true + - target_triple: "x86_64_v3-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "pgo" + run: true + - target_triple: "x86_64_v3-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "pgo+lto" + run: true + + # # GitHub Actions runners don't support x86-64-v4 so we can't PGO. + # - target_triple: "x86_64_v4-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "debug" + # - target_triple: "x86_64_v4-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "noopt" + # - target_triple: "x86_64_v4-unknown-linux-gnu" + # py: "cpython-3.9" + # optimizations: "lto" + + # # GitHub Actions runners don't support x86-64-v4 so we can't PGO. + # - target_triple: "x86_64_v4-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "debug" + # - target_triple: "x86_64_v4-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "noopt" + # - target_triple: "x86_64_v4-unknown-linux-gnu" + # py: "cpython-3.10" + # optimizations: "lto" + + # - target_triple: "x86_64_v4-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "debug" + # - target_triple: "x86_64_v4-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "noopt" + # - target_triple: "x86_64_v4-unknown-linux-gnu" + # py: "cpython-3.11" + # optimizations: "lto" + + # - target_triple: "x86_64_v4-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "debug" + # - target_triple: "x86_64_v4-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "noopt" + # - target_triple: "x86_64_v4-unknown-linux-gnu" + # py: "cpython-3.12" + # optimizations: "lto" + + - target_triple: "x86_64_v4-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "debug" + - target_triple: "x86_64_v4-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "noopt" + - target_triple: "x86_64_v4-unknown-linux-gnu" + py: "cpython-3.13" + optimizations: "lto" # musl doesn't support PGO. - - target_triple: 'x86_64-unknown-linux-musl' - py: 'cpython-3.8' - optimizations: 'debug' - run: true - - target_triple: 'x86_64-unknown-linux-musl' - py: 'cpython-3.8' - optimizations: 'noopt' - run: true - - target_triple: 'x86_64-unknown-linux-musl' - py: 'cpython-3.8' - optimizations: 'lto' - run: true - - - target_triple: 'x86_64-unknown-linux-musl' - py: 'cpython-3.9' - optimizations: 'debug' - run: true - - target_triple: 'x86_64-unknown-linux-musl' - py: 'cpython-3.9' - optimizations: 'noopt' - run: true - - target_triple: 'x86_64-unknown-linux-musl' - py: 'cpython-3.9' - optimizations: 'lto' - run: true - - - target_triple: 'x86_64-unknown-linux-musl' - py: 'cpython-3.10' - optimizations: 'debug' - run: true - - target_triple: 'x86_64-unknown-linux-musl' - py: 'cpython-3.10' - optimizations: 'noopt' - run: true - - target_triple: 'x86_64-unknown-linux-musl' - py: 'cpython-3.10' - optimizations: 'lto' - run: true - - - target_triple: 'x86_64-unknown-linux-musl' - py: 'cpython-3.11' - optimizations: 'debug' - run: true - - target_triple: 'x86_64-unknown-linux-musl' - py: 'cpython-3.11' - optimizations: 'noopt' - run: true - - target_triple: 'x86_64-unknown-linux-musl' - py: 'cpython-3.11' - optimizations: 'lto' - run: true - - - target_triple: 'x86_64-unknown-linux-musl' - py: 'cpython-3.12' - optimizations: 'debug' - run: true - - target_triple: 'x86_64-unknown-linux-musl' - py: 'cpython-3.12' - optimizations: 'noopt' - run: true - - target_triple: 'x86_64-unknown-linux-musl' - py: 'cpython-3.12' - optimizations: 'lto' - run: true - - - target_triple: 'x86_64_v2-unknown-linux-musl' - py: 'cpython-3.9' - optimizations: 'debug' - run: true - - target_triple: 'x86_64_v2-unknown-linux-musl' - py: 'cpython-3.9' - optimizations: 'noopt' - run: true - - target_triple: 'x86_64_v2-unknown-linux-musl' - py: 'cpython-3.9' - optimizations: 'lto' - run: true - - - target_triple: 'x86_64_v2-unknown-linux-musl' - py: 'cpython-3.10' - optimizations: 'debug' - run: true - - target_triple: 'x86_64_v2-unknown-linux-musl' - py: 'cpython-3.10' - optimizations: 'noopt' - run: true - - target_triple: 'x86_64_v2-unknown-linux-musl' - py: 'cpython-3.10' - optimizations: 'lto' - run: true - - - target_triple: 'x86_64_v2-unknown-linux-musl' - py: 'cpython-3.11' - optimizations: 'debug' - run: true - - target_triple: 'x86_64_v2-unknown-linux-musl' - py: 'cpython-3.11' - optimizations: 'noopt' - run: true - - target_triple: 'x86_64_v2-unknown-linux-musl' - py: 'cpython-3.11' - optimizations: 'lto' - run: true - - - target_triple: 'x86_64_v2-unknown-linux-musl' - py: 'cpython-3.12' - optimizations: 'debug' - run: true - - target_triple: 'x86_64_v2-unknown-linux-musl' - py: 'cpython-3.12' - optimizations: 'noopt' - run: true - - target_triple: 'x86_64_v2-unknown-linux-musl' - py: 'cpython-3.12' - optimizations: 'lto' - run: true - - - target_triple: 'x86_64_v3-unknown-linux-musl' - py: 'cpython-3.9' - optimizations: 'debug' - run: true - - target_triple: 'x86_64_v3-unknown-linux-musl' - py: 'cpython-3.9' - optimizations: 'noopt' - run: true - - target_triple: 'x86_64_v3-unknown-linux-musl' - py: 'cpython-3.9' - optimizations: 'lto' - run: true - - - target_triple: 'x86_64_v3-unknown-linux-musl' - py: 'cpython-3.10' - optimizations: 'debug' - run: true - - target_triple: 'x86_64_v3-unknown-linux-musl' - py: 'cpython-3.10' - optimizations: 'noopt' - run: true - - target_triple: 'x86_64_v3-unknown-linux-musl' - py: 'cpython-3.10' - optimizations: 'lto' - run: true - - - target_triple: 'x86_64_v3-unknown-linux-musl' - py: 'cpython-3.11' - optimizations: 'debug' - run: true - - target_triple: 'x86_64_v3-unknown-linux-musl' - py: 'cpython-3.11' - optimizations: 'noopt' - run: true - - target_triple: 'x86_64_v3-unknown-linux-musl' - py: 'cpython-3.11' - optimizations: 'lto' - run: true - - - target_triple: 'x86_64_v3-unknown-linux-musl' - py: 'cpython-3.12' - optimizations: 'debug' - run: true - - target_triple: 'x86_64_v3-unknown-linux-musl' - py: 'cpython-3.12' - optimizations: 'noopt' - run: true - - target_triple: 'x86_64_v3-unknown-linux-musl' - py: 'cpython-3.12' - optimizations: 'lto' - run: true - - - target_triple: 'x86_64_v4-unknown-linux-musl' - py: 'cpython-3.9' - optimizations: 'debug' - - target_triple: 'x86_64_v4-unknown-linux-musl' - py: 'cpython-3.9' - optimizations: 'noopt' - - target_triple: 'x86_64_v4-unknown-linux-musl' - py: 'cpython-3.9' - optimizations: 'lto' - - - target_triple: 'x86_64_v4-unknown-linux-musl' - py: 'cpython-3.10' - optimizations: 'debug' - - target_triple: 'x86_64_v4-unknown-linux-musl' - py: 'cpython-3.10' - optimizations: 'noopt' - - target_triple: 'x86_64_v4-unknown-linux-musl' - py: 'cpython-3.10' - optimizations: 'lto' - - - target_triple: 'x86_64_v4-unknown-linux-musl' - py: 'cpython-3.11' - optimizations: 'debug' - - target_triple: 'x86_64_v4-unknown-linux-musl' - py: 'cpython-3.11' - optimizations: 'noopt' - - target_triple: 'x86_64_v4-unknown-linux-musl' - py: 'cpython-3.11' - optimizations: 'lto' - - - target_triple: 'x86_64_v4-unknown-linux-musl' - py: 'cpython-3.12' - optimizations: 'debug' - - target_triple: 'x86_64_v4-unknown-linux-musl' - py: 'cpython-3.12' - optimizations: 'noopt' - - target_triple: 'x86_64_v4-unknown-linux-musl' - py: 'cpython-3.12' - optimizations: 'lto' + # - target_triple: "x86_64-unknown-linux-musl" + # py: "cpython-3.8" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64-unknown-linux-musl" + # py: "cpython-3.8" + # optimizations: "noopt" + # run: true + # - target_triple: "x86_64-unknown-linux-musl" + # py: "cpython-3.8" + # optimizations: "lto" + # run: true + + # - target_triple: "x86_64-unknown-linux-musl" + # py: "cpython-3.9" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64-unknown-linux-musl" + # py: "cpython-3.9" + # optimizations: "noopt" + # run: true + # - target_triple: "x86_64-unknown-linux-musl" + # py: "cpython-3.9" + # optimizations: "lto" + # run: true + + # - target_triple: "x86_64-unknown-linux-musl" + # py: "cpython-3.10" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64-unknown-linux-musl" + # py: "cpython-3.10" + # optimizations: "noopt" + # run: true + # - target_triple: "x86_64-unknown-linux-musl" + # py: "cpython-3.10" + # optimizations: "lto" + # run: true + + # - target_triple: "x86_64-unknown-linux-musl" + # py: "cpython-3.11" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64-unknown-linux-musl" + # py: "cpython-3.11" + # optimizations: "noopt" + # run: true + # - target_triple: "x86_64-unknown-linux-musl" + # py: "cpython-3.11" + # optimizations: "lto" + # run: true + + # - target_triple: "x86_64-unknown-linux-musl" + # py: "cpython-3.12" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64-unknown-linux-musl" + # py: "cpython-3.12" + # optimizations: "noopt" + # run: true + # - target_triple: "x86_64-unknown-linux-musl" + # py: "cpython-3.12" + # optimizations: "lto" + # run: true + + - target_triple: "x86_64-unknown-linux-musl" + py: "cpython-3.13" + optimizations: "debug" + run: true + - target_triple: "x86_64-unknown-linux-musl" + py: "cpython-3.13" + optimizations: "noopt" + run: true + - target_triple: "x86_64-unknown-linux-musl" + py: "cpython-3.13" + optimizations: "lto" + run: true + + # - target_triple: "x86_64_v2-unknown-linux-musl" + # py: "cpython-3.9" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64_v2-unknown-linux-musl" + # py: "cpython-3.9" + # optimizations: "noopt" + # run: true + # - target_triple: "x86_64_v2-unknown-linux-musl" + # py: "cpython-3.9" + # optimizations: "lto" + # run: true + + # - target_triple: "x86_64_v2-unknown-linux-musl" + # py: "cpython-3.10" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64_v2-unknown-linux-musl" + # py: "cpython-3.10" + # optimizations: "noopt" + # run: true + # - target_triple: "x86_64_v2-unknown-linux-musl" + # py: "cpython-3.10" + # optimizations: "lto" + # run: true + + # - target_triple: "x86_64_v2-unknown-linux-musl" + # py: "cpython-3.11" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64_v2-unknown-linux-musl" + # py: "cpython-3.11" + # optimizations: "noopt" + # run: true + # - target_triple: "x86_64_v2-unknown-linux-musl" + # py: "cpython-3.11" + # optimizations: "lto" + # run: true + + # - target_triple: "x86_64_v2-unknown-linux-musl" + # py: "cpython-3.12" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64_v2-unknown-linux-musl" + # py: "cpython-3.12" + # optimizations: "noopt" + # run: true + # - target_triple: "x86_64_v2-unknown-linux-musl" + # py: "cpython-3.12" + # optimizations: "lto" + # run: true + + - target_triple: "x86_64_v2-unknown-linux-musl" + py: "cpython-3.13" + optimizations: "debug" + run: true + - target_triple: "x86_64_v2-unknown-linux-musl" + py: "cpython-3.13" + optimizations: "noopt" + run: true + - target_triple: "x86_64_v2-unknown-linux-musl" + py: "cpython-3.13" + optimizations: "lto" + run: true + + # - target_triple: "x86_64_v3-unknown-linux-musl" + # py: "cpython-3.9" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64_v3-unknown-linux-musl" + # py: "cpython-3.9" + # optimizations: "noopt" + # run: true + # - target_triple: "x86_64_v3-unknown-linux-musl" + # py: "cpython-3.9" + # optimizations: "lto" + # run: true + + # - target_triple: "x86_64_v3-unknown-linux-musl" + # py: "cpython-3.10" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64_v3-unknown-linux-musl" + # py: "cpython-3.10" + # optimizations: "noopt" + # run: true + # - target_triple: "x86_64_v3-unknown-linux-musl" + # py: "cpython-3.10" + # optimizations: "lto" + # run: true + + # - target_triple: "x86_64_v3-unknown-linux-musl" + # py: "cpython-3.11" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64_v3-unknown-linux-musl" + # py: "cpython-3.11" + # optimizations: "noopt" + # run: true + # - target_triple: "x86_64_v3-unknown-linux-musl" + # py: "cpython-3.11" + # optimizations: "lto" + # run: true + + # - target_triple: "x86_64_v3-unknown-linux-musl" + # py: "cpython-3.12" + # optimizations: "debug" + # run: true + # - target_triple: "x86_64_v3-unknown-linux-musl" + # py: "cpython-3.12" + # optimizations: "noopt" + # run: true + # - target_triple: "x86_64_v3-unknown-linux-musl" + # py: "cpython-3.12" + # optimizations: "lto" + # run: true + + - target_triple: "x86_64_v3-unknown-linux-musl" + py: "cpython-3.13" + optimizations: "debug" + run: true + - target_triple: "x86_64_v3-unknown-linux-musl" + py: "cpython-3.13" + optimizations: "noopt" + run: true + - target_triple: "x86_64_v3-unknown-linux-musl" + py: "cpython-3.13" + optimizations: "lto" + run: true + + # - target_triple: "x86_64_v4-unknown-linux-musl" + # py: "cpython-3.9" + # optimizations: "debug" + # - target_triple: "x86_64_v4-unknown-linux-musl" + # py: "cpython-3.9" + # optimizations: "noopt" + # - target_triple: "x86_64_v4-unknown-linux-musl" + # py: "cpython-3.9" + # optimizations: "lto" + + # - target_triple: "x86_64_v4-unknown-linux-musl" + # py: "cpython-3.10" + # optimizations: "debug" + # - target_triple: "x86_64_v4-unknown-linux-musl" + # py: "cpython-3.10" + # optimizations: "noopt" + # - target_triple: "x86_64_v4-unknown-linux-musl" + # py: "cpython-3.10" + # optimizations: "lto" + + # - target_triple: "x86_64_v4-unknown-linux-musl" + # py: "cpython-3.11" + # optimizations: "debug" + # - target_triple: "x86_64_v4-unknown-linux-musl" + # py: "cpython-3.11" + # optimizations: "noopt" + # - target_triple: "x86_64_v4-unknown-linux-musl" + # py: "cpython-3.11" + # optimizations: "lto" + + # - target_triple: "x86_64_v4-unknown-linux-musl" + # py: "cpython-3.12" + # optimizations: "debug" + # - target_triple: "x86_64_v4-unknown-linux-musl" + # py: "cpython-3.12" + # optimizations: "noopt" + # - target_triple: "x86_64_v4-unknown-linux-musl" + # py: "cpython-3.12" + # optimizations: "lto" + + - target_triple: "x86_64_v4-unknown-linux-musl" + py: "cpython-3.13" + optimizations: "debug" + - target_triple: "x86_64_v4-unknown-linux-musl" + py: "cpython-3.13" + optimizations: "noopt" + - target_triple: "x86_64_v4-unknown-linux-musl" + py: "cpython-3.13" + optimizations: "lto" needs: - pythonbuild @@ -849,7 +1022,7 @@ jobs: - name: Install Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: "3.11" - name: Download pythonbuild uses: actions/download-artifact@v4 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 19bdba30..f1d834bb 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -2,12 +2,17 @@ name: Windows Python build on: push: + branches: [main] pull_request: - schedule: - - cron: '13 11 * * *' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + jobs: pythonbuild: - runs-on: 'windows-2019' + runs-on: "windows-2019" steps: - uses: actions/checkout@v4 @@ -43,18 +48,19 @@ jobs: fail-fast: false matrix: py: - - 'cpython-3.8' - - 'cpython-3.9' - - 'cpython-3.10' - - 'cpython-3.11' - - 'cpython-3.12' + - "cpython-3.8" + - "cpython-3.9" + - "cpython-3.10" + - "cpython-3.11" + - "cpython-3.12" + - "cpython-3.13" vcvars: - - 'vcvars32.bat' - - 'vcvars64.bat' + - "vcvars32.bat" + - "vcvars64.bat" profile: - - 'pgo' + - "pgo" needs: pythonbuild - runs-on: 'windows-2019' + runs-on: "windows-2019" steps: - uses: actions/checkout@v4 with: @@ -68,7 +74,7 @@ jobs: - name: Install Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: "3.11" - name: Download pythonbuild Executable uses: actions/download-artifact@v4 diff --git a/cpython-unix/Makefile b/cpython-unix/Makefile index 08488956..d3225451 100644 --- a/cpython-unix/Makefile +++ b/cpython-unix/Makefile @@ -270,6 +270,8 @@ $(OUTDIR)/cpython-3.11-$(CPYTHON_3.11_VERSION)-$(HOST_PLATFORM).tar: $(PYTHON_HO $(OUTDIR)/cpython-3.12-$(CPYTHON_3.12_VERSION)-$(HOST_PLATFORM).tar: $(PYTHON_HOST_DEPENDS) $(RUN_BUILD) --docker-image $(DOCKER_IMAGE_BUILD) cpython-3.12-host +$(OUTDIR)/cpython-3.13-$(CPYTHON_3.13_VERSION)-$(HOST_PLATFORM).tar: $(PYTHON_HOST_DEPENDS) + $(RUN_BUILD) --docker-image $(DOCKER_IMAGE_BUILD) cpython-3.13-host PYTHON_DEPENDS := \ $(PYTHON_SUPPORT_FILES) \ @@ -318,3 +320,6 @@ $(OUTDIR)/cpython-$(CPYTHON_3.11_VERSION)-$(PACKAGE_SUFFIX).tar: $(ALL_PYTHON_DE $(OUTDIR)/cpython-$(CPYTHON_3.12_VERSION)-$(PACKAGE_SUFFIX).tar: $(ALL_PYTHON_DEPENDS) $(RUN_BUILD) --docker-image $(DOCKER_IMAGE_BUILD) cpython-3.12 + +$(OUTDIR)/cpython-$(CPYTHON_3.13_VERSION)-$(PACKAGE_SUFFIX).tar: $(ALL_PYTHON_DEPENDS) + $(RUN_BUILD) --docker-image $(DOCKER_IMAGE_BUILD) cpython-3.13 diff --git a/cpython-unix/build-cpython-host.sh b/cpython-unix/build-cpython-host.sh index cfc1e8a7..459558bb 100755 --- a/cpython-unix/build-cpython-host.sh +++ b/cpython-unix/build-cpython-host.sh @@ -38,7 +38,9 @@ pushd "Python-${PYTHON_VERSION}" # configure. This is reported as https://bugs.python.org/issue45405. We nerf the # check since we know what we're doing. if [ "${CC}" = "clang" ]; then - if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_9}" ]; then + if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" ]; then + patch -p1 -i ${ROOT}/patch-disable-multiarch-13.patch + elif [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_9}" ]; then patch -p1 -i ${ROOT}/patch-disable-multiarch.patch else patch -p1 -i ${ROOT}/patch-disable-multiarch-legacy.patch diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index 87225429..4e3524a5 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -72,7 +72,10 @@ cat Makefile.extra pushd Python-${PYTHON_VERSION} # configure doesn't support cross-compiling on Apple. Teach it. -if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_12}" ]; then +if [ "${PYTHON_MAJMIN_VERSION}" = "3.13" ]; then + # FIXME: new patch may be required + : +elif [ "${PYTHON_MAJMIN_VERSION}" = "3.12" ]; then patch -p1 -i ${ROOT}/patch-apple-cross-3.12.patch else patch -p1 -i ${ROOT}/patch-apple-cross.patch @@ -94,7 +97,9 @@ fi # Configure nerfs RUNSHARED when cross-compiling, which prevents PGO from running when # we can in fact run the target binaries (e.g. x86_64 host and i686 target). Undo that. if [ -n "${CROSS_COMPILING}" ]; then - if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_11}" ]; then + if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" ]; then + patch -p1 -i ${ROOT}/patch-dont-clear-runshared-13.patch + elif [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_11}" ]; then patch -p1 -i ${ROOT}/patch-dont-clear-runshared.patch else patch -p1 -i ${ROOT}/patch-dont-clear-runshared-legacy.patch @@ -105,7 +110,9 @@ fi # configure. This is reported as https://bugs.python.org/issue45405. We nerf the # check since we know what we're doing. if [ "${CC}" = "clang" ]; then - if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_9}" ]; then + if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" ]; then + patch -p1 -i ${ROOT}/patch-disable-multiarch-13.patch + elif [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_9}" ]; then patch -p1 -i ${ROOT}/patch-disable-multiarch.patch else patch -p1 -i ${ROOT}/patch-disable-multiarch-legacy.patch @@ -136,7 +143,11 @@ fi # The default build rule for the macOS dylib doesn't pick up libraries # from modules / makesetup. So patch it accordingly. -patch -p1 -i ${ROOT}/patch-macos-link-extension-modules.patch +if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" ]; then + patch -p1 -i ${ROOT}/patch-macos-link-extension-modules-13.patch +else + patch -p1 -i ${ROOT}/patch-macos-link-extension-modules.patch +fi # Also on macOS, the `python` executable is linked against libraries defined by statically # linked modules. But those libraries should only get linked into libpython, not the @@ -280,7 +291,7 @@ if [ "${PYBUILD_PLATFORM}" != "macos" ]; then fi fi -# On Python 3.12 we need to link the special hacl library provided some SHA-256 +# On Python 3.12+ we need to link the special hacl library provided some SHA-256 # implementations. Since we hack up the regular extension building mechanism, we # need to reinvent this wheel. if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_12}" ]; then @@ -832,7 +843,7 @@ ${BUILD_PYTHON} ${ROOT}/fix_shebangs.py ${ROOT}/out/python/install # downstream consumers. OBJECT_DIRS="Objects Parser Parser/pegen Programs Python" OBJECT_DIRS="${OBJECT_DIRS} Modules" -for ext in _blake2 cjkcodecs _ctypes _ctypes/darwin _decimal _expat _hacl _io _multiprocessing _sha3 _sqlite _sre _xxtestfuzz ; do +for ext in _blake2 cjkcodecs _ctypes _ctypes/darwin _decimal _expat _hacl _io _multiprocessing _sha3 _sqlite _sre _testinternalcapi _xxtestfuzz ; do OBJECT_DIRS="${OBJECT_DIRS} Modules/${ext}" done @@ -894,8 +905,11 @@ cp -av Modules/config.c.in ${ROOT}/out/python/build/Modules/ cp -av Python/frozen.c ${ROOT}/out/python/build/Python/ cp -av Modules/Setup* ${ROOT}/out/python/build/Modules/ -# Copy the test hardness runner for convenience. -cp -av Tools/scripts/run_tests.py ${ROOT}/out/python/build/ +# Copy the test harness runner for convenience. +# In Python 3.13+, this script is not needed to run tests and is not present. +if [ -d Tools/scripts/run_tests.py ]; then + cp -av Tools/scripts/run_tests.py ${ROOT}/out/python/build/ +fi mkdir ${ROOT}/out/python/licenses cp ${ROOT}/LICENSE.*.txt ${ROOT}/out/python/licenses/ diff --git a/cpython-unix/build-main.py b/cpython-unix/build-main.py index b9b3c5dc..34a90d19 100755 --- a/cpython-unix/build-main.py +++ b/cpython-unix/build-main.py @@ -67,6 +67,7 @@ def main(): "cpython-3.10", "cpython-3.11", "cpython-3.12", + "cpython-3.13", }, default="cpython-3.11", help="Python distribution to build", diff --git a/cpython-unix/build.py b/cpython-unix/build.py index ccea702c..e3570054 100755 --- a/cpython-unix/build.py +++ b/cpython-unix/build.py @@ -435,6 +435,7 @@ def build_cpython_host( support = { "build-cpython-host.sh", "patch-disable-multiarch.patch", + "patch-disable-multiarch-13.patch", "patch-disable-multiarch-legacy.patch", } for s in sorted(support): @@ -455,7 +456,7 @@ def build_cpython_host( # Set environment variables allowing convenient testing for Python # version ranges. - for v in ("3.8", "3.9", "3.10", "3.11", "3.12"): + for v in ("3.8", "3.9", "3.10", "3.11", "3.12", "3.13"): normal_version = v.replace(".", "_") if meets_python_minimum_version(python_version, v): @@ -782,7 +783,7 @@ def build_cpython( # Set environment variables allowing convenient testing for Python # version ranges. - for v in ("3.8", "3.9", "3.10", "3.11", "3.12"): + for v in ("3.8", "3.9", "3.10", "3.11", "3.12", "3.13"): normal_version = v.replace(".", "_") if meets_python_minimum_version(python_version, v): @@ -1195,6 +1196,7 @@ def main(): "cpython-3.10", "cpython-3.11", "cpython-3.12", + "cpython-3.13", ): build_cpython( settings, diff --git a/cpython-unix/extension-modules.yml b/cpython-unix/extension-modules.yml index 37f78101..52150b59 100644 --- a/cpython-unix/extension-modules.yml +++ b/cpython-unix/extension-modules.yml @@ -67,6 +67,7 @@ _contextvars: - _contextvarsmodule.c _crypt: + maximum-python-version: "3.12" build-mode: shared sources: - _cryptmodule.c @@ -286,6 +287,21 @@ _heapq: _imp: config-c-only: true +_interpchannels: + minimum-python-version: "3.13" + sources: + - _interpchannelsmodule.c + +_interpqueues: + minimum-python-version: "3.13" + sources: + - _interpqueuesmodule.c + +_interpreters: + minimum-python-version: "3.13" + sources: + - _interpretersmodule.c + _io: setup-enabled: true required-targets: @@ -528,9 +544,21 @@ _struct: sources: - _struct.c +_suggestions: + setup-enabled: true + minimum-python-version: '3.13' + sources: + - _suggestions.c + _symtable: setup-enabled: true +_sysconfig: + setup-enabled: true + minimum-python-version: '3.13' + sources: + - _sysconfig.c + _testbuffer: minimum-python-version: '3.9' sources: @@ -545,6 +573,11 @@ _testcapi: sources: - _testcapimodule.c +_testexternalinspection: + minimum-python-version: '3.13' + sources: + - _testexternalinspection.c + _testimportmultiple: minimum-python-version: '3.9' sources: @@ -558,6 +591,18 @@ _testinternalcapi: - Include/internal sources: - _testinternalcapi.c + includes-conditional: + - path: _testinternalcapi/parts.h + minimum-python-version: "3.13" + sources-conditional: + - source: _testinternalcapi/pytime.c + minimum-python-version: "3.13" + - source: _testinternalcapi/set.c + minimum-python-version: "3.13" + - source: _testinternalcapi/test_critical_sections.c + minimum-python-version: "3.13" + - source: _testinternalcapi/test_lock.c + minimum-python-version: "3.13" _testmultiphase: minimum-python-version: '3.9' @@ -659,11 +704,13 @@ _weakref: _xxinterpchannels: minimum-python-version: '3.12' + maximum-python-version: '3.12' sources: - _xxinterpchannelsmodule.c _xxsubinterpreters: minimum-python-version: '3.9' + maximum-python-version: '3.12' sources: - _xxsubinterpretersmodule.c @@ -687,6 +734,7 @@ atexit: # Modules/Setup comment is ambiguous as to whether this module actually works. audioop: + maximum-python-version: '3.12' sources: - audioop.c @@ -745,6 +793,7 @@ mmap: - mmapmodule.c nis: + maximum-python-version: "3.12" disabled-targets: # NIS is not available on Apple OS. - aarch64-apple-.* @@ -767,6 +816,7 @@ nis: - nsl ossaudiodev: + maximum-python-version: "3.12" disabled-targets: # ossaudiodev not available on Apple OS. - aarch64-apple-.* @@ -806,6 +856,7 @@ readline: - readline.c defines: - USE_LIBEDIT=1 + - Py_RL_STARTUP_HOOK_TAKES_ARGS includes-deps: - libedit/include - libedit/include/ncursesw @@ -828,6 +879,7 @@ select: - selectmodule.c spwd: + maximum-python-version: "3.12" sources: - spwdmodule.c diff --git a/cpython-unix/patch-disable-multiarch-13.patch b/cpython-unix/patch-disable-multiarch-13.patch new file mode 100644 index 00000000..3ff33246 --- /dev/null +++ b/cpython-unix/patch-disable-multiarch-13.patch @@ -0,0 +1,17 @@ +diff -u 13-a/configure.ac 13-b/configure.ac +--- 13-a/configure.ac 2024-05-08 05:21:00.000000000 -0400 ++++ 13-b/configure.ac 2024-05-19 07:42:23.294762624 -0400 +@@ -1090,12 +1090,7 @@ + dnl architecture. PLATFORM_TRIPLET will be a pair or single value for these + dnl platforms. + AC_MSG_CHECKING([for multiarch]) +-AS_CASE([$ac_sys_system], +- [Darwin*], [MULTIARCH=""], +- [iOS], [MULTIARCH=""], +- [FreeBSD*], [MULTIARCH=""], +- [MULTIARCH=$($CC --print-multiarch 2>/dev/null)] +-) ++MULTIARCH= + AC_SUBST([MULTIARCH]) + + if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then diff --git a/cpython-unix/patch-dont-clear-runshared-13.patch b/cpython-unix/patch-dont-clear-runshared-13.patch new file mode 100644 index 00000000..7dcba084 --- /dev/null +++ b/cpython-unix/patch-dont-clear-runshared-13.patch @@ -0,0 +1,14 @@ +diff -u 13-a/configure.ac 13-b/configure.ac +--- 13-a/configure.ac 2024-05-08 05:21:00.000000000 -0400 ++++ 13-b/configure.ac 2024-05-19 12:44:04.530770938 -0400 +@@ -1564,10 +1564,6 @@ + fi + AC_MSG_RESULT([$LDLIBRARY]) + +-if test "$cross_compiling" = yes; then +- RUNSHARED= +-fi +- + AC_MSG_CHECKING([HOSTRUNNER]) + AC_ARG_VAR([HOSTRUNNER], [Program to run CPython for the host platform]) + if test -z "$HOSTRUNNER" diff --git a/cpython-unix/patch-macos-link-extension-modules-13.patch b/cpython-unix/patch-macos-link-extension-modules-13.patch new file mode 100644 index 00000000..75b0d781 --- /dev/null +++ b/cpython-unix/patch-macos-link-extension-modules-13.patch @@ -0,0 +1,12 @@ +diff -u 13-a/Makefile.pre.in 13-b/Makefile.pre.in +--- 13-a/Makefile.pre.in 2024-05-08 05:21:00.000000000 -0400 ++++ 13-b/Makefile.pre.in 2024-05-19 07:55:45.091521909 -0400 +@@ -903,7 +903,7 @@ + $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^ + + libpython$(LDVERSION).dylib: $(LIBRARY_OBJS) +- $(CC) -dynamiclib $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \ ++ $(CC) -dynamiclib $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \ + + + libpython$(VERSION).sl: $(LIBRARY_OBJS) diff --git a/cpython-unix/targets.yml b/cpython-unix/targets.yml index fd81e286..02e41311 100644 --- a/cpython-unix/targets.yml +++ b/cpython-unix/targets.yml @@ -64,6 +64,7 @@ aarch64-apple-darwin: - '3.10' - '3.11' - '3.12' + - '3.13' needs_toolchain: true host_cc: clang host_cxx: clang++ @@ -153,6 +154,7 @@ aarch64-unknown-linux-gnu: - '3.10' - '3.11' - '3.12' + - '3.13' docker_image_suffix: .cross host_cc: /usr/bin/x86_64-linux-gnu-gcc host_cxx: /usr/bin/x86_64-linux-gnu-g++ @@ -231,6 +233,7 @@ armv7-unknown-linux-gnueabi: - '3.10' - '3.11' - '3.12' + - '3.13' docker_image_suffix: .cross host_cc: /usr/bin/x86_64-linux-gnu-gcc host_cxx: /usr/bin/x86_64-linux-gnu-g++ @@ -269,6 +272,7 @@ armv7-unknown-linux-gnueabihf: - '3.10' - '3.11' - '3.12' + - '3.13' docker_image_suffix: .cross host_cc: /usr/bin/x86_64-linux-gnu-gcc host_cxx: /usr/bin/x86_64-linux-gnu-g++ @@ -308,6 +312,7 @@ i686-unknown-linux-gnu: - '3.10' - '3.11' - '3.12' + - '3.13' needs_toolchain: true host_cc: clang host_cxx: clang++ @@ -351,6 +356,7 @@ mips-unknown-linux-gnu: - '3.10' - '3.11' - '3.12' + - '3.13' docker_image_suffix: .cross host_cc: /usr/bin/x86_64-linux-gnu-gcc host_cxx: /usr/bin/x86_64-linux-gnu-g++ @@ -389,6 +395,7 @@ mipsel-unknown-linux-gnu: - '3.10' - '3.11' - '3.12' + - '3.13' docker_image_suffix: .cross host_cc: /usr/bin/x86_64-linux-gnu-gcc host_cxx: /usr/bin/x86_64-linux-gnu-g++ @@ -427,6 +434,7 @@ ppc64le-unknown-linux-gnu: - '3.10' - '3.11' - '3.12' + - '3.13' docker_image_suffix: .cross host_cc: /usr/bin/x86_64-linux-gnu-gcc host_cxx: /usr/bin/x86_64-linux-gnu-g++ @@ -465,6 +473,7 @@ s390x-unknown-linux-gnu: - '3.10' - '3.11' - '3.12' + - '3.13' docker_image_suffix: .cross host_cc: /usr/bin/x86_64-linux-gnu-gcc host_cxx: /usr/bin/x86_64-linux-gnu-g++ @@ -548,6 +557,7 @@ x86_64-apple-darwin: - '3.10' - '3.11' - '3.12' + - '3.13' needs_toolchain: true apple_sdk_platform: macosx host_cc: clang @@ -717,6 +727,7 @@ x86_64-unknown-linux-gnu: - '3.10' - '3.11' - '3.12' + - '3.13' needs_toolchain: true host_cc: clang host_cxx: clang++ @@ -761,6 +772,7 @@ x86_64_v2-unknown-linux-gnu: - '3.10' - '3.11' - '3.12' + - '3.13' needs_toolchain: true host_cc: clang host_cxx: clang++ @@ -806,6 +818,7 @@ x86_64_v3-unknown-linux-gnu: - '3.10' - '3.11' - '3.12' + - '3.13' needs_toolchain: true host_cc: clang host_cxx: clang++ @@ -851,6 +864,7 @@ x86_64_v4-unknown-linux-gnu: - '3.10' - '3.11' - '3.12' + - '3.13' needs_toolchain: true host_cc: clang host_cxx: clang++ @@ -896,6 +910,7 @@ x86_64-unknown-linux-musl: - '3.10' - '3.11' - '3.12' + - '3.13' needs_toolchain: true host_cc: clang host_cxx: clang++ @@ -938,6 +953,7 @@ x86_64_v2-unknown-linux-musl: - '3.10' - '3.11' - '3.12' + - '3.13' needs_toolchain: true host_cc: clang host_cxx: clang++ @@ -981,6 +997,7 @@ x86_64_v3-unknown-linux-musl: - '3.10' - '3.11' - '3.12' + - '3.13' needs_toolchain: true host_cc: clang host_cxx: clang++ @@ -1024,6 +1041,7 @@ x86_64_v4-unknown-linux-musl: - '3.10' - '3.11' - '3.12' + - '3.13' needs_toolchain: true host_cc: clang host_cxx: clang++ diff --git a/cpython-windows/build.py b/cpython-windows/build.py index bc97cd57..f1df1224 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -120,6 +120,10 @@ # # This set was copied from test.libregrtest.pgo in the CPython source # distribution. +# +# When tests are removed, we generally retain their names as we just look for presence in this set. +# +# See https://github.com/python/cpython/blob/main/Lib/test/libregrtest/pgo.py PGO_TESTS = { "test_array", "test_base64", @@ -152,19 +156,22 @@ "test_memoryview", "test_operator", "test_ordered_dict", + "test_patma", "test_pickle", "test_pprint", "test_re", "test_set", - # Renamed to test_sqlite3 in 3.11. We keep both names as we just look for - # test presence in this set. + # `test_sqlite` was renamed to `test_sqlite3` in 3.11. "test_sqlite", "test_sqlite3", "test_statistics", + # `test_unicode` was renamed to `test_str` in 3.13. + # See https://github.com/python/cpython/pull/13172 + "test_str", + "test_unicode", "test_struct", "test_tabnanny", "test_time", - "test_unicode", "test_xml_etree", "test_xml_etree_c", } @@ -1700,10 +1707,18 @@ def build_cpython( log("copying %s to %s" % (source, dest)) shutil.copyfile(source, dest) - shutil.copyfile( - cpython_source_path / "Tools" / "scripts" / "run_tests.py", - out_dir / "python" / "build" / "run_tests.py", - ) + # CPython 3.13 removed `run_tests.py`. + if meets_python_minimum_version(python_version, "3.13"): + # TODO(zanieb): Write a script to invoke `python -m test --slow-ci` + # or update the metadata to not require `run_tests.py` + pathlib.Path( + out_dir / "python" / "build" / "run_tests.py", + ).touch() + else: + shutil.copyfile( + cpython_source_path / "Tools" / "scripts" / "run_tests.py", + out_dir / "python" / "build" / "run_tests.py", + ) licenses_dir = out_dir / "python" / "licenses" licenses_dir.mkdir() diff --git a/pythonbuild/cpython.py b/pythonbuild/cpython.py index 97a715d5..c499cc0f 100644 --- a/pythonbuild/cpython.py +++ b/pythonbuild/cpython.py @@ -41,6 +41,8 @@ "properties": { "path": {"type": "string"}, "targets": {"type": "array", "items": {"type": "string"}}, + "minimum-python-version": {"type": "string"}, + "maximum-python-version": {"type": "string"}, }, "additionalProperties": False, }, @@ -534,7 +536,19 @@ def derive_setup_local( line += f" -I{path}" for entry in info.get("includes-conditional", []): - if any(re.match(p, target_triple) for p in entry["targets"]): + if targets := entry.get("targets", []): + target_match = any(re.match(p, target_triple) for p in targets) + else: + target_match = True + + python_min_match = meets_python_minimum_version( + python_version, entry.get("minimum-python-version", "1.0") + ) + python_max_match = meets_python_maximum_version( + python_version, entry.get("maximum-python-version", "100.0") + ) + + if target_match and (python_min_match and python_max_match): line += f" -I{entry['path']}" for path in info.get("includes-deps", []): diff --git a/pythonbuild/downloads.py b/pythonbuild/downloads.py index ae46a85d..6ebfbeb3 100644 --- a/pythonbuild/downloads.py +++ b/pythonbuild/downloads.py @@ -79,6 +79,15 @@ "license_file": "LICENSE.cpython.txt", "python_tag": "cp312", }, + "cpython-3.13": { + "url": "https://www.python.org/ftp/python/3.13.0/Python-3.13.0b2.tar.xz", + "size": 21054240, + "sha256": "bf11be01b42a07a3659e4e233591e03da631b7112aa61ee1e030eeb8c5dfd869", + "version": "3.13.0b2", + "licenses": ["Python-2.0", "CNRI-Python"], + "license_file": "LICENSE.cpython.txt", + "python_tag": "cp313", + }, "expat": { "url": "https://github.com/libexpat/libexpat/releases/download/R_2_5_0/expat-2.5.0.tar.xz", "size": 460560, diff --git a/src/validation.rs b/src/validation.rs index 292a3c56..7e015a79 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -287,6 +287,16 @@ static DARWIN_ALLOWED_DYLIBS: Lazy> = Lazy::new(|| { max_compatibility_version: "3.12.0".try_into().unwrap(), required: false, }, + MachOAllowedDylib { + name: "@executable_path/../lib/libpython3.13.dylib".to_string(), + max_compatibility_version: "3.13.0".try_into().unwrap(), + required: false, + }, + MachOAllowedDylib { + name: "@executable_path/../lib/libpython3.13d.dylib".to_string(), + max_compatibility_version: "3.13.0".try_into().unwrap(), + required: false, + }, MachOAllowedDylib { name: "/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit".to_string(), max_compatibility_version: "45.0.0".try_into().unwrap(), @@ -638,7 +648,6 @@ const GLOBAL_EXTENSIONS: &[&str] = &[ "_weakref", "array", "atexit", - "audioop", "binascii", "builtins", "cmath", @@ -665,13 +674,17 @@ const GLOBAL_EXTENSIONS: &[&str] = &[ // _testsinglephase added in 3.12. // _sha256 and _sha512 merged into _sha2 in 3.12. // _xxinterpchannels added in 3.12. +// audioop removed in 3.13 +// _crypt removed in 3.13 +// spwd removed in Python 3.13 // We didn't build ctypes_test until 3.9. // We didn't build some test extensions until 3.9. -const GLOBAL_EXTENSIONS_PYTHON_3_8: &[&str] = &["_sha256", "_sha512", "parser"]; +const GLOBAL_EXTENSIONS_PYTHON_3_8: &[&str] = &["audioop", "_sha256", "_sha512", "parser"]; const GLOBAL_EXTENSIONS_PYTHON_3_9: &[&str] = &[ + "audioop", "_peg_parser", "_sha256", "_sha512", @@ -682,6 +695,7 @@ const GLOBAL_EXTENSIONS_PYTHON_3_9: &[&str] = &[ ]; const GLOBAL_EXTENSIONS_PYTHON_3_10: &[&str] = &[ + "audioop", "_sha256", "_sha512", "_uuid", @@ -690,6 +704,7 @@ const GLOBAL_EXTENSIONS_PYTHON_3_10: &[&str] = &[ ]; const GLOBAL_EXTENSIONS_PYTHON_3_11: &[&str] = &[ + "audioop", "_sha256", "_sha512", "_tokenize", @@ -700,6 +715,7 @@ const GLOBAL_EXTENSIONS_PYTHON_3_11: &[&str] = &[ ]; const GLOBAL_EXTENSIONS_PYTHON_3_12: &[&str] = &[ + "audioop", "_sha2", "_tokenize", "_typing", @@ -708,9 +724,24 @@ const GLOBAL_EXTENSIONS_PYTHON_3_12: &[&str] = &[ "_zoneinfo", ]; +// FIXME: ensure that this list is correct for 3.13 +const GLOBAL_EXTENSIONS_PYTHON_3_13: &[&str] = &[ + "_interpchannels", + "_interpqueues", + "_interpreters", + "_sha2", + "_suggestions", + "_sysconfig", + "_testexternalinspection", + "_tokenize", + "_typing", + "_zoneinfo", +]; + const GLOBAL_EXTENSIONS_MACOS: &[&str] = &["_scproxy"]; -const GLOBAL_EXTENSIONS_POSIX: &[&str] = &[ +// TODO(zanieb): Consider replicating this explicitly for each Python version. +const GLOBAL_EXTENSIONS_POSIX_PRE_313: &[&str] = &[ "_crypt", "_ctypes_test", "_curses", @@ -729,7 +760,26 @@ const GLOBAL_EXTENSIONS_POSIX: &[&str] = &[ "termios", ]; -const GLOBAL_EXTENSIONS_LINUX: &[&str] = &["spwd"]; +const GLOBAL_EXTENSIONS_POSIX_POST_313: &[&str] = &[ + "_ctypes_test", + "_curses", + "_curses_panel", + "_dbm", + "_posixshmem", + "_posixsubprocess", + "_testinternalcapi", + "fcntl", + "grp", + "posix", + "pwd", + "readline", + "resource", + "syslog", + "termios", +]; + +const GLOBAL_EXTENSIONS_LINUX_PRE_313: &[&str] = &["spwd"]; +const GLOBAL_EXTENSIONS_LINUX_POST_313: &[&str] = &[]; const GLOBAL_EXTENSIONS_WINDOWS: &[&str] = &[ "_msi", @@ -985,20 +1035,18 @@ fn validate_elf<'data, Elf: FileHeader>( if let Some(version) = version_version { let parts: Vec<&str> = version.splitn(2, '_').collect(); - if parts.len() == 2 { - if parts[0] == "GLIBC" { - let v = version_compare::Version::from(parts[1]) - .expect("unable to parse version"); + if parts.len() == 2 && parts[0] == "GLIBC" { + let v = version_compare::Version::from(parts[1]) + .expect("unable to parse version"); - if &v > wanted_glibc_max_version { - context.errors.push(format!( - "{} references too new glibc symbol {:?} ({} > {})", - path.display(), - name, - v, - wanted_glibc_max_version, - )); - } + if &v > wanted_glibc_max_version { + context.errors.push(format!( + "{} references too new glibc symbol {:?} ({} > {})", + path.display(), + name, + v, + wanted_glibc_max_version, + )); } } } @@ -1026,12 +1074,12 @@ fn validate_elf<'data, Elf: FileHeader>( if let Some(filename) = path.file_name() { let filename = filename.to_string_lossy(); - if filename.starts_with("libpython") && filename.ends_with(".so.1.0") { - if matches!(symbol.st_bind(), STB_GLOBAL | STB_WEAK) - && symbol.st_visibility() == STV_DEFAULT - { - context.libpython_exported_symbols.insert(name.to_string()); - } + if filename.starts_with("libpython") + && filename.ends_with(".so.1.0") + && matches!(symbol.st_bind(), STB_GLOBAL | STB_WEAK) + && symbol.st_visibility() == STV_DEFAULT + { + context.libpython_exported_symbols.insert(name.to_string()); } } } @@ -1125,7 +1173,7 @@ fn validate_macho>( target_version = Some(parse_version_nibbles(v.version.get(endian))); } LoadCommandVariant::Dylib(command) => { - let raw_string = load_command.string(endian, command.dylib.name.clone())?; + let raw_string = load_command.string(endian, command.dylib.name)?; let lib = String::from_utf8(raw_string.to_vec())?; dylib_names.push(lib.clone()); @@ -1336,9 +1384,9 @@ fn validate_possible_object_file( json, triple, python_major_minor, - path.as_ref(), + path, header, - &data, + data, )?; } FileKind::Elf64 => { @@ -1349,9 +1397,9 @@ fn validate_possible_object_file( json, triple, python_major_minor, - path.as_ref(), + path, header, - &data, + data, )?; } FileKind::MachO32 => { @@ -1367,9 +1415,9 @@ fn validate_possible_object_file( json.apple_sdk_version .as_ref() .expect("apple_sdk_version should be set"), - path.as_ref(), + path, header, - &data, + data, )?; } FileKind::MachO64 => { @@ -1385,9 +1433,9 @@ fn validate_possible_object_file( json.apple_sdk_version .as_ref() .expect("apple_sdk_version should be set"), - path.as_ref(), + path, header, - &data, + data, )?; } FileKind::MachOFat32 | FileKind::MachOFat64 => { @@ -1399,11 +1447,11 @@ fn validate_possible_object_file( } FileKind::Pe32 => { let file = PeFile32::parse(data)?; - validate_pe(&mut context, path.as_ref(), &file)?; + validate_pe(&mut context, path, &file)?; } FileKind::Pe64 => { let file = PeFile64::parse(data)?; - validate_pe(&mut context, path.as_ref(), &file)?; + validate_pe(&mut context, path, &file)?; } _ => {} } @@ -1431,7 +1479,7 @@ fn validate_extension_modules( return Ok(errors); } - let mut wanted = BTreeSet::from_iter(GLOBAL_EXTENSIONS.iter().map(|x| *x)); + let mut wanted = BTreeSet::from_iter(GLOBAL_EXTENSIONS.iter().copied()); match python_major_minor { "3.8" => { @@ -1449,13 +1497,26 @@ fn validate_extension_modules( "3.12" => { wanted.extend(GLOBAL_EXTENSIONS_PYTHON_3_12); } + "3.13" => { + wanted.extend(GLOBAL_EXTENSIONS_PYTHON_3_13); + } _ => { panic!("unhandled Python version: {}", python_major_minor); } } if is_macos { - wanted.extend(GLOBAL_EXTENSIONS_POSIX); + match python_major_minor { + "3.8" | "3.9" | "3.10" | "3.11" | "3.12" => { + wanted.extend(GLOBAL_EXTENSIONS_POSIX_PRE_313); + } + "3.13" => { + wanted.extend(GLOBAL_EXTENSIONS_POSIX_POST_313); + } + _ => { + panic!("unhandled Python version: {}", python_major_minor); + } + } wanted.extend(GLOBAL_EXTENSIONS_MACOS); } @@ -1470,15 +1531,42 @@ fn validate_extension_modules( } if is_linux { - wanted.extend(GLOBAL_EXTENSIONS_POSIX); - wanted.extend(GLOBAL_EXTENSIONS_LINUX); + match python_major_minor { + "3.8" | "3.9" | "3.10" | "3.11" | "3.12" => { + wanted.extend(GLOBAL_EXTENSIONS_POSIX_PRE_313); + } + "3.13" => { + wanted.extend(GLOBAL_EXTENSIONS_POSIX_POST_313); + } + _ => { + panic!("unhandled Python version: {}", python_major_minor); + } + } + match python_major_minor { + "3.8" | "3.9" | "3.10" | "3.11" | "3.12" => { + wanted.extend(GLOBAL_EXTENSIONS_LINUX_PRE_313); + } + "3.13" => { + wanted.extend(GLOBAL_EXTENSIONS_LINUX_POST_313); + } + _ => { + panic!("unhandled Python version: {}", python_major_minor); + } + } - if !is_linux_musl { + // Removed in Python 3.13 + if !is_linux_musl && matches!(python_major_minor, "3.8" | "3.9" | "3.10" | "3.11" | "3.12") + { wanted.insert("ossaudiodev"); } } - if (is_linux || is_macos) && matches!(python_major_minor, "3.9" | "3.10" | "3.11" | "3.12") { + if (is_linux || is_macos) + && matches!( + python_major_minor, + "3.9" | "3.10" | "3.11" | "3.12" | "3.13" + ) + { wanted.extend([ "_testbuffer", "_testimportmultiple", @@ -1487,7 +1575,7 @@ fn validate_extension_modules( ]); } - if (is_linux || is_macos) && python_major_minor == "3.12" { + if (is_linux || is_macos) && matches!(python_major_minor, "3.12" | "3.13") { wanted.insert("_testsinglephase"); } @@ -1501,7 +1589,7 @@ fn validate_extension_modules( } // _wmi is Windows only on 3.12+. - if python_major_minor == "3.12" && is_windows { + if matches!(python_major_minor, "3.12" | "3.13") && is_windows { wanted.insert("_wmi"); } @@ -1576,15 +1664,12 @@ fn validate_json(json: &PythonJsonMain, triple: &str, is_debug: bool) -> Result< .map(|x| x.as_str()) .collect::>(); - errors.extend( - validate_extension_modules( - &json.python_major_minor_version, - triple, - json.crt_features.contains(&"static".to_string()), - &have_extensions, - )? - .into_iter(), - ); + errors.extend(validate_extension_modules( + &json.python_major_minor_version, + triple, + json.crt_features.contains(&"static".to_string()), + &have_extensions, + )?); Ok(errors) } @@ -1627,6 +1712,8 @@ fn validate_distribution( "3.11" } else if dist_filename.starts_with("cpython-3.12.") { "3.12" + } else if dist_filename.starts_with("cpython-3.13.") { + "3.13" } else { return Err(anyhow!("could not parse Python version from filename")); }; @@ -1635,7 +1722,7 @@ fn validate_distribution( let is_static = triple.contains("unknown-linux-musl"); - let mut tf = crate::open_distribution_archive(&dist_path)?; + let mut tf = crate::open_distribution_archive(dist_path)?; // First entry in archive should be python/PYTHON.json. let mut entries = tf.entries()?; @@ -1701,7 +1788,7 @@ fn validate_distribution( context.merge(validate_possible_object_file( json.as_ref().unwrap(), python_major_minor, - &triple, + triple, &path, &data, )?); @@ -1726,9 +1813,9 @@ fn validate_distribution( context.merge(validate_possible_object_file( json.as_ref().unwrap(), python_major_minor, - &triple, + triple, &member_path, - &member_data, + member_data, )?); } } @@ -1914,10 +2001,8 @@ fn validate_distribution( } else if triple.contains("-windows-") { false // Presence of a shared library extension implies no export. - } else if ext.shared_lib.is_some() { - false } else { - true + ext.shared_lib.is_none() }; if exported != wanted { @@ -1996,7 +2081,7 @@ fn verify_distribution_behavior(dist_path: &Path) -> Result> { tf.unpack(temp_dir.path())?; let python_json_path = temp_dir.path().join("python").join("PYTHON.json"); - let python_json_data = std::fs::read(&python_json_path)?; + let python_json_data = std::fs::read(python_json_path)?; let python_json = parse_python_json(&python_json_data)?; let python_exe = temp_dir.path().join("python").join(python_json.python_exe); @@ -2005,7 +2090,7 @@ fn verify_distribution_behavior(dist_path: &Path) -> Result> { std::fs::write(&test_file, PYTHON_VERIFICATIONS.as_bytes())?; eprintln!(" running interpreter tests (output should follow)"); - let output = duct::cmd(&python_exe, &[test_file.display().to_string()]) + let output = duct::cmd(python_exe, [test_file.display().to_string()]) .stdout_to_stderr() .unchecked() .env("TARGET_TRIPLE", &python_json.target_triple)