Caching
Operate the artifact cache, RUSTC_WRAPPER, and layer planning together.
rusty has two cache tiers:
- Content store — source blobs and crate tarballs (global, deduplicated)
- Artifact cache — compiled outputs keyed by layer digests (global, sharded)
Project-local .rusty/ holds the layer index tying crate identities to artifact keys.
Inspect cache state
rusty cache path
rusty cache stats
rusty layers list
rusty layers plan --profile releaseManual cache operations
Low-level commands exist for debugging and custom tooling:
rusty cache key --source <hex> [--rustc v] [--profile p]
rusty cache has <key-hex>
rusty cache put <key-hex> <out-dir>
rusty cache get <key-hex> <dest>Inside a project, cache key can auto-discover manifest paths when --source is omitted.
RUSTC_WRAPPER
rusty cache wrap is the RUSTC_WRAPPER entry point used by rusty-wrapper. Normal builds set this automatically:
# set by rusty during build — not usually manual
export RUSTC_WRAPPER="${RUSTY_HOME}/bin/rusty-wrapper"The wrapper records successful rustc invocations into the artifact cache and updates layer indices.
CI checklist
| Step | Why |
|---|---|
Pin RUSTY_HOME | Stable cache directory across jobs |
| Restore store + cache | Avoid re-downloading and re-compiling |
rusty fetch before build | Ensure sources are in CAS |
layers plan logging | Prove cache effectiveness |
Same --profile everywhere | Keys must match between plan and build |
Garbage collection
Store GC (rusty store gc) is separate from artifact cache eviction. rusty does not automatically shrink the artifact cache in 0.0.1-dev — plan manual pruning on long-lived builders if disk grows without bound.
Debugging a miss
rusty layers why my-crate@1.2.3 --profile releaseCheck whether the artifact is present or missing, then compare lock digest and profile against the last successful build.