Skip to content

Commit bb3ea59

Browse files
committed
Merge branch 'main' into use-attributes-to-guide-inline-values-size
2 parents 3d7e23f + 0b0f7be commit bb3ea59

File tree

430 files changed

+22877
-10361
lines changed

Some content is hidden

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

430 files changed

+22877
-10361
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM docker.io/library/fedora:40
22

33
ENV CC=clang
44

5-
ENV WASI_SDK_VERSION=22
5+
ENV WASI_SDK_VERSION=24
66
ENV WASI_SDK_PATH=/opt/wasi-sdk
77

88
ENV WASMTIME_HOME=/opt/wasmtime
@@ -14,7 +14,7 @@ RUN dnf -y --nodocs --setopt=install_weak_deps=False install /usr/bin/{blurb,cla
1414
dnf -y clean all
1515

1616
RUN mkdir ${WASI_SDK_PATH} && \
17-
curl --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-linux.tar.gz | \
17+
curl --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz | \
1818
tar --strip-components 1 --directory ${WASI_SDK_PATH} --extract --gunzip
1919

2020
RUN mkdir --parents ${WASMTIME_HOME} && \

.github/workflows/reusable-change-detection.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,18 @@ jobs:
126126
.github/workflows/reusable-docs.yml
127127
format: csv # works for paths with spaces
128128
- name: Check for docs changes
129+
# We only want to run this on PRs when related files are changed,
130+
# or when user triggers manual workflow run.
129131
if: >-
130-
github.event_name == 'pull_request'
131-
&& steps.changed-docs-files.outputs.added_modified_renamed != ''
132+
(
133+
github.event_name == 'pull_request'
134+
&& steps.changed-docs-files.outputs.added_modified_renamed != ''
135+
) || github.event_name == 'workflow_dispatch'
132136
id: docs-changes
133137
run: |
134138
echo "run-docs=true" >> "${GITHUB_OUTPUT}"
135139
- name: Get a list of the MSI installer-related files
140+
if: github.event_name == 'pull_request'
136141
id: changed-win-msi-files
137142
uses: Ana06/get-changed-files@v2.3.0
138143
with:
@@ -141,10 +146,13 @@ jobs:
141146
.github/workflows/reusable-windows-msi.yml
142147
format: csv # works for paths with spaces
143148
- name: Check for changes in MSI installer-related files
149+
# We only want to run this on PRs when related files are changed,
150+
# or when user triggers manual workflow run.
144151
if: >-
145-
steps.changed-win-msi-files.outputs.added_modified_renamed != ''
152+
(
153+
github.event_name == 'pull_request'
154+
&& steps.changed-win-msi-files.outputs.added_modified_renamed != ''
155+
) || github.event_name == 'workflow_dispatch'
146156
id: win-msi-changes
147157
run: |
148158
echo "run-win-msi=true" >> "${GITHUB_OUTPUT}"
149-
150-
...

.github/workflows/reusable-docs.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,15 @@ jobs:
2525
- name: 'Check out latest PR branch commit'
2626
uses: actions/checkout@v4
2727
with:
28-
ref: ${{ github.event.pull_request.head.sha }}
28+
ref: >-
29+
${{
30+
github.event_name == 'pull_request'
31+
&& github.event.pull_request.head.sha
32+
|| ''
33+
}}
2934
# Adapted from https://github.com/actions/checkout/issues/520#issuecomment-1167205721
3035
- name: 'Fetch commits to get branch diff'
36+
if: github.event_name == 'pull_request'
3137
run: |
3238
# Fetch enough history to find a common ancestor commit (aka merge-base):
3339
git fetch origin ${{ env.refspec_pr }} --depth=$(( ${{ github.event.pull_request.commits }} + 1 )) \

.github/workflows/reusable-macos.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ jobs:
4848
--prefix=/opt/python-dev \
4949
--with-openssl="$(brew --prefix openssl@3.0)"
5050
- name: Build CPython
51-
run: make -j8
51+
run: set -o pipefail; make -j8 2>&1 | tee compiler_output.txt
5252
- name: Display build info
5353
run: make pythoninfo
54+
- name: Check compiler warnings
55+
run: python3 Tools/build/check_warnings.py --compiler-output-file-path=compiler_output.txt --warning-ignore-file-path=Tools/build/.warningignore_macos --compiler-output-type=clang
5456
- name: Tests
5557
run: make test

.github/workflows/reusable-ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
working-directory: ${{ env.CPYTHON_BUILDDIR }}
8181
run: make pythoninfo
8282
- name: Check compiler warnings
83-
run: python Tools/build/check_warnings.py --compiler-output-file-path=${{ env.CPYTHON_BUILDDIR }}/compiler_output.txt --warning-ignore-file-path ${GITHUB_WORKSPACE}/Tools/build/.warningignore_ubuntu
83+
run: python Tools/build/check_warnings.py --compiler-output-file-path=${{ env.CPYTHON_BUILDDIR }}/compiler_output.txt --warning-ignore-file-path ${GITHUB_WORKSPACE}/Tools/build/.warningignore_ubuntu --compiler-output-type=json
8484
- name: Remount sources writable for tests
8585
# some tests write to srcdir, lack of pyc files slows down testing
8686
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw

.github/workflows/reusable-wasi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-22.04
1313
env:
1414
WASMTIME_VERSION: 22.0.0
15-
WASI_SDK_VERSION: 22
15+
WASI_SDK_VERSION: 24
1616
WASI_SDK_PATH: /opt/wasi-sdk
1717
CROSS_BUILD_PYTHON: cross-build/build
1818
CROSS_BUILD_WASI: cross-build/wasm32-wasi
@@ -33,7 +33,7 @@ jobs:
3333
if: steps.cache-wasi-sdk.outputs.cache-hit != 'true'
3434
run: |
3535
mkdir ${{ env.WASI_SDK_PATH }} && \
36-
curl -s -S --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-linux.tar.gz | \
36+
curl -s -S --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-x86_64-linux.tar.gz | \
3737
tar --strip-components 1 --directory ${{ env.WASI_SDK_PATH }} --extract --gunzip
3838
- name: "Configure ccache action"
3939
uses: hendrikmuhs/ccache-action@v1.2

Android/README.md

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ you don't already have the SDK, here's how to install it:
2525
The `android.py` script also requires the following commands to be on the `PATH`:
2626

2727
* `curl`
28-
* `java`
28+
* `java` (or set the `JAVA_HOME` environment variable)
2929
* `tar`
3030
* `unzip`
3131

@@ -80,18 +80,54 @@ call. For example, if you want a pydebug build that also caches the results from
8080

8181
## Testing
8282

83-
To run the Python test suite on Android:
84-
85-
* Install Android Studio, if you don't already have it.
86-
* Follow the instructions in the previous section to build all supported
87-
architectures.
88-
* Run `./android.py setup-testbed` to download the Gradle wrapper.
89-
* Open the `testbed` directory in Android Studio.
90-
* In the *Device Manager* dock, connect a device or start an emulator.
91-
Then select it from the drop-down list in the toolbar.
92-
* Click the "Run" button in the toolbar.
93-
* The testbed app displays nothing on screen while running. To see its output,
94-
open the [Logcat window](https://developer.android.com/studio/debug/logcat).
95-
96-
To run specific tests, or pass any other arguments to the test suite, edit the
97-
command line in testbed/app/src/main/python/main.py.
83+
The tests can be run on Linux, macOS, or Windows, although on Windows you'll
84+
have to build the `cross-build/HOST` subdirectory on one of the other platforms
85+
and copy it over.
86+
87+
The test suite can usually be run on a device with 2 GB of RAM, though for some
88+
configurations or test orders you may need to increase this. As of Android
89+
Studio Koala, 2 GB is the default for all emulators, although the user interface
90+
may indicate otherwise. The effective setting is `hw.ramSize` in
91+
~/.android/avd/*.avd/hardware-qemu.ini, whereas Android Studio displays the
92+
value from config.ini. Changing the value in Android Studio will update both of
93+
these files.
94+
95+
Before running the test suite, follow the instructions in the previous section
96+
to build the architecture you want to test. Then run the test script in one of
97+
the following modes:
98+
99+
* In `--connected` mode, it runs on a device or emulator you have already
100+
connected to the build machine. List the available devices with
101+
`$ANDROID_HOME/platform-tools/adb devices -l`, then pass a device ID to the
102+
script like this:
103+
104+
```sh
105+
./android.py test --connected emulator-5554
106+
```
107+
108+
* In `--managed` mode, it uses a temporary headless emulator defined in the
109+
`managedDevices` section of testbed/app/build.gradle.kts. This mode is slower,
110+
but more reproducible.
111+
112+
We currently define two devices: `minVersion` and `maxVersion`, corresponding
113+
to our minimum and maximum supported Android versions. For example:
114+
115+
```sh
116+
./android.py test --managed maxVersion
117+
```
118+
119+
By default, the only messages the script will show are Python's own stdout and
120+
stderr. Add the `-v` option to also show Gradle output, and non-Python logcat
121+
messages.
122+
123+
Any other arguments on the `android.py test` command line will be passed through
124+
to `python -m test` – use `--` to separate them from android.py's own options.
125+
See the [Python Developer's
126+
Guide](https://devguide.python.org/testing/run-write-tests/) for common options
127+
– most of them will work on Android, except for those that involve subprocesses,
128+
such as `-j`.
129+
130+
Every time you run `android.py test`, changes in pure-Python files in the
131+
repository's `Lib` directory will be picked up immediately. Changes in C files,
132+
and architecture-specific files such as sysconfigdata, will not take effect
133+
until you re-run `android.py make-host` or `build`.

Android/android-env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ndk_version=26.2.11394342
2828

2929
ndk=$ANDROID_HOME/ndk/$ndk_version
3030
if ! [ -e $ndk ]; then
31-
log "Installing NDK: this may take several minutes"
31+
log "Installing NDK - this may take several minutes"
3232
yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "ndk;$ndk_version"
3333
fi
3434

0 commit comments

Comments
 (0)