Skip to content

Commit 52606d1

Browse files
authored
Merge branch 'main' into feature-smaller-pipe-buffer-pull-request
2 parents 94d4c4a + 9187484 commit 52606d1

File tree

574 files changed

+16032
-8888
lines changed

Some content is hidden

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

574 files changed

+16032
-8888
lines changed

.devcontainer/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ FROM docker.io/library/fedora:40
22

33
ENV CC=clang
44

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

88
ENV WASMTIME_HOME=/opt/wasmtime
9-
ENV WASMTIME_VERSION=18.0.3
9+
ENV WASMTIME_VERSION=22.0.0
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)' && \

.github/CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Include/internal/pycore_freelist.h @ericsnowcurrently
7272
Include/internal/pycore_global_objects.h @ericsnowcurrently
7373
Include/internal/pycore_obmalloc.h @ericsnowcurrently
7474
Include/internal/pycore_pymem.h @ericsnowcurrently
75+
Include/internal/pycore_stackref.h @Fidget-Spinner
7576
Modules/main.c @ericsnowcurrently
7677
Programs/_bootstrap_python.c @ericsnowcurrently
7778
Programs/python.c @ericsnowcurrently
@@ -213,6 +214,7 @@ Doc/c-api/stable.rst @encukou
213214
**/*idlelib* @terryjreedy
214215
/Doc/library/idle.rst @terryjreedy
215216

217+
**/*annotationlib* @JelleZijlstra
216218
**/*typing* @JelleZijlstra @AlexWaygood
217219

218220
**/*ftplib @giampaolo

.github/workflows/build.yml

+108-55
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,32 @@ jobs:
2727
runs-on: ubuntu-latest
2828
timeout-minutes: 10
2929
outputs:
30+
# Some of the referenced steps set outputs conditionally and there may be
31+
# cases when referencing them evaluates to empty strings. It is nice to
32+
# work with proper booleans so they have to be evaluated through JSON
33+
# conversion in the expressions. However, empty strings used like that
34+
# may trigger all sorts of undefined and hard-to-debug behaviors in
35+
# GitHub Actions CI/CD. To help with this, all of the outputs set here
36+
# that are meant to be used as boolean flags (and not arbitrary strings),
37+
# MUST have fallbacks with default values set. A common pattern would be
38+
# to add ` || false` to all such expressions here, in the output
39+
# definitions. They can then later be safely used through the following
40+
# idiom in job conditionals and other expressions. Here's some examples:
41+
#
42+
# if: fromJSON(needs.check_source.outputs.run-docs)
43+
#
44+
# ${{
45+
# fromJSON(needs.check_source.outputs.run_tests)
46+
# && 'truthy-branch'
47+
# || 'falsy-branch'
48+
# }}
49+
#
3050
run-docs: ${{ steps.docs-changes.outputs.run-docs || false }}
31-
run_tests: ${{ steps.check.outputs.run_tests }}
32-
run_hypothesis: ${{ steps.check.outputs.run_hypothesis }}
33-
run_cifuzz: ${{ steps.check.outputs.run_cifuzz }}
34-
config_hash: ${{ steps.config_hash.outputs.hash }}
51+
run-win-msi: ${{ steps.win-msi-changes.outputs.run-win-msi || false }}
52+
run_tests: ${{ steps.check.outputs.run_tests || false }}
53+
run_hypothesis: ${{ steps.check.outputs.run_hypothesis || false }}
54+
run_cifuzz: ${{ steps.check.outputs.run_cifuzz || false }}
55+
config_hash: ${{ steps.config_hash.outputs.hash }} # str
3556
steps:
3657
- uses: actions/checkout@v4
3758
- name: Check for source changes
@@ -103,6 +124,20 @@ jobs:
103124
id: docs-changes
104125
run: |
105126
echo "run-docs=true" >> "${GITHUB_OUTPUT}"
127+
- name: Get a list of the MSI installer-related files
128+
id: changed-win-msi-files
129+
uses: Ana06/[email protected]
130+
with:
131+
filter: |
132+
Tools/msi/**
133+
.github/workflows/reusable-windows-msi.yml
134+
format: csv # works for paths with spaces
135+
- name: Check for changes in MSI installer-related files
136+
if: >-
137+
steps.changed-win-msi-files.outputs.added_modified_renamed != ''
138+
id: win-msi-changes
139+
run: |
140+
echo "run-win-msi=true" >> "${GITHUB_OUTPUT}"
106141
107142
check-docs:
108143
name: Docs
@@ -179,68 +214,89 @@ jobs:
179214
run: make check-c-globals
180215

181216
build_windows:
182-
name: 'Windows'
183-
needs: check_source
184-
if: needs.check_source.outputs.run_tests == 'true'
185-
uses: ./.github/workflows/reusable-windows.yml
186-
187-
build_windows_free_threading:
188-
name: 'Windows (free-threading)'
217+
name: >-
218+
Windows
219+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
189220
needs: check_source
190-
if: needs.check_source.outputs.run_tests == 'true'
221+
if: fromJSON(needs.check_source.outputs.run_tests)
222+
strategy:
223+
matrix:
224+
arch:
225+
- Win32
226+
- x64
227+
- arm64
228+
free-threading:
229+
- false
230+
- true
191231
uses: ./.github/workflows/reusable-windows.yml
192232
with:
193-
free-threading: true
233+
arch: ${{ matrix.arch }}
234+
free-threading: ${{ matrix.free-threading }}
194235

195-
build_macos:
196-
name: 'macOS'
236+
build_windows_msi:
237+
name: >- # ${{ '' } is a hack to nest jobs under the same sidebar category
238+
Windows MSI${{ '' }}
197239
needs: check_source
198-
if: needs.check_source.outputs.run_tests == 'true'
199-
uses: ./.github/workflows/reusable-macos.yml
240+
if: fromJSON(needs.check_source.outputs.run-win-msi)
241+
strategy:
242+
matrix:
243+
arch:
244+
- x86
245+
- x64
246+
- arm64
247+
uses: ./.github/workflows/reusable-windows-msi.yml
200248
with:
201-
config_hash: ${{ needs.check_source.outputs.config_hash }}
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"]'
249+
arch: ${{ matrix.arch }}
205250

206-
build_macos_free_threading:
207-
name: 'macOS (free-threading)'
251+
build_macos:
252+
name: >-
253+
macOS
254+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
208255
needs: check_source
209256
if: needs.check_source.outputs.run_tests == 'true'
257+
strategy:
258+
fail-fast: false
259+
matrix:
260+
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
261+
# macOS 13 only runs tests against the GIL-enabled CPython.
262+
# Cirrus used for upstream, macos-14 for forks.
263+
os:
264+
- ghcr.io/cirruslabs/macos-runner:sonoma
265+
- macos-14
266+
- macos-13
267+
is-fork: # only used for the exclusion trick
268+
- ${{ github.repository_owner != 'python' }}
269+
free-threading:
270+
- false
271+
- true
272+
exclude:
273+
- os: ghcr.io/cirruslabs/macos-runner:sonoma
274+
is-fork: true
275+
- os: macos-14
276+
is-fork: false
277+
- os: macos-13
278+
free-threading: true
210279
uses: ./.github/workflows/reusable-macos.yml
211280
with:
212281
config_hash: ${{ needs.check_source.outputs.config_hash }}
213-
free-threading: true
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"]'
282+
free-threading: ${{ matrix.free-threading }}
283+
os: ${{ matrix.os }}
217284

218285
build_ubuntu:
219-
name: 'Ubuntu'
220-
needs: check_source
221-
if: needs.check_source.outputs.run_tests == 'true'
222-
uses: ./.github/workflows/reusable-ubuntu.yml
223-
with:
224-
config_hash: ${{ needs.check_source.outputs.config_hash }}
225-
options: |
226-
../cpython-ro-srcdir/configure \
227-
--config-cache \
228-
--with-pydebug \
229-
--with-openssl=$OPENSSL_DIR
230-
231-
build_ubuntu_free_threading:
232-
name: 'Ubuntu (free-threading)'
286+
name: >-
287+
Ubuntu
288+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
233289
needs: check_source
234290
if: needs.check_source.outputs.run_tests == 'true'
291+
strategy:
292+
matrix:
293+
free-threading:
294+
- false
295+
- true
235296
uses: ./.github/workflows/reusable-ubuntu.yml
236297
with:
237298
config_hash: ${{ needs.check_source.outputs.config_hash }}
238-
options: |
239-
../cpython-ro-srcdir/configure \
240-
--config-cache \
241-
--with-pydebug \
242-
--with-openssl=$OPENSSL_DIR \
243-
--disable-gil
299+
free-threading: ${{ matrix.free-threading }}
244300

245301
build_ubuntu_ssltests:
246302
name: 'Ubuntu SSL tests with OpenSSL'
@@ -292,7 +348,7 @@ jobs:
292348
with:
293349
save: false
294350
- name: Configure CPython
295-
run: ./configure --config-cache --with-pydebug --with-openssl=$OPENSSL_DIR
351+
run: ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl=$OPENSSL_DIR
296352
- name: Build CPython
297353
run: make -j4
298354
- name: Display build info
@@ -365,6 +421,7 @@ jobs:
365421
../cpython-ro-srcdir/configure \
366422
--config-cache \
367423
--with-pydebug \
424+
--enable-slower-safety \
368425
--with-openssl=$OPENSSL_DIR
369426
- name: Build CPython out-of-tree
370427
working-directory: ${{ env.CPYTHON_BUILDDIR }}
@@ -393,7 +450,7 @@ jobs:
393450
path: ${{ env.CPYTHON_BUILDDIR }}/.hypothesis/
394451
key: hypothesis-database-${{ github.head_ref || github.run_id }}
395452
restore-keys: |
396-
- hypothesis-database-
453+
hypothesis-database-
397454
- name: "Run tests"
398455
working-directory: ${{ env.CPYTHON_BUILDDIR }}
399456
run: |
@@ -550,13 +607,11 @@ jobs:
550607
- check-docs
551608
- check_generated_files
552609
- build_macos
553-
- build_macos_free_threading
554610
- build_ubuntu
555-
- build_ubuntu_free_threading
556611
- build_ubuntu_ssltests
557612
- build_wasi
558613
- build_windows
559-
- build_windows_free_threading
614+
- build_windows_msi
560615
- test_hypothesis
561616
- build_asan
562617
- build_tsan
@@ -571,6 +626,7 @@ jobs:
571626
with:
572627
allowed-failures: >-
573628
build_ubuntu_ssltests,
629+
build_windows_msi,
574630
cifuzz,
575631
test_hypothesis,
576632
allowed-skips: >-
@@ -586,13 +642,10 @@ jobs:
586642
&& '
587643
check_generated_files,
588644
build_macos,
589-
build_macos_free_threading,
590645
build_ubuntu,
591-
build_ubuntu_free_threading,
592646
build_ubuntu_ssltests,
593647
build_wasi,
594648
build_windows,
595-
build_windows_free_threading,
596649
build_asan,
597650
build_tsan,
598651
build_tsan_free_threading,

.github/workflows/build_msi.yml

-40
This file was deleted.

.github/workflows/reusable-macos.yml

+7-16
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ on:
88
required: false
99
type: boolean
1010
default: false
11-
os-matrix:
12-
required: false
11+
os:
12+
description: OS to run the job
13+
required: true
1314
type: string
1415

1516
jobs:
1617
build_macos:
17-
name: build and test (${{ matrix.os }})
18+
name: build and test (${{ inputs.os }})
1819
timeout-minutes: 60
1920
env:
2021
HOMEBREW_NO_ANALYTICS: 1
@@ -23,18 +24,7 @@ jobs:
2324
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
2425
PYTHONSTRICTEXTENSIONBUILD: 1
2526
TERM: linux
26-
strategy:
27-
fail-fast: false
28-
matrix:
29-
os: ${{fromJson(inputs.os-matrix)}}
30-
is-fork:
31-
- ${{ github.repository_owner != 'python' }}
32-
exclude:
33-
- os: "ghcr.io/cirruslabs/macos-runner:sonoma"
34-
is-fork: true
35-
- os: "macos-14"
36-
is-fork: false
37-
runs-on: ${{ matrix.os }}
27+
runs-on: ${{ inputs.os }}
3828
steps:
3929
- uses: actions/checkout@v4
4030
- name: Runner image version
@@ -43,7 +33,7 @@ jobs:
4333
uses: actions/cache@v4
4434
with:
4535
path: config.cache
46-
key: ${{ github.job }}-${{ matrix.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
36+
key: ${{ github.job }}-${{ inputs.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
4737
- name: Install Homebrew dependencies
4838
run: brew install pkg-config [email protected] xz gdbm tcl-tk
4939
- name: Configure CPython
@@ -53,6 +43,7 @@ jobs:
5343
./configure \
5444
--config-cache \
5545
--with-pydebug \
46+
--enable-slower-safety \
5647
${{ inputs.free-threading && '--disable-gil' || '' }} \
5748
--prefix=/opt/python-dev \
5849
--with-openssl="$(brew --prefix [email protected])"

0 commit comments

Comments
 (0)