Skip to main content

Module cache

Module cache 

Source
Expand description

Persistent per-file compile cache. Skips lex/parse/transform/codegen (and the sidecar dispatch) for unchanged inputs by hashing the source together with the build config and stashing the resulting record on disk. Cache hits are O(read JSON + parse).

Default location: <output_dir>/.cache/dmc/. One file per record, named {16-hex blake3}.json.

Invalidation strategy: the key encodes the dmc version, the file source bytes, the source path, and a serialised view of the relevant CompileConfig fields. Any change to source or config produces a different hash; nothing is ever overwritten in place.

Structs§

FileCache
File-backed key/value store. One file per cached record.

Functions§

fingerprint
Hash any Serialize-able config snippet into an opaque fingerprint. Returns the empty vec on serialisation failure (cache still works, just collides across configs that fail to serialise).