8000 Merge branch 'main' into gh-129824-concurrent-futures · colesbury/cpython@bd5e796 · GitHub
[go: up one dir, main page]

Skip to content

Commit bd5e796

Browse files
authored
Merge branch 'main' into pythongh-129824-concurrent-futures
2 parents aab035b + 2498c22 commit bd5e796

File tree

479 files changed

+17018
-9928
lines changed

Some content is hidden

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

479 files changed

+17018
-9928
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ Objects/exceptions.c @iritkatriel
106106

107107
# Hashing & cryptographic primitives
108108
**/*hashlib* @gpshead @tiran @picnixz
109+
**/*hashopenssl* @gpshead @tiran @picnixz
109110
**/*pyhash* @gpshead @tiran
110111
**/sha* @gpshead @tiran @picnixz
111112
Modules/md5* @gpshead @tiran @picnixz

.github/workflows/build.yml

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ jobs:
6262
with:
6363
fetch-depth: 1
6464
persist-credentials: false
65-
- name: Runner image version
66-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
6765
- name: Check Autoconf and aclocal versions
6866
run: |
6967
grep "Generated by GNU Autoconf 2.72" configure
@@ -104,14 +102,14 @@ jobs:
104102
with:
105103
python-version: '3.x'
106104
- name: Runner image version
107-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
105+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
108106
- name: Restore config.cache
109107
uses: actions/cache@v4
110108
with:
111109
path: config.cache
112110
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
113-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.build-context.outputs.config-hash }}-${{ env.pythonLocation }}
114-
- name: Install Dependencies
111+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}-${{ env.pythonLocation }}
112+
- name: Install dependencies
115113
run: sudo ./.github/workflows/posix-deps-apt.sh
116114
- name: Add ccache to PATH
117115
run: echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
@@ -154,7 +152,7 @@ jobs:
154152
Windows
155153
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
156154
needs: build-context
157-
if: fromJSON(needs.build-context.outputs.run-tests)
155+
if: fromJSON(needs.build-context.outputs.run-windows-tests)
158156
strategy:
159157
fail-fast: false
160158
matrix:
@@ -247,13 +245,13 @@ jobs:
247245
- true
248246
os:
249247
- ubuntu-24.04
250-
- ubuntu-24.04-arm
248+
- ubuntu-22.04-arm
251249
exclude:
252250
# Do not test BOLT with free-threading, to conserve resources
253251
- bolt: true
254252
free-threading: true
255253
# BOLT currently crashes during instrumentation on aarch64
256-
- os: ubuntu-24.04-arm
254+
- os: ubuntu-22.04-arm
257255
bolt: true
258256
uses: ./.github/workflows/reusable-ubuntu.yml
259257
with:
@@ -284,15 +282,15 @@ jobs:
284282
with:
285283
persist-credentials: false
286284
- name: Runner image version
287-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
285+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
288286
- name: Restore config.cache
289287
uses: actions/cache@v4
290288
with:
291289
path: config.cache
292-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.build-context.outputs.config-hash }}
290+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
293291
- name: Register gcc problem matcher
294292
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
295-
- name: Install Dependencies
293+
- name: Install dependencies
296294
run: sudo ./.github/workflows/posix-deps-apt.sh
297295
- name: Configure OpenSSL env vars
298296
run: |
@@ -347,7 +345,7 @@ jobs:
347345
persist-credentials: false
348346
- name: Register gcc problem matcher
349347
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
350-
- name: Install Dependencies
348+
- name: Install dependencies
351349
run: sudo ./.github/workflows/posix-deps-apt.sh
352350
- name: Configure OpenSSL env vars
353351
run: |
@@ -379,12 +377,12 @@ jobs:
379377
- name: Bind mount sources read-only
380378
run: sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
381379
- name: Runner image version
382-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
380+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
383381
- name: Restore config.cache
384382
uses: actions/cache@v4
385383
with:
386384
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
387-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.build-context.outputs.config-hash }}
385+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
388386
- name: Configure CPython out-of-tree
389387
working-directory: ${{ env.CPYTHON_BUILDDIR }}
390388
run: |
@@ -466,15 +464,15 @@ jobs:
466464
with:
467465
persist-credentials: false
468466
- name: Runner image version
469-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
467+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
470468
- name: Restore config.cache
471469
uses: actions/cache@v4
472470
with:
473471
path: config.cache
474-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.build-context.outputs.config-hash }}
472+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
475473
- name: Register gcc problem matcher
476474
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
477-
- name: Install Dependencies
475+
- name: Install dependencies
478476
run: sudo ./.github/workflows/posix-deps-apt.sh
479477
- name: Set up GCC-10 for ASAN
480478
uses: egor-tensin/setup-gcc@v1
@@ -537,19 +535,19 @@ jobs:
537535
with:
538536
persist-credentials: false
539537
- name: Runner image version
540-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
538+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
541539
- name: Restore config.cache
542540
uses: actions/cache@v4
543541
with:
544542
path: config.cache
545-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.build-context.outputs.config-hash }}
543+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
546544
- name: Register gcc problem matcher
547545
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
548546
- name: Set build dir
549547
run:
550548
# an absolute path outside of the working directoy
551549
echo "BUILD_DIR=$(realpath ${{ github.workspace }}/../build)" >> "$GITHUB_ENV"
552-
- name: Install Dependencies
550+
- name: Install dependencies
553551
run: sudo ./.github/workflows/posix-deps-apt.sh
554552
- name: Configure host build
555553
run: ./configure --prefix="$BUILD_DIR/host-python"
@@ -621,6 +619,7 @@ jobs:
621619
- build_wasi
622620
- build_windows
623621
- build_windows_msi
622+
- cross-build-linux
624623
- test_hypothesis
625624
- build_asan
626625
- build_tsan
@@ -654,10 +653,17 @@ jobs:
654653
build_ubuntu,
655654
build_ubuntu_ssltests,
656655
build_wasi,
657-
build_windows,
658656
build_asan,
659657
build_tsan,
660658
test_hypothesis,
659+
cross-build-linux,
660+
'
661+
|| ''
662+
}}
663+
${{
664+
!fromJSON(needs.build-context.outputs.run-windows-tests)
665+
&& '
666+
build_windows,
661667
'
662668
|| ''
663669
}}

.github/workflows/jit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
runner: ubuntu-24.04
8787
- target: aarch64-unknown-linux-gnu/gcc
8888
architecture: aarch64
89-
runner: ubuntu-24.04-arm
89+
runner: ubuntu-22.04-arm
9090
steps:
9191
- uses: actions/checkout@v4
9292
with:

.github/workflows/reusable-context.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ on: # yamllint disable-line rule:truthy
2626
run-tests:
2727
description: Whether to run the regular tests
2828
value: ${{ jobs.compute-changes.outputs.run-tests }} # bool
29+
run-windows-tests:
30+
description: Whether to run the Windows tests
31+
value: ${{ jobs.compute-changes.outputs.run-windows-tests }} # bool
2932
run-windows-msi:
3033
description: Whether to run the MSI installer smoke tests
3134
value: ${{ jobs.compute-changes.outputs.run-windows-msi }} # bool
@@ -44,6 +47,7 @@ jobs:
4447
run-docs: ${{ steps.changes.outputs.run-docs }}
4548
run-tests: ${{ steps.changes.outputs.run-tests }}
4649
run-windows-msi: ${{ steps.changes.outputs.run-windows-msi }}
50+
run-windows-tests: ${{ steps.changes.outputs.run-windows-tests }}
4751
steps:
4852
- name: Set up Python
4953
uses: actions/setup-python@v5

.github/workflows/reusable-macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ jobs:
3535
with:
3636
persist-credentials: false
3737
- name: Runner image version
38-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
38+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
3939
- name: Restore config.cache
4040
uses: actions/cache@v4
4141
with:
4242
path: config.cache
43-
key: ${{ github.job }}-${{ inputs.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
43+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ inputs.config_hash }}
4444
- name: Install Homebrew dependencies
4545
run: |
4646
brew install pkg-config openssl@3.0 xz gdbm tcl-tk@8 make

.github/workflows/reusable-tsan.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ jobs:
2525
with:
2626
persist-credentials: false
2727
- name: Runner image version
28-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
28+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
2929
- name: Restore config.cache
3030
uses: actions/cache@v4
3131
with:
3232
path: config.cache
33-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
34-
- name: Install Dependencies
33+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ inputs.config_hash }}
34+
- name: Install dependencies
3535
run: |
3636
sudo ./.github/workflows/posix-deps-apt.sh
3737
# Install clang-18
@@ -44,7 +44,7 @@ jobs:
4444
sudo update-alternatives --set clang++ /usr/bin/clang++-17
4545
# Reduce ASLR to avoid TSAN crashing
4646
sudo sysctl -w vm.mmap_rnd_bits=28
47-
- name: TSAN Option Setup
47+
- name: TSAN option setup
4848
run: |
4949
echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/Tools/tsan/suppressions${{
5050
fromJSON(inputs.free-threading)

.github/workflows/reusable-ubuntu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ jobs:
7878
- name: Bind mount sources read-only
7979
run: sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
8080
- name: Runner image version
81-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
81+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
8282
- name: Restore config.cache
8383
uses: actions/cache@v4
8484
with:
8585
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
86-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
86+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ inputs.config_hash }}
8787
- name: Configure CPython out-of-tree
8888
working-directory: ${{ env.CPYTHON_BUILDDIR }}
8989
# `test_unpickle_module_race` writes to the source directory, which is

.github/workflows/reusable-wasi.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,16 @@ jobs:
5353
uses: actions/setup-python@v5
5454
with:
5555
python-version: '3.x'
56+
- name: "Runner image version"
57+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
5658
- name: "Restore Python build config.cache"
5759
uses: actions/cache@v4
5860
with:
5961
path: ${{ env.CROSS_BUILD_PYTHON }}/config.cache
6062
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python.
6163
# Include the hash of `Tools/wasm/wasi.py` as it may change the environment variables.
6264
# (Make sure to keep the key in sync with the other config.cache step below.)
63-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ env.WASI_SDK_VERSION }}-${{ env.WASMTIME_VERSION }}-${{ inputs.config_hash }}-${{ hashFiles('Tools/wasm/wasi.py') }}-${{ env.pythonLocation }}
65+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ env.WASI_SDK_VERSION }}-${{ env.WASMTIME_VERSION }}-${{ inputs.config_hash }}-${{ hashFiles('Tools/wasm/wasi.py') }}-${{ env.pythonLocation }}
6466
- name: "Configure build Python"
6567
run: python3 Tools/wasm/wasi.py configure-build-python -- --config-cache --with-pydebug
6668
- name: "Make build Python"
@@ -70,7 +72,7 @@ jobs:
7072
with:
7173
path: ${{ env.CROSS_BUILD_WASI }}/config.cache
7274
# Should be kept in sync with the other config.cache step above.
73-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ env.WASI_SDK_VERSION }}-${{ env.WASMTIME_VERSION }}-${{ inputs.config_hash }}-${{ hashFiles('Tools/wasm/wasi.py') }}-${{ env.pythonLocation }}
75+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ env.WASI_SDK_VERSION }}-${{ env.WASMTIME_VERSION }}-${{ inputs.config_hash }}-${{ hashFiles('Tools/wasm/wasi.py') }}-${{ env.pythonLocation }}
7476
- name: "Configure host"
7577
# `--with-pydebug` inferred from configure-build-python
7678
run: python3 Tools/wasm/wasi.py configure-host -- --config-cache

.github/workflows/tail-call.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ on:
55
- 'Python/bytecodes.c'
66
- 'Python/ceval.c'
77
- 'Python/ceval_macros.h'
8+
- 'Python/generated_cases.c.h'
89
push:
910
paths:
1011
- 'Python/bytecodes.c'
1112
- 'Python/ceval.c'
1213
- 'Python/ceval_macros.h'
14+
- 'Python/generated_cases.c.h'
1315
workflow_dispatch:
1416

1517
permissions:
@@ -39,6 +41,7 @@ jobs:
3941
- aarch64-apple-darwin/clang
4042
- x86_64-unknown-linux-gnu/gcc
4143
- aarch64-unknown-linux-gnu/gcc
44+
- free-threading
4245
llvm:
4346
- 19
4447
include:
@@ -62,7 +65,10 @@ jobs:
6265
runner: ubuntu-24.04
6366
- target: aarch64-unknown-linux-gnu/gcc
6467
architecture: aarch64
65-
runner: ubuntu-24.04-arm
68+
runner: ubuntu-22.04-arm
69+
- target: free-threading
70+
architecture: x86_64
71+
runner: ubuntu-24.04
6672
steps:
6773
- uses: actions/checkout@v4
6874
with:
@@ -103,11 +109,20 @@ jobs:
103109
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
104110
105111
- name: Native Linux (release)
106-
if: runner.os == 'Linux'
112+
if: runner.os == 'Linux' && matrix.target != 'free-threading'
107113
run: |
108114
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
109115
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
110116
CC=clang-19 ./configure --with-tail-call-interp
111117
make all --jobs 4
112118
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
113119
120+
- name: Native Linux with free-threading (release)
121+
if: matrix.target == 'free-threading'
122+
run: |
123+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
124+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
125+
CC=clang-19 ./configure --with-tail-call-interp --disable-gil
126+
make all --jobs 4
127+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
128+

Android/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ stderr. Add the `-v` option to also show Gradle output, and non-Python logcat
119119
messages.
120120

121121
Any other arguments on the `android.py test` command line will be passed through
122-
to `python -m test` use `--` to separate them from android.py's own options.
122+
to `python -m test` use `--` to separate them from android.py's own options.
123123
See the [Python Developer's
124124
Guide](https://devguide.python.org/testing/run-write-tests/) for common options
125-
 most of them will work on Android, except for those that involve subprocesses,
125+
most of them will work on Android, except for those that involve subprocesses,
126126
such as `-j`.
127127

128128
Every time you run `android.py test`, changes in pure-Python files in the

0 commit comments

Comments
 (0)
0