Skip to content

Commit 50df04e

Browse files
authored
Merge branch 'main' into 42664-dup-cookie-fix
2 parents e6a739b + 1726902 commit 50df04e

File tree

1,641 files changed

+98299
-43373
lines changed

Some content is hidden

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

1,641 files changed

+98299
-43373
lines changed

.devcontainer/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM docker.io/library/fedora:37
1+
FROM docker.io/library/fedora:40
22

33
ENV CC=clang
44

5-
ENV WASI_SDK_VERSION=20
5+
ENV WASI_SDK_VERSION=21
66
ENV WASI_SDK_PATH=/opt/wasi-sdk
77

88
ENV WASMTIME_HOME=/opt/wasmtime
9-
ENV WASMTIME_VERSION=14.0.4
9+
ENV WASMTIME_VERSION=18.0.3
1010
ENV WASMTIME_CPU_ARCH=x86_64
1111

1212
RUN dnf -y --nodocs --setopt=install_weak_deps=False install /usr/bin/{blurb,clang,curl,git,ln,tar,xz} 'dnf-command(builddep)' && \

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ Include/opcode_ids.h generated
8383
Include/token.h generated
8484
Lib/_opcode_metadata.py generated
8585
Lib/keyword.py generated
86+
Lib/test/certdata/*.pem generated
87+
Lib/test/certdata/*.0 generated
8688
Lib/test/levenshtein_examples.json generated
8789
Lib/test/test_stable_abi_ctypes.py generated
8890
Lib/token.py generated

.github/CODEOWNERS

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Python/dynload_*.c @ericsnowcurrently
119119
Lib/test/test_module/ @ericsnowcurrently
120120
Doc/c-api/module.rst @ericsnowcurrently
121121
**/*importlib/resources/* @jaraco @warsaw @FFY00
122-
**/importlib/metadata/* @jaraco @warsaw
122+
**/*importlib/metadata/* @jaraco @warsaw
123123

124124
# Dates and times
125125
**/*datetime* @pganssle @abalkin
@@ -243,6 +243,18 @@ Lib/test/support/interpreters/ @ericsnowcurrently
243243
Modules/_xx*interp*module.c @ericsnowcurrently
244244
Lib/test/test_interpreters/ @ericsnowcurrently
245245

246+
# Android
247+
**/*Android* @mhsmith
248+
**/*android* @mhsmith
249+
250+
# iOS (but not termios)
251+
**/iOS* @freakboy3742
252+
**/ios* @freakboy3742
253+
**/*_iOS* @freakboy3742
254+
**/*_ios* @freakboy3742
255+
**/*-iOS* @freakboy3742
256+
**/*-ios* @freakboy3742
257+
246258
# WebAssembly
247259
/Tools/wasm/ @brettcannon
248260

.github/workflows/build.yml

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,11 @@ on:
88
push:
99
branches:
1010
- 'main'
11-
- '3.12'
12-
- '3.11'
13-
- '3.10'
14-
- '3.9'
15-
- '3.8'
11+
- '3.*'
1612
pull_request:
1713
branches:
1814
- 'main'
19-
- '3.12'
20-
- '3.11'
21-
- '3.10'
22-
- '3.9'
23-
- '3.8'
15+
- '3.*'
2416

2517
permissions:
2618
contents: read
@@ -97,7 +89,7 @@ jobs:
9789
- name: Get a list of the changed documentation-related files
9890
if: github.event_name == 'pull_request'
9991
id: changed-docs-files
100-
uses: Ana06/get-changed-files@v2.2.0
92+
uses: Ana06/get-changed-files@v2.3.0
10193
with:
10294
filter: |
10395
Doc/**
@@ -137,6 +129,7 @@ jobs:
137129
uses: actions/cache@v4
138130
with:
139131
path: config.cache
132+
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
140133
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
141134
- name: Install Dependencies
142135
run: sudo ./.github/workflows/posix-deps-apt.sh
@@ -206,6 +199,8 @@ jobs:
206199
uses: ./.github/workflows/reusable-macos.yml
207200
with:
208201
config_hash: ${{ needs.check_source.outputs.config_hash }}
202+
# macos-14 is M1, macos-13 is Intel
203+
os-matrix: '["macos-14", "macos-13"]'
209204

210205
build_macos_free_threading:
211206
name: 'macOS (free-threading)'
@@ -215,6 +210,8 @@ jobs:
215210
with:
216211
config_hash: ${{ needs.check_source.outputs.config_hash }}
217212
free-threading: true
213+
# macos-14-large is Intel with 12 cores (most parallelism)
214+
os-matrix: '["macos-14"]'
218215

219216
build_ubuntu:
220217
name: 'Ubuntu'
@@ -245,7 +242,7 @@ jobs:
245242
246243
build_ubuntu_ssltests:
247244
name: 'Ubuntu SSL tests with OpenSSL'
248-
runs-on: ubuntu-20.04
245+
runs-on: ubuntu-22.04
249246
timeout-minutes: 60
250247
needs: check_source
251248
if: needs.check_source.outputs.run_tests == 'true'
@@ -301,9 +298,17 @@ jobs:
301298
- name: SSL tests
302299
run: ./python Lib/test/ssltests.py
303300

301+
build_wasi:
302+
name: 'WASI'
303+
needs: check_source
304+
if: needs.check_source.outputs.run_tests == 'true'
305+
uses: ./.github/workflows/reusable-wasi.yml
306+
with:
307+
config_hash: ${{ needs.check_source.outputs.config_hash }}
308+
304309
test_hypothesis:
305310
name: "Hypothesis tests on Ubuntu"
306-
runs-on: ubuntu-20.04
311+
runs-on: ubuntu-22.04
307312
timeout-minutes: 60
308313
needs: check_source
309314
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
@@ -416,7 +421,7 @@ jobs:
416421

417422
build_asan:
418423
name: 'Address sanitizer'
419-
runs-on: ubuntu-20.04
424+
runs-on: ubuntu-22.04
420425
timeout-minutes: 60
421426
needs: check_source
422427
if: needs.check_source.outputs.run_tests == 'true'
@@ -472,6 +477,28 @@ jobs:
472477
- name: Tests
473478
run: xvfb-run make test
474479

480+
build_tsan:
481+
name: 'Thread sanitizer'
482+
needs: check_source
483+
if: needs.check_source.outputs.run_tests == 'true'
484+
uses: ./.github/workflows/reusable-tsan.yml
485+
with:
486+
config_hash: ${{ needs.check_source.outputs.config_hash }}
487+
options: ./configure --config-cache --with-thread-sanitizer --with-pydebug
488+
suppressions_path: Tools/tsan/supressions.txt
489+
tsan_logs_artifact_name: tsan-logs-default
490+
491+
build_tsan_free_threading:
492+
name: 'Thread sanitizer (free-threading)'
493+
needs: check_source
494+
if: needs.check_source.outputs.run_tests == 'true'
495+
uses: ./.github/workflows/reusable-tsan.yml
496+
with:
497+
config_hash: ${{ needs.check_source.outputs.config_hash }}
498+
options: ./configure --config-cache --disable-gil --with-thread-sanitizer --with-pydebug
499+
suppressions_path: Tools/tsan/suppressions_free_threading.txt
500+
tsan_logs_artifact_name: tsan-logs-free-threading
501+
475502
# CIFuzz job based on https://google.github.io/oss-fuzz/getting-started/continuous-integration/
476503
cifuzz:
477504
name: CIFuzz
@@ -525,10 +552,13 @@ jobs:
525552
- build_ubuntu
526553
- build_ubuntu_free_threading
527554
- build_ubuntu_ssltests
555+
- build_wasi
528556
- build_windows
529557
- build_windows_free_threading
530558
- test_hypothesis
531559
- build_asan
560+
- build_tsan
561+
- build_tsan_free_threading
532562
- cifuzz
533563

534564
runs-on: ubuntu-latest
@@ -558,9 +588,12 @@ jobs:
558588
build_ubuntu,
559589
build_ubuntu_free_threading,
560590
build_ubuntu_ssltests,
591+
build_wasi,
561592
build_windows,
562593
build_windows_free_threading,
563594
build_asan,
595+
build_tsan,
596+
build_tsan_free_threading,
564597
'
565598
|| ''
566599
}}

.github/workflows/jit.yml

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,22 @@ on:
55
- '**jit**'
66
- 'Python/bytecodes.c'
77
- 'Python/optimizer*.c'
8-
- 'Python/optimizer_bytecodes.c'
8+
- '!Python/perf_jit_trampoline.c'
9+
- '!**/*.md'
10+
- '!**/*.ini'
911
push:
1012
paths:
1113
- '**jit**'
1214
- 'Python/bytecodes.c'
1315
- 'Python/optimizer*.c'
14-
- 'Python/optimizer_bytecodes.c'
16+
- '!Python/perf_jit_trampoline.c'
17+
- '!**/*.md'
18+
- '!**/*.ini'
1519
workflow_dispatch:
1620

21+
permissions:
22+
contents: read
23+
1724
concurrency:
1825
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1926
cancel-in-progress: true
@@ -22,13 +29,14 @@ jobs:
2229
jit:
2330
name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }})
2431
runs-on: ${{ matrix.runner }}
25-
timeout-minutes: 60
32+
timeout-minutes: 90
2633
strategy:
2734
fail-fast: false
2835
matrix:
2936
target:
3037
- i686-pc-windows-msvc/msvc
3138
- x86_64-pc-windows-msvc/msvc
39+
- aarch64-pc-windows-msvc/msvc
3240
- x86_64-apple-darwin/clang
3341
- aarch64-apple-darwin/clang
3442
- x86_64-unknown-linux-gnu/gcc
@@ -39,7 +47,7 @@ jobs:
3947
- true
4048
- false
4149
llvm:
42-
- 16
50+
- 18
4351
include:
4452
- target: i686-pc-windows-msvc/msvc
4553
architecture: Win32
@@ -49,6 +57,10 @@ jobs:
4957
architecture: x64
5058
runner: windows-latest
5159
compiler: msvc
60+
- target: aarch64-pc-windows-msvc/msvc
61+
architecture: ARM64
62+
runner: windows-latest
63+
compiler: msvc
5264
- target: x86_64-apple-darwin/clang
5365
architecture: x86_64
5466
runner: macos-13
@@ -69,14 +81,10 @@ jobs:
6981
architecture: aarch64
7082
runner: ubuntu-latest
7183
compiler: gcc
72-
# These fail because of emulation, not because of the JIT:
73-
exclude: test_unix_events test_init test_process_pool test_shutdown test_multiprocessing_fork test_cmd_line test_faulthandler test_os test_perf_profiler test_posix test_signal test_socket test_subprocess test_threading test_venv test_external_inspection
7484
- target: aarch64-unknown-linux-gnu/clang
7585
architecture: aarch64
7686
runner: ubuntu-latest
7787
compiler: clang
78-
# These fail because of emulation, not because of the JIT:
79-
exclude: test_unix_events test_init test_process_pool test_shutdown test_multiprocessing_fork test_cmd_line test_faulthandler test_os test_perf_profiler test_posix test_signal test_socket test_subprocess test_threading test_venv test_external_inspection
8088
env:
8189
CC: ${{ matrix.compiler }}
8290
steps:
@@ -85,33 +93,46 @@ jobs:
8593
with:
8694
python-version: '3.11'
8795

88-
- name: Windows
89-
if: runner.os == 'Windows'
96+
- name: Native Windows
97+
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
9098
run: |
99+
choco upgrade llvm -y
91100
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
92101
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '--pgo' }} -p ${{ matrix.architecture }}
93-
./PCbuild/rt.bat ${{ matrix.debug && '-d' }} -p ${{ matrix.architecture }} -q --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
102+
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
103+
104+
# No PGO or tests (yet):
105+
- name: Emulated Windows
106+
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
107+
run: |
108+
choco upgrade llvm -y
109+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
110+
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
94111
95-
- name: macOS
112+
- name: Native macOS
96113
if: runner.os == 'macOS'
97114
run: |
115+
brew update
98116
brew install llvm@${{ matrix.llvm }}
99-
export SDKROOT="$(xcrun --show-sdk-path)"
100-
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
117+
SDKROOT="$(xcrun --show-sdk-path)" \
118+
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
101119
make all --jobs 4
102-
./python.exe -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
120+
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
103121
122+
# --with-lto has been removed temporarily as a result of an open issue in LLVM 18 (see https://github.com/llvm/llvm-project/issues/87553)
104123
- name: Native Linux
105124
if: runner.os == 'Linux' && matrix.architecture == 'x86_64'
106125
run: |
107126
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
108127
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
109-
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
128+
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations' }}
110129
make all --jobs 4
111-
./python -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
130+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
112131
132+
# --with-lto has been removed temporarily as a result of an open issue in LLVM 18 (see https://github.com/llvm/llvm-project/issues/87553)
113133
- name: Emulated Linux
114134
if: runner.os == 'Linux' && matrix.architecture != 'x86_64'
135+
# The --ignorefile on ./python -m test is used to exclude tests known to fail when running on an emulated Linux.
115136
run: |
116137
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
117138
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
@@ -122,10 +143,10 @@ jobs:
122143
sudo apt install --yes "gcc-$HOST" qemu-user
123144
${{ !matrix.debug && matrix.compiler == 'clang' && './configure --enable-optimizations' || '' }}
124145
${{ !matrix.debug && matrix.compiler == 'clang' && 'make profile-run-stamp --jobs 4' || '' }}
125-
export CC="${{ matrix.compiler == 'clang' && 'clang --target=$HOST' || '$HOST-gcc' }}"
126-
export CPP="$CC --preprocess"
127-
export HOSTRUNNER=qemu-${{ matrix.architecture }}
128146
export QEMU_LD_PREFIX="/usr/$HOST"
129-
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }} --build=x86_64-linux-gnu --host="$HOST" --with-build-python=../build/bin/python3 --with-pkg-config=no ac_cv_buggy_getaddrinfo=no ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes
147+
CC="${{ matrix.compiler == 'clang' && 'clang --target=$HOST' || '$HOST-gcc' }}" \
148+
CPP="$CC --preprocess" \
149+
HOSTRUNNER=qemu-${{ matrix.architecture }} \
150+
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations ' }} --build=x86_64-linux-gnu --host="$HOST" --with-build-python=../build/bin/python3 --with-pkg-config=no ac_cv_buggy_getaddrinfo=no ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes
130151
make all --jobs 4
131-
./python -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
152+
./python -m test --ignorefile=Tools/jit/ignore-tests-emulated-linux.txt --multiprocess 0 --timeout 4500 --verbose2 --verbose3

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
- uses: actions/setup-python@v5
2424
with:
2525
python-version: "3.x"
26-
- uses: pre-commit/[email protected].0
26+
- uses: pre-commit/[email protected].1

.github/workflows/mypy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
pull_request:
99
paths:
1010
- ".github/workflows/mypy.yml"
11+
- "Lib/_pyrepl/**"
1112
- "Lib/test/libregrtest/**"
1213
- "Tools/build/generate_sbom.py"
1314
- "Tools/cases_generator/**"
@@ -35,8 +36,9 @@ jobs:
3536
strategy:
3637
matrix:
3738
target: [
39+
"Lib/_pyrepl",
3840
"Lib/test/libregrtest",
39-
"Tools/build/",
41+
"Tools/build",
4042
"Tools/cases_generator",
4143
"Tools/clinic",
4244
"Tools/jit",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ apt-get -yq install \
1515
libgdbm-dev \
1616
libgdbm-compat-dev \
1717
liblzma-dev \
18+
libmpdec-dev \
1819
libncurses5-dev \
1920
libreadline6-dev \
2021
libsqlite3-dev \

.github/workflows/project-updater.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- { project: 32, label: sprint }
2424

2525
steps:
26-
- uses: actions/add-to-project@v0.1.0
26+
- uses: actions/add-to-project@v1.0.0
2727
with:
2828
project-url: https://github.com/orgs/python/projects/${{ matrix.project }}
2929
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}

0 commit comments

Comments
 (0)