Skip to content

ci: trial zccache in place of rust-cache - #395

Closed
AbysmalBiscuit wants to merge 2 commits into
mainfrom
ci-zccache-trial
Closed

AbysmalBiscuit wants to merge 2 commits into
mainfrom
ci-zccache-trial

Conversation

@AbysmalBiscuit

Copy link
Copy Markdown
Owner

Agent summary

Trial, not for merging. Measures whether zccache cuts compile time in CI, mainly in the Windows test jobs, which spend about 3 minutes compiling workspace crates even with rust-cache restoring dependencies.

The clippy and test jobs swap Swatinem/rust-cache@v2 for zackees/zccache@1.15.4 (binary pinned to 1.15.4), with the cargo registry, compilation and target/ snapshot caches on and both restore fallbacks enabled, as zccache recommends for fast developer CI. Its cleanup action runs with if: always() to save the caches. postgres is unchanged.

For the measurement:

  • saves are forced on, because the action skips them on pull_request runs by default;
  • only the first partition per OS saves, since the partitions build the same artifacts;
  • CARGO_INCREMENTAL=0, as rust-cache set it;
  • timeouts are raised so a cold run completes.

The first CI run is the cold one; an empty commit follows for the warm one. Each job's total time and compile time (first Compiling line to first nextest PASS, or end of clippy) are compared with run 38927774308.

Proof

  1. yq '.jobs.test.steps[].uses' .github/workflows/ci.yml lists zackees/zccache@1.15.4 after the toolchain and zackees/zccache/action/cleanup@1.15.4 last; the clippy job has the same pair.
  2. The cold and warm timings come from this PR's CI runs, read from each job's log.

🤖 Generated with Claude Opus 5.5 via Claude Code

Windows test jobs spend about 3 minutes compiling workspace crates even with rust-cache restoring dependencies. zccache caches each rustc invocation, workspace crates included, plus a target/ snapshot, so a warm run may skip most of that.

The clippy and test jobs use zccache 1.15.4 with its target snapshot and restore fallbacks on. Saves are forced, since the action skips them on pull_request runs by default, and only the first partition per OS saves. CARGO_INCREMENTAL=0 matches what rust-cache set. Timeouts are raised so a cold run finishes and can be measured.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T16:26:03.978367Z f1250c8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1250c89c7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml
zccache-version: 1.15.4
shared-key: test
cache-target: true
target-restore-fallback: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Disable target fallback for the CI test gate

When a PR run can restore a target snapshot from an earlier source tree, Cargo may accept the restored fingerprints and run stale test binaries instead of rebuilding changed crates, allowing nextest and the similarly configured clippy job to report false success. The action's restore policy explicitly disables this fallback by default because stale Cargo fingerprints and build-script outputs can make a PR merge ref appear fresh; retain exact target restores or disable cache-target, but do not enable target-restore-fallback on these required checks.

AGENTS.md reference: AGENTS.md:L8-L14

Useful? React with 👍 / 👎.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚡ Grok Review

Reviewed commit: f1250c89c7

✅ No issues found.

The cache trial only rewires the clippy and test job caches and leaves the compile and test commands unchanged, so existing code and tests still run.

On Windows the action's RUSTC_WRAPPER install probe starts the daemon before the compilation cache is restored, so a warm run hit 0% of the restored entries while Linux and macOS hit 100%. Restarting the daemon after setup tests whether it then serves the restored cache.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚡ Grok Review

Reviewed commit: f758ea26ab

✅ No issues found.

The zccache trial only changes CI cache setup for clippy and test, and the workflow still runs the same checks, so existing code and tests will not break.

@AbysmalBiscuit

Copy link
Copy Markdown
Owner Author

Trial measured: zccache matches rust-cache on Windows test jobs (about 6m either way, even at a 100% hit rate) and slows Windows clippy from 1m36 to 3m28. The uncacheable rustc calls and test-binary linking dominate, and the target/ snapshot exceeds the 2 GiB cache cap. Not adopting.

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