Skip to content

Commit 92e011b

Browse files
vstinnerhugovk
andcommitted
gh-152785: Upgrade Ubuntu from 24.04 to 26.04 in GitHub Actions (#152717)
* Replace "ubuntu-24.04" with "ubuntu-26.04". * Replace "ubuntu-latest" with "ubuntu-26.04" for Cross build Linux. * Replace "ubuntu-latest" with "ubuntu-slim" for small workloads. * Update ".github/actionlint.yaml" to allow "ubuntu-26.04" and "ubuntu-26.04-arm" images. * Install Ubuntu libmpdec-dev package, rather than installing libmpdec from source (tarball). * No longer run https://apt.llvm.org/llvm.sh, since ubuntu-26.04 provides clang-21 by default. Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> (cherry picked from commit 4c79929)
1 parent 6404803 commit 92e011b

15 files changed

Lines changed: 43 additions & 60 deletions

.github/actionlint.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
config-variables: null
22

3+
# Pending release of actionlint > 1.7.12 for ubuntu-26.04* support:
4+
# https://github.com/rhysd/actionlint/pull/683
5+
self-hosted-runner:
6+
labels:
7+
- ubuntu-26.04
8+
- ubuntu-26.04-arm
9+
310
paths:
411
.github/workflows/**/*.yml:
512
ignore:

.github/workflows/add-issue-header.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions:
1717

1818
jobs:
1919
add-header:
20-
runs-on: ubuntu-latest
20+
runs-on: ubuntu-slim
2121
permissions:
2222
issues: write
2323
timeout-minutes: 5

.github/workflows/build.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
name: 'Check if Autoconf files are up to date'
101101
# Don't use ubuntu-latest but a specific version to make the job
102102
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
103-
runs-on: ubuntu-24.04
103+
runs-on: ubuntu-26.04
104104
container:
105105
image: ghcr.io/python/autoconf:2025.01.02.12581854023
106106
timeout-minutes: 60
@@ -143,7 +143,7 @@ jobs:
143143
name: 'Check if generated files are up to date'
144144
# Don't use ubuntu-latest but a specific version to make the job
145145
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
146-
runs-on: ubuntu-24.04
146+
runs-on: ubuntu-26.04
147147
timeout-minutes: 60
148148
needs: build-context
149149
if: needs.build-context.outputs.run-tests == 'true'
@@ -286,18 +286,18 @@ jobs:
286286
- false
287287
- true
288288
os:
289-
- ubuntu-24.04
290-
- ubuntu-24.04-arm
289+
- ubuntu-26.04
290+
- ubuntu-26.04-arm
291291
exclude:
292292
# Do not test BOLT with free-threading, to conserve resources
293293
- bolt: true
294294
free-threading: true
295295
# BOLT currently crashes during instrumentation on aarch64
296-
- os: ubuntu-24.04-arm
296+
- os: ubuntu-26.04-arm
297297
bolt: true
298298
include:
299299
# Enable CPU-intensive tests on ARM (default build only)
300-
- os: ubuntu-24.04-arm
300+
- os: ubuntu-26.04-arm
301301
bolt: false
302302
free-threading: false
303303
test-opts: '-u cpu'
@@ -317,7 +317,7 @@ jobs:
317317
strategy:
318318
fail-fast: false
319319
matrix:
320-
os: [ubuntu-24.04]
320+
os: [ubuntu-26.04]
321321
ssllib:
322322
# See Tools/ssl/make_ssl_data.py for notes on adding a new version
323323
## OpenSSL
@@ -393,7 +393,7 @@ jobs:
393393
- arch: aarch64
394394
runs-on: macos-26
395395
- arch: x86_64
396-
runs-on: ubuntu-24.04
396+
runs-on: ubuntu-26.04
397397

398398
runs-on: ${{ matrix.runs-on }}
399399
steps:
@@ -440,7 +440,7 @@ jobs:
440440

441441
test-hypothesis:
442442
name: "Hypothesis tests on Ubuntu"
443-
runs-on: ubuntu-24.04
443+
runs-on: ubuntu-26.04
444444
timeout-minutes: 60
445445
needs: build-context
446446
if: needs.build-context.outputs.run-ubuntu == 'true'
@@ -551,7 +551,7 @@ jobs:
551551
strategy:
552552
fail-fast: false
553553
matrix:
554-
os: [ubuntu-24.04]
554+
os: [ubuntu-26.04]
555555
env:
556556
OPENSSL_VER: 3.5.7
557557
PYTHONSTRICTEXTENSIONBUILD: 1
@@ -625,7 +625,7 @@ jobs:
625625

626626
cross-build-linux:
627627
name: Cross build Linux
628-
runs-on: ubuntu-latest
628+
runs-on: ubuntu-26.04
629629
timeout-minutes: 60
630630
needs: build-context
631631
if: needs.build-context.outputs.run-ubuntu == 'true'

.github/workflows/jit.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ env:
2929
jobs:
3030
interpreter:
3131
name: Interpreter (Debug)
32-
runs-on: ubuntu-24.04
32+
runs-on: ubuntu-26.04
3333
timeout-minutes: 60
3434
steps:
3535
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -145,9 +145,9 @@ jobs:
145145
- false
146146
include:
147147
- target: x86_64-unknown-linux-gnu/gcc
148-
runner: ubuntu-24.04
148+
runner: ubuntu-26.04
149149
- target: aarch64-unknown-linux-gnu/gcc
150-
runner: ubuntu-24.04-arm
150+
runner: ubuntu-26.04-arm
151151
steps:
152152
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
153153
with:
@@ -160,8 +160,7 @@ jobs:
160160
sudo ./.github/workflows/posix-deps-apt.sh
161161
- name: Build
162162
run: |
163-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ env.LLVM_VERSION }}
164-
export PATH="$(llvm-config-${{ env.LLVM_VERSION }} --bindir):$PATH"
163+
# On ubuntu-26.04 image, clang is clang-21 by default
165164
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '' }}
166165
make all --jobs 4
167166
- name: Test
@@ -171,7 +170,7 @@ jobs:
171170
linux-extras:
172171
name: ${{ matrix.name }}
173172

174-
runs-on: ubuntu-24.04
173+
runs-on: ubuntu-26.04
175174
timeout-minutes: 60
176175
strategy:
177176
fail-fast: false
@@ -202,8 +201,7 @@ jobs:
202201
sudo ./.github/workflows/posix-deps-apt.sh
203202
- name: Build
204203
run: |
205-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ env.LLVM_VERSION }}
206-
export PATH="$(llvm-config-${{ env.LLVM_VERSION }} --bindir):$PATH"
204+
# On ubuntu-26.04 image, clang is clang-21 by default
207205
if [ "${{ matrix.use_clang }}" = "true" ]; then
208206
export CC=clang-${{ env.LLVM_VERSION }}
209207
fi

.github/workflows/new-bugs-announce-notifier.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010

1111
jobs:
1212
notify-new-bugs-announce:
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-slim
1414
permissions:
1515
issues: read
1616
timeout-minutes: 10

.github/workflows/posix-deps-apt.sh

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,23 @@ apt-get -yq --no-install-recommends install \
55
build-essential \
66
pkg-config \
77
cmake \
8+
curl \
89
gdb \
910
lcov \
1011
libb2-dev \
1112
libbz2-dev \
1213
libffi-dev \
13-
libgdbm-dev \
1414
libgdbm-compat-dev \
15+
libgdbm-dev \
1516
liblzma-dev \
17+
libmpdec-dev \
1618
libncurses5-dev \
1719
libreadline6-dev \
1820
libsqlite3-dev \
1921
libssl-dev \
2022
libzstd-dev \
21-
lzma \
22-
lzma-dev \
2323
strace \
2424
tk-dev \
2525
uuid-dev \
2626
xvfb \
2727
zlib1g-dev
28-
29-
# Workaround missing libmpdec-dev on ubuntu 24.04 by building mpdecimal
30-
# from source. ppa:ondrej/php (launchpad.net) are unreliable
31-
# (https://status.canonical.com) so fetch the tarball directly
32-
# from the upstream host.
33-
# https://www.bytereef.org/mpdecimal/
34-
MPDECIMAL_VERSION=4.0.1
35-
curl -fsSL "https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-${MPDECIMAL_VERSION}.tar.gz" \
36-
| tar -xz -C /tmp
37-
(cd "/tmp/mpdecimal-${MPDECIMAL_VERSION}" \
38-
&& ./configure --prefix=/usr/local \
39-
&& make -j"$(nproc)" \
40-
&& make install)
41-
ldconfig

.github/workflows/require-pr-label.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
label-dnm:
1212
name: DO-NOT-MERGE
1313
if: github.repository_owner == 'python'
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-slim
1515
permissions:
1616
pull-requests: read
1717
timeout-minutes: 10
@@ -28,7 +28,7 @@ jobs:
2828
label-reviews:
2929
name: Unresolved review
3030
if: github.repository_owner == 'python'
31-
runs-on: ubuntu-latest
31+
runs-on: ubuntu-slim
3232
permissions:
3333
pull-requests: read
3434
timeout-minutes: 10

.github/workflows/reusable-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
107107
doctest:
108108
name: 'Doctest'
109-
runs-on: ubuntu-24.04
109+
runs-on: ubuntu-26.04
110110
timeout-minutes: 60
111111
steps:
112112
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/reusable-emscripten.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ env:
1212
jobs:
1313
build-emscripten-reusable:
1414
name: 'build and test'
15-
runs-on: ubuntu-24.04
15+
runs-on: ubuntu-26.04
1616
timeout-minutes: 40
1717
steps:
1818
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/reusable-san.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
&& ' (free-threading)'
2828
|| ''
2929
}}
30-
runs-on: ubuntu-24.04
30+
runs-on: ubuntu-26.04
3131
timeout-minutes: 60
3232
steps:
3333
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -38,14 +38,7 @@ jobs:
3838
- name: Install dependencies
3939
run: |
4040
sudo ./.github/workflows/posix-deps-apt.sh
41-
# Install clang
42-
wget https://apt.llvm.org/llvm.sh
43-
chmod +x llvm.sh
44-
sudo ./llvm.sh 21
45-
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-21 100
46-
sudo update-alternatives --set clang /usr/bin/clang-21
47-
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-21 100
48-
sudo update-alternatives --set clang++ /usr/bin/clang++-21
41+
# On ubuntu-26.04 image, clang is clang-21 by default
4942
echo "CC=clang" >> "$GITHUB_ENV"
5043
echo "CXX=clang++" >> "$GITHUB_ENV"
5144
- name: TSan option setup

0 commit comments

Comments
 (0)