fix(cache): PERRY_SEGVIEW keys the build cache, PERRY_SEGVIEW_DIAG is a recorded diagnostic exclusion — fixes codegen_env_vars_are_build_cache_inputs on main - #9971
Conversation
Include PERRY_SEGVIEW in the build-cache environment fingerprint so switching the lowering cannot reuse a binary built under the other mode. Record PERRY_SEGVIEW_DIAG as diagnostics-only, and cover the real cache miss with a qualifying Intl.Segmenter compile. Claude-Session: https://claude.ai/code/session_011dhBmdn4vGgNibjo3oZqTo
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit details: You’ve used all 8 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Landed on The three non-passing gates are accounted for: public-baseline is pre-existing on |
Small fix on
origin/mainfor the one unit test that has been red in CI'scargo-teston main:commands::compile::build_cache::tests::codegen_env_vars_are_build_cache_inputs.Why
The segment-view lowering (#9893, landed via the merge train) reads two environment variables in codegen that were registered neither as build-cache key inputs nor as exclusions.
PERRY_SEGVIEWselects the lowering, so a compile with a different value could be served a stale cached object — the same class of silent staleness the build-cache inventory test exists to prevent.What changes
PERRY_SEGVIEWis a build-cache input (crates/perry/src/commands/compile/build_cache.rs); it is read incrates/perry-codegen/src/collectors/segview.rsand gates the lowering.PERRY_SEGVIEW_DIAGis an explicit diagnostic-only exclusion with its reason recorded; its read only toggles diagnostics and does not change emitted code.crates/perry/tests/native_link_cache.rs: compiling the same program withPERRY_SEGVIEW=0then=1must miss both the build and the object cache. Sabotage (registration removed) fails with an erroneous manifest match.Verified locally
Scoped build-cache units 4 passed; the
perrybinary's unit tests 1,089 passed; the new cache test passes; rustfmt and diff-check clean. (perryhas no library target, so the gates ran as--bin perry.)https://claude.ai/code/session_011dhBmdn4vGgNibjo3oZqTo