Skip to content

Commit 643c47c

Browse files
committed
ci: provide explicit toolchain input to dtolnay/rust-toolchain
The action requires a `toolchain` input — when SHA-pinned (which is our policy), the action can't infer the channel from action_ref the way `@stable`/`@1.93.1` ref pins would, so it errors out with "'toolchain' is a required input". The original comments ("toolchain version is read from rust-toolchain.toml") referred to rustup's behavior after install, not the action's pre-install resolution — the action doesn't read rust-toolchain.toml itself. Set `toolchain: "1.93.1"` on every Install Rust step, matching the channel in rust-toolchain.toml. The duplication is intentional: if they drift, rustup will reconcile by installing the toolchain.toml channel on first cargo invocation, just at a small extra cost.
1 parent 25aa3b8 commit 643c47c

1 file changed

Lines changed: 28 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ jobs:
1919

2020
- name: Install Rust
2121
uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # stable
22-
# toolchain version + components are read from rust-toolchain.toml.
22+
with:
23+
# Must match rust-toolchain.toml's channel. The SHA-pinned
24+
# action can't read action_ref for the toolchain (it's a
25+
# SHA, not a channel name) so we have to be explicit.
26+
toolchain: "1.93.1"
2327

2428
- name: Cache cargo
2529
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
@@ -48,7 +52,11 @@ jobs:
4852

4953
- name: Install Rust
5054
uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # stable
51-
# toolchain version is read from rust-toolchain.toml (exact-pinned).
55+
with:
56+
# Must match rust-toolchain.toml's channel. The SHA-pinned
57+
# action can't read action_ref for the toolchain (it's a
58+
# SHA, not a channel name) so we have to be explicit.
59+
toolchain: "1.93.1"
5260

5361
- name: Cache cargo
5462
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
@@ -76,7 +84,11 @@ jobs:
7684

7785
- name: Install Rust
7886
uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # stable
79-
# toolchain version is read from rust-toolchain.toml (exact-pinned).
87+
with:
88+
# Must match rust-toolchain.toml's channel. The SHA-pinned
89+
# action can't read action_ref for the toolchain (it's a
90+
# SHA, not a channel name) so we have to be explicit.
91+
toolchain: "1.93.1"
8092

8193
- name: Cache cargo
8294
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
@@ -109,9 +121,10 @@ jobs:
109121
- name: Install Rust
110122
uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # stable
111123
with:
124+
# Must match rust-toolchain.toml's channel.
125+
toolchain: "1.93.1"
112126
# `llvm-tools-preview` is what cargo-llvm-cov uses to merge
113-
# `.profraw` files and emit lcov. The toolchain channel itself
114-
# is read from `rust-toolchain.toml`.
127+
# `.profraw` files and emit lcov.
115128
components: llvm-tools-preview
116129

117130
- name: Install cargo-llvm-cov
@@ -203,6 +216,8 @@ jobs:
203216
- name: Install Rust
204217
uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # stable
205218
with:
219+
# Must match rust-toolchain.toml's channel.
220+
toolchain: "1.93.1"
206221
components: llvm-tools-preview
207222

208223
- name: Install cargo-llvm-cov
@@ -396,7 +411,11 @@ jobs:
396411

397412
- name: Install Rust
398413
uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # stable
399-
# toolchain version is read from rust-toolchain.toml (exact-pinned).
414+
with:
415+
# Must match rust-toolchain.toml's channel. The SHA-pinned
416+
# action can't read action_ref for the toolchain (it's a
417+
# SHA, not a channel name) so we have to be explicit.
418+
toolchain: "1.93.1"
400419

401420
- name: Cache cargo
402421
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
@@ -462,7 +481,9 @@ jobs:
462481

463482
- name: Install Rust
464483
uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # stable
465-
# toolchain version is read from rust-toolchain.toml.
484+
with:
485+
# Must match rust-toolchain.toml's channel.
486+
toolchain: "1.93.1"
466487

467488
# No `actions/cache` here intentionally. This job builds Docker
468489
# images and would be flagged by zizmor's cache-poisoning audit.

0 commit comments

Comments
 (0)