ci: warm the dynamic build via a persistent CARGO_TARGET_DIR (drop rust-cache) #21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ci/cache-dynamic-dylib"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Every PR/release build gate spends 10+ min "just getting started."
actions/checkout'sclean:truewipes the in-workspacetarget/each run, soSwatinem/rust-cachetar/untars the dependency artifacts — including the ~1.1 GB--features dynamiclibbevy_dylib.so— through Forgejo's cache backend on every run (and a blob that size can exceed the backend's per-entry cap and get dropped, rebuilding cold anyway).What
On a single persistent native runner you don't need a cache backend: point
CARGO_TARGET_DIRat a persistent path outside the cleaned workspace and let cargo's own on-disk fingerprinting decide rebuilds. Deps (incl. the dylib) are reused from real disk; only the changed local crate + tests recompile — exactly like local dev. (The "rawtarget/mtime invalidation" worry is a tar-cache failure mode; nothing is tarred here.)rust-toolchain.toml— pin1.96.0+ clippy + wasm, so the cache only cold-rebuilds on a deliberate toolchain/Cargo.lockbump, not a runner-siderustup update.ci.yml+release.ymlbuild-and-test— routeCARGO_TARGET_DIR=$HOME/.cache/soundy-bits-ci/target(same path → the release gate is pre-warmed by PR runs) + a self-bounding 40 G disk guard; drop the now-redundantrust-cachestep. Addedrust-toolchain.tomlto the CI paths filter.releasematrix keepsrust-cache— its per-targetCARGO_TARGET_DIRbuilds (nvenc/cross/headless) weren't migrated to the persistent-dir scheme.Note on the first run
The first CI run on this PR is cold — it populates the persistent dir. Subsequent runs reuse it; push a trivial follow-up commit to watch the warm path skip the Bevy/dylib compile.
🤖 Generated with Claude Code
a1ee958c8d148f5c953e