Skip to content

CI: Use local cache action. Cache Windows via GitHub - #5951

Merged
nicoburns merged 5 commits into
mainfrom
devin/1792170996-rust-cache-action
Oct 16, 2026
Merged

nicoburns merged 5 commits into
mainfrom
devin/1792170996-rust-cache-action

Conversation

@nicoburns

@nicoburns nicoburns commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Replaces the ten Swatinem/rust-cache@v2 blocks and the mark/prune python3 steps in main.yml with a single local action per job, then fixes two cache problems on top (separate commits).

.github/actions/rust-cache (composite): Swatinem/rust-cache@v2 with the shared settings (cache-all-crates, cache-workspace-crates, save-if: github.ref == 'refs/heads/main'), passing through optional key and workspaces inputs, followed by:

.github/actions/prune-cargo-target (node24, no dependencies): main: mark.js sets every fingerprint file's atime to 0 right after the cache is restored; post: prune.js (post-if: success()) deletes the deps/build/.fingerprint/examples entries whose fingerprint cargo never read. Nested actions' post steps run in reverse order, so the prune runs before rust-cache's post-step save. Same algorithm as prune-cargo-target.py from #5950, ported to Node (fs.lutimesSync, lstatSync({ bigint: true }).atimeNs).

Each job is now just:

- uses: ./.github/actions/rust-cache
  with:              # only where the job had them before
    key: "matrix-${{ matrix.platform.target }}"
    workspaces: ${{ env.DIOXUS_WORKSPACE }}

Don't prune when the filesystem doesn't record atime. prune only bailed out if no fingerprint had been read; on a noatime mount freshly compiled units still get nonzero atimes, so every restored-but-reused unit would have been deleted. Now prune also reads one fingerprint that is still at atime 0 and skips pruning if its atime did not move.

Windows caches go to GitHub's cache service. Bundle | Windows and Playwright | Windows have never saved a cache since March (restore 404, save Path Validation Error: Path(s) specified in the action for caching do(es) not exist). The cause is not the V: dev drive: rust-cache v2.9.0's Rollup bundle ships a CommonJS copy of @actions/glob@0.6.1 that matches no paths on Windows (actions/toolkit#2484), and Swatinem/rust-cache#355 (v2.9.2) fixed only the GitHub provider, leaving cache-provider: warpbuild broken there. The composite action now selects the provider per OS:

cache-provider: ${{ runner.os == 'Windows' && 'github' || 'warpbuild' }}

Verified on this PR's CI by temporarily allowing Windows saves (commit since reverted): both Windows jobs saved (1.63 GB / 1.30 GB, ~36 s) and mark/prune ran on the dev drive.

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/63e4b68136954300817972d04a921c7b
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/63e4b68136954300817972d04a921c7b?variant=devin-insiders
Requested by: @nicoburns

@staging-devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

Swatinem/rust-cache's warpbuild provider bundles an @actions/glob that
matches no paths on Windows, so those jobs have never saved a cache
(Path Validation Error) since the Rollup migration in v2.9.0.
Swatinem/rust-cache#355 fixed only the GitHub provider.
@staging-devin-ai-integration staging-devin-ai-integration Bot changed the title ci: move cargo cache setup and pruning into a local rust-cache action ci: move cargo cache setup and pruning into a local rust-cache action, probe atime, cache Windows via GitHub Oct 16, 2026
@nicoburns nicoburns changed the title ci: move cargo cache setup and pruning into a local rust-cache action, probe atime, cache Windows via GitHub CI: Use local cache action. Cache Windows via GitHub Oct 16, 2026
@nicoburns
nicoburns merged commit da90d0a into main Oct 16, 2026
46 checks passed
@nicoburns
nicoburns deleted the devin/1792170996-rust-cache-action branch October 16, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant