From 63c90809a368d862ef2a41de20ac594c711d8aa3 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 1 Jul 2026 01:37:54 +0200 Subject: [PATCH 01/12] [WIP] Upgrade Ubuntu from 24.04 to 26.06 in GitHub Actions Touch Python/getcompiler.c to trigger most GHA jobs. --- .github/workflows/build.yml | 20 ++++++++++---------- .github/workflows/jit.yml | 8 ++++---- .github/workflows/reusable-docs.yml | 2 +- .github/workflows/reusable-emscripten.yml | 2 +- .github/workflows/reusable-san.yml | 2 +- .github/workflows/reusable-wasi.yml | 2 +- .github/workflows/tail-call.yml | 6 +++--- Python/getcompiler.c | 1 + 8 files changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9a956a6bf5303..620325b475fe41 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,7 +53,7 @@ jobs: name: 'Check if Autoconf files are up to date' # Don't use ubuntu-latest but a specific version to make the job # reproducible: to get the same tools versions (autoconf, aclocal, ...) - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 container: image: ghcr.io/python/autoconf:2025.01.02.12581854023 timeout-minutes: 60 @@ -96,7 +96,7 @@ jobs: name: 'Check if generated files are up to date' # Don't use ubuntu-latest but a specific version to make the job # reproducible: to get the same tools versions (autoconf, aclocal, ...) - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 timeout-minutes: 60 needs: build-context if: needs.build-context.outputs.run-tests == 'true' @@ -239,18 +239,18 @@ jobs: - false - true os: - - ubuntu-24.04 - - ubuntu-24.04-arm + - ubuntu-26.04 + - ubuntu-26.04-arm exclude: # Do not test BOLT with free-threading, to conserve resources - bolt: true free-threading: true # BOLT currently crashes during instrumentation on aarch64 - - os: ubuntu-24.04-arm + - os: ubuntu-26.04-arm bolt: true include: # Enable CPU-intensive tests on ARM (default build only) - - os: ubuntu-24.04-arm + - os: ubuntu-26.04-arm bolt: false free-threading: false test-opts: '-u cpu' @@ -270,7 +270,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-24.04] + os: [ubuntu-26.04] ssllib: # See Tools/ssl/make_ssl_data.py for notes on adding a new version ## OpenSSL @@ -346,7 +346,7 @@ jobs: - arch: aarch64 runs-on: macos-26 - arch: x86_64 - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 runs-on: ${{ matrix.runs-on }} steps: @@ -393,7 +393,7 @@ jobs: test-hypothesis: name: "Hypothesis tests on Ubuntu" - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 timeout-minutes: 60 needs: build-context if: needs.build-context.outputs.run-ubuntu == 'true' @@ -504,7 +504,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-24.04] + os: [ubuntu-26.04] env: OPENSSL_VER: 3.5.7 PYTHONSTRICTEXTENSIONBUILD: 1 diff --git a/.github/workflows/jit.yml b/.github/workflows/jit.yml index 025ff7ecbeeaff..994e35858ff992 100644 --- a/.github/workflows/jit.yml +++ b/.github/workflows/jit.yml @@ -29,7 +29,7 @@ env: jobs: interpreter: name: Interpreter (Debug) - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 timeout-minutes: 60 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -145,9 +145,9 @@ jobs: - false include: - target: x86_64-unknown-linux-gnu/gcc - runner: ubuntu-24.04 + runner: ubuntu-26.04 - target: aarch64-unknown-linux-gnu/gcc - runner: ubuntu-24.04-arm + runner: ubuntu-26.04-arm steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: @@ -171,7 +171,7 @@ jobs: linux-extras: name: ${{ matrix.name }} - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 timeout-minutes: 60 strategy: fail-fast: false diff --git a/.github/workflows/reusable-docs.yml b/.github/workflows/reusable-docs.yml index 7b524569f85c9e..e00967e2413a66 100644 --- a/.github/workflows/reusable-docs.yml +++ b/.github/workflows/reusable-docs.yml @@ -95,7 +95,7 @@ jobs: # Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release doctest: name: 'Doctest' - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 timeout-minutes: 60 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/.github/workflows/reusable-emscripten.yml b/.github/workflows/reusable-emscripten.yml index 38e6dcceb8f47c..c14a41b5682877 100644 --- a/.github/workflows/reusable-emscripten.yml +++ b/.github/workflows/reusable-emscripten.yml @@ -12,7 +12,7 @@ env: jobs: build-emscripten-reusable: name: 'build and test' - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 timeout-minutes: 40 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/.github/workflows/reusable-san.yml b/.github/workflows/reusable-san.yml index ef36447964cf41..d53fa86c70265b 100644 --- a/.github/workflows/reusable-san.yml +++ b/.github/workflows/reusable-san.yml @@ -26,7 +26,7 @@ jobs: && ' (free-threading)' || '' }} - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 timeout-minutes: 60 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/.github/workflows/reusable-wasi.yml b/.github/workflows/reusable-wasi.yml index 4b4888c3844409..2643b438c2a7a8 100644 --- a/.github/workflows/reusable-wasi.yml +++ b/.github/workflows/reusable-wasi.yml @@ -12,7 +12,7 @@ env: jobs: build-wasi-reusable: name: 'build and test' - runs-on: ubuntu-24.04-arm + runs-on: ubuntu-26.04-arm timeout-minutes: 60 env: WASMTIME_VERSION: 38.0.3 diff --git a/.github/workflows/tail-call.yml b/.github/workflows/tail-call.yml index 656a14906b3cb7..fcfecc85f83409 100644 --- a/.github/workflows/tail-call.yml +++ b/.github/workflows/tail-call.yml @@ -66,13 +66,13 @@ jobs: matrix: include: - target: x86_64-unknown-linux-gnu/gcc - runner: ubuntu-24.04 + runner: ubuntu-26.04 configure_flags: --with-pydebug - target: x86_64-unknown-linux-gnu/gcc-free-threading - runner: ubuntu-24.04 + runner: ubuntu-26.04 configure_flags: --disable-gil - target: aarch64-unknown-linux-gnu/gcc - runner: ubuntu-24.04-arm + runner: ubuntu-26.04-arm configure_flags: --with-pydebug steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/Python/getcompiler.c b/Python/getcompiler.c index cc56ad8c895551..1381a278f80149 100644 --- a/Python/getcompiler.c +++ b/Python/getcompiler.c @@ -24,6 +24,7 @@ #endif /* !COMPILER */ + const char * Py_GetCompiler(void) { From 875b36e3c501f51c77d892ed0c575ea7dcc3ca83 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 1 Jul 2026 02:14:59 +0200 Subject: [PATCH 02/12] posix-deps-apt.sh: remove lzma-dev --- .github/workflows/posix-deps-apt.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/posix-deps-apt.sh b/.github/workflows/posix-deps-apt.sh index f241fccdeb2a32..1b4c9b13539726 100755 --- a/.github/workflows/posix-deps-apt.sh +++ b/.github/workflows/posix-deps-apt.sh @@ -19,7 +19,6 @@ apt-get -yq --no-install-recommends install \ libssl-dev \ libzstd-dev \ lzma \ - lzma-dev \ strace \ tk-dev \ uuid-dev \ From 3930e105375b631b36ebf8f3eac2b0438a73c7b9 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 1 Jul 2026 02:18:42 +0200 Subject: [PATCH 03/12] add an explicit dependency to curl --- .github/workflows/posix-deps-apt.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/posix-deps-apt.sh b/.github/workflows/posix-deps-apt.sh index 1b4c9b13539726..aeec15b66a3b7e 100755 --- a/.github/workflows/posix-deps-apt.sh +++ b/.github/workflows/posix-deps-apt.sh @@ -5,6 +5,7 @@ apt-get -yq --no-install-recommends install \ build-essential \ pkg-config \ cmake \ + curl \ gdb \ lcov \ libb2-dev \ From 8ab2cee5d5bc8fbd6f9e6e800615c8f5b7689fc6 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 1 Jul 2026 02:49:27 +0200 Subject: [PATCH 04/12] Fix prek: allow ubuntu-26.04 and ubuntu-26.04-arm images --- .github/actionlint.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml index eacfff24889021..51bcdecde12005 100644 --- a/.github/actionlint.yaml +++ b/.github/actionlint.yaml @@ -1,5 +1,12 @@ config-variables: null +# At 2026-07-01, ubuntu-26.04 is not self hosted, but a "public preview" not +# recognized by actionlint yet. +self-hosted-runner: + labels: + - ubuntu-26.04 + - ubuntu-26.04-arm + paths: .github/workflows/**/*.yml: ignore: From dd14ce0dd0dd12f2bd61488b97b4bcb5964762fb Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 1 Jul 2026 02:52:58 +0200 Subject: [PATCH 05/12] Upgrade LLVM from 19 to 22 --- .github/workflows/reusable-ubuntu.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reusable-ubuntu.yml b/.github/workflows/reusable-ubuntu.yml index f4321cefa1b598..4396f0887ffdc9 100644 --- a/.github/workflows/reusable-ubuntu.yml +++ b/.github/workflows/reusable-ubuntu.yml @@ -49,9 +49,9 @@ jobs: - name: Install Clang and BOLT if: ${{ fromJSON(inputs.bolt-optimizations) }} run: | - sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh 19 - sudo apt-get install --no-install-recommends bolt-19 - echo PATH="$(llvm-config-19 --bindir):$PATH" >> $GITHUB_ENV + sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh 22 + sudo apt-get install --no-install-recommends bolt-22 + echo PATH="$(llvm-config-22 --bindir):$PATH" >> $GITHUB_ENV - name: Configure OpenSSL env vars run: | echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV" From 52c983ee4e1eccd0940cc24344b4b88482e60b3a Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 1 Jul 2026 02:54:47 +0200 Subject: [PATCH 06/12] SAN: upgrade LLVM from 20 to 22 --- .github/workflows/reusable-san.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/reusable-san.yml b/.github/workflows/reusable-san.yml index d53fa86c70265b..6b2f8fc5d65460 100644 --- a/.github/workflows/reusable-san.yml +++ b/.github/workflows/reusable-san.yml @@ -40,11 +40,11 @@ jobs: # Install clang wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh - sudo ./llvm.sh 20 - sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-20 100 - sudo update-alternatives --set clang /usr/bin/clang-20 - sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-20 100 - sudo update-alternatives --set clang++ /usr/bin/clang++-20 + sudo ./llvm.sh 22 + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-22 100 + sudo update-alternatives --set clang /usr/bin/clang-22 + sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-22 100 + sudo update-alternatives --set clang++ /usr/bin/clang++-22 if [ "${SANITIZER}" = "TSan" ]; then # Reduce ASLR to avoid TSan crashing From f5ac4d6286bc5e71d96f5c38510e174ca40d499c Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 1 Jul 2026 02:56:13 +0200 Subject: [PATCH 07/12] Tail-call: Upgrade LLVM from 21 to 22 --- .github/workflows/tail-call.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tail-call.yml b/.github/workflows/tail-call.yml index fcfecc85f83409..5ca1db9bd517c5 100644 --- a/.github/workflows/tail-call.yml +++ b/.github/workflows/tail-call.yml @@ -20,7 +20,7 @@ concurrency: env: FORCE_COLOR: 1 - LLVM_VERSION: 21 + LLVM_VERSION: 22 jobs: macos: From 7a6f2735aacd9fe977530d4320e80d88b9ee89fa Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 1 Jul 2026 02:57:40 +0200 Subject: [PATCH 08/12] Touch Python/bytecodes.c to trigger JIT compiler jobs --- Python/bytecodes.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 7fb48516e2eae7..88e80877f22b4f 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -6,6 +6,7 @@ // The actual instruction definitions start at // BEGIN BYTECODES //. // See Tools/cases_generator/README.md for more information. + #include "Python.h" #include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_audit.h" // _PySys_Audit() From 27b16d8565d5c2647ca996008f0e2481e7213796 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 1 Jul 2026 03:08:49 +0200 Subject: [PATCH 09/12] Address Sanitizer uses Ubuntu default GCC version --- .github/workflows/build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 620325b475fe41..e4a5f1c7770b9e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -519,10 +519,6 @@ jobs: run: echo "::add-matcher::.github/problem-matchers/gcc.json" - name: Install dependencies run: sudo ./.github/workflows/posix-deps-apt.sh - - name: Set up GCC-10 for ASAN - uses: egor-tensin/setup-gcc@a2861a8b8538f49cf2850980acccf6b05a1b2ae4 # v2.0 - with: - version: 10 - name: Configure OpenSSL env vars run: | echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV" From da66235f0d512b2c603dd23f6e3329bd475c9863 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 1 Jul 2026 03:23:48 +0200 Subject: [PATCH 10/12] DEBUG: Android: Run gradlew with --stacktrace --debug --- Platforms/Android/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platforms/Android/__main__.py b/Platforms/Android/__main__.py index 063e1f31603144..644c2c10174099 100755 --- a/Platforms/Android/__main__.py +++ b/Platforms/Android/__main__.py @@ -663,7 +663,7 @@ async def gradle_task(context): context.args[0:0] = ["-m", "test"] args = [ - gradlew, "--console", "plain", f"{task_prefix}DebugAndroidTest", + gradlew, "--stacktrace", "--debug", "--console", "plain", f"{task_prefix}DebugAndroidTest", ] + [ f"-P{name}={value}" for name, value in [ From a07822ed24c3f67cc6477969aa864a22c1316ec1 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 1 Jul 2026 03:50:12 +0200 Subject: [PATCH 11/12] Android uses Java 11 Revert "DEBUG: Android: Run gradlew with --stacktrace --debug" --- .github/workflows/build.yml | 6 ++++++ Platforms/Android/__main__.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e4a5f1c7770b9e..672c4627b48d09 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -354,6 +354,12 @@ jobs: with: persist-credentials: false - name: Build and test + env: + # Gradle 8 doesn't work on Java 25 + # https://github.com/gradle/gradle/issues/35111 + # https://github.com/gradle/gradle/issues/35401 + JAVA_HOME: $(JAVA_HOME_11_X64) + PATH: $(JAVA_HOME_11_X64)/bin:$(PATH) run: python3 Platforms/Android ci --fast-ci ${{ matrix.arch }}-linux-android build-ios: diff --git a/Platforms/Android/__main__.py b/Platforms/Android/__main__.py index 644c2c10174099..063e1f31603144 100755 --- a/Platforms/Android/__main__.py +++ b/Platforms/Android/__main__.py @@ -663,7 +663,7 @@ async def gradle_task(context): context.args[0:0] = ["-m", "test"] args = [ - gradlew, "--stacktrace", "--debug", "--console", "plain", f"{task_prefix}DebugAndroidTest", + gradlew, "--console", "plain", f"{task_prefix}DebugAndroidTest", ] + [ f"-P{name}={value}" for name, value in [ From ec2ae381e090dbdc4ef1abe765ea463ce5b55382 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 1 Jul 2026 04:04:54 +0200 Subject: [PATCH 12/12] Hack Android job --- .github/workflows/build.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 672c4627b48d09..7bd831c6bea3b1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -353,14 +353,10 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false + - name: Dump environment + run: env - name: Build and test - env: - # Gradle 8 doesn't work on Java 25 - # https://github.com/gradle/gradle/issues/35111 - # https://github.com/gradle/gradle/issues/35401 - JAVA_HOME: $(JAVA_HOME_11_X64) - PATH: $(JAVA_HOME_11_X64)/bin:$(PATH) - run: python3 Platforms/Android ci --fast-ci ${{ matrix.arch }}-linux-android + run: JAVA_HOME="${JAVA_HOME_17_X64:-$JAVA_HOME_17_arm64}" python3 Platforms/Android ci --fast-ci ${{ matrix.arch }}-linux-android build-ios: name: iOS