Skip to content

Commit 7a19b94

Browse files
authored
Merge branch 'main' into main
2 parents cf09fbb + 5d2eb98 commit 7a19b94

File tree

1,528 files changed

+33102
-11531
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,528 files changed

+33102
-11531
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"image": "ghcr.io/python/wasicontainer:latest",
3+
"onCreateCommand": [
4+
// Install common tooling.
5+
"dnf",
6+
"install",
7+
"-y",
8+
// For umask fix below.
9+
"/usr/bin/setfacl"
10+
],
11+
"updateContentCommand": {
12+
// Using the shell for `nproc` usage.
13+
"python": "python3 Tools/wasm/wasi build --quiet -- --with-pydebug -C"
14+
},
15+
"postCreateCommand": {
16+
// https://github.com/orgs/community/discussions/26026
17+
"umask fix: workspace": ["sudo", "setfacl", "-bnR", "."],
18+
"umask fix: /tmp": ["sudo", "setfacl", "-bnR", "/tmp"]
19+
},
20+
"customizations": {
21+
"vscode": {
22+
"extensions": [
23+
// Highlighting for Parser/Python.asdl.
24+
"brettcannon.zephyr-asdl",
25+
// Highlighting for configure.ac.
26+
"maelvalais.autoconf",
27+
// C auto-complete.
28+
"ms-vscode.cpptools",
29+
// Python auto-complete.
30+
"ms-python.python"
31+
],
32+
"settings": {
33+
"C_Cpp.default.compilerPath": "/usr/bin/clang",
34+
"C_Cpp.default.cStandard": "c11",
35+
"C_Cpp.default.defines": [
36+
"CONFIG_64",
37+
"Py_BUILD_CORE"
38+
],
39+
"C_Cpp.default.includePath": [
40+
"${workspaceFolder}/*",
41+
"${workspaceFolder}/Include/**"
42+
],
43+
// https://github.com/microsoft/vscode-cpptools/issues/10732
44+
"C_Cpp.errorSquiggles": "disabled",
45+
"editor.insertSpaces": true,
46+
"editor.rulers": [
47+
80
48+
],
49+
"editor.tabSize": 4,
50+
"editor.trimAutoWhitespace": true,
51+
"files.associations": {
52+
"*.h": "c"
53+
},
54+
"files.encoding": "utf8",
55+
"files.eol": "\n",
56+
"files.insertFinalNewline": true,
57+
"files.trimTrailingWhitespace": true,
58+
"python.analysis.diagnosticSeverityOverrides": {
59+
// Complains about shadowing the stdlib w/ the stdlib.
60+
"reportShadowedImports": "none",
61+
// Doesn't like _frozen_importlib.
62+
"reportMissingImports": "none"
63+
},
64+
"python.analysis.extraPaths": [
65+
"Lib"
66+
],
67+
"[restructuredtext]": {
68+
"editor.tabSize": 3
69+
}
70+
}
71+
}
72+
}
73+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Include/opcode_ids.h generated
8383
Include/token.h generated
8484
Lib/_opcode_metadata.py generated
8585
Lib/keyword.py generated
86+
Lib/idlelib/help.html generated
8687
Lib/test/certdata/*.pem generated
8788
Lib/test/certdata/*.0 generated
8889
Lib/test/levenshtein_examples.json generated

.github/workflows/build.yml

Lines changed: 25 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,10 @@ jobs:
109109
python-version: '3.x'
110110
- name: Runner image version
111111
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
112-
- name: Restore config.cache
113-
uses: actions/cache@v4
114-
with:
115-
path: config.cache
116-
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
117-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}-${{ env.pythonLocation }}
118112
- name: Install dependencies
119113
run: sudo ./.github/workflows/posix-deps-apt.sh
120114
- name: Add ccache to PATH
121115
run: echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
122-
- name: Configure ccache action
123-
uses: hendrikmuhs/ccache-action@v1.2
124-
with:
125-
save: false
126116
- name: Configure CPython
127117
run: |
128118
# Build Python with the libpython dynamic library
@@ -215,7 +205,6 @@ jobs:
215205
free-threading: true
216206
uses: ./.github/workflows/reusable-macos.yml
217207
with:
218-
config_hash: ${{ needs.build-context.outputs.config-hash }}
219208
free-threading: ${{ matrix.free-threading }}
220209
os: ${{ matrix.os }}
221210

@@ -247,7 +236,6 @@ jobs:
247236
bolt: true
248237
uses: ./.github/workflows/reusable-ubuntu.yml
249238
with:
250-
config_hash: ${{ needs.build-context.outputs.config-hash }}
251239
bolt-optimizations: ${{ matrix.bolt }}
252240
free-threading: ${{ matrix.free-threading }}
253241
os: ${{ matrix.os }}
@@ -278,11 +266,6 @@ jobs:
278266
persist-credentials: false
279267
- name: Runner image version
280268
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
281-
- name: Restore config.cache
282-
uses: actions/cache@v4
283-
with:
284-
path: config.cache
285-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
286269
- name: Register gcc problem matcher
287270
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
288271
- name: Install dependencies
@@ -304,10 +287,6 @@ jobs:
304287
- name: Add ccache to PATH
305288
run: |
306289
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
307-
- name: Configure ccache action
308-
uses: hendrikmuhs/ccache-action@v1.2
309-
with:
310-
save: false
311290
- name: Configure CPython
312291
run: ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl="$OPENSSL_DIR"
313292
- name: Build CPython
@@ -339,11 +318,6 @@ jobs:
339318
persist-credentials: false
340319
- name: Runner image version
341320
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
342-
- name: Restore config.cache
343-
uses: actions/cache@v4
344-
with:
345-
path: config.cache
346-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
347321
- name: Register gcc problem matcher
348322
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
349323
- name: Install dependencies
@@ -370,10 +344,6 @@ jobs:
370344
- name: Add ccache to PATH
371345
run: |
372346
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
373-
- name: Configure ccache action
374-
uses: hendrikmuhs/ccache-action@v1.2
375-
with:
376-
save: false
377347
- name: Configure CPython
378348
run: |
379349
./configure CFLAGS="-fdiagnostics-format=json" \
@@ -414,13 +384,34 @@ jobs:
414384
- name: Build and test
415385
run: ./Android/android.py ci --fast-ci ${{ matrix.arch }}-linux-android
416386

387+
build-ios:
388+
name: iOS
389+
needs: build-context
390+
if: needs.build-context.outputs.run-tests == 'true'
391+
timeout-minutes: 60
392+
runs-on: macos-15
393+
steps:
394+
- uses: actions/checkout@v4
395+
with:
396+
persist-credentials: false
397+
398+
# GitHub recommends explicitly selecting the desired Xcode version:
399+
# https://github.com/actions/runner-images/issues/12541#issuecomment-3083850140
400+
# This became a necessity as a result of
401+
# https://github.com/actions/runner-images/issues/12541 and
402+
# https://github.com/actions/runner-images/issues/12751.
403+
- name: Select Xcode version
404+
run: |
405+
sudo xcode-select --switch /Applications/Xcode_16.4.app
406+
407+
- name: Build and test
408+
run: python3 Apple ci iOS --fast-ci --simulator 'iPhone 16e,OS=18.5'
409+
417410
build-wasi:
418411
name: 'WASI'
419412
needs: build-context
420413
if: needs.build-context.outputs.run-tests == 'true'
421414
uses: ./.github/workflows/reusable-wasi.yml
422-
with:
423-
config_hash: ${{ needs.build-context.outputs.config-hash }}
424415

425416
test-hypothesis:
426417
name: "Hypothesis tests on Ubuntu"
@@ -456,10 +447,6 @@ jobs:
456447
- name: Add ccache to PATH
457448
run: |
458449
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
459-
- name: Configure ccache action
460-
uses: hendrikmuhs/ccache-action@v1.2
461-
with:
462-
save: false
463450
- name: Setup directory envs for out-of-tree builds
464451
run: |
465452
echo "CPYTHON_RO_SRCDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-ro-srcdir)" >> "$GITHUB_ENV"
@@ -470,11 +457,6 @@ jobs:
470457
run: sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
471458
- name: Runner image version
472459
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
473-
- name: Restore config.cache
474-
uses: actions/cache@v4
475-
with:
476-
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
477-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
478460
- name: Configure CPython out-of-tree
479461
working-directory: ${{ env.CPYTHON_BUILDDIR }}
480462
run: |
@@ -558,11 +540,6 @@ jobs:
558540
persist-credentials: false
559541
- name: Runner image version
560542
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
561-
- name: Restore config.cache
562-
uses: actions/cache@v4
563-
with:
564-
path: config.cache
565-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
566543
- name: Register gcc problem matcher
567544
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
568545
- name: Install dependencies
@@ -588,11 +565,6 @@ jobs:
588565
- name: Add ccache to PATH
589566
run: |
590567
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
591-
- name: Configure ccache action
592-
uses: hendrikmuhs/ccache-action@v1.2
593-
with:
594-
save: ${{ github.event_name == 'push' }}
595-
max-size: "200M"
596568
- name: Configure CPython
597569
run: ./configure --config-cache --with-address-sanitizer --without-pymalloc
598570
- name: Build CPython
@@ -624,7 +596,6 @@ jobs:
624596
uses: ./.github/workflows/reusable-san.yml
625597
with:
626598
sanitizer: ${{ matrix.sanitizer }}
627-
config_hash: ${{ needs.build-context.outputs.config-hash }}
628599
free-threading: ${{ matrix.free-threading }}
629600

630601
cross-build-linux:
@@ -639,11 +610,6 @@ jobs:
639610
persist-credentials: false
640611
- name: Runner image version
641612
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
642-
- name: Restore config.cache
643-
uses: actions/cache@v4
644-
with:
645-
path: config.cache
646-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
647613
- name: Register gcc problem matcher
648614
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
649615
- name: Set build dir
@@ -723,6 +689,7 @@ jobs:
723689
- build-ubuntu-ssltests-awslc
724690
- build-ubuntu-ssltests-openssl
725691
- build-android
692+
- build-ios
726693
- build-wasi
727694
- test-hypothesis
728695
- build-asan
@@ -759,6 +726,7 @@ jobs:
759726
build-ubuntu-ssltests-awslc,
760727
build-ubuntu-ssltests-openssl,
761728
build-android,
729+
build-ios,
762730
build-wasi,
763731
test-hypothesis,
764732
build-asan,

.github/workflows/jit.yml

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ jobs:
5757
fail-fast: false
5858
matrix:
5959
target:
60-
- i686-pc-windows-msvc/msvc
61-
- x86_64-pc-windows-msvc/msvc
62-
- aarch64-pc-windows-msvc/msvc
60+
# To re-enable later when we support these.
61+
# - i686-pc-windows-msvc/msvc
62+
# - x86_64-pc-windows-msvc/msvc
63+
# - aarch64-pc-windows-msvc/msvc
6364
- x86_64-apple-darwin/clang
6465
- aarch64-apple-darwin/clang
6566
- x86_64-unknown-linux-gnu/gcc
@@ -68,17 +69,18 @@ jobs:
6869
- true
6970
- false
7071
llvm:
71-
- 19
72+
- 21
7273
include:
73-
- target: i686-pc-windows-msvc/msvc
74-
architecture: Win32
75-
runner: windows-2022
76-
- target: x86_64-pc-windows-msvc/msvc
77-
architecture: x64
78-
runner: windows-2022
79-
- target: aarch64-pc-windows-msvc/msvc
80-
architecture: ARM64
81-
runner: windows-11-arm
74+
# To re-enable later when we support these.
75+
# - target: i686-pc-windows-msvc/msvc
76+
# architecture: Win32
77+
# runner: windows-2022
78+
# - target: x86_64-pc-windows-msvc/msvc
79+
# architecture: x64
80+
# runner: windows-2022
81+
# - target: aarch64-pc-windows-msvc/msvc
82+
# architecture: ARM64
83+
# runner: windows-11-arm
8284
- target: x86_64-apple-darwin/clang
8385
architecture: x86_64
8486
runner: macos-15-intel
@@ -138,7 +140,7 @@ jobs:
138140
fail-fast: false
139141
matrix:
140142
llvm:
141-
- 19
143+
- 21
142144
steps:
143145
- uses: actions/checkout@v4
144146
with:
@@ -166,7 +168,7 @@ jobs:
166168
fail-fast: false
167169
matrix:
168170
llvm:
169-
- 19
171+
- 21
170172
steps:
171173
- uses: actions/checkout@v4
172174
with:
@@ -183,3 +185,27 @@ jobs:
183185
- name: Run tests without optimizations
184186
run: |
185187
PYTHON_UOPS_OPTIMIZE=0 ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
188+
189+
tail-call-jit:
190+
name: JIT with tail calling interpreter
191+
needs: interpreter
192+
runs-on: ubuntu-24.04
193+
timeout-minutes: 90
194+
strategy:
195+
fail-fast: false
196+
matrix:
197+
llvm:
198+
- 21
199+
steps:
200+
- uses: actions/checkout@v4
201+
with:
202+
persist-credentials: false
203+
- uses: actions/setup-python@v5
204+
with:
205+
python-version: '3.11'
206+
- name: Build with JIT and tailcall
207+
run: |
208+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
209+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
210+
CC=clang-${{ matrix.llvm }} ./configure --enable-experimental-jit --with-tail-call-interp --with-pydebug
211+
make all --jobs 4

.github/workflows/mypy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
- "Tools/build/check_extension_modules.py"
1717
- "Tools/build/check_warnings.py"
1818
- "Tools/build/compute-changes.py"
19+
- "Tools/build/consts_getter.py"
1920
- "Tools/build/deepfreeze.py"
2021
- "Tools/build/generate-build-details.py"
2122
- "Tools/build/generate_sbom.py"

0 commit comments

Comments
 (0)