Skip to content

Commit 63812b5

Browse files
committed
Merge remote-tracking branch 'upstream/main' into vfazio-thread_get_ident
2 parents 140a4d8 + b0f77c4 commit 63812b5

File tree

1,084 files changed

+43280
-22775
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,084 files changed

+43280
-22775
lines changed

.github/CODEOWNERS

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,16 @@ Objects/exceptions.c @iritkatriel
107107
# Hashing & cryptographic primitives
108108
**/*hashlib* @gpshead @tiran @picnixz
109109
**/*hashopenssl* @gpshead @tiran @picnixz
110-
**/*pyhash* @gpshead @tiran
111-
**/sha* @gpshead @tiran @picnixz
112-
Modules/md5* @gpshead @tiran @picnixz
113-
**/*blake* @gpshead @tiran @picnixz
114-
Modules/_hacl/** @gpshead
110+
**/*pyhash* @gpshead @tiran @picnixz
111+
Modules/*blake* @gpshead @tiran @picnixz
112+
Modules/*md5* @gpshead @tiran @picnixz
113+
Modules/*sha* @gpshead @tiran @picnixz
114+
Modules/_hacl/** @gpshead @picnixz
115115
**/*hmac* @gpshead @picnixz
116116

117+
# libssl
118+
**/*ssl* @gpshead @picnixz
119+
117120
# logging
118121
**/*logging* @vsajip
119122

@@ -309,3 +312,6 @@ Doc/reference/ @willingc @AA-Turner
309312
# Colorize
310313
Lib/_colorize.py @hugovk
311314
Lib/test/test__colorize.py @hugovk
315+
316+
# Fuzzing
317+
Modules/_xxtestfuzz/ @ammaraskar

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ jobs:
185185
needs: build-context
186186
if: fromJSON(needs.build-context.outputs.run-windows-msi)
187187
strategy:
188+
fail-fast: false
188189
matrix:
189190
arch:
190191
- x86
@@ -236,6 +237,7 @@ jobs:
236237
needs: build-context
237238
if: needs.build-context.outputs.run-tests == 'true'
238239
strategy:
240+
fail-fast: false
239241
matrix:
240242
bolt:
241243
- false
@@ -452,6 +454,7 @@ jobs:
452454
needs: build-context
453455
if: needs.build-context.outputs.run-tests == 'true'
454456
strategy:
457+
fail-fast: false
455458
matrix:
456459
os: [ubuntu-24.04]
457460
env:
@@ -515,6 +518,7 @@ jobs:
515518
needs: build-context
516519
if: needs.build-context.outputs.run-tests == 'true'
517520
strategy:
521+
fail-fast: false
518522
matrix:
519523
free-threading:
520524
- false

.github/workflows/jit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ jobs:
139139
runs-on: ubuntu-24.04
140140
timeout-minutes: 90
141141
strategy:
142+
fail-fast: false
142143
matrix:
143144
llvm:
144145
- 19

.github/workflows/project-updater.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
timeout-minutes: 10
1717
strategy:
18+
fail-fast: false
1819
matrix:
1920
include:
2021
# if an issue has any of these labels, it will be added

.github/workflows/require-pr-label.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ jobs:
1010
if: github.repository_owner == 'python'
1111
runs-on: ubuntu-latest
1212
permissions:
13-
issues: write
14-
pull-requests: write
13+
pull-requests: read
1514
timeout-minutes: 10
1615

1716
steps:
@@ -28,8 +27,7 @@ jobs:
2827
if: github.repository_owner == 'python'
2928
runs-on: ubuntu-latest
3029
permissions:
31-
issues: write
32-
pull-requests: write
30+
pull-requests: read
3331
timeout-minutes: 10
3432

3533
steps:

.github/workflows/tail-call.yml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ name: Tail calling interpreter
22
on:
33
pull_request:
44
paths:
5+
- '.github/workflows/tail-call.yml'
56
- 'Python/bytecodes.c'
67
- 'Python/ceval.c'
78
- 'Python/ceval_macros.h'
89
- 'Python/generated_cases.c.h'
910
push:
1011
paths:
12+
- '.github/workflows/tail-call.yml'
1113
- 'Python/bytecodes.c'
1214
- 'Python/ceval.c'
1315
- 'Python/ceval_macros.h'
@@ -35,7 +37,7 @@ jobs:
3537
target:
3638
# Un-comment as we add support for more platforms for tail-calling interpreters.
3739
# - i686-pc-windows-msvc/msvc
38-
# - x86_64-pc-windows-msvc/msvc
40+
- x86_64-pc-windows-msvc/msvc
3941
# - aarch64-pc-windows-msvc/msvc
4042
- x86_64-apple-darwin/clang
4143
- aarch64-apple-darwin/clang
@@ -48,9 +50,9 @@ jobs:
4850
# - target: i686-pc-windows-msvc/msvc
4951
# architecture: Win32
5052
# runner: windows-latest
51-
# - target: x86_64-pc-windows-msvc/msvc
52-
# architecture: x64
53-
# runner: windows-latest
53+
- target: x86_64-pc-windows-msvc/msvc
54+
architecture: x64
55+
runner: windows-latest
5456
# - target: aarch64-pc-windows-msvc/msvc
5557
# architecture: ARM64
5658
# runner: windows-latest
@@ -79,41 +81,49 @@ jobs:
7981

8082
- name: Native Windows (debug)
8183
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
84+
shell: cmd
8285
run: |
83-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
84-
./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
85-
./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
86+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.5
87+
set PlatformToolset=clangcl
88+
set LLVMToolsVersion=${{ matrix.llvm }}.1.5
89+
set LLVMInstallDir=C:\Program Files\LLVM
90+
call ./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
91+
call ./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
8692
8793
# No tests (yet):
8894
- name: Emulated Windows (release)
8995
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
96+
shell: cmd
9097
run: |
91-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
98+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.5
99+
set PlatformToolset=clangcl
100+
set LLVMToolsVersion=${{ matrix.llvm }}.1.5
101+
set LLVMInstallDir=C:\Program Files\LLVM
92102
./PCbuild/build.bat --tail-call-interp -p ${{ matrix.architecture }}
93103
94104
# The `find` line is required as a result of https://github.com/actions/runner-images/issues/9966.
95105
# This is a bug in the macOS runner image where the pre-installed Python is installed in the same
96106
# directory as the Homebrew Python, which causes the build to fail for macos-13. This line removes
97107
# the symlink to the pre-installed Python so that the Homebrew Python is used instead.
98-
- name: Native macOS (debug)
108+
- name: Native macOS (release)
99109
if: runner.os == 'macOS'
100110
run: |
101111
brew update
102112
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
103113
brew install llvm@${{ matrix.llvm }}
104114
export SDKROOT="$(xcrun --show-sdk-path)"
105-
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
106-
export PATH="/usr/local/opt/llvm/bin:$PATH"
107-
CC=clang-19 ./configure --with-tail-call-interp --with-pydebug
115+
export PATH="/opt/homebrew/opt/llvm@${{ matrix.llvm }}/bin:$PATH"
116+
export PATH="/usr/local/opt/llvm@${{ matrix.llvm }}/bin:$PATH"
117+
CC=clang-19 ./configure --with-tail-call-interp
108118
make all --jobs 4
109119
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
110120
111-
- name: Native Linux (release)
121+
- name: Native Linux (debug)
112122
if: runner.os == 'Linux' && matrix.target != 'free-threading'
113123
run: |
114124
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
115125
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
116-
CC=clang-19 ./configure --with-tail-call-interp
126+
CC=clang-19 ./configure --with-tail-call-interp --with-pydebug
117127
make all --jobs 4
118128
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
119129

Android/README.md

Lines changed: 47 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
# Python for Android
22

3-
These instructions are only needed if you're planning to compile Python for
4-
Android yourself. Most users should *not* need to do this. Instead, use one of
5-
the tools listed in `Doc/using/android.rst`, which will provide a much easier
6-
experience.
3+
If you obtained this README as part of a release package, then the only
4+
applicable sections are "Prerequisites", "Testing", and "Using in your own app".
75

6+
If you obtained this README as part of the CPython source tree, then you can
7+
also follow the other sections to compile Python for Android yourself.
8+
9+
However, most app developers should not need to do any of these things manually.
10+
Instead, use one of the tools listed
11+
[here](https://docs.python.org/3/using/android.html), which will provide a much
12+
easier experience.
813

9-
## Prerequisites
1014

11-
First, make sure you have all the usual tools and libraries needed to build
12-
Python for your development machine.
15+
## Prerequisites
1316

14-
Second, you'll need an Android SDK. If you already have the SDK installed,
15-
export the `ANDROID_HOME` environment variable to point at its location.
16-
Otherwise, here's how to install it:
17+
If you already have an Android SDK installed, export the `ANDROID_HOME`
18+
environment variable to point at its location. Otherwise, here's how to install
19+
it:
1720

1821
* Download the "Command line tools" from <https://developer.android.com/studio>.
1922
* Create a directory `android-sdk/cmdline-tools`, and unzip the command line
@@ -27,15 +30,16 @@ The `android.py` script also requires the following commands to be on the `PATH`
2730
* `curl`
2831
* `java` (or set the `JAVA_HOME` environment variable)
2932
* `tar`
30-
* `unzip`
3133

3234

3335
## Building
3436

3537
Python can be built for Android on any POSIX platform supported by the Android
36-
development tools, which currently means Linux or macOS. This involves doing a
37-
cross-build where you use a "build" Python (for your development machine) to
38-
help produce a "host" Python for Android.
38+
development tools, which currently means Linux or macOS.
39+
40+
First we'll make a "build" Python (for your development machine), then use it to
41+
help produce a "host" Python for Android. So make sure you have all the usual
42+
tools and libraries needed to build Python for your development machine.
3943

4044
The easiest way to do a build is to use the `android.py` script. You can either
4145
have it perform the entire build process from start to finish in one step, or
@@ -60,8 +64,8 @@ To do all steps in a single command, run:
6064
./android.py build HOST
6165
```
6266

63-
In the end you should have a build Python in `cross-build/build`, and an Android
64-
build in `cross-build/HOST`.
67+
In the end you should have a build Python in `cross-build/build`, and a host
68+
Python in `cross-build/HOST`.
6569

6670
You can use `--` as a separator for any of the `configure`-related commands –
6771
including `build` itself – to pass arguments to the underlying `configure`
@@ -73,14 +77,27 @@ call. For example, if you want a pydebug build that also caches the results from
7377
```
7478

7579

80+
## Packaging
81+
82+
After building an architecture as described in the section above, you can
83+
package it for release with this command:
84+
85+
```sh
86+
./android.py package HOST
87+
```
88+
89+
`HOST` is defined in the section above.
90+
91+
This will generate a tarball in `cross-build/HOST/dist`, whose structure is
92+
similar to the `Android` directory of the CPython source tree.
93+
94+
7695
## Testing
7796

78-
The test suite can be run on Linux, macOS, or Windows:
97+
The Python test suite can be run on Linux, macOS, or Windows:
7998

8099
* On Linux, the emulator needs access to the KVM virtualization interface, and
81100
a DISPLAY environment variable pointing at an X server.
82-
* On Windows, you won't be able to do the build on the same machine, so you'll
83-
have to copy the `cross-build/HOST` directory from somewhere else.
84101

85102
The test suite can usually be run on a device with 2 GB of RAM, but this is
86103
borderline, so you may need to increase it to 4 GB. As of Android
@@ -90,9 +107,16 @@ and find `hw.ramSize` in both config.ini and hardware-qemu.ini. Either set these
90107
manually to the same value, or use the Android Studio Device Manager, which will
91108
update both files.
92109

93-
Before running the test suite, follow the instructions in the previous section
94-
to build the architecture you want to test. Then run the test script in one of
95-
the following modes:
110+
You can run the test suite either:
111+
112+
* Within the CPython repository, after doing a build as described above. On
113+
Windows, you won't be able to do the build on the same machine, so you'll have
114+
to copy the `cross-build/HOST/prefix` directory from somewhere else.
115+
116+
* Or by taking a release package built using the `package` command, extracting
117+
it wherever you want, and using its own copy of `android.py`.
118+
119+
The test script supports the following modes:
96120

97121
* In `--connected` mode, it runs on a device or emulator you have already
98122
connected to the build machine. List the available devices with
@@ -133,4 +157,4 @@ until you re-run `android.py make-host` or `build`.
133157

134158
## Using in your own app
135159

136-
See `Doc/using/android.rst`.
160+
See https://docs.python.org/3/using/android.html.

0 commit comments

Comments
 (0)