Skip to main content

Crate kache_format

Crate kache_format 

Source
Expand description

Cache-entry metadata and validation shared by local and remote storage.

Structs§

CachedFile
EntryMeta
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.json enters (download/import) so a malformed hash can never reach path construction or the integrity gate (#211).
is_safe_artifact_name
A cached artifact’s name must be a single, normal path component — no absolute/rooted path, no .., no separators. meta.json names are attacker-influenced for a shared/MITM’d bucket, and Path::join with 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 name as the local writers may commit it: one normal path component (rustc and cc outputs), or a build-script tree out/<relative> (OUT_DIR) or outside/<relative> (a file under the target directory that the script named from outside OUT_DIR).
is_valid_cache_key
Is s a well-formed cache key: exactly 64 lowercase hex chars, matching the blake3::Hash::to_hex() output produced by cache-key recipes?
is_valid_crate_name
Is s a crate name safe to use as an S3 object-key path component?
reports_debug_info_tool_failure
Whether rustc’s stderr reports that a debug-info tool failed after linking (kunobi-ninja/kache#1326). rustc only warns when rust-objcopy cannot strip a binary or dsymutil cannot 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.