Skip to content

Commit e1f8be7

Browse files
authored
Merge branch 'RustPython:main' into main
2 parents b119be2 + b275a90 commit e1f8be7

File tree

16 files changed

+1369
-419
lines changed

16 files changed

+1369
-419
lines changed

.github/workflows/ci.yaml

Lines changed: 54 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ env:
2727
PYTHON_VERSION: "3.14.3"
2828
X86_64_PC_WINDOWS_MSVC_OPENSSL_LIB_DIR: C:\Program Files\OpenSSL\lib\VC\x64\MD
2929
X86_64_PC_WINDOWS_MSVC_OPENSSL_INCLUDE_DIR: C:\Program Files\OpenSSL\include
30+
CARGO_INCREMENTAL: 0
31+
CARGO_TERM_COLOR: always
3032

3133
jobs:
3234
rust_tests:
@@ -45,7 +47,7 @@ jobs:
4547
with:
4648
persist-credentials: false
4749

48-
- uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9
50+
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
4951
with:
5052
components: clippy
5153
toolchain: stable
@@ -108,41 +110,39 @@ jobs:
108110

109111
cargo_check:
110112
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
111-
name: Ensure compilation on various targets
113+
name: cargo check
112114
runs-on: ${{ matrix.os }}
113115
strategy:
114116
matrix:
115117
include:
116118
- os: ubuntu-latest
117-
targets:
118-
- aarch64-linux-android
119-
- i686-unknown-linux-gnu
120-
- i686-unknown-linux-musl
121-
- wasm32-wasip2
122-
- x86_64-unknown-freebsd
119+
target: aarch64-linux-android
120+
- os: ubuntu-latest
121+
target: i686-unknown-linux-gnu
123122
dependencies:
124123
gcc-multilib: true
124+
- os: ubuntu-latest
125+
target: i686-unknown-linux-musl
126+
dependencies:
125127
musl-tools: true
126128
- os: ubuntu-latest
127-
targets:
128-
- aarch64-unknown-linux-gnu
129+
target: wasm32-wasip2
130+
- os: ubuntu-latest
131+
target: x86_64-unknown-freebsd
132+
- os: ubuntu-latest
133+
target: aarch64-unknown-linux-gnu
129134
dependencies:
130-
gcc-aarch64-linux-gnu: true # conflict with `gcc-multilib`
135+
gcc-aarch64-linux-gnu: true
131136
- os: macos-latest
132-
targets:
133-
- aarch64-apple-ios
134-
- x86_64-apple-darwin
137+
target: aarch64-apple-ios
138+
- os: macos-latest
139+
target: x86_64-apple-darwin
135140
fail-fast: false
136141
steps:
137142
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
138143
with:
139144
persist-credentials: false
140145

141-
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
142-
with:
143-
prefix-key: v0-rust-${{ join(matrix.targets, '-') }}
144-
save-if: ${{ github.ref == 'refs/heads/main' }}
145-
146146
- name: Install dependencies
147147
uses: ./.github/actions/install-linux-deps
148148
# zizmor has an issue with dynamic `with`
@@ -152,13 +152,25 @@ jobs:
152152
musl-tools: ${{ matrix.dependencies.musl-tools || false }}
153153
gcc-aarch64-linux-gnu: ${{ matrix.dependencies.gcc-aarch64-linux-gnu || false }}
154154

155-
- uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9
155+
- name: Restore cache
156+
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
157+
if: ${{ github.ref != 'refs/heads/main' }} # Never restore on main
156158
with:
157-
targets: ${{ join(matrix.targets, ',') }}
158-
toolchain: stable
159+
path: |
160+
~/.cargo/bin/
161+
~/.cargo/registry/index/
162+
~/.cargo/registry/cache/
163+
~/.cargo/git/db/
164+
target/
165+
# key won't match, will rely on restore-keys
166+
key: cargo-check-${{ runner.os }}-${{ matrix.target }}
167+
restore-keys: |
168+
cargo-check-${{ runner.os }}-${{ matrix.target }}-
169+
170+
- run: rustup toolchain install stable --target "${{ matrix.target }}"
159171

160172
- name: Setup Android NDK
161-
if: ${{ contains(matrix.targets, 'aarch64-linux-android') }}
173+
if: ${{ matrix.target == 'aarch64-linux-android' }}
162174
id: setup-ndk
163175
uses: nttld/setup-ndk@v1
164176
with:
@@ -174,18 +186,24 @@ jobs:
174186
# args: --ignore-rust-version
175187

176188
- name: Check compilation
177-
run: |
178-
for target in ${{ join(matrix.targets, ' ') }}
179-
do
180-
echo "::group::${target}"
181-
cargo check --target $target ${{ env.CARGO_ARGS_NO_SSL }}
182-
echo "::endgroup::"
183-
done
189+
run: cargo check --target "${{ matrix.target }}" ${{ env.CARGO_ARGS_NO_SSL }}
184190
env:
185191
CC_aarch64_linux_android: ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang
186192
AR_aarch64_linux_android: ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar
187193
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER: ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang
188194

195+
- name: Save cache
196+
if: ${{ github.ref == 'refs/heads/main' }} # only save on main
197+
uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
198+
with:
199+
path: |
200+
~/.cargo/bin/
201+
~/.cargo/registry/index/
202+
~/.cargo/registry/cache/
203+
~/.cargo/git/db/
204+
target/
205+
key: cargo-check-${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('Cargo.lock') }}-${{ github.sha }}
206+
189207
snippets_cpython:
190208
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
191209
env:
@@ -230,7 +248,7 @@ jobs:
230248
with:
231249
persist-credentials: false
232250

233-
- uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9
251+
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
234252
with:
235253
toolchain: stable
236254

@@ -345,7 +363,7 @@ jobs:
345363
with:
346364
python-version: ${{ env.PYTHON_VERSION }}
347365

348-
- uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9
366+
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
349367
with:
350368
toolchain: stable
351369
components: rustfmt
@@ -372,7 +390,7 @@ jobs:
372390

373391
- name: prek
374392
id: prek
375-
uses: j178/prek-action@79f765515bd648eb4d6bb1b17277b7cb22cb6468 # v2.0.0
393+
uses: j178/prek-action@53276d8b0d10f8b6672aa85b4588c6921d0370cc # v2.0.1
376394
with:
377395
cache: false
378396
show-verbose-logs: false
@@ -404,7 +422,7 @@ jobs:
404422
with:
405423
persist-credentials: false
406424

407-
- uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9
425+
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
408426
with:
409427
toolchain: ${{ env.NIGHTLY_CHANNEL }}
410428
components: miri
@@ -430,7 +448,7 @@ jobs:
430448
with:
431449
persist-credentials: false
432450

433-
- uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9
451+
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
434452
with:
435453
components: clippy
436454
toolchain: stable
@@ -508,7 +526,7 @@ jobs:
508526
with:
509527
persist-credentials: false
510528

511-
- uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9
529+
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
512530
with:
513531
target: wasm32-wasip1
514532
toolchain: stable

.github/workflows/comment-commands.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ jobs:
1818
steps:
1919
# Using REST API and not `gh issue edit`. https://github.com/cli/cli/issues/6235#issuecomment-1243487651
2020
- run: |
21-
curl -H "Authorization: token ${{ github.token }}" -d '{"assignees": ["${{ github.event.comment.user.login }}"]}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees
21+
curl -H "Authorization: token ${{ github.token }}" -d '{"assignees": ["${{ env.USER }}"]}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees
22+
env:
23+
USER: ${{ github.event.comment.user.login }}

.github/workflows/release.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ on:
1212
required: false
1313
default: true
1414

15-
permissions:
16-
contents: write
17-
1815
env:
1916
X86_64_PC_WINDOWS_MSVC_OPENSSL_LIB_DIR: C:\Program Files\OpenSSL\lib\VC\x64\MD
2017
X86_64_PC_WINDOWS_MSVC_OPENSSL_INCLUDE_DIR: C:\Program Files\OpenSSL\include
@@ -55,7 +52,7 @@ jobs:
5552
with:
5653
persist-credentials: false
5754

58-
- uses: dtolnay/rust-toolchain@stable
55+
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
5956
with:
6057
target: ${{ matrix.target }}
6158

@@ -92,7 +89,7 @@ jobs:
9289
with:
9390
persist-credentials: false
9491

95-
- uses: dtolnay/rust-toolchain@stable
92+
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
9693
with:
9794
targets: wasm32-wasip1
9895

@@ -115,8 +112,9 @@ jobs:
115112
with:
116113
package-manager-cache: false
117114

118-
- uses: mwilliamson/setup-wabt-action@v3
119-
with: { wabt-version: "1.0.30" }
115+
- uses: mwilliamson/setup-wabt-action@febe2a12b7ccb999a6e5d953a8362a3b7ffcf148 # v3.2.0
116+
with:
117+
wabt-version: "1.0.30"
120118

121119
- name: build demo
122120
run: |
@@ -137,7 +135,7 @@ jobs:
137135

138136
- name: Deploy demo to Github Pages
139137
if: ${{ github.repository == 'RustPython/RustPython' }}
140-
uses: peaceiris/actions-gh-pages@v4
138+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
141139
with:
142140
deploy_key: ${{ secrets.ACTIONS_DEMO_DEPLOY_KEY }}
143141
publish_dir: ./wasm/demo/dist

Cargo.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ rand_core = { version = "0.9", features = ["os_rng"] }
214214
rustix = { version = "1.1", features = ["event"] }
215215
rustyline = "17.0.1"
216216
serde = { package = "serde_core", version = "1.0.225", default-features = false, features = ["alloc"] }
217-
schannel = "0.1.28"
217+
schannel = "0.1.29"
218218
scoped-tls = "1"
219219
scopeguard = "1"
220220
static_assertions = "1.1"

Lib/test/test_peepholer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,6 @@ def f(x):
529529
self.assertEqual(len(returns), 1)
530530
self.check_lnotab(f)
531531

532-
@unittest.expectedFailure # TODO: RUSTPYTHON; KeyError: 20
533532
def test_elim_jump_to_return(self):
534533
# JUMP_FORWARD to RETURN --> RETURN
535534
def f(cond, true_value, false_value):

0 commit comments

Comments
 (0)