Skip to content

Commit 2227748

Browse files
Merge branch 'main' into wip-inspect-multi-signature
2 parents 57f3abf + 90b7540 commit 2227748

1,414 files changed

Lines changed: 61479 additions & 23569 deletions

File tree

Some content is hidden

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

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.io/library/fedora:37
1+
FROM docker.io/library/fedora:40
22

33
ENV CC=clang
44

.github/CODEOWNERS

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,23 @@ Objects/type* @markshannon
2929
Objects/codeobject.c @markshannon
3030
Objects/frameobject.c @markshannon
3131
Objects/call.c @markshannon
32-
Python/ceval*.c @markshannon @gvanrossum
33-
Python/ceval*.h @markshannon @gvanrossum
32+
Python/ceval*.c @markshannon
33+
Python/ceval*.h @markshannon
3434
Python/compile.c @markshannon @iritkatriel
3535
Python/assemble.c @markshannon @iritkatriel
3636
Python/flowgraph.c @markshannon @iritkatriel
37+
Python/instruction_sequence.c @iritkatriel
3738
Python/ast_opt.c @isidentical
38-
Python/bytecodes.c @markshannon @gvanrossum
39-
Python/optimizer*.c @markshannon @gvanrossum
39+
Python/bytecodes.c @markshannon
40+
Python/optimizer*.c @markshannon
4041
Python/optimizer_analysis.c @Fidget-Spinner
4142
Python/optimizer_bytecodes.c @Fidget-Spinner
43+
Python/symtable.c @JelleZijlstra @carljm
44+
Lib/_pyrepl/* @pablogsal @lysnikolaou @ambv
4245
Lib/test/test_patma.py @brandtbucher
4346
Lib/test/test_type_*.py @JelleZijlstra
44-
Lib/test/test_capi/test_misc.py @markshannon @gvanrossum
47+
Lib/test/test_capi/test_misc.py @markshannon
48+
Lib/test/test_pyrepl/* @pablogsal @lysnikolaou @ambv
4549
Tools/c-analyzer/ @ericsnowcurrently
4650

4751
# dbm
@@ -72,11 +76,8 @@ Programs/python.c @ericsnowcurrently
7276
Tools/build/generate_global_objects.py @ericsnowcurrently
7377

7478
# Exceptions
75-
Lib/traceback.py @iritkatriel
7679
Lib/test/test_except*.py @iritkatriel
77-
Lib/test/test_traceback.py @iritkatriel
7880
Objects/exceptions.c @iritkatriel
79-
Python/traceback.c @iritkatriel
8081

8182
# Hashing
8283
**/*hashlib* @gpshead @tiran
@@ -150,13 +151,13 @@ Include/internal/pycore_time.h @pganssle @abalkin
150151
/Lib/test/test_tokenize.py @pablogsal @lysnikolaou
151152

152153
# Code generator
153-
/Tools/cases_generator/ @gvanrossum
154+
/Tools/cases_generator/ @markshannon
154155

155156
# AST
156-
Python/ast.c @isidentical
157-
Parser/asdl.py @isidentical
158-
Parser/asdl_c.py @isidentical
159-
Lib/ast.py @isidentical
157+
Python/ast.c @isidentical @JelleZijlstra
158+
Parser/asdl.py @isidentical @JelleZijlstra
159+
Parser/asdl_c.py @isidentical @JelleZijlstra
160+
Lib/ast.py @isidentical @JelleZijlstra
160161

161162
# Mock
162163
/Lib/unittest/mock.py @cjw296
@@ -173,6 +174,10 @@ Lib/ast.py @isidentical
173174
/Lib/test/test_subprocess.py @gpshead
174175
/Modules/*subprocess* @gpshead
175176

177+
# debugger
178+
**/*pdb* @gaogaotiantian
179+
**/*bdb* @gaogaotiantian
180+
176181
# Limited C API & stable ABI
177182
Tools/build/stable_abi.py @encukou
178183
Misc/stable_abi.toml @encukou
@@ -243,6 +248,18 @@ Lib/test/support/interpreters/ @ericsnowcurrently
243248
Modules/_xx*interp*module.c @ericsnowcurrently
244249
Lib/test/test_interpreters/ @ericsnowcurrently
245250

251+
# Android
252+
**/*Android* @mhsmith
253+
**/*android* @mhsmith
254+
255+
# iOS (but not termios)
256+
**/iOS* @freakboy3742
257+
**/ios* @freakboy3742
258+
**/*_iOS* @freakboy3742
259+
**/*_ios* @freakboy3742
260+
**/*-iOS* @freakboy3742
261+
**/*-ios* @freakboy3742
262+
246263
# WebAssembly
247264
/Tools/wasm/ @brettcannon
248265

.github/workflows/build.yml

Lines changed: 18 additions & 19 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
@@ -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,8 +199,9 @@ jobs:
206199
uses: ./.github/workflows/reusable-macos.yml
207200
with:
208201
config_hash: ${{ needs.check_source.outputs.config_hash }}
209-
# macos-14 is M1, macos-13 is Intel
210-
os-matrix: '["macos-14", "macos-13"]'
202+
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
203+
# Cirrus used for upstream, macos-14 for forks.
204+
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14", "macos-13"]'
211205

212206
build_macos_free_threading:
213207
name: 'macOS (free-threading)'
@@ -217,8 +211,9 @@ jobs:
217211
with:
218212
config_hash: ${{ needs.check_source.outputs.config_hash }}
219213
free-threading: true
220-
# macos-14 is M1
221-
os-matrix: '["macos-14"]'
214+
# Cirrus and macos-14 are M1.
215+
# Cirrus used for upstream, macos-14 for forks.
216+
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14"]'
222217

223218
build_ubuntu:
224219
name: 'Ubuntu'
@@ -249,7 +244,7 @@ jobs:
249244
250245
build_ubuntu_ssltests:
251246
name: 'Ubuntu SSL tests with OpenSSL'
252-
runs-on: ubuntu-20.04
247+
runs-on: ubuntu-22.04
253248
timeout-minutes: 60
254249
needs: check_source
255250
if: needs.check_source.outputs.run_tests == 'true'
@@ -315,7 +310,7 @@ jobs:
315310

316311
test_hypothesis:
317312
name: "Hypothesis tests on Ubuntu"
318-
runs-on: ubuntu-20.04
313+
runs-on: ubuntu-22.04
319314
timeout-minutes: 60
320315
needs: check_source
321316
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
@@ -395,7 +390,7 @@ jobs:
395390
id: cache-hypothesis-database
396391
uses: actions/cache@v4
397392
with:
398-
path: ./hypothesis
393+
path: ${{ env.CPYTHON_BUILDDIR }}/.hypothesis/
399394
key: hypothesis-database-${{ github.head_ref || github.run_id }}
400395
restore-keys: |
401396
- hypothesis-database-
@@ -423,12 +418,12 @@ jobs:
423418
if: always()
424419
with:
425420
name: hypothesis-example-db
426-
path: .hypothesis/examples/
421+
path: ${{ env.CPYTHON_BUILDDIR }}/.hypothesis/examples/
427422

428423

429424
build_asan:
430425
name: 'Address sanitizer'
431-
runs-on: ubuntu-20.04
426+
runs-on: ubuntu-22.04
432427
timeout-minutes: 60
433428
needs: check_source
434429
if: needs.check_source.outputs.run_tests == 'true'
@@ -492,6 +487,8 @@ jobs:
492487
with:
493488
config_hash: ${{ needs.check_source.outputs.config_hash }}
494489
options: ./configure --config-cache --with-thread-sanitizer --with-pydebug
490+
suppressions_path: Tools/tsan/supressions.txt
491+
tsan_logs_artifact_name: tsan-logs-default
495492

496493
build_tsan_free_threading:
497494
name: 'Thread sanitizer (free-threading)'
@@ -501,6 +498,8 @@ jobs:
501498
with:
502499
config_hash: ${{ needs.check_source.outputs.config_hash }}
503500
options: ./configure --config-cache --disable-gil --with-thread-sanitizer --with-pydebug
501+
suppressions_path: Tools/tsan/suppressions_free_threading.txt
502+
tsan_logs_artifact_name: tsan-logs-free-threading
504503

505504
# CIFuzz job based on https://google.github.io/oss-fuzz/getting-started/continuous-integration/
506505
cifuzz:

.github/workflows/jit.yml

Lines changed: 56 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,45 @@ on:
55
- '**jit**'
66
- 'Python/bytecodes.c'
77
- 'Python/optimizer*.c'
8+
- '!Python/perf_jit_trampoline.c'
9+
- '!**/*.md'
10+
- '!**/*.ini'
811
push:
912
paths:
1013
- '**jit**'
1114
- 'Python/bytecodes.c'
1215
- 'Python/optimizer*.c'
16+
- '!Python/perf_jit_trampoline.c'
17+
- '!**/*.md'
18+
- '!**/*.ini'
1319
workflow_dispatch:
1420

21+
permissions:
22+
contents: read
23+
1524
concurrency:
1625
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1726
cancel-in-progress: true
1827

1928
jobs:
29+
interpreter:
30+
name: Interpreter (Debug)
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 90
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Build tier two interpreter
36+
run: |
37+
./configure --enable-experimental-jit=interpreter --with-pydebug
38+
make all --jobs 4
39+
- name: Test tier two interpreter
40+
run: |
41+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
2042
jit:
2143
name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }})
44+
needs: interpreter
2245
runs-on: ${{ matrix.runner }}
23-
timeout-minutes: 75
46+
timeout-minutes: 90
2447
strategy:
2548
fail-fast: false
2649
matrix:
@@ -38,7 +61,7 @@ jobs:
3861
- true
3962
- false
4063
llvm:
41-
- 16
64+
- 18
4265
include:
4366
- target: i686-pc-windows-msvc/msvc
4467
architecture: Win32
@@ -72,14 +95,10 @@ jobs:
7295
architecture: aarch64
7396
runner: ubuntu-latest
7497
compiler: gcc
75-
# These fail because of emulation, not because of the JIT:
76-
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
7798
- target: aarch64-unknown-linux-gnu/clang
7899
architecture: aarch64
79100
runner: ubuntu-latest
80101
compiler: clang
81-
# These fail because of emulation, not because of the JIT:
82-
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
83102
env:
84103
CC: ${{ matrix.compiler }}
85104
steps:
@@ -91,37 +110,43 @@ jobs:
91110
- name: Native Windows
92111
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
93112
run: |
113+
choco upgrade llvm -y
94114
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
95115
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '--pgo' }} -p ${{ matrix.architecture }}
96-
./PCbuild/rt.bat ${{ matrix.debug && '-d' }} -p ${{ matrix.architecture }} -q --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 4500 --verbose2 --verbose3
116+
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
97117
98118
# No PGO or tests (yet):
99119
- name: Emulated Windows
100120
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
101121
run: |
122+
choco upgrade llvm -y
102123
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
103124
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
104125
105126
- name: Native macOS
106127
if: runner.os == 'macOS'
107128
run: |
129+
brew update
108130
brew install llvm@${{ matrix.llvm }}
109131
SDKROOT="$(xcrun --show-sdk-path)" \
110132
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
111133
make all --jobs 4
112-
./python.exe -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 4500 --verbose2 --verbose3
134+
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
113135
136+
# --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)
114137
- name: Native Linux
115138
if: runner.os == 'Linux' && matrix.architecture == 'x86_64'
116139
run: |
117140
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
118141
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
119-
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
142+
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations' }}
120143
make all --jobs 4
121-
./python -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 4500 --verbose2 --verbose3
144+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
122145
146+
# --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)
123147
- name: Emulated Linux
124148
if: runner.os == 'Linux' && matrix.architecture != 'x86_64'
149+
# The --ignorefile on ./python -m test is used to exclude tests known to fail when running on an emulated Linux.
125150
run: |
126151
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
127152
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
@@ -136,6 +161,25 @@ jobs:
136161
CC="${{ matrix.compiler == 'clang' && 'clang --target=$HOST' || '$HOST-gcc' }}" \
137162
CPP="$CC --preprocess" \
138163
HOSTRUNNER=qemu-${{ matrix.architecture }} \
139-
./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
164+
./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
140165
make all --jobs 4
141-
./python -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 4500 --verbose2 --verbose3
166+
./python -m test --ignorefile=Tools/jit/ignore-tests-emulated-linux.txt --multiprocess 0 --timeout 4500 --verbose2 --verbose3
167+
168+
jit-with-disabled-gil:
169+
name: Free-Threaded (Debug)
170+
needs: interpreter
171+
runs-on: ubuntu-latest
172+
steps:
173+
- uses: actions/checkout@v4
174+
- uses: actions/setup-python@v5
175+
with:
176+
python-version: '3.11'
177+
- name: Build with JIT enabled and GIL disabled
178+
run: |
179+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh 18
180+
export PATH="$(llvm-config-18 --bindir):$PATH"
181+
./configure --enable-experimental-jit --with-pydebug --disable-gil
182+
make all --jobs 4
183+
- name: Run tests
184+
run: |
185+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3

.github/workflows/mypy.yml

Lines changed: 4 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/**"
@@ -33,10 +34,12 @@ concurrency:
3334
jobs:
3435
mypy:
3536
strategy:
37+
fail-fast: false
3638
matrix:
3739
target: [
40+
"Lib/_pyrepl",
3841
"Lib/test/libregrtest",
39-
"Tools/build/",
42+
"Tools/build",
4043
"Tools/cases_generator",
4144
"Tools/clinic",
4245
"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 \

0 commit comments

Comments
 (0)