Skip to content

Restore build-script input timestamps for nested Cargo workspaces - #44

Draft
zanieb wants to merge 2 commits into
zb/native-rust-cachefrom
zb/nested-workspace-inputs
Draft

zanieb wants to merge 2 commits into
zb/native-rust-cachefrom
zb/nested-workspace-inputs

Conversation

@zanieb

@zanieb zanieb commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Nested Cargo workspaces can rebuild local path dependencies on exact cache hits because build-script input snapshots include only workspace members beneath the configured directory. Discover local path dependencies within the same Git checkout and restore timestamps for matching tracked inputs, allowing nested builds such as Ruff's fuzz targets to reuse those artifacts. Changes to recorded files or directory entries still invalidate the affected build scripts.

Version the workspace cache key for the expanded input snapshot; dependency-only keys are unchanged. Allow only one workspace cache per Git checkout to prevent conflicting timestamp restores. Depends on #43.

Twenty paired warm runs of Ruff’s fuzz build on 4-core Linux runners, with caches seeded at acba99d5 and restored at 7a8f63f0, six first-parent commits later. Cargo dependencies and the toolchain are unchanged. Times include setup and post steps and exclude queues; parentheses show 90% confidence intervals for mean time saved.

Baseline Before → after (s) Speedup Saved (s; 90% CI)
Shared action before this fix 354.8 → 322.0 1.10× 32.7 (10.6 to 54.8)
Swatinem dependency cache 377.7 → 322.0 1.17× 55.7 (37.0 to 74.4)

All three variants restore exact Rust-cache hits, and no measured warm job uploads a Rust cache. For this revision pair, the fix reduces local dependency rebuilds from 15 crates to one. The intervals describe uncertainty in the mean for this revision pair, not variation across future source changes.

This branch has not been deployed

No deployments
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.

2 participants