Skip to content

Commit 24774ab

Browse files
Merge branch 'main' into pending-calls-linked-list
2 parents bc284be + 93b7ed7 commit 24774ab

File tree

1,211 files changed

+64457
-34039
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,211 files changed

+64457
-34039
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=18.0.2
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: 1 addition & 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

.github/workflows/build.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
- name: Get a list of the changed documentation-related files
9898
if: github.event_name == 'pull_request'
9999
id: changed-docs-files
100-
uses: Ana06/get-changed-files@v2.2.0
100+
uses: Ana06/get-changed-files@v2.3.0
101101
with:
102102
filter: |
103103
Doc/**
@@ -137,6 +137,7 @@ jobs:
137137
uses: actions/cache@v4
138138
with:
139139
path: config.cache
140+
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
140141
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
141142
- name: Install Dependencies
142143
run: sudo ./.github/workflows/posix-deps-apt.sh
@@ -206,6 +207,8 @@ jobs:
206207
uses: ./.github/workflows/reusable-macos.yml
207208
with:
208209
config_hash: ${{ needs.check_source.outputs.config_hash }}
210+
# macos-14 is M1, macos-13 is Intel
211+
os-matrix: '["macos-14", "macos-13"]'
209212

210213
build_macos_free_threading:
211214
name: 'macOS (free-threading)'
@@ -215,6 +218,8 @@ jobs:
215218
with:
216219
config_hash: ${{ needs.check_source.outputs.config_hash }}
217220
free-threading: true
221+
# macos-14 is M1
222+
os-matrix: '["macos-14"]'
218223

219224
build_ubuntu:
220225
name: 'Ubuntu'
@@ -301,6 +306,14 @@ jobs:
301306
- name: SSL tests
302307
run: ./python Lib/test/ssltests.py
303308

309+
build_wasi:
310+
name: 'WASI'
311+
needs: check_source
312+
if: needs.check_source.outputs.run_tests == 'true'
313+
uses: ./.github/workflows/reusable-wasi.yml
314+
with:
315+
config_hash: ${{ needs.check_source.outputs.config_hash }}
316+
304317
test_hypothesis:
305318
name: "Hypothesis tests on Ubuntu"
306319
runs-on: ubuntu-20.04
@@ -472,6 +485,26 @@ jobs:
472485
- name: Tests
473486
run: xvfb-run make test
474487

488+
build_tsan:
489+
name: 'Thread sanitizer'
490+
needs: check_source
491+
if: needs.check_source.outputs.run_tests == 'true'
492+
uses: ./.github/workflows/reusable-tsan.yml
493+
with:
494+
config_hash: ${{ needs.check_source.outputs.config_hash }}
495+
options: ./configure --config-cache --with-thread-sanitizer --with-pydebug
496+
suppressions_path: Tools/tsan/supressions.txt
497+
498+
build_tsan_free_threading:
499+
name: 'Thread sanitizer (free-threading)'
500+
needs: check_source
501+
if: needs.check_source.outputs.run_tests == 'true'
502+
uses: ./.github/workflows/reusable-tsan.yml
503+
with:
504+
config_hash: ${{ needs.check_source.outputs.config_hash }}
505+
options: ./configure --config-cache --disable-gil --with-thread-sanitizer --with-pydebug
506+
suppressions_path: Tools/tsan/suppressions_free_threading.txt
507+
475508
# CIFuzz job based on https://google.github.io/oss-fuzz/getting-started/continuous-integration/
476509
cifuzz:
477510
name: CIFuzz
@@ -525,10 +558,13 @@ jobs:
525558
- build_ubuntu
526559
- build_ubuntu_free_threading
527560
- build_ubuntu_ssltests
561+
- build_wasi
528562
- build_windows
529563
- build_windows_free_threading
530564
- test_hypothesis
531565
- build_asan
566+
- build_tsan
567+
- build_tsan_free_threading
532568
- cifuzz
533569

534570
runs-on: ubuntu-latest
@@ -558,9 +594,12 @@ jobs:
558594
build_ubuntu,
559595
build_ubuntu_free_threading,
560596
build_ubuntu_ssltests,
597+
build_wasi,
561598
build_windows,
562599
build_windows_free_threading,
563600
build_asan,
601+
build_tsan,
602+
build_tsan_free_threading,
564603
'
565604
|| ''
566605
}}

.github/workflows/jit.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@ on:
55
- '**jit**'
66
- 'Python/bytecodes.c'
77
- 'Python/optimizer*.c'
8-
- 'Python/optimizer_bytecodes.c'
98
push:
109
paths:
1110
- '**jit**'
1211
- 'Python/bytecodes.c'
1312
- 'Python/optimizer*.c'
14-
- 'Python/optimizer_bytecodes.c'
1513
workflow_dispatch:
1614

15+
permissions:
16+
contents: read
17+
1718
concurrency:
1819
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1920
cancel-in-progress: true
@@ -22,7 +23,7 @@ jobs:
2223
jit:
2324
name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }})
2425
runs-on: ${{ matrix.runner }}
25-
timeout-minutes: 60
26+
timeout-minutes: 75
2627
strategy:
2728
fail-fast: false
2829
matrix:
@@ -95,7 +96,7 @@ jobs:
9596
run: |
9697
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
9798
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '--pgo' }} -p ${{ matrix.architecture }}
98-
./PCbuild/rt.bat ${{ matrix.debug && '-d' }} -p ${{ matrix.architecture }} -q --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
99+
./PCbuild/rt.bat ${{ matrix.debug && '-d' }} -p ${{ matrix.architecture }} -q --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 4500 --verbose2 --verbose3
99100
100101
# No PGO or tests (yet):
101102
- name: Emulated Windows
@@ -108,10 +109,10 @@ jobs:
108109
if: runner.os == 'macOS'
109110
run: |
110111
brew install llvm@${{ matrix.llvm }}
111-
export SDKROOT="$(xcrun --show-sdk-path)"
112-
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
112+
SDKROOT="$(xcrun --show-sdk-path)" \
113+
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
113114
make all --jobs 4
114-
./python.exe -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
115+
./python.exe -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 4500 --verbose2 --verbose3
115116
116117
- name: Native Linux
117118
if: runner.os == 'Linux' && matrix.architecture == 'x86_64'
@@ -120,7 +121,7 @@ jobs:
120121
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
121122
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
122123
make all --jobs 4
123-
./python -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
124+
./python -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 4500 --verbose2 --verbose3
124125
125126
- name: Emulated Linux
126127
if: runner.os == 'Linux' && matrix.architecture != 'x86_64'
@@ -134,10 +135,10 @@ jobs:
134135
sudo apt install --yes "gcc-$HOST" qemu-user
135136
${{ !matrix.debug && matrix.compiler == 'clang' && './configure --enable-optimizations' || '' }}
136137
${{ !matrix.debug && matrix.compiler == 'clang' && 'make profile-run-stamp --jobs 4' || '' }}
137-
export CC="${{ matrix.compiler == 'clang' && 'clang --target=$HOST' || '$HOST-gcc' }}"
138-
export CPP="$CC --preprocess"
139-
export HOSTRUNNER=qemu-${{ matrix.architecture }}
140138
export QEMU_LD_PREFIX="/usr/$HOST"
141-
./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
139+
CC="${{ matrix.compiler == 'clang' && 'clang --target=$HOST' || '$HOST-gcc' }}" \
140+
CPP="$CC --preprocess" \
141+
HOSTRUNNER=qemu-${{ matrix.architecture }} \
142+
./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
142143
make all --jobs 4
143-
./python -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
144+
./python -m test --exclude ${{ matrix.exclude }} --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/action@v3.0.0
26+
- uses: pre-commit/action@v3.0.1

.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 }}

.github/workflows/reusable-macos.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
required: false
99
type: boolean
1010
default: false
11+
os-matrix:
12+
required: false
13+
type: string
1114

1215
jobs:
1316
build_macos:
@@ -22,10 +25,7 @@ jobs:
2225
strategy:
2326
fail-fast: false
2427
matrix:
25-
os: [
26-
"macos-14", # M1
27-
"macos-13", # Intel
28-
]
28+
os: ${{fromJson(inputs.os-matrix)}}
2929
runs-on: ${{ matrix.os }}
3030
steps:
3131
- uses: actions/checkout@v4
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
config_hash:
5+
required: true
6+
type: string
7+
options:
8+
required: true
9+
type: string
10+
suppressions_path:
11+
description: 'A repo relative path to the suppressions file'
12+
required: true
13+
type: string
14+
15+
jobs:
16+
build_tsan_reusable:
17+
name: 'Thread sanitizer'
18+
runs-on: ubuntu-22.04
19+
timeout-minutes: 60
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Runner image version
23+
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
24+
- name: Restore config.cache
25+
uses: actions/cache@v4
26+
with:
27+
path: config.cache
28+
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
29+
- name: Install Dependencies
30+
run: |
31+
sudo ./.github/workflows/posix-deps-apt.sh
32+
sudo apt install -y clang
33+
# Reduce ASLR to avoid TSAN crashing
34+
sudo sysctl -w vm.mmap_rnd_bits=28
35+
- name: TSAN Option Setup
36+
run: |
37+
echo "TSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/${{ inputs.suppressions_path }}" >> $GITHUB_ENV
38+
echo "CC=clang" >> $GITHUB_ENV
39+
echo "CXX=clang++" >> $GITHUB_ENV
40+
- name: Add ccache to PATH
41+
run: |
42+
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
43+
- name: Configure ccache action
44+
uses: hendrikmuhs/ccache-action@v1.2
45+
with:
46+
save: ${{ github.event_name == 'push' }}
47+
max-size: "200M"
48+
- name: Configure CPython
49+
run: ${{ inputs.options }}
50+
- name: Build CPython
51+
run: make -j4
52+
- name: Display build info
53+
run: make pythoninfo
54+
- name: Tests
55+
run: ./python -m test --tsan -j4

.github/workflows/reusable-ubuntu.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
timeout-minutes: 60
1515
runs-on: ubuntu-20.04
1616
env:
17+
FORCE_COLOR: 1
1718
OPENSSL_VER: 3.0.13
1819
PYTHONSTRICTEXTENSIONBUILD: 1
1920
steps:

0 commit comments

Comments
 (0)