File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -288,19 +288,30 @@ jobs:
288288 toolchain : nightly
289289 components : miri
290290
291- - name : Cache cargo registry and build
291+ - name : Cache cargo registry (no target for Miri)
292292 uses : actions/cache@v5
293293 with :
294294 path : |
295295 ~/.cargo/registry
296296 ~/.cargo/git
297- target
297+ # NOTE: do not cache `target/` for Miri.
298+ # `cargo miri` writes toolchain-specific wrapper artifacts under `target/miri/`.
299+ # Caching/restoring those across changing nightly toolchains can break builds with:
300+ # "contains outdated or invalid JSON; try `cargo clean`".
298301 # Include matrix.name in cache key for job-specific caching
299302 key : miri-${{ matrix.os }}-${{ matrix.name }}-cargo-${{ hashFiles('**/Cargo.lock') }}
300303 restore-keys : |
301304 miri-${{ matrix.os }}-${{ matrix.name }}-cargo-
302305 miri-${{ matrix.os }}-cargo-
303306
307+ - name : Miri toolchain diagnostics
308+ shell : bash
309+ run : |
310+ set -euo pipefail
311+ rustc -Vv
312+ cargo -Vv
313+ cargo miri --version
314+
304315 - name : Setup Miri
305316 run : cargo miri setup
306317
Original file line number Diff line number Diff line change @@ -336,13 +336,16 @@ miri:
336336 toolchain : nightly
337337 components : miri
338338
339- - name : Cache cargo registry and build
340- uses : actions/cache@v4
339+ - name : Cache cargo registry (avoid target/ for Miri)
340+ uses : actions/cache@v5
341341 with :
342342 path : |
343343 ~/.cargo/registry
344344 ~/.cargo/git
345- target
345+ # NOTE: Avoid caching `target/` for Miri.
346+ # `cargo miri` writes toolchain-specific wrapper artifacts under `target/miri/`.
347+ # Restoring those across changing nightlies can fail with:
348+ # "contains outdated or invalid JSON; try `cargo clean`".
346349 key : miri-${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
347350 restore-keys : |
348351 miri-${{ matrix.os }}-cargo-
You can’t perform that action at this time.
0 commit comments