Skip to content

Commit fd62937

Browse files
committed
Merge upstream/main into heatmap branch
2 parents e1ef737 + 6462322 commit fd62937

File tree

812 files changed

+36664
-13767
lines changed

Some content is hidden

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

812 files changed

+36664
-13767
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/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ updates:
1212
update-types:
1313
- "version-update:semver-minor"
1414
- "version-update:semver-patch"
15+
cooldown:
16+
# https://blog.yossarian.net/2025/11/21/We-should-all-be-using-dependency-cooldowns
17+
# Cooldowns protect against supply chain attacks by avoiding the
18+
# highest-risk window immediately after new releases.
19+
default-days: 14
1520
- package-ecosystem: "pip"
1621
directory: "/Tools/"
1722
schedule:
1823
interval: "monthly"
1924
labels:
2025
- "skip issue"
2126
- "skip news"
27+
cooldown:
28+
default-days: 14

.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/[email protected]
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/[email protected]
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/[email protected]
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/[email protected]
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/[email protected]
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: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
- true
6969
- false
7070
llvm:
71-
- 19
71+
- 21
7272
include:
7373
- target: i686-pc-windows-msvc/msvc
7474
architecture: Win32
@@ -138,7 +138,7 @@ jobs:
138138
fail-fast: false
139139
matrix:
140140
llvm:
141-
- 19
141+
- 21
142142
steps:
143143
- uses: actions/checkout@v4
144144
with:
@@ -166,7 +166,7 @@ jobs:
166166
fail-fast: false
167167
matrix:
168168
llvm:
169-
- 19
169+
- 21
170170
steps:
171171
- uses: actions/checkout@v4
172172
with:
@@ -183,3 +183,27 @@ jobs:
183183
- name: Run tests without optimizations
184184
run: |
185185
PYTHON_UOPS_OPTIMIZE=0 ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
186+
187+
tail-call-jit:
188+
name: JIT with tail calling interpreter
189+
needs: interpreter
190+
runs-on: ubuntu-24.04
191+
timeout-minutes: 90
192+
strategy:
193+
fail-fast: false
194+
matrix:
195+
llvm:
196+
- 21
197+
steps:
198+
- uses: actions/checkout@v4
199+
with:
200+
persist-credentials: false
201+
- uses: actions/setup-python@v5
202+
with:
203+
python-version: '3.11'
204+
- name: Build with JIT and tailcall
205+
run: |
206+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
207+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
208+
CC=clang-${{ matrix.llvm }} ./configure --enable-experimental-jit --with-tail-call-interp --with-pydebug
209+
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"

.github/workflows/reusable-context.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ on: # yamllint disable-line rule:truthy
1717
# || 'falsy-branch'
1818
# }}
1919
#
20-
config-hash:
21-
description: Config hash value for use in cache keys
22-
value: ${{ jobs.compute-changes.outputs.config-hash }} # str
2320
run-docs:
2421
description: Whether to build the docs
2522
value: ${{ jobs.compute-changes.outputs.run-docs }} # bool
@@ -42,7 +39,6 @@ jobs:
4239
runs-on: ubuntu-latest
4340
timeout-minutes: 10
4441
outputs:
45-
config-hash: ${{ steps.config-hash.outputs.hash }}
4642
run-ci-fuzz: ${{ steps.changes.outputs.run-ci-fuzz }}
4743
run-docs: ${{ steps.changes.outputs.run-docs }}
4844
run-tests: ${{ steps.changes.outputs.run-tests }}
@@ -100,8 +96,3 @@ jobs:
10096
GITHUB_EVENT_NAME: ${{ github.event_name }}
10197
CCF_TARGET_REF: ${{ github.base_ref || github.event.repository.default_branch }}
10298
CCF_HEAD_REF: ${{ github.event.pull_request.head.sha || github.sha }}
103-
104-
- name: Compute hash for config cache key
105-
id: config-hash
106-
run: |
107-
echo "hash=${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)