Skip to main content

Module prune

Module prune 

Source
Expand description

Garbage collection for the shared cache.

The key idea: every artifact in the cache belongs to a build “unit” identified by a name-hash key (Cargo appends a metadata hash to filenames). Deleting a whole unit keeps Cargo’s bookkeeping consistent; and if anything still needed got deleted, Cargo simply rebuilds it — pruning is safe by design.

Structs§

Group
One build unit: all files in the cache sharing a name-hash key.
PruneReport

Functions§

artifact_key
Classify a file inside the cache into its build unit.
prune
The garbage collector.
scan
Walk root and group every file into units.