rustydocs
Guides

Caching

Operate the artifact cache, RUSTC_WRAPPER, and layer planning together.

rusty has two cache tiers:

  1. Content store — source blobs and crate tarballs (global, deduplicated)
  2. 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 release

Manual 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

StepWhy
Pin RUSTY_HOMEStable cache directory across jobs
Restore store + cacheAvoid re-downloading and re-compiling
rusty fetch before buildEnsure sources are in CAS
layers plan loggingProve cache effectiveness
Same --profile everywhereKeys 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 release

Check whether the artifact is present or missing, then compare lock digest and profile against the last successful build.

On this page