Commit eb4e6de
Adds the cache module that wraps `crate::resolve` in a blake3-keyed
`zccache_artifact::KvStore` lookup, completing Phase 4 of #205. The
resolver is a pure function of (project sources, search paths, library
set, toolchain triple, framework version, scanner/LDF semantics); cold
cost is tens of ms, restore from a hit is sub-ms.
Cache key composition follows Q9 from the issue:
- sorted (canonical_path, blake3(content)) pairs for seeds,
- sorted (lib_name, blake3(canonical header)) pairs for libraries,
- ordered search-path list (order is observable per PIO semantics),
- toolchain triple, framework install path + version,
- SCANNER_VERSION + LDF_MODE_VERSION constants for invalidation.
Corrupt entries fall through to recompute and overwrite rather than
propagating decode errors — a stale cache must never poison a build.
Tests (16/16 passing):
- 9 resolver tests for the 2-pass LDF + path-prefix attribution
- 7 cache tests covering miss-then-hit, content/toolchain/version
invalidation, input-order normalization, search-path order
observability, and corrupt-entry recovery
Wires the workspace to `zccache-artifact = "1.4.0"` (released from
~/dev/zccache as part of the Phase 4 coordination).
Refs: #205 Phase 4
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f58e8d8 commit eb4e6de
5 files changed
Lines changed: 514 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| |||
0 commit comments