40
40
if : fromJSON(needs.check_source.outputs.run-docs)
41
41
uses : ./.github/workflows/reusable-docs.yml
42
42
43
+ check_autoconf_regen :
44
+ name : ' Check if Autoconf files are up to date'
45
+ # Don't use ubuntu-latest but a specific version to make the job
46
+ # reproducible: to get the same tools versions (autoconf, aclocal, ...)
47
+ runs-on : ubuntu-24.04
48
+ container :
49
+ image : ghcr.io/python/autoconf:2024.10.16.11360930377
50
+ timeout-minutes : 60
51
+ needs : check_source
52
+ if : needs.check_source.outputs.run_tests == 'true'
53
+ steps :
54
+ - name : Install Git
55
+ run : |
56
+ apt install git -yq
57
+ git config --global --add safe.directory "$GITHUB_WORKSPACE"
58
+ - uses : actions/checkout@v4
59
+ with :
60
+ fetch-depth : 1
61
+ - name : Runner image version
62
+ run : echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
63
+ - name : Check Autoconf and aclocal versions
64
+ run : |
65
+ grep "Generated by GNU Autoconf 2.71" configure
66
+ grep "aclocal 1.16.5" aclocal.m4
67
+ grep -q "runstatedir" configure
68
+ grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
69
+ - name : Regenerate autoconf files
70
+ # Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
71
+ run : autoreconf -ivf -Werror
72
+ - name : Check for changes
73
+ run : |
74
+ git add -u
75
+ changes=$(git status --porcelain)
76
+ # Check for changes in regenerated files
77
+ if test -n "$changes"; then
78
+ echo "Generated files not up to date."
79
+ echo "Perhaps you forgot to run make regen-all or build.bat --regen. ;)"
80
+ echo "configure files must be regenerated with a specific version of autoconf."
81
+ echo "$changes"
82
+ echo ""
83
+ git diff --staged || true
84
+ exit 1
85
+ fi
86
+
43
87
check_generated_files :
44
88
name : ' Check if generated files are up to date'
45
89
# Don't use ubuntu-latest but a specific version to make the job
54
98
with :
55
99
python-version : ' 3.x'
56
100
- name : Runner image version
57
- run : echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
101
+ run : echo "IMAGE_VERSION=${ImageVersion}" >> " $GITHUB_ENV"
58
102
- name : Restore config.cache
59
103
uses : actions/cache@v4
60
104
with :
@@ -64,24 +108,15 @@ jobs:
64
108
- name : Install Dependencies
65
109
run : sudo ./.github/workflows/posix-deps-apt.sh
66
110
- name : Add ccache to PATH
67
- run : echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
111
+ run : echo "PATH=/usr/lib/ccache:$PATH" >> " $GITHUB_ENV"
68
112
- name : Configure ccache action
69
113
uses :
hendrikmuhs/[email protected]
70
114
with :
71
115
save : false
72
- - name : Check Autoconf and aclocal versions
73
- run : |
74
- grep "Generated by GNU Autoconf 2.71" configure
75
- grep "aclocal 1.16.5" aclocal.m4
76
- grep -q "runstatedir" configure
77
- grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
78
116
- name : Configure CPython
79
117
run : |
80
118
# Build Python with the libpython dynamic library
81
119
./configure --config-cache --with-pydebug --enable-shared
82
- - name : Regenerate autoconf files
83
- # Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
84
- run : autoreconf -ivf -Werror
85
120
- name : Build CPython
86
121
run : |
87
122
make -j4 regen-all
@@ -212,7 +247,7 @@ jobs:
212
247
steps :
213
248
- uses : actions/checkout@v4
214
249
- name : Runner image version
215
- run : echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
250
+ run : echo "IMAGE_VERSION=${ImageVersion}" >> " $GITHUB_ENV"
216
251
- name : Restore config.cache
217
252
uses : actions/cache@v4
218
253
with :
@@ -224,9 +259,9 @@ jobs:
224
259
run : sudo ./.github/workflows/posix-deps-apt.sh
225
260
- name : Configure OpenSSL env vars
226
261
run : |
227
- echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
228
- echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
229
- 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"
230
265
- name : ' Restore OpenSSL build'
231
266
id : cache-openssl
232
267
uses : actions/cache@v4
@@ -235,16 +270,16 @@ jobs:
235
270
key : ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
236
271
- name : Install OpenSSL
237
272
if : steps.cache-openssl.outputs.cache-hit != 'true'
238
- 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
239
274
- name : Add ccache to PATH
240
275
run : |
241
- echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
276
+ echo "PATH=/usr/lib/ccache:$PATH" >> " $GITHUB_ENV"
242
277
- name : Configure ccache action
243
278
uses :
hendrikmuhs/[email protected]
244
279
with :
245
280
save : false
246
281
- name : Configure CPython
247
- run : ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl=$OPENSSL_DIR
282
+ run : ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl=" $OPENSSL_DIR"
248
283
- name : Build CPython
249
284
run : make -j4
250
285
- name : Display build info
@@ -277,9 +312,9 @@ jobs:
277
312
run : sudo ./.github/workflows/posix-deps-apt.sh
278
313
- name : Configure OpenSSL env vars
279
314
run : |
280
- echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
281
- echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
282
- echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
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"
283
318
- name : ' Restore OpenSSL build'
284
319
id : cache-openssl
285
320
uses : actions/cache@v4
@@ -288,24 +323,24 @@ jobs:
288
323
key : ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
289
324
- name : Install OpenSSL
290
325
if : steps.cache-openssl.outputs.cache-hit != 'true'
291
- run : python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
326
+ run : python3 Tools/ssl/multissltests.py --steps=library --base-directory " $MULTISSL_DIR" --openssl " $OPENSSL_VER" --system Linux
292
327
- name : Add ccache to PATH
293
328
run : |
294
- echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
329
+ echo "PATH=/usr/lib/ccache:$PATH" >> " $GITHUB_ENV"
295
330
- name : Configure ccache action
296
331
uses :
hendrikmuhs/[email protected]
297
332
with :
298
333
save : false
299
334
- name : Setup directory envs for out-of-tree builds
300
335
run : |
301
- echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
302
- echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
336
+ echo "CPYTHON_RO_SRCDIR=$(realpath -m " ${GITHUB_WORKSPACE}" /../cpython-ro-srcdir)" >> " $GITHUB_ENV"
337
+ echo "CPYTHON_BUILDDIR=$(realpath -m " ${GITHUB_WORKSPACE}" /../cpython-builddir)" >> " $GITHUB_ENV"
303
338
- name : Create directories for read-only out-of-tree builds
304
- run : mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
339
+ run : mkdir -p " $CPYTHON_RO_SRCDIR" " $CPYTHON_BUILDDIR"
305
340
- name : Bind mount sources read-only
306
- run : sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
341
+ run : sudo mount --bind -o ro " $GITHUB_WORKSPACE" " $CPYTHON_RO_SRCDIR"
307
342
- name : Runner image version
308
- run : echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
343
+ run : echo "IMAGE_VERSION=${ImageVersion}" >> " $GITHUB_ENV"
309
344
- name : Restore config.cache
310
345
uses : actions/cache@v4
311
346
with :
@@ -318,7 +353,7 @@ jobs:
318
353
--config-cache \
319
354
--with-pydebug \
320
355
--enable-slower-safety \
321
- --with-openssl=$OPENSSL_DIR
356
+ --with-openssl=" $OPENSSL_DIR"
322
357
- name : Build CPython out-of-tree
323
358
working-directory : ${{ env.CPYTHON_BUILDDIR }}
324
359
run : make -j4
@@ -327,18 +362,18 @@ jobs:
327
362
run : make pythoninfo
328
363
- name : Remount sources writable for tests
329
364
# some tests write to srcdir, lack of pyc files slows down testing
330
- run : sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
365
+ run : sudo mount " $CPYTHON_RO_SRCDIR" -oremount,rw
331
366
- name : Setup directory envs for out-of-tree builds
332
367
run : |
333
- echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
368
+ echo "CPYTHON_BUILDDIR=$(realpath -m " ${GITHUB_WORKSPACE}" /../cpython-builddir)" >> " $GITHUB_ENV"
334
369
- name : " Create hypothesis venv"
335
370
working-directory : ${{ env.CPYTHON_BUILDDIR }}
336
371
run : |
337
372
VENV_LOC=$(realpath -m .)/hypovenv
338
373
VENV_PYTHON=$VENV_LOC/bin/python
339
- echo "HYPOVENV=${VENV_LOC}" >> $GITHUB_ENV
340
- echo "VENV_PYTHON=${VENV_PYTHON}" >> $GITHUB_ENV
341
- ./python -m venv $VENV_LOC && $VENV_PYTHON -m pip install -r ${GITHUB_WORKSPACE}/Tools/requirements-hypothesis.txt
374
+ echo "HYPOVENV=${VENV_LOC}" >> " $GITHUB_ENV"
375
+ echo "VENV_PYTHON=${VENV_PYTHON}" >> " $GITHUB_ENV"
376
+ ./python -m venv " $VENV_LOC" && " $VENV_PYTHON" -m pip install -r " ${GITHUB_WORKSPACE}/Tools/requirements-hypothesis.txt"
342
377
- name : ' Restore Hypothesis database'
343
378
id : cache-hypothesis-database
344
379
uses : actions/cache@v4
@@ -376,18 +411,21 @@ jobs:
376
411
377
412
build_asan :
378
413
name : ' Address sanitizer'
379
- runs-on : ubuntu-22.04
414
+ runs-on : ${{ matrix.os }}
380
415
timeout-minutes : 60
381
416
needs : check_source
382
417
if : needs.check_source.outputs.run_tests == 'true'
418
+ strategy :
419
+ matrix :
420
+ os : [ubuntu-22.04]
383
421
env :
384
422
OPENSSL_VER : 3.0.15
385
423
PYTHONSTRICTEXTENSIONBUILD : 1
386
424
ASAN_OPTIONS : detect_leaks=0:allocator_may_return_null=1:handle_segv=0
387
425
steps :
388
426
- uses : actions/checkout@v4
389
427
- name : Runner image version
390
- run : echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
428
+ run : echo "IMAGE_VERSION=${ImageVersion}" >> " $GITHUB_ENV"
391
429
- name : Restore config.cache
392
430
uses : actions/cache@v4
393
431
with :
@@ -403,9 +441,9 @@ jobs:
403
441
version : 10
404
442
- name : Configure OpenSSL env vars
405
443
run : |
406
- echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
407
- echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
408
- echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
444
+ echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> " $GITHUB_ENV"
445
+ echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> " $GITHUB_ENV"
446
+ echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> " $GITHUB_ENV"
409
447
- name : ' Restore OpenSSL build'
410
448
id : cache-openssl
411
449
uses : actions/cache@v4
@@ -414,10 +452,10 @@ jobs:
414
452
key : ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
415
453
- name : Install OpenSSL
416
454
if : steps.cache-openssl.outputs.cache-hit != 'true'
417
- run : python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
455
+ run : python3 Tools/ssl/multissltests.py --steps=library --base-directory " $MULTISSL_DIR" --openssl " $OPENSSL_VER" --system Linux
418
456
- name : Add ccache to PATH
419
457
run : |
420
- echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
458
+ echo "PATH=/usr/lib/ccache:$PATH" >> " $GITHUB_ENV"
421
459
- name : Configure ccache action
422
460
uses :
hendrikmuhs/[email protected]
423
461
with :
@@ -430,7 +468,7 @@ jobs:
430
468
- name : Display build info
431
469
run : make pythoninfo
432
470
- name : Tests
433
- run : xvfb-run make test
471
+ run : xvfb-run make ci
434
472
435
473
build_tsan :
436
474
name : ' Thread sanitizer'
@@ -501,6 +539,7 @@ jobs:
501
539
needs :
502
540
- check_source # Transitive dependency, needed to access `run_tests` value
503
541
- check-docs
542
+ - check_autoconf_regen
504
543
- check_generated_files
505
544
- build_macos
506
545
- build_ubuntu
@@ -536,6 +575,7 @@ jobs:
536
575
${{
537
576
needs.check_source.outputs.run_tests != 'true'
538
577
&& '
578
+ check_autoconf_regen,
539
579
check_generated_files,
540
580
build_macos,
541
581
build_ubuntu,
0 commit comments