Expand description
The vault: a durable store of Cargo unit groups, addressed by Cargo’s own fingerprint hashes.
A unit group is exactly what Cargo needs to consider one built unit
fresh: the 16-hex fingerprint hash file, the serialized Fingerprint
JSON, the binary dep-info, and the unit’s artifacts (deps/…, and the
build/<anchor>/… tree for build-script units). The vault keeps one
directory per generation, where a generation is one toolchain plus one
flag environment (the parity key):
{cargo-cache-home}/epicenter/
store/<parity-key>/
manifest.json file list, sizes, canonical stamps
units/<pkg>-<unit-hash>/ one unit group
<memo-file> the authoritative 16-hex hash
<memo-file>.json the serialized Fingerprint
dep-<memo-file> EncodedDepInfo (mandatory for freshness)
deps/… build/… artifacts, as the profile dir holds them
build/… the shared working dir (a disposable view)Timestamps are the only lever besides the hash in Cargo’s freshness
check, so every file of a unit group carries ONE canonical second
(stamp): the ceiling of the group’s metadata output (.rmeta) when it
has one — the moment dependents can compile against it — else of its
newest file, and always ≥ every dependency’s stamp (harvest clamps the
store). Restore never stamps hard links: they share the store’s inode,
and a touch on a restored file would rewrite the store itself.
Structs§
- File
Entry - One stored file.
- Generation
Info - One generation as the
vaultcommand shows it. - Harvest
Report - What one harvest did.
- Manifest
manifest.jsonof one generation.- Restore
Report - What one restore did.
- Stored
Unit - One unit as the vault holds it.
- Toolchain
- The
rustc -vVfacts that name a vault generation. - Unit
Entry - One stored unit group.
- Verify
Report - Result of auditing one generation.
Functions§
- drop_
units - Remove stored unit groups: their directories go, the manifest is pruned, and a generation left without units disappears entirely. Returns how many groups were dropped; groups that could not be removed stay recorded.
- generation_
names - Names of the store generations (directories under
store/). - generations
- Summarize every generation of the vault.
- harvest
- Store unit groups from a build dir into the vault.
- parity_
key - One vault generation = toolchain + host + flag environment:
1.99.0-b940084d7-x86_64-unknown-linux-gnu-3f9a2c1b. - restore
- Link matching unit groups from the vault into a working dir.
- store_
root <build>/../store— the vault lives beside the shared build dir, socargo cleancan never touch it.- stored_
unit_ rustc - The
rustcidentity recorded in a stored unit’s Fingerprint JSON. - stored_
units - Every stored unit across all generations, manifest-driven.
- toolchain
- Parse
rustc -vV(first line +host:). - toolchain_
install_ time - Install time of the active toolchain: the real
rustcbinary in the sysroot (falling back to the sysroot directory). This is the reference for “was this unit built by the installed toolchain?”. - units_
dir store/<parity-key>/units.- verify
- Audit every generation in the vault: every manifest file present with the recorded size, the canonical stamp, and — for memo files — the recorded hash content; plus a count of unit groups the manifest doesn’t know.