Skip to content

Commit 55a8237

Browse files
Merge branch 'main' into threading-fix-failed-thread-state-cleanup
2 parents 3162202 + 4759ba6 commit 55a8237

26 files changed

+727
-381
lines changed

.github/actionlint.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
self-hosted-runner:
2+
labels: ["ubuntu-24.04-aarch64", "windows-aarch64"]
3+
4+
config-variables: null
5+
6+
paths:
7+
.github/workflows/**/*.yml:
8+
ignore:
9+
- 1st argument of function call is not assignable
10+
- SC2(015|038|086|091|097|098|129|155)

.github/workflows/build.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,28 @@ jobs:
150150
needs: check_source
151151
if: fromJSON(needs.check_source.outputs.run_tests)
152152
strategy:
153+
fail-fast: false
153154
matrix:
155+
os:
156+
- windows-latest
154157
arch:
155-
- Win32
156-
- x64
157-
- arm64
158+
- x64
158159
free-threading:
159-
- false
160-
- true
160+
- false
161+
- true
162+
include:
163+
- os: windows-latest # FIXME(diegorusso): change to os: windows-aarch64
164+
arch: arm64
165+
free-threading: false
166+
- os: windows-latest # FIXME(diegorusso): change to os: windows-aarch64
167+
arch: arm64
168+
free-threading: true
169+
- os: windows-latest
170+
arch: Win32
171+
free-threading: false
161172
uses: ./.github/workflows/reusable-windows.yml
162173
with:
174+
os: ${{ matrix.os }}
163175
arch: ${{ matrix.arch }}
164176
free-threading: ${{ matrix.free-threading }}
165177

.github/workflows/reusable-ubuntu.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
os: [ubuntu-24.04]
23+
os: [ubuntu-24.04, ubuntu-24.04-aarch64]
2424
env:
2525
FORCE_COLOR: 1
2626
OPENSSL_VER: 3.0.15
@@ -82,11 +82,11 @@ jobs:
8282
- name: Build CPython out-of-tree
8383
if: ${{ inputs.free-threading }}
8484
working-directory: ${{ env.CPYTHON_BUILDDIR }}
85-
run: make -j4
85+
run: make -j
8686
- name: Build CPython out-of-tree (for compiler warning check)
8787
if: ${{ !inputs.free-threading}}
8888
working-directory: ${{ env.CPYTHON_BUILDDIR }}
89-
run: set -o pipefail; make -j4 --output-sync 2>&1 | tee compiler_output_ubuntu.txt
89+
run: set -o pipefail; make -j --output-sync 2>&1 | tee compiler_output_ubuntu.txt
9090
- name: Display build info
9191
working-directory: ${{ env.CPYTHON_BUILDDIR }}
9292
run: make pythoninfo

.github/workflows/reusable-windows.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Reusable Windows
33
on:
44
workflow_call:
55
inputs:
6+
os:
7+
description: OS to run on
8+
required: true
9+
type: string
610
arch:
711
description: CPU architecture
812
required: true
@@ -19,10 +23,8 @@ env:
1923
2024
jobs:
2125
build:
22-
name: >-
23-
build${{ inputs.arch != 'arm64' && ' and test' || '' }}
24-
(${{ inputs.arch }})
25-
runs-on: windows-latest
26+
name: 'build and test (${{ inputs.arch }})'
27+
runs-on: ${{ inputs.os }}
2628
timeout-minutes: 60
2729
steps:
2830
- uses: actions/checkout@v4
@@ -31,17 +33,17 @@ jobs:
3133
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
3234
- name: Build CPython
3335
run: >-
34-
.\PCbuild\build.bat
36+
.\\PCbuild\\build.bat
3537
-e -d -v
3638
-p ${{ inputs.arch }}
3739
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
38-
- name: Display build info
40+
- name: Display build info # FIXME(diegorusso): remove the `if`
3941
if: inputs.arch != 'arm64'
40-
run: .\python.bat -m test.pythoninfo
41-
- name: Tests
42+
run: .\\python.bat -m test.pythoninfo
43+
- name: Tests # FIXME(diegorusso): remove the `if`
4244
if: inputs.arch != 'arm64'
4345
run: >-
44-
.\PCbuild\rt.bat
46+
.\\PCbuild\\rt.bat
4547
-p ${{ inputs.arch }}
4648
-d -q --fast-ci
4749
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}

.pre-commit-config.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,9 @@ repos:
5757
- id: check-github-workflows
5858

5959
- repo: https://github.com/rhysd/actionlint
60-
rev: v1.7.3
60+
rev: v1.7.4
6161
hooks:
6262
- id: actionlint
63-
args: [
64-
-ignore=1st argument of function call is not assignable,
65-
-ignore=SC2(015|038|086|091|097|098|129|155),
66-
]
6763

6864
- repo: https://github.com/sphinx-contrib/sphinx-lint
6965
rev: v1.0.0

Doc/library/argparse.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ your usage messages.
195195
When a custom usage message is specified for the main parser, you may also want to
196196
consider passing the ``prog`` argument to :meth:`~ArgumentParser.add_subparsers`
197197
or the ``prog`` and the ``usage`` arguments to
198-
:meth:`~_SubParsersAction.add_parser`, to ensure consistent command prefixes and
198+
:meth:`~_SubParsersAction.add_parser`, to ensure consistent command prefixes and
199199
usage information across subparsers.
200200

201201

Doc/library/shutil.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -491,12 +491,6 @@ Directory and files operations
491491
or ends with an extension that is in ``PATHEXT``; and filenames that
492492
have no extension can now be found.
493493

494-
.. versionchanged:: 3.12.1
495-
On Windows, if *mode* includes ``os.X_OK``, executables with an
496-
extension in ``PATHEXT`` will be preferred over executables without a
497-
matching extension.
498-
This brings behavior closer to that of Python 3.11.
499-
500494
.. exception:: Error
501495

502496
This exception collects exceptions that are raised during a multi-file

Include/internal/pycore_interp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,8 @@ struct _is {
283283

284284
/* the initial PyInterpreterState.threads.head */
285285
_PyThreadStateImpl _initial_thread;
286+
// _initial_thread should be the last field of PyInterpreterState.
287+
// See https://github.com/python/cpython/issues/127117.
286288
};
287289

288290

Include/internal/pycore_opcode_metadata.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_runtime.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ typedef struct pyruntimestate {
169169
struct _Py_unicode_runtime_state unicode_state;
170170
struct _types_runtime_state types;
171171

172+
#if defined(__EMSCRIPTEN__) && defined(PY_CALL_TRAMPOLINE)
173+
// Used in "Python/emscripten_trampoline.c" to choose between type
174+
// reflection trampoline and EM_JS trampoline.
175+
bool wasm_type_reflection_available;
176+
#endif
177+
172178
/* All the objects that are shared by the runtime's interpreters. */
173179
struct _Py_cached_objects cached_objects;
174180
struct _Py_static_objects static_objects;
@@ -189,13 +195,8 @@ typedef struct pyruntimestate {
189195

190196
/* _PyRuntimeState.interpreters.main */
191197
PyInterpreterState _main_interpreter;
192-
193-
#if defined(__EMSCRIPTEN__) && defined(PY_CALL_TRAMPOLINE)
194-
// Used in "Python/emscripten_trampoline.c" to choose between type
195-
// reflection trampoline and EM_JS trampoline.
196-
bool wasm_type_reflection_available;
197-
#endif
198-
198+
// _main_interpreter should be the last field of _PyRuntimeState.
199+
// See https://github.com/python/cpython/issues/127117.
199200
} _PyRuntimeState;
200201

201202

0 commit comments

Comments
 (0)