Skip to content

Commit c0d903f

Browse files
Merge branch 'main' into math-log-int-like-overflow
2 parents 1d7449c + aef95eb commit c0d903f

File tree

431 files changed

+10967
-6237
lines changed

Some content is hidden

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

431 files changed

+10967
-6237
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ 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

.github/workflows/build.yml

Lines changed: 81 additions & 37 deletions
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,18 +214,39 @@ jobs:
179214
run: make check-c-globals
180215

181216
build_windows:
182-
name: 'Windows'
217+
name: >-
218+
Windows
219+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
183220
needs: check_source
184-
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
185231
uses: ./.github/workflows/reusable-windows.yml
232+
with:
233+
arch: ${{ matrix.arch }}
234+
free-threading: ${{ matrix.free-threading }}
186235

187-
build_windows_free_threading:
188-
name: 'Windows (free-threading)'
236+
build_windows_msi:
237+
name: >- # ${{ '' } is a hack to nest jobs under the same sidebar category
238+
Windows MSI${{ '' }}
189239
needs: check_source
190-
if: needs.check_source.outputs.run_tests == 'true'
191-
uses: ./.github/workflows/reusable-windows.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
192248
with:
193-
free-threading: true
249+
arch: ${{ matrix.arch }}
194250

195251
build_macos:
196252
name: 'macOS'
@@ -216,31 +272,20 @@ jobs:
216272
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14"]'
217273

218274
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)'
275+
name: >-
276+
Ubuntu
277+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
233278
needs: check_source
234279
if: needs.check_source.outputs.run_tests == 'true'
280+
strategy:
281+
matrix:
282+
free-threading:
283+
- false
284+
- true
235285
uses: ./.github/workflows/reusable-ubuntu.yml
236286
with:
237287
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
288+
free-threading: ${{ matrix.free-threading }}
244289

245290
build_ubuntu_ssltests:
246291
name: 'Ubuntu SSL tests with OpenSSL'
@@ -292,7 +337,7 @@ jobs:
292337
with:
293338
save: false
294339
- name: Configure CPython
295-
run: ./configure --config-cache --with-pydebug --with-openssl=$OPENSSL_DIR
340+
run: ./configure --config-cache --enable-slower-safety --with-pydebug --with-openssl=$OPENSSL_DIR
296341
- name: Build CPython
297342
run: make -j4
298343
- name: Display build info
@@ -365,6 +410,7 @@ jobs:
365410
../cpython-ro-srcdir/configure \
366411
--config-cache \
367412
--with-pydebug \
413+
--enable-slower-safety \
368414
--with-openssl=$OPENSSL_DIR
369415
- name: Build CPython out-of-tree
370416
working-directory: ${{ env.CPYTHON_BUILDDIR }}
@@ -393,7 +439,7 @@ jobs:
393439
path: ${{ env.CPYTHON_BUILDDIR }}/.hypothesis/
394440
key: hypothesis-database-${{ github.head_ref || github.run_id }}
395441
restore-keys: |
396-
- hypothesis-database-
442+
hypothesis-database-
397443
- name: "Run tests"
398444
working-directory: ${{ env.CPYTHON_BUILDDIR }}
399445
run: |
@@ -552,11 +598,10 @@ jobs:
552598
- build_macos
553599
- build_macos_free_threading
554600
- build_ubuntu
555-
- build_ubuntu_free_threading
556601
- build_ubuntu_ssltests
557602
- build_wasi
558603
- build_windows
559-
- build_windows_free_threading
604+
- build_windows_msi
560605
- test_hypothesis
561606
- build_asan
562607
- build_tsan
@@ -571,6 +616,7 @@ jobs:
571616
with:
572617
allowed-failures: >-
573618
build_ubuntu_ssltests,
619+
build_windows_msi,
574620
cifuzz,
575621
test_hypothesis,
576622
allowed-skips: >-
@@ -588,11 +634,9 @@ jobs:
588634
build_macos,
589635
build_macos_free_threading,
590636
build_ubuntu,
591-
build_ubuntu_free_threading,
592637
build_ubuntu_ssltests,
593638
build_wasi,
594639
build_windows,
595-
build_windows_free_threading,
596640
build_asan,
597641
build_tsan,
598642
build_tsan_free_threading,

.github/workflows/build_msi.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/reusable-macos.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
./configure \
5454
--config-cache \
5555
--with-pydebug \
56+
--enable-slower-safety \
5657
${{ inputs.free-threading && '--disable-gil' || '' }} \
5758
--prefix=/opt/python-dev \
5859
--with-openssl="$(brew --prefix [email protected])"

.github/workflows/reusable-ubuntu.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ on:
44
config_hash:
55
required: true
66
type: string
7-
options:
8-
required: true
9-
type: string
7+
free-threading:
8+
description: Whether to use free-threaded mode
9+
required: false
10+
type: boolean
11+
default: false
1012

1113
jobs:
1214
build_ubuntu_reusable:
@@ -63,7 +65,13 @@ jobs:
6365
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
6466
- name: Configure CPython out-of-tree
6567
working-directory: ${{ env.CPYTHON_BUILDDIR }}
66-
run: ${{ inputs.options }}
68+
run: >-
69+
../cpython-ro-srcdir/configure
70+
--config-cache
71+
--with-pydebug
72+
--enable-slower-safety
73+
--with-openssl=$OPENSSL_DIR
74+
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
6775
- name: Build CPython out-of-tree
6876
working-directory: ${{ env.CPYTHON_BUILDDIR }}
6977
run: make -j4

.github/workflows/reusable-wasi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-22.04
1313
env:
1414
WASMTIME_VERSION: 22.0.0
15-
WASI_SDK_VERSION: 21
15+
WASI_SDK_VERSION: 22
1616
WASI_SDK_PATH: /opt/wasi-sdk
1717
CROSS_BUILD_PYTHON: cross-build/build
1818
CROSS_BUILD_WASI: cross-build/wasm32-wasi
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: TestsMSI
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
arch:
7+
description: CPU architecture
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
build:
16+
name: installer for ${{ inputs.arch }}
17+
runs-on: windows-latest
18+
timeout-minutes: 60
19+
env:
20+
IncludeFreethreaded: true
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Build CPython installer
24+
run: .\Tools\msi\build.bat --doc -${{ inputs.arch }}

0 commit comments

Comments
 (0)