Expand description
gen-cache-attic — typed cache-probe layer for the gen engine.
The engine consults a CacheClient for every derivation before
triggering a build. A hit short-circuits the rebuild; a miss flows
into the local builder. The trait is the swap-in seam: today’s
prime impl is NoCacheClient (always reports miss); the
production impl is AtticClient (HEAD-probes the substituter
URL). Future impls (cachix, R2, S3) drop in without touching the
engine.
Structs§
- Attic
Client - Production attic client. Builds an
CacheClient::probeby issuing a HEAD against<substituter>/<hash>.narinfofor each configured substituter; first 200-OK wins. - Cache
Key - Typed cache key. Engines compute the input-addressed hash of the
derivation (typed
Manifest+ adapter + target + features) into aContentHashand consult the cache with that key. The key is what makes the cache content-addressed: same inputs → same key → same answer fleet-wide. - Cache
Report - Aggregate report — one probe per supplied key.
- NoCache
Client - No-cache default. Always reports miss. Used when no substituter is
configured OR when
cache.always_build = true.
Enums§
- Cache
Error - Cache
Outcome - Outcome of a cache probe. Either a hit (substituter has the derivation) or a miss (engine triggers the local builder).
- Miss
Reason
Traits§
- Cache
Client - Typed cache client. New backends (cachix, R2, S3, IPFS, …)
implement this trait + plug into the engine via
gen_config.
Functions§
- client_
from_ config - Convenience constructor — selects
NoCacheClientorAtticClientbased on a typedCacheConfig. Engines call this once at startup + cache the boxed result.