Skip to main content

Module cache

Module cache 

Source
Expand description

Content-hashing and per-generator caching for skip-if-unchanged builds.

Constants§

CLI_VERSION
Version string baked into every cache entry. Bumping the WeaveFFI CLI version automatically invalidates every cache file so users never see stale generator output after an upgrade.

Functions§

hash_api
Serialize the API to canonical JSON and return its SHA-256 hex digest.
hash_api_for_generator
Return the SHA-256 hex digest of the API content keyed by generator_name.
hash_generator_inputs
Return the SHA-256 hex digest of every input that affects a single generator’s output: the canonical IR, the generator’s name, the generator’s typed config (already serialized to canonical JSON bytes by the caller via crate::codegen::DynGenerator::config_hash_input), and the CLI version.
invalidate_all
Delete every persisted cache entry under out_dir/.weaveffi-cache/.
read_generator_cache
Read the persisted hash for generator_name from out_dir/.weaveffi-cache/.
write_generator_cache
Persist hash as the cache entry for generator_name.