Skip to content

fix(build-cache): key PERRY_U8_INLINE_READ — it changes emitted code (#9342) - #9475

Merged
proggeramlug merged 1 commit into
mainfrom
fix/u8-inline-read-cache-key
Sep 2, 2026
Merged

fix(build-cache): key PERRY_U8_INLINE_READ — it changes emitted code (#9342)#9475
proggeramlug merged 1 commit into
mainfrom
fix/u8-inline-read-cache-key

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

cargo-test fails on main:

commands::compile::build_cache::tests::codegen_env_vars_are_build_cache_inputs ... FAILED
these codegen env vars key neither the build cache nor an exclusion (#6394's rule):
  ["PERRY_U8_INLINE_READ"]
Add each to BUILD_CACHE_ENV_VARS, or to BUILD_CACHE_ENV_VARS_EXCLUDED

#9342 added the var but did not register it, and the #6394 guard correctly refuses to let a codegen-affecting env var go unaccounted for.

It belongs in BUILD_CACHE_ENV_VARS, not the exclusion list. It is a codegen kill switch — perry-codegen/src/expr/u8_buffer_read.rs gates the inline u8-read lane on it, and issue_9342_u8_inline_read.rs asserts that PERRY_U8_INLINE_READ=0 removes the lane. Since it changes emitted code, an object built with the lane must not be served from cache to a build that turned it off, or vice versa. Excluding it would let exactly that happen — silently, and only under a cache hit.

Verified: codegen_env_vars_are_build_cache_inputs passes with the entry added.

Blocking: cargo-test is in full-suite-gate's needs, so this stops any release cut.

Summary by CodeRabbit

  • Bug Fixes
    • Build caching now correctly accounts for the inline byte-read configuration, preventing incompatible cached build artifacts from being reused when this setting changes.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 2fa3a46d-99e2-4e3f-9011-0f047f1fb947

📥 Commits

Reviewing files that changed from the base of the PR and between 020e5cf and 2ef98c0.

📒 Files selected for processing (1)
  • crates/perry/src/commands/compile/build_cache.rs

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The build cache now treats PERRY_U8_INLINE_READ as an input. Cache entries are separated when this setting changes the emitted inline u8-read code.

Changes

Build cache configuration

Layer / File(s) Summary
Include inline u8-read setting in cache keys
crates/perry/src/commands/compile/build_cache.rs
PERRY_U8_INLINE_READ is added to BUILD_CACHE_ENV_VARS because it changes emitted code.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to 2ef98

The change partitions build-cache entries by the code-generation setting so incompatible compiled outputs are not reused across configurations. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: jdalton

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding PERRY_U8_INLINE_READ to build-cache keying because it changes emitted code.
Description check ✅ Passed The description explains the failure, the required code change, the cache-safety reason, the related issues, and the verification performed. It does not use all template headings or checklist items, b…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the failure, the required code change, the cache-safety reason, the related issues, and the verification performed. It does not use all template headings or checklist items, but it contains the critical information for this focused change.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/u8-inline-read-cache-key

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug
proggeramlug merged commit 605a26f into main Sep 2, 2026
18 of 20 checks passed
@proggeramlug
proggeramlug deleted the fix/u8-inline-read-cache-key branch September 2, 2026 04:07
@proggeramlug

Copy link
Copy Markdown
Contributor Author

Verified both sides before merging: the #6394 guard fails on main with exactly the reported message and passes with this change (2/2).

Two notes worth attaching. This is fallout from #9436 (my merge of the #9342 content), so thanks for catching it — the guard test is a model of the kill-policy discipline: a codegen-affecting env var cannot exist without either keying the cache or carrying a written reason it can't.

And it retroactively adds a second, independent reason my early PERRY_U8_INLINE_READ=0 A/B on the #9360 regression was untrustworthy: beyond the lowering never firing for that fixture (the vacuity I already retracted), an unkeyed cache could have served either arm artifacts built with the other arm's setting. Both failure modes are now closed — the lowering question by symbol-level checks, the cache by this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant