Skip to content

Commit d36599e

Browse files
fix(cargo-anvil): make stable toolchains deterministic (#109)
* Make Anvil stable toolchains deterministic Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(cargo-anvil): test PRs against MSRV Add a conditional Linux PR check when a selecting toolchain file differs from the workspace MSRV, with support for mapped internal toolchains. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat(cargo-anvil): run MSRV tests across platforms Run affected-package tests under every declared root MSRV across the same GitHub and ADO platform matrices as ordinary PR tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test(cargo-anvil): accept PowerShell error streams Validate resolver diagnostics across stdout and stderr so the regression tests behave consistently across host PowerShell implementations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test(cargo-anvil): normalize resolver diagnostics Collapse PowerShell line wrapping before asserting resolver errors so the tests are portable across host terminal widths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test(cargo-anvil): ignore PowerShell line markers Assert stable resolver diagnostic fragments independently so PowerShell continuation markers do not make the tests host-dependent. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test(cargo-anvil): isolate impact fixtures from CI toolchain state Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(cargo-anvil): complete deterministic toolchain adoption Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test(cargo-anvil): quarantine resolver subprocess test from miri Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test(cargo-anvil): exclude resolver process tests from miri Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Scope stable toolchains to Anvil commands Remove the globally exported resolved toolchain and route stable commands through private Just helpers. Keep explicit nightly and MSRV selection at each command site, and preserve current-checkout toolchain selection for impact baselines. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Harden MSRV toolchain validation Reject incomplete internal mappings, accept member MSRVs satisfied by the root floor, and cover public and mapped MSRV provisioning branches. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Bootstrap Just before toolchain setup Install the Just bootstrap before invoking private resolver recipes in GitHub Actions, preserving recipe-based selection without assuming Just is preinstalled on hosted runners. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Make MSRV diagnostic test portable Accept PowerShell's platform-specific diagnostic wrapping while still asserting every actionable part of the mapped-toolchain error. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(cargo-anvil): preserve scoped command working directory Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e * fix(cargo-anvil): use native scoped command paths Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e * test(cargo-anvil): compare scoped paths canonically Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e * Remove nested stable toolchain wrappers Select stable toolchain arguments lazily in Just so Cargo and Rust commands run directly. Keep setup behavior recipe-owned and remove the generated resolver script. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e * Fix lazy toolchain selection portability Rely on Just's normal lazy evaluation and derive the repository root from the selector working directory so the embedded PowerShell works on Unix and Windows. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e * Integrate stable provisioning into setup Make stable toolchain preparation a shared setup prerequisite and evaluate the optional toolchain argument directly inside PowerShell recipes without host-specific shell invocation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e * Simplify deterministic toolchain resolution Delegate repository toolchain files to rustup, keep command-scoped explicit selection, and validate workspace MSRVs with the selected compiler. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e * Harden deterministic toolchain setup Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e * Preserve path-selected toolchain names Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e * Simplify stable toolchain selection Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e * Simplify cloud tool cache setup Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e * Address stable toolchain review feedback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e * Fix missing-rustup test on Linux Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e * Correct installer helper diagnostic Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e * Keep tool validation read-only Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e * Narrow read-only tool validation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e * Require rustup for native selections Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e * Match exact rustup toolchain selectors Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f7996e6f-5c20-4d7a-b2f7-690af95e557e
1 parent ff4aa04 commit d36599e

94 files changed

Lines changed: 4645 additions & 1238 deletions

File tree

Some content is hidden

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

.anvil.lock

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version = 1
22
tool = "anvil"
33
tool_version = "0.6.0"
4-
catalog_checksum = "sha256:7e4e7f7fa0e7f9491d3f5123f80ef209261e71b9cd9039e2f388e4287dc2f6bc"
4+
catalog_checksum = "sha256:411e8b3d247721c856c6a8a69f7b388711159325472ab687eff9c40bdd9727b0"
55

66
[[file]]
77
path = ".anvil/container/Dockerfile.dockerignore"
@@ -21,15 +21,15 @@ checksum = "sha256:ff8def6c0786b6e146c4b633dfe38cb9b8ede398345516cca32bbcd558608
2121

2222
[[file]]
2323
path = ".github/actions/anvil-setup/action.yml"
24-
checksum = "sha256:3df22c126c79170d39c515a06b597a0c20a05a5803eacd38326f0fa63bea846b"
24+
checksum = "sha256:e1029f7ff95a5966184b4c04ccbed04ee8ba93bfc93bc9ac307d3dcef31374fb"
2525

2626
[[file]]
2727
path = ".github/actions/anvil-setup/just-problem-matcher.json"
2828
checksum = "sha256:ea44d5e1a2cb1471cf2cef05eceab846d8afa45cf691be800f21fec1218da120"
2929

3030
[[file]]
3131
path = ".github/workflows/anvil-pr-impl.yml"
32-
checksum = "sha256:518d267b6def1d2549800df52fbe32c5f0848b2b2d9c00d9480b86e07b54ee3a"
32+
checksum = "sha256:f69ff8d422152ec5b4e59d5905316be02ea5b054b8b16752e87aac3ae290a579"
3333

3434
[[file]]
3535
path = ".github/workflows/anvil-pr.yml"
@@ -45,79 +45,79 @@ checksum = "sha256:d4d3bd645a5586e9a1cc3a5fc27e38c93e59b1e29f83ede0ccd610273eec0
4545

4646
[[file]]
4747
path = "justfiles/anvil/checks/aprz.just"
48-
checksum = "sha256:0f9f3dd3c8a2f034ebf4f2ac0344cba3db79612ff2fc2ea037bfabbaacb1be12"
48+
checksum = "sha256:e10edbbe60358ec930241cd5d4e681a84f30f9d5278e652696e2f149e112d066"
4949

5050
[[file]]
5151
path = "justfiles/anvil/checks/audit.just"
52-
checksum = "sha256:54abf96a320bb4b35a3c0ddf2f30b0f4a30e0673e482ca3a71242fa383536415"
52+
checksum = "sha256:ef33da620683628208b4c5ad51f96f5f6424fe1d56c2d0475487228b1f1aec23"
5353

5454
[[file]]
5555
path = "justfiles/anvil/checks/bench.just"
56-
checksum = "sha256:50f04b4ea6c99df8ad7434d320f34dccdb6db6a77b83e3090e35de0ca3a15f83"
56+
checksum = "sha256:850793443ada2151a895ee2728e81f03da5430facde16522bcc2e0c314a28577"
5757

5858
[[file]]
5959
path = "justfiles/anvil/checks/bolero.just"
60-
checksum = "sha256:754827bb664723169b8d48a6f1e69f9122b5440ba0b94a91622f4d23313e2503"
60+
checksum = "sha256:5a1767c4ff911cec3b0870d675cbefb563193146cedd3a1cbfe1667215bdb264"
6161

6262
[[file]]
6363
path = "justfiles/anvil/checks/careful.just"
64-
checksum = "sha256:bf69fadd48df96f97640ec41eade07eb2b6916800014cb277c86208efc34396b"
64+
checksum = "sha256:ea06cf7ebd7d5955b409db500a9ab193311af584437412d7bf0429fa70e43fac"
6565

6666
[[file]]
6767
path = "justfiles/anvil/checks/cargo-hack.just"
68-
checksum = "sha256:681c8952690496c7d29c7bf83a5ab99c193088b05a5dc7ea3b3b0ed2400904ea"
68+
checksum = "sha256:4eca78f197c2cf428b693c49cf0af4afb735b9c6caa8c83a71e5f5fd312a9bc1"
6969

7070
[[file]]
7171
path = "justfiles/anvil/checks/cargo-sort.just"
72-
checksum = "sha256:98c9f90e1b6b3beba5d818bf9a4023068eb61e9f071ffb6f9cd009a7374e9a30"
72+
checksum = "sha256:ab342c014199ffb58a9346b7b9fcea88201b5b60a07b06cbc9c4e5ef03bd18f5"
7373

7474
[[file]]
7575
path = "justfiles/anvil/checks/clippy.just"
76-
checksum = "sha256:64e8f11ed1a308797e5599117ab6152d0ca3a1dfb55e6a4cfdd42d35de13e1e2"
76+
checksum = "sha256:945a1bf3bb1372b2bfbbfec00d520a97da56ebc5575b1e6292c421b52cc77243"
7777

7878
[[file]]
7979
path = "justfiles/anvil/checks/deny.just"
80-
checksum = "sha256:4bb4bc0822612e2d2a43689e3f5c7f1190f59ef3db201fad7f3332725ceaef16"
80+
checksum = "sha256:c5604e8cb0eaa2baf4e2e2c70032d037d21873090375ffcf1ee99983965f6635"
8181

8282
[[file]]
8383
path = "justfiles/anvil/checks/doc-build.just"
84-
checksum = "sha256:57bf3ce93d3e7b947cb203f85b572531b86706ed2437ce3098f086745bf5d111"
84+
checksum = "sha256:9e187f61cb1ef9d11fab2e402af8a882b77f6ed17ca332afb9ae0b1d2112e95b"
8585

8686
[[file]]
8787
path = "justfiles/anvil/checks/doc-test.just"
88-
checksum = "sha256:e923667a5ceb376232db02ec41824d21f2fccffd041565109f7740c001c1c23d"
88+
checksum = "sha256:0e54c767de8e57a523a8b1b589a88ab6aca3169ac97d157c42d509d429f4b024"
8989

9090
[[file]]
9191
path = "justfiles/anvil/checks/ensure-no-cyclic-deps.just"
92-
checksum = "sha256:7351afd07f020f04fa6c7c82d4740ef32cbb1b648550f0a5ff306af6a5d58588"
92+
checksum = "sha256:2d19930c33a93b49d0c9e9672a31d85e1ad4fb92faecc0fb599803139b11c18f"
9393

9494
[[file]]
9595
path = "justfiles/anvil/checks/ensure-no-default-features.just"
96-
checksum = "sha256:25c61d31ea76c5e65b5c3caf744ddc9b49f6f9cdf9717b012d1d82cebfe555b9"
96+
checksum = "sha256:38e089afe176aea92c93ac6758154b206b6fc8940931035c0d059449fa824d6c"
9797

9898
[[file]]
9999
path = "justfiles/anvil/checks/examples.just"
100-
checksum = "sha256:0e84a7b43ff07608c624ece03d46ddd58c629ebd5f6a5684f3b43b7190026e0f"
100+
checksum = "sha256:8d01fa3e303a9f2b768213636f12c68cc8b41932b68549239e9f10d3be43507b"
101101

102102
[[file]]
103103
path = "justfiles/anvil/checks/external-types.just"
104-
checksum = "sha256:d003f1d82898706c136f42c3156d5ecc8f288c18f125c964b9dca1d24fa93d67"
104+
checksum = "sha256:7e67d90a9d8bd8cd5c8adb68baf41fdd4625bff4d425b5bf18b75baee62892a8"
105105

106106
[[file]]
107107
path = "justfiles/anvil/checks/fmt.just"
108-
checksum = "sha256:618907282b9b7d1e5c094d0b29c1c7231465078b617fa233219fe8c4870437cb"
108+
checksum = "sha256:0434e1a8720453a4bc635ea56af1d19875ac79e6fdd76349052cd57e70392eb8"
109109

110110
[[file]]
111111
path = "justfiles/anvil/checks/license-headers.just"
112-
checksum = "sha256:ab9ef6c3b50475ff3a8ab873b319f1ec04c456275d566ce323a76730be3ad0fc"
112+
checksum = "sha256:7aa0560dc9088b33e80cd55aee0a25090cbd3d3610652afd3734d0ca52ee7b47"
113113

114114
[[file]]
115115
path = "justfiles/anvil/checks/llvm-cov.just"
116-
checksum = "sha256:689f7d5b1eaea32672f8d0b9fff0994cc03bc56fb8ef282a4286f930fc503725"
116+
checksum = "sha256:cb23283ac3d377b1219c904f4de93b05b437b48c93629fec617307914bba6296"
117117

118118
[[file]]
119119
path = "justfiles/anvil/checks/loom.just"
120-
checksum = "sha256:a919429e9693c230ba8c9a194c41127708acf2cb1bfd196049a1386e7bb7b4e4"
120+
checksum = "sha256:f4822a8f9cb282bc426790355ba83b63e778db9327e986ba3c86ae6205cfdabb"
121121

122122
[[file]]
123123
path = "justfiles/anvil/checks/miri-race-coverage.just"
@@ -135,29 +135,33 @@ checksum = "sha256:c82f586402f2cb05397a40eec6fe95c7590df2cc52f0dd9da6879de085175
135135
path = "justfiles/anvil/checks/miri.just"
136136
checksum = "sha256:9e9d0cbfef1e1e1586c2af4e9c387719c2f017ea1203d326baacc3ae25df80e2"
137137

138+
[[file]]
139+
path = "justfiles/anvil/checks/msrv-test.just"
140+
checksum = "sha256:9c25b140dcaa4b38db7701fd627dd9a2d5ad5f9bb83d4490c146058bf4328cc8"
141+
138142
[[file]]
139143
path = "justfiles/anvil/checks/mutants-diff.just"
140-
checksum = "sha256:d13b1c467b8899d54e3567cb8d1a2157c4a54ac7ba9dabc00a09f3105fddb9b4"
144+
checksum = "sha256:e8d23688dcb86f82bf537e82c35ab8af9296d5530898645ddfe95132f9192bd0"
141145

142146
[[file]]
143147
path = "justfiles/anvil/checks/mutants-full.just"
144-
checksum = "sha256:9792344e6696f5c63f30fdccb5ef90a3598c56adb7561cec33f074c84ce6f89b"
148+
checksum = "sha256:604dfb6aa2742695ff638a7d2db6811a1bcbf27da73660027baacc86b2fe1509"
145149

146150
[[file]]
147151
path = "justfiles/anvil/checks/pr-title.just"
148152
checksum = "sha256:28734aa77526ca5c53d89a32c3e20ae6b42d2032c73ab6a1dbc9831f25cb0f76"
149153

150154
[[file]]
151155
path = "justfiles/anvil/checks/readme-check.just"
152-
checksum = "sha256:6d4b4c3e4a59e825a3f613e1011272c711d8d6cbdef315e5f6aadf653c6ae206"
156+
checksum = "sha256:4993e662875561ddf976ec94c69ec0d647a5c957bfb8f5174f79162a640ed892"
153157

154158
[[file]]
155159
path = "justfiles/anvil/checks/semver-check.just"
156-
checksum = "sha256:b214a8abbf2895df838ac1ff06c11bec4e8b8b3105c2cc4c0982a8a13414abd1"
160+
checksum = "sha256:be0430a53007301db00602d4bc9296f51ad9b2f011583084d069c51b30939b74"
157161

158162
[[file]]
159163
path = "justfiles/anvil/checks/spellcheck.just"
160-
checksum = "sha256:8f47518b756607402a7b3652762d5d37cff5d91eecd1052053176eedd65a9958"
164+
checksum = "sha256:2b2063f7e494dba51f805534bce5235132be1eeabde3a118d42d87ce49d51fd6"
161165

162166
[[file]]
163167
path = "justfiles/anvil/checks/udeps.just"
@@ -171,6 +175,10 @@ checksum = "sha256:3363992c6c006c649eae3732b2a7b04c2a4925eff369179b128d43380e280
171175
path = "justfiles/anvil/groups/pr-fast.just"
172176
checksum = "sha256:29a219b7d8b2eaa605b0444838f05ffc7538ab8bccc43d1613c555f7562a731f"
173177

178+
[[file]]
179+
path = "justfiles/anvil/groups/pr-msrv.just"
180+
checksum = "sha256:5c862a1c7775742377e75d6848650070d11e9ce3facd9ab304b03dbca1c4b1d2"
181+
174182
[[file]]
175183
path = "justfiles/anvil/groups/pr-mutants.just"
176184
checksum = "sha256:19a5fb032f680eee2d2e4eca56dece0ced80ac15bd2332b8135915d884f804a1"
@@ -181,7 +189,7 @@ checksum = "sha256:9a94b6ae2d212f91d324e401ebdb2238805f3450d95d4d45df791d7f1679a
181189

182190
[[file]]
183191
path = "justfiles/anvil/groups/pr-slow.just"
184-
checksum = "sha256:8b7c490cb6eb20c31549ef71eb75eac86ae145c8c6380ee1f590ccd81eec48ea"
192+
checksum = "sha256:c3281f2044494dcfcfa7544b022ce3d751444241d93d3e8f136669d72d102528"
185193

186194
[[file]]
187195
path = "justfiles/anvil/groups/pr-test.just"
@@ -209,23 +217,23 @@ checksum = "sha256:dc42a4b2ed4a25e3a37b322dad209df34d7adca88bf3c4de60b2f8c1b396e
209217

210218
[[file]]
211219
path = "justfiles/anvil/impact.just"
212-
checksum = "sha256:5714a138135154b91b234f6bad06ec3ade0e5780f761d631c1eca92b6010e5ad"
220+
checksum = "sha256:0b3a5c96dd33384b4c86ac02b17396bc1a9fe9c82edbc516a2ceea7f4fe3833d"
213221

214222
[[file]]
215223
path = "justfiles/anvil/mod.just"
216-
checksum = "sha256:2f7f0187f8c45716a1bed85f0c45ffbc71cdf592ed6414c9bc4cd72cf716a3a5"
224+
checksum = "sha256:4892e7a17d5f576241834041c89916708b23e88503156721af3048b2a358538f"
217225

218226
[[file]]
219227
path = "justfiles/anvil/tiers.just"
220228
checksum = "sha256:00453a12cbb34811ee6a2c083dade5f6198575e3b0610f49e4743366326cdd18"
221229

222230
[[file]]
223231
path = "justfiles/anvil/tools.just"
224-
checksum = "sha256:c1f5181d14a734cde8ccc32bbf5acece485791573b7a95cfff61b63d0f1fcb97"
232+
checksum = "sha256:48b887481a7eb8dc7615367347c93b8a02dd7baafb0ef80ece883f03600285dd"
225233

226234
[[file]]
227235
path = "justfiles/anvil/versions.just"
228-
checksum = "sha256:b48c7a29f694acdc4ff02a15bfdae5a286c1d0b6272fffad3acefbd8b1f2dcaa"
236+
checksum = "sha256:ae6676fb883aa58adb0995384adef477957ad7df10fc43439517cfb617fd92d1"
229237

230238
[[region]]
231239
host = ".anvil/container/Dockerfile"
@@ -250,7 +258,7 @@ checksum = "sha256:3788845ea3d4c483917954ddf9bccf918bf69ab7c64bbf559baf59d5781c4
250258
[[region]]
251259
host = ".anvil/container/Dockerfile"
252260
id = "anvil-container-tools"
253-
checksum = "sha256:0b6923e81ec99170ece298fcd9ef875f26a3ff018708ce5ec21b4b1dd7a18900"
261+
checksum = "sha256:ba7456ca88da39f72024dd0616e56d49d1aef7a5d26b81a8b33efccb13321379"
254262

255263
[[region]]
256264
host = ".delta.toml"

.anvil/container/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ RUN curl -fsSLo /tmp/cargo-binstall.tgz \
7575
&& tar -xzf /tmp/cargo-binstall.tgz -C "${CARGO_HOME}/bin" cargo-binstall \
7676
&& chmod 755 "${CARGO_HOME}/bin/cargo-binstall" \
7777
&& rm /tmp/cargo-binstall.tgz
78-
7978
# <<< anvil-managed: anvil-container-tools
8079

8180
# >>> anvil-managed: anvil-container-setup

.github/actions/anvil-setup/action.yml

Lines changed: 21 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ inputs:
1313
- "" (default): install the full catalog via
1414
`just anvil-setup` -- use for local "give me everything"
1515
flows.
16-
- "none": skip tool installation entirely; just bootstrap the
17-
rust toolchain + just + binstall + cache. Used by
16+
- "none": skip tool installation entirely; just restore the
17+
Cargo cache and bootstrap just + binstall. Used by
1818
anvil-impact, which installs only cargo-delta afterwards.
1919
- a name containing only lowercase letters, digits, and hyphens:
2020
install only that group's prerequisites via
@@ -77,80 +77,37 @@ runs:
7777
}
7878
"Free after cleanup (GiB): $(Get-FreeDiskGiB)"
7979
80-
- id: rustc-version
81-
shell: bash
82-
run: echo "version=$(rustc --version | awk '{print $2}')" >> "$GITHUB_OUTPUT"
80+
# Restore before bootstrapping Just so a warm job can reuse the cached
81+
# executable. Repository toolchain files intentionally define a fresh
82+
# cache generation, bounding registry growth without invalidating on
83+
# routine Cargo.toml or Cargo.lock edits.
8384
- name: Restore cargo cache
8485
id: cargo-cache
8586
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
8687
with:
87-
# Key on OS + arch + rustc version + lockfile hashes + catalog
88-
# hash so a Rust toolchain bump, a cross-arch matrix leg, or a
89-
# tool-versions update all invalidate the cache cleanly.
90-
# runner.arch resolves to X64 / ARM64 / X86, which keeps the
91-
# x86_64 and aarch64 legs of the same OS from colliding on
92-
# arch-incompatible cached binaries in ~/.cargo/bin.
93-
#
94-
# ${{ github.job }} discriminates by workflow-job-id (`pr-fast`,
95-
# `pr-test`, `pr-slow`, etc.) so concurrent matrix legs that
96-
# share OS+arch (e.g. pr-fast linux + pr-test linux) don't race
97-
# on the same cache key. Without this, the first-to-finish job
98-
# reserves the key, the others get "Unable to reserve cache:
99-
# another job may be creating this cache" and silently skip
100-
# the save -- leaving the cache empty forever. The restore-keys
101-
# fall back across jobs so the install work is still shared
102-
# across sibling legs on subsequent runs.
103-
key: anvil-v1-${{ runner.os }}-${{ runner.arch }}-rust${{ steps.rustc-version.outputs.version }}-${{ hashFiles('Cargo.lock', '.cargo/config.toml', 'rust-toolchain.toml', 'justfiles/anvil/versions.just') }}-${{ github.job }}
88+
# The job suffix prevents concurrent matrix jobs from racing to save
89+
# one key. The prefix shares a completed cache across sibling jobs.
90+
# There is deliberately no fallback across toolchain/catalog changes:
91+
# those inputs are the cache-pruning boundary.
92+
key: anvil-v2-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.cargo/config.toml', 'rust-toolchain', 'rust-toolchain.toml', 'justfiles/anvil/versions.just') }}-${{ github.job }}
10493
restore-keys: |
105-
anvil-v1-${{ runner.os }}-${{ runner.arch }}-rust${{ steps.rustc-version.outputs.version }}-${{ hashFiles('Cargo.lock', '.cargo/config.toml', 'rust-toolchain.toml', 'justfiles/anvil/versions.just') }}-
106-
anvil-v1-${{ runner.os }}-${{ runner.arch }}-rust${{ steps.rustc-version.outputs.version }}-
107-
anvil-v1-${{ runner.os }}-${{ runner.arch }}-
94+
anvil-v2-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.cargo/config.toml', 'rust-toolchain', 'rust-toolchain.toml', 'justfiles/anvil/versions.just') }}-
10895
# `.crates.toml` and `.crates2.json` track which cargo-installed
10996
# tools and versions live in ~/.cargo/bin/. Without them in the
11097
# cache, `cargo install --list` and (downstream) the
11198
# tool-install recipes' early-skip on "installed >= pin" don't
112-
# see the cached binaries — every run then tries to reinstall
113-
# on top of them and fails with "binary X already exists in
114-
# destination".
99+
# see the cached binaries.
115100
#
116-
# target/ (the compilation output dir) is deliberately NOT cached here:
117-
# per the GitHub backend design's caching policy, multi-GB per-job
118-
# target/ trees dwarf the high-value tool cache under the repo cache
119-
# quota, give only modest recompile savings once tools are cached, and
120-
# could overwrite the downloaded target/anvil/impact/ cache. Only the
121-
# ~/.cargo tool + registry state below is cached.
101+
# target/ is deliberately excluded: per-job target trees dwarf the
102+
# tool cache and could overwrite the downloaded impact cache.
122103
path: |
123104
~/.cargo/registry/cache/
124105
~/.cargo/registry/index/
125106
~/.cargo/bin/
126107
~/.cargo/.crates.toml
127108
~/.cargo/.crates2.json
128109
129-
# rustup auto-installs the toolchain from rust-toolchain.toml on
130-
# first cargo invocation, but it doesn't pull profile/component
131-
# extras. The `anvil-setup` recipe in step "Install anvil
132-
# toolchains + tools" below handles that exhaustively (the
133-
# per-component install recipes in tools.just install
134-
# default-toolchain components and pinned-nightly components for
135-
# miri/careful/etc.) -- we don't add components inline here anymore.
136-
# This step exists only to ensure rustup itself has the default
137-
# toolchain set up so subsequent cargo / just calls work.
138-
- name: Ensure default toolchain is installed
139-
shell: bash
140-
run: rustup show active-toolchain || rustup default stable
141-
142-
# The catalog recipe `anvil-setup` (or `anvil-<group>-setup`
143-
# when a group is specified via the `group` input) needs `just` to
144-
# run. We bootstrap just here (chicken-and-egg), then hand off
145-
# everything else to it. The setup recipes are idempotent and
146-
# short-circuit on tools already installed at or above the pinned
147-
# version, so re-running on cache-hit runs is cheap.
148-
# Install a prebuilt cargo-binstall binary in seconds. Without this,
149-
# the first `_install-tool` recipe that needs binstall bootstraps it
150-
# via `cargo install --locked cargo-binstall`, which takes ~4 min of
151-
# source compilation on every cold-cache job. The official action
152-
# downloads the release binary from cargo-bins/cargo-binstall, so
153-
# the bootstrap branch in `tools.just` becomes a no-op on GH.
110+
# cargo-binstall keeps the cold bootstrap path fast.
154111
- name: Install cargo-binstall
155112
uses: cargo-bins/cargo-binstall@v1.21.0 # immutable release, the tag cannot be moved
156113

@@ -161,6 +118,11 @@ runs:
161118
cargo binstall --no-confirm --locked just || cargo install --locked just
162119
fi
163120
121+
# The catalog recipe `anvil-setup` (or `anvil-<group>-setup`
122+
# when a group is specified via the `group` input) uses the Just executable
123+
# bootstrapped above, then handles everything else. The setup recipes are idempotent and
124+
# short-circuit on tools already installed at or above the pinned
125+
# version, so re-running on cache-hit runs is cheap.
164126
- name: Install anvil toolchains + tools
165127
shell: bash
166128
# Carry action data through the environment instead of interpolating it

.github/workflows/anvil-pr-impl.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,33 @@ jobs:
222222
token: ${{ secrets.CODECOV_TOKEN }}
223223
fail_ci_if_error: false
224224

225+
pr-msrv:
226+
name: "Check Group: MSRV Tests (${{ matrix.os }})"
227+
needs: [impact-linux, impact-windows]
228+
strategy:
229+
fail-fast: false
230+
matrix:
231+
os: [linux, windows, linux-arm, windows-arm]
232+
runs-on: ${{ matrix.os == 'linux' && inputs.linux_runner
233+
|| matrix.os == 'windows' && inputs.windows_runner
234+
|| matrix.os == 'linux-arm' && inputs.linux_arm_runner
235+
|| inputs.windows_arm_runner }}
236+
steps:
237+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
238+
with:
239+
lfs: true
240+
- name: Download impact artifact
241+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
242+
with:
243+
name: anvil-impact-${{ startsWith(matrix.os, 'linux') && 'Linux' || 'Windows' }}
244+
path: target/anvil/impact
245+
- uses: ./.github/actions/anvil-run-group
246+
with:
247+
group: pr-msrv
248+
publish_commit_statuses: ${{ inputs.publish_commit_statuses }}
249+
free-disk-space: true
250+
impact_mode: consume
251+
225252
pr-runtime-analysis:
226253
name: "Check Group: Runtime Analysis (${{ matrix.os }})"
227254
# Stricter-runtime correctness: miri + careful.

0 commit comments

Comments
 (0)