Skip to main content

Module cache_key

Module cache_key 

Source
Expand description

Cache-key derivation for one task in a workspace.

build_cache_key is the executor-side wrapper around haz_cache::CacheKeyBuilder. It gathers the four normative ingredients of CACHE-005..008 from the validated workspace state, the dependency graph, the host environment snapshot, and the supplied per-predecessor stream hashes; hands them to the cache library; and returns the resulting CacheKey.

The function is pure and synchronous. Filesystem access happens through the supplied Filesystem handle; no tokio runtime is required. Callers that want to off-load the file-hashing work from an async context can wrap the call in tokio::task::spawn_blocking.

Structs§

OwnedInputFile
One file resolved from a task’s inputs patterns, paired with the hash of its content under the active hash function.
PredecessorStreamHashes
Hashes of one hard-edge predecessor’s captured stdout and stderr, as recorded by its prior successful run (CACHE-007).

Enums§

BuildKeyError
Failure modes of build_cache_key.

Functions§

build_cache_key
Derive the cache key for one task in workspace per CACHE-001..009.
resolve_input_files
Resolve every InputSpec declared on a task against fs and hash the bytes of each matched file under algo.