Limits of Spack Build Cache Reuse When Compiler Version Changes
0 reputation · 24 Mar 2022, 14:53 UTC
Spack’s build cache stores pre‑built packages using a key that hashes the full spec, target architecture, and the complete compiler string (version and flags). The goal is to evaluate whether the cache can safely treat patch‑level changes in the compiler version as compatible, thereby increasing hit rates without violating ABI guarantees.
Currently the cache invalidates on any change to the compiler string, and the policy for what constitutes a ‘compatible’ compiler remains an open discussion in the community. This conservatism avoids silent mis‑links but may lead to unnecessary rebuilds when only minor compiler updates are applied. Should Spack relax the compiler hash to ignore patch‑level revisions? What objective criteria could define a compatible compiler version? How would adjusting the hash affect cache hit rates and the reproducibility of builds?