#34274 [kernel] Content-addressed JIT build cache, generated from our own ninja
原始 PR · 作者 DarkSharpness · 合并时间 2026-08-14 13:41
JIT 缓存改内容寻址双 key,修复陈旧复用
值得精读。设计上有三个可借鉴点:双 key 分离“编译前可知 / 编译后可知”信息;leaf 名 = 依赖状态哈希的内容寻址自验证,无共享 manifest;快速路径无锁 + 锁内重查 + 原子 rename 发布。测试上 41 个用例专门 pin 静默失败模式(如 `test_no_unordered_container_reaches_the_key`)。建议阅读重点:`cache.py` 的 key 推导与缓存布局、`ninja.py` 的 `generate` 与 depfile 处理。
参与讨论