Expand description
Cache-entry metadata and validation shared by local and remote storage.
Structs§
- Cached
File - Entry
Meta - Metadata stored alongside cached artifacts.
Constants§
- CACHE_
KEY_ VERSION - Cache-key recipe version written into entry metadata.
- GATED_
EMIT_ KINDS - Emit kinds represented by the current entry format.
Functions§
- is_
blob_ hash - A blob hash is a 64-char blake3 hex digest. Validated where untrusted
meta.jsonenters (download/import) so a malformed hash can never reach path construction or the integrity gate (#211). - is_
safe_ artifact_ name - A cached artifact’s
namemust be a single, normal path component — no absolute/rooted path, no.., no separators.meta.jsonnames are attacker-influenced for a shared/MITM’d bucket, andPath::joinwith an absolute or..-bearing component escapes the entry/target dir (e.g.dir.join("/etc/x") == "/etc/x"), giving an arbitrary read/overwrite primitive. Enforced at the import and restore trust boundaries (#211). - is_
safe_ stored_ artifact_ name - A cached artifact’s
nameas the local writers may commit it: one normal path component (rustcandccoutputs), or a build-script treeout/<relative>(OUT_DIR) oroutside/<relative>(a file under the target directory that the script named from outsideOUT_DIR). - is_
valid_ cache_ key - Is
sa well-formed cache key: exactly 64 lowercase hex chars, matching theblake3::Hash::to_hex()output produced by cache-key recipes? - is_
valid_ crate_ name - Is
sa crate name safe to use as an S3 object-key path component? - reports_
debug_ info_ tool_ failure - Whether rustc’s
stderrreports that a debug-info tool failed after linking (kunobi-ninja/kache#1326). rustc only warns whenrust-objcopycannot strip a binary ordsymutilcannot package its debug info, and the build still succeeds with the output unstripped or without its dSYM. Such a compile must not be cached: the key does not change when the toolchain is repaired, so the degraded output would be served from then on.