Skip to content

Commit 8993e6c

Browse files
Merge remote-tracking branch 'upstream/main' into tracing_jit
2 parents b72ab8b + 35ed3e4 commit 8993e6c

File tree

378 files changed

+7828
-2264
lines changed

Some content is hidden

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

378 files changed

+7828
-2264
lines changed

.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: 0 additions & 52 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
@@ -278,11 +268,6 @@ jobs:
278268
persist-credentials: false
279269
- name: Runner image version
280270
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 }}
286271
- name: Register gcc problem matcher
287272
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
288273
- name: Install dependencies
@@ -304,10 +289,6 @@ jobs:
304289
- name: Add ccache to PATH
305290
run: |
306291
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
311292
- name: Configure CPython
312293
run: ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl="$OPENSSL_DIR"
313294
- name: Build CPython
@@ -339,11 +320,6 @@ jobs:
339320
persist-credentials: false
340321
- name: Runner image version
341322
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 }}
347323
- name: Register gcc problem matcher
348324
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
349325
- name: Install dependencies
@@ -370,10 +346,6 @@ jobs:
370346
- name: Add ccache to PATH
371347
run: |
372348
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
377349
- name: Configure CPython
378350
run: |
379351
./configure CFLAGS="-fdiagnostics-format=json" \
@@ -479,10 +451,6 @@ jobs:
479451
- name: Add ccache to PATH
480452
run: |
481453
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
482-
- name: Configure ccache action
483-
uses: hendrikmuhs/ccache-action@v1.2
484-
with:
485-
save: false
486454
- name: Setup directory envs for out-of-tree builds
487455
run: |
488456
echo "CPYTHON_RO_SRCDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-ro-srcdir)" >> "$GITHUB_ENV"
@@ -493,11 +461,6 @@ jobs:
493461
run: sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
494462
- name: Runner image version
495463
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
496-
- name: Restore config.cache
497-
uses: actions/cache@v4
498-
with:
499-
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
500-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
501464
- name: Configure CPython out-of-tree
502465
working-directory: ${{ env.CPYTHON_BUILDDIR }}
503466
run: |
@@ -581,11 +544,6 @@ jobs:
581544
persist-credentials: false
582545
- name: Runner image version
583546
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
584-
- name: Restore config.cache
585-
uses: actions/cache@v4
586-
with:
587-
path: config.cache
588-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
589547
- name: Register gcc problem matcher
590548
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
591549
- name: Install dependencies
@@ -611,11 +569,6 @@ jobs:
611569
- name: Add ccache to PATH
612570
run: |
613571
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
614-
- name: Configure ccache action
615-
uses: hendrikmuhs/ccache-action@v1.2
616-
with:
617-
save: ${{ github.event_name == 'push' }}
618-
max-size: "200M"
619572
- name: Configure CPython
620573
run: ./configure --config-cache --with-address-sanitizer --without-pymalloc
621574
- name: Build CPython
@@ -662,11 +615,6 @@ jobs:
662615
persist-credentials: false
663616
- name: Runner image version
664617
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
665-
- name: Restore config.cache
666-
uses: actions/cache@v4
667-
with:
668-
path: config.cache
669-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
670618
- name: Register gcc problem matcher
671619
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
672620
- name: Set build dir

.github/workflows/jit.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
- true
7070
- false
7171
llvm:
72-
- 19
72+
- 21
7373
include:
7474
# To re-enable later when we support these.
7575
# - target: i686-pc-windows-msvc/msvc
@@ -140,7 +140,7 @@ jobs:
140140
fail-fast: false
141141
matrix:
142142
llvm:
143-
- 19
143+
- 21
144144
steps:
145145
- uses: actions/checkout@v4
146146
with:
@@ -168,7 +168,7 @@ jobs:
168168
fail-fast: false
169169
matrix:
170170
llvm:
171-
- 19
171+
- 21
172172
steps:
173173
- uses: actions/checkout@v4
174174
with:
@@ -185,3 +185,27 @@ jobs:
185185
- name: Run tests without optimizations
186186
run: |
187187
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/reusable-macos.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ jobs:
3636
persist-credentials: false
3737
- name: Runner image version
3838
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
39-
- name: Restore config.cache
40-
uses: actions/cache@v4
41-
with:
42-
path: config.cache
43-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ inputs.config_hash }}
4439
- name: Install Homebrew dependencies
4540
run: |
4641
brew install pkg-config openssl@3.0 xz gdbm tcl-tk@9 make

.github/workflows/reusable-san.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ jobs:
3434
persist-credentials: false
3535
- name: Runner image version
3636
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
37-
- name: Restore config.cache
38-
uses: actions/cache@v4
39-
with:
40-
path: config.cache
41-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ inputs.sanitizer }}-${{ inputs.config_hash }}
4237
- name: Install dependencies
4338
run: |
4439
sudo ./.github/workflows/posix-deps-apt.sh
@@ -77,11 +72,6 @@ jobs:
7772
- name: Add ccache to PATH
7873
run: |
7974
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
80-
- name: Configure ccache action
81-
uses: hendrikmuhs/ccache-action@v1.2
82-
with:
83-
save: ${{ github.event_name == 'push' }}
84-
max-size: "200M"
8575
- name: Configure CPython
8676
run: >-
8777
./configure

.github/workflows/reusable-ubuntu.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ jobs:
6464
- name: Add ccache to PATH
6565
run: |
6666
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
67-
- name: Configure ccache action
68-
uses: hendrikmuhs/ccache-action@v1.2
69-
with:
70-
save: ${{ github.event_name == 'push' }}
71-
max-size: "200M"
7267
- name: Setup directory envs for out-of-tree builds
7368
run: |
7469
echo "CPYTHON_RO_SRCDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-ro-srcdir)" >> "$GITHUB_ENV"
@@ -79,11 +74,6 @@ jobs:
7974
run: sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
8075
- name: Runner image version
8176
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
82-
- name: Restore config.cache
83-
uses: actions/cache@v4
84-
with:
85-
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
86-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ inputs.config_hash }}
8777
- name: Configure CPython out-of-tree
8878
working-directory: ${{ env.CPYTHON_BUILDDIR }}
8979
# `test_unpickle_module_race` writes to the source directory, which is

.github/workflows/reusable-wasi.yml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ jobs:
4242
mkdir "${WASI_SDK_PATH}" && \
4343
curl -s -S --location "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-arm64-linux.tar.gz" | \
4444
tar --strip-components 1 --directory "${WASI_SDK_PATH}" --extract --gunzip
45-
- name: "Configure ccache action"
46-
uses: hendrikmuhs/ccache-action@v1.2
47-
with:
48-
save: ${{ github.event_name == 'push' }}
49-
max-size: "200M"
5045
- name: "Add ccache to PATH"
5146
run: echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
5247
- name: "Install Python"
@@ -55,29 +50,15 @@ jobs:
5550
python-version: '3.x'
5651
- name: "Runner image version"
5752
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
58-
- name: "Restore Python build config.cache"
59-
uses: actions/cache@v4
60-
with:
61-
path: ${{ env.CROSS_BUILD_PYTHON }}/config.cache
62-
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python.
63-
# Include the hash of `Tools/wasm/wasi.py` as it may change the environment variables.
64-
# (Make sure to keep the key in sync with the other config.cache step below.)
65-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ env.WASI_SDK_VERSION }}-${{ env.WASMTIME_VERSION }}-${{ inputs.config_hash }}-${{ hashFiles('Tools/wasm/wasi.py') }}-${{ env.pythonLocation }}
6653
- name: "Configure build Python"
67-
run: python3 Tools/wasm/wasi.py configure-build-python -- --config-cache --with-pydebug
54+
run: python3 Tools/wasm/wasi configure-build-python -- --config-cache --with-pydebug
6855
- name: "Make build Python"
6956
run: python3 Tools/wasm/wasi.py make-build-python
70-
- name: "Restore host config.cache"
71-
uses: actions/cache@v4
72-
with:
73-
path: ${{ env.CROSS_BUILD_WASI }}/config.cache
74-
# Should be kept in sync with the other config.cache step above.
75-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ env.WASI_SDK_VERSION }}-${{ env.WASMTIME_VERSION }}-${{ inputs.config_hash }}-${{ hashFiles('Tools/wasm/wasi.py') }}-${{ env.pythonLocation }}
7657
- name: "Configure host"
7758
# `--with-pydebug` inferred from configure-build-python
78-
run: python3 Tools/wasm/wasi.py configure-host -- --config-cache
59+
run: python3 Tools/wasm/wasi configure-host -- --config-cache
7960
- name: "Make host"
80-
run: python3 Tools/wasm/wasi.py make-host
61+
run: python3 Tools/wasm/wasi make-host
8162
- name: "Display build info"
8263
run: make --directory "${CROSS_BUILD_WASI}" pythoninfo
8364
- name: "Test"

Apple/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ def lib_non_platform_files(dirname, names):
507507
def create_xcframework(platform: str) -> str:
508508
"""Build an XCframework from the component parts for the platform.
509509
510-
:return: The version number of the Python verion that was packaged.
510+
:return: The version number of the Python version that was packaged.
511511
"""
512512
package_path = CROSS_BUILD_DIR / platform
513513
try:

Doc/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ dist-pdf:
241241
# as otherwise the full latexmk process is run twice.
242242
# ($$ is needed to escape the $; https://www.gnu.org/software/make/manual/make.html#Basics-of-Variable-References)
243243
-sed -i 's/: all-$$(FMT)/:/' build/latex/Makefile
244-
(cd build/latex; $(MAKE) clean && $(MAKE) --jobs=$$((`nproc`+1)) --output-sync LATEXMKOPTS='-quiet' all-pdf && $(MAKE) FMT=pdf zip bz2)
244+
if [ -n "$(filter output-sync,$(value .FEATURES))" ]; then OUTPUTSYNC=--output-sync; else OUTPUTSYNC=; fi && \
245+
(cd build/latex; $(MAKE) clean && $(MAKE) --jobs=$$((`getconf _NPROCESSORS_ONLN`+1)) $$OUTPUTSYNC LATEXMKOPTS='-quiet' all-pdf && $(MAKE) FMT=pdf zip bz2)
245246
cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-a4.zip
246247
cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-a4.tar.bz2
247248
@echo "Build finished and archived!"

Doc/c-api/allocation.rst

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ Allocating Objects on the Heap
140140
* :c:member:`~PyTypeObject.tp_alloc`
141141

142142

143-
.. c:function:: void PyObject_Del(void *op)
144-
145-
Same as :c:func:`PyObject_Free`.
146-
147143
.. c:var:: PyObject _Py_NoneStruct
148144
149145
Object which is visible in Python as ``None``. This should only be accessed
@@ -156,3 +152,35 @@ Allocating Objects on the Heap
156152
:ref:`moduleobjects`
157153
To allocate and create extension modules.
158154

155+
156+
Deprecated aliases
157+
^^^^^^^^^^^^^^^^^^
158+
159+
These are :term:`soft deprecated` aliases to existing functions and macros.
160+
They exist solely for backwards compatibility.
161+
162+
163+
.. list-table::
164+
:widths: auto
165+
:header-rows: 1
166+
167+
* * Deprecated alias
168+
* Function
169+
* * .. c:macro:: PyObject_NEW(type, typeobj)
170+
* :c:macro:`PyObject_New`
171+
* * .. c:macro:: PyObject_NEW_VAR(type, typeobj, n)
172+
* :c:macro:`PyObject_NewVar`
173+
* * .. c:macro:: PyObject_INIT(op, typeobj)
174+
* :c:func:`PyObject_Init`
175+
* * .. c:macro:: PyObject_INIT_VAR(op, typeobj, n)
176+
* :c:func:`PyObject_InitVar`
177+
* * .. c:macro:: PyObject_MALLOC(n)
178+
* :c:func:`PyObject_Malloc`
179+
* * .. c:macro:: PyObject_REALLOC(p, n)
180+
* :c:func:`PyObject_Realloc`
181+
* * .. c:macro:: PyObject_FREE(p)
182+
* :c:func:`PyObject_Free`
183+
* * .. c:macro:: PyObject_DEL(p)
184+
* :c:func:`PyObject_Free`
185+
* * .. c:macro:: PyObject_Del(p)
186+
* :c:func:`PyObject_Free`

0 commit comments

Comments
 (0)