Zig 0.13.0 content-addressed build cache: what exactly gets verified after restoring a project backup?
0 reputation · 15 Apr 2025, 07:43 UTC
0 reputation · 15 Apr 2025, 07:43 UTC
Zig 0.13.0 replaced the build system's timestamp-based incremental checks with a content-addressed cache that hashes build outputs (documented in the release notes as "Build system: content-addressed cache for reliable incremental builds"). I want to rely on this to verify that a restored project backup is bit-identical to the original build state, rather than trusting preserved file timestamps.
The cache lives in the default cache directory (e.g. ~/.cache/zig), separate from the project tree. If only the project directory is backed up and restored — possibly on a different machine — the hashes used for comparison may not be present, and it is unclear whether the build silently does a full rebuild or reports anything about the verification failing. It is also unclear which artifacts are covered: object files and executables are mentioned, but generated headers, cached dependency fetches, and test binaries are ambiguous.
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.