Expand description
Read-only parser for cargo’s .fingerprint/ state: parses each unit
directory into a Unit (kind, hashes, fingerprint JSON, dep-info) and
attaches the artifacts that belong to it.
Directory layout as written by cargo:
<build>/<profile>/.fingerprint/<package>-<16hex>/
<memo-file> ← TEXT, 16 hex chars = the authoritative memo hash
<memo-file>.json ← serialized Fingerprint (schema below)
dep-<memo-file> ← binary EncodedDepInfo (not parsed here)
invoked.timestamp ← optional, ignorable<memo-file> names the target kind: lib-serde (lib),
build-script-build (compile build script), run-build-script-build
(run build script), or the bin name.
JSON schema — mostly opaque HASH NUMBERS plus two human facts:
{rustc, features, declared_features, target, profile, path, deps, local, rustflags, config, compile_kind} where features /
declared_features are STRINGS containing serialized JSON arrays.
Structs§
- Artifact
Info - Artifacts that belong to a unit, found by suffix (fingerprint dir hash
== deps filename suffix) —
deps/*-{hex}.rlib|rmeta|so…and, for build script units, the wholebuild/{hex}/subtree. Registry and workspace units look identical here. - DepRef
- Fingerprint
Json - Typed view of the serialized Fingerprint schema.
- Unit
- One parsed
.fingerprint/<package>-<16hex>/directory.
Enums§
Functions§
- artifacts_
for - classify_
kind - The target kind a memo file name implies (
lib-serde,build-script-build, …). - dep_
edges - Every unit’s dependency edges, resolved to indices in
units. - memo_
index - Memo hash → index of the unit that owns it. First wins on duplicates.
- parse_
fingerprint - Parse a serialized
<memo>.jsonfingerprint — from a build dir or from the vault’s stored copy; both hold the same cargo-written bytes. - read_
units - Read every unit directory under all
.fingerprint/roots inside the build dir. - resolve_
dep - Resolve one dependency edge against a memo index.