Skip to content

Commit de70708

Browse files
authored
Merge branch '3.11' into backport-120384-3.11
2 parents 391eb41 + 3511c2e commit de70708

File tree

105 files changed

+23892
-14267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+23892
-14267
lines changed

.github/workflows/build.yml

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
name: Tests
22

3-
# gh-84728: "paths-ignore" is not used to skip documentation-only PRs, because
4-
# it prevents to mark a job as mandatory. A PR cannot be merged if a job is
5-
# mandatory but not scheduled because of "paths-ignore".
63
on:
74
workflow_dispatch:
85
push:
96
branches:
107
- 'main'
11-
- '3.11'
12-
- '3.10'
13-
- '3.9'
14-
- '3.8'
8+
- '3.*'
159
pull_request:
1610
branches:
1711
- 'main'
18-
- '3.11'
19-
- '3.10'
20-
- '3.9'
21-
- '3.8'
12+
- '3.*'
2213

2314
permissions:
2415
contents: read
@@ -27,6 +18,9 @@ concurrency:
2718
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-reusable
2819
cancel-in-progress: true
2920

21+
env:
22+
FORCE_COLOR: 1
23+
3024
jobs:
3125
check_source:
3226
name: 'Check for source changes'
@@ -93,11 +87,13 @@ jobs:
9387

9488
check_abi:
9589
name: 'Check if the ABI has changed'
96-
runs-on: ubuntu-20.04
90+
runs-on: ubuntu-22.04 # 24.04 causes spurious errors
9791
needs: check_source
9892
if: needs.check_source.outputs.run_tests == 'true'
9993
steps:
10094
- uses: actions/checkout@v4
95+
with:
96+
persist-credentials: false
10197
- uses: actions/setup-python@v5
10298
- name: Install dependencies
10399
run: |
@@ -136,26 +132,31 @@ jobs:
136132

137133
check_generated_files:
138134
name: 'Check if generated files are up to date'
139-
runs-on: ubuntu-latest
135+
# Don't use ubuntu-latest but a specific version to make the job
136+
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
137+
runs-on: ubuntu-24.04
140138
timeout-minutes: 60
141139
needs: check_source
142140
if: needs.check_source.outputs.run_tests == 'true'
143141
steps:
144142
- uses: actions/checkout@v4
143+
with:
144+
persist-credentials: false
145145
- uses: actions/setup-python@v5
146146
with:
147147
python-version: '3.x'
148148
- name: Runner image version
149-
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
149+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
150150
- name: Restore config.cache
151151
uses: actions/cache@v4
152152
with:
153153
path: config.cache
154-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
155-
- name: Install Dependencies
154+
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
155+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
156+
- name: Install dependencies
156157
run: sudo ./.github/workflows/posix-deps-apt.sh
157158
- name: Add ccache to PATH
158-
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
159+
run: echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
159160
- name: Configure ccache action
160161
uses: hendrikmuhs/[email protected]
161162
with:
@@ -227,49 +228,52 @@ jobs:
227228
228229
build_ubuntu_ssltests:
229230
name: 'Ubuntu SSL tests with OpenSSL'
230-
runs-on: ubuntu-20.04
231+
runs-on: ${{ matrix.os }}
231232
timeout-minutes: 60
232233
needs: check_source
233234
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_ssl_tests == 'true'
234235
strategy:
235236
fail-fast: false
236237
matrix:
237-
openssl_ver: [1.1.1w, 3.0.13, 3.1.5, 3.2.1]
238+
os: [ubuntu-24.04]
239+
openssl_ver: [1.1.1w, 3.0.15, 3.1.7, 3.2.3]
238240
env:
239241
OPENSSL_VER: ${{ matrix.openssl_ver }}
240242
MULTISSL_DIR: ${{ github.workspace }}/multissl
241243
OPENSSL_DIR: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}
242244
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
243245
steps:
244246
- uses: actions/checkout@v4
247+
with:
248+
persist-credentials: false
245249
- name: Runner image version
246-
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
250+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
247251
- name: Restore config.cache
248252
uses: actions/cache@v4
249253
with:
250254
path: config.cache
251-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}
255+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.check_source.outputs.config_hash }}
252256
- name: Register gcc problem matcher
253257
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
254-
- name: Install Dependencies
258+
- name: Install dependencies
255259
run: sudo ./.github/workflows/posix-deps-apt.sh
256260
- name: Configure OpenSSL env vars
257261
run: |
258-
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
259-
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
260-
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
262+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
263+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> "$GITHUB_ENV"
264+
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> "$GITHUB_ENV"
261265
- name: 'Restore OpenSSL build'
262266
id: cache-openssl
263267
uses: actions/cache@v4
264268
with:
265269
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
266-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
270+
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
267271
- name: Install OpenSSL
268272
if: steps.cache-openssl.outputs.cache-hit != 'true'
269-
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
273+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
270274
- name: Add ccache to PATH
271275
run: |
272-
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
276+
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
273277
- name: Configure ccache action
274278
uses: hendrikmuhs/[email protected]
275279
with:
@@ -285,48 +289,50 @@ jobs:
285289

286290
build_asan:
287291
name: 'Address sanitizer'
288-
runs-on: ubuntu-20.04
292+
runs-on: ubuntu-22.04
289293
timeout-minutes: 60
290294
needs: check_source
291295
if: needs.check_source.outputs.run_tests == 'true'
292296
env:
293-
OPENSSL_VER: 3.0.13
297+
OPENSSL_VER: 3.0.15
294298
PYTHONSTRICTEXTENSIONBUILD: 1
295299
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
296300
steps:
297301
- uses: actions/checkout@v4
302+
with:
303+
persist-credentials: false
298304
- name: Runner image version
299-
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
305+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
300306
- name: Restore config.cache
301307
uses: actions/cache@v4
302308
with:
303309
path: config.cache
304-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}
310+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.check_source.outputs.config_hash }}
305311
- name: Register gcc problem matcher
306312
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
307-
- name: Install Dependencies
313+
- name: Install dependencies
308314
run: sudo ./.github/workflows/posix-deps-apt.sh
309315
- name: Set up GCC-10 for ASAN
310316
uses: egor-tensin/setup-gcc@v1
311317
with:
312318
version: 10
313319
- name: Configure OpenSSL env vars
314320
run: |
315-
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
316-
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
317-
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
321+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
322+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> "$GITHUB_ENV"
323+
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> "$GITHUB_ENV"
318324
- name: 'Restore OpenSSL build'
319325
id: cache-openssl
320326
uses: actions/cache@v4
321327
with:
322328
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
323-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
329+
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
324330
- name: Install OpenSSL
325331
if: steps.cache-openssl.outputs.cache-hit != 'true'
326-
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
332+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
327333
- name: Add ccache to PATH
328334
run: |
329-
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
335+
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
330336
- name: Configure ccache action
331337
uses: hendrikmuhs/[email protected]
332338
with:

.github/workflows/reusable-macos.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,17 @@ jobs:
3030
steps:
3131
- uses: actions/checkout@v4
3232
- name: Runner image version
33-
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
33+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
3434
- name: Restore config.cache
3535
uses: actions/cache@v4
3636
with:
3737
path: config.cache
38-
key: ${{ github.job }}-${{ matrix.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
38+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ inputs.config_hash }}
3939
- name: Install Homebrew dependencies
40-
run: brew install pkg-config [email protected] xz gdbm tcl-tk
40+
run: |
41+
brew install pkg-config [email protected] xz gdbm tcl-tk@8
42+
# Because alternate versions are not symlinked into place by default:
43+
brew link --overwrite tcl-tk@8
4144
- name: Configure CPython
4245
run: |
4346
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \

.github/workflows/reusable-ubuntu.yml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,57 +8,66 @@ on:
88
required: true
99
type: string
1010

11+
env:
12+
FORCE_COLOR: 1
13+
1114
jobs:
1215
build_ubuntu_reusable:
1316
name: 'build and test'
1417
timeout-minutes: 60
15-
runs-on: ubuntu-20.04
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [ubuntu-22.04]
1623
env:
17-
OPENSSL_VER: 3.0.13
24+
OPENSSL_VER: 3.0.15
1825
PYTHONSTRICTEXTENSIONBUILD: 1
1926
steps:
2027
- uses: actions/checkout@v4
28+
with:
29+
persist-credentials: false
2130
- name: Register gcc problem matcher
2231
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
2332
- name: Install dependencies
2433
run: sudo ./.github/workflows/posix-deps-apt.sh
2534
- name: Configure OpenSSL env vars
2635
run: |
27-
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
28-
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
29-
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
36+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
37+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> "$GITHUB_ENV"
38+
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> "$GITHUB_ENV"
3039
- name: 'Restore OpenSSL build'
3140
id: cache-openssl
3241
uses: actions/cache@v4
3342
with:
3443
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
35-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
44+
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
3645
- name: Install OpenSSL
3746
if: steps.cache-openssl.outputs.cache-hit != 'true'
38-
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
47+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
3948
- name: Add ccache to PATH
4049
run: |
41-
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
50+
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
4251
- name: Configure ccache action
4352
uses: hendrikmuhs/[email protected]
4453
with:
4554
save: ${{ github.event_name == 'push' }}
4655
max-size: "200M"
4756
- name: Setup directory envs for out-of-tree builds
4857
run: |
49-
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
50-
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
58+
echo "CPYTHON_RO_SRCDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-ro-srcdir)" >> "$GITHUB_ENV"
59+
echo "CPYTHON_BUILDDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-builddir)" >> "$GITHUB_ENV"
5160
- name: Create directories for read-only out-of-tree builds
52-
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
61+
run: mkdir -p "$CPYTHON_RO_SRCDIR" "$CPYTHON_BUILDDIR"
5362
- name: Bind mount sources read-only
54-
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
63+
run: sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
5564
- name: Runner image version
56-
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
65+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
5766
- name: Restore config.cache
5867
uses: actions/cache@v4
5968
with:
6069
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
61-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
70+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ inputs.config_hash }}
6271
- name: Configure CPython out-of-tree
6372
working-directory: ${{ env.CPYTHON_BUILDDIR }}
6473
run: ${{ inputs.options }}
@@ -70,7 +79,7 @@ jobs:
7079
run: make pythoninfo
7180
- name: Remount sources writable for tests
7281
# some tests write to srcdir, lack of pyc files slows down testing
73-
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
82+
run: sudo mount "$CPYTHON_RO_SRCDIR" -oremount,rw
7483
- name: Tests
7584
working-directory: ${{ env.CPYTHON_BUILDDIR }}
7685
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"

0 commit comments

Comments
 (0)