pub fn compose_local_cache_key(
arch: &str,
short_hash: &Option<String>,
canonical: &Path,
user_config_hash: Option<&str>,
) -> StringExpand description
Compose the cache key for a local source given its arch, optional
HEAD short hash, canonical source path, and optional user
.config hash.
Three shapes:
local-{hash7}-{arch}-kc{suffix}— clean git tree, no user.config(plainmake defconfigpath or no config file yet)local-{hash7}-{arch}-cfg{user_config}-kc{suffix}— clean git tree with a user.configwhose hash differs fromdefconfiglocal-unknown-{path_hash}-{arch}-kc{suffix}— dirty / non-git tree (HEAD does not describe the source; the path-derived crc32 salt keeps two distinct dirty trees from colliding on the samelocal-unknown-...slot)
path_hash is the full 8-char (32-bit) lowercase-hex CRC32 of
the canonical source-path bytes. CRC32 keeps the per-path
disambiguator stable across runs without pulling in a
crypto-grade hash for what is fundamentally a slot disambiguator.
user_config_hash is None whenever the source tree has no
.config file yet (the build will run make defconfig and
produce one). This collapses the user-config branch back into the
hash-only key so a fresh checkout’s first build still hits a
later cache lookup keyed without the cfg segment.