Skip to content

build: let PERRY_OBJECT_CACHE_BUILD_ID pin the object-cache build id - #9751

Closed
proggeramlug wants to merge 2 commits into
PerryTS:mainfrom
proggeramlug:feat/object-cache-build-id-override
Closed

build: let PERRY_OBJECT_CACHE_BUILD_ID pin the object-cache build id#9751
proggeramlug wants to merge 2 commits into
PerryTS:mainfrom
proggeramlug:feat/object-cache-build-id-override

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

A compiler built from a runtime-only branch computes a different build_id (djb2 of its own executable) and therefore misses every object a sibling build cached, even though the HIR and every codegen option match. PERRY_OBJECT_CACHE_BUILD_ID=<hex> pins that component so relink workflows on large bundles (the 13 MB claude-code bundle: ~3 min link instead of ~40 min codegen) reuse those objects. Codegen changes still miss through the hir and option fields of the key; an unparsable value is ignored. Unit test for the parser included.

https://claude.ai/code/session_01YPfnmWZmSpSWpmnoXvH8z2

Summary by CodeRabbit

  • New Features
    • Added the PERRY_OBJECT_CACHE_BUILD_ID environment variable, allowing compatible builds to reuse cached compilation objects and proceed directly to linking.
    • Supports hexadecimal build IDs; invalid values are ignored.
  • Documentation
    • Added documentation describing the cache build ID override and its compatibility limitations.

Ralph Küpper added 2 commits September 5, 2026 00:03
A compiler built from a runtime-only branch computes a different
`build_id` (djb2 of its own executable) and therefore misses every object a
sibling build cached, even though the HIR and every codegen option match.
Pinning the id lets relink workflows on large bundles (the 13 MB claude-code
bundle: ~3 min link instead of ~40 min codegen) reuse those objects. Codegen
changes still miss through the `hir` and option fields; an unparsable value
is ignored.

Claude-Session: https://claude.ai/code/session_01YPfnmWZmSpSWpmnoXvH8z2
@coderabbitai

coderabbitai Bot commented Sep 4, 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: 5f7ec481-5627-4b5b-857c-f8a385af7ff5

📥 Commits

Reviewing files that changed from the base of the PR and between 12efed1 and 512d6c1.

📒 Files selected for processing (3)
  • changelog.d/object-cache-build-id-override.md
  • crates/perry/src/commands/compile/object_cache.rs
  • crates/perry/src/commands/compile/object_cache/object_cache_tests.rs

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


📝 Walkthrough

Walkthrough

The object cache now accepts PERRY_OBJECT_CACHE_BUILD_ID as a hexadecimal build ID override. Valid values take precedence over executable hashing. Invalid or absent values use the existing fallback.

Changes

Object cache build ID override

Layer / File(s) Summary
Parse and apply the pinned build ID
crates/perry/src/commands/compile/object_cache.rs, crates/perry/src/commands/compile/object_cache/object_cache_tests.rs, changelog.d/object-cache-build-id-override.md
The cache build ID parser accepts up to 16 hexadecimal digits. Valid values override executable hashing, while invalid values fall back to the existing behavior. Tests cover whitespace, zero, invalid input, empty input, and absent input. The changelog documents the environment variable and cache-key behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 512d6

This adds an opt-in object-cache build-ID override so compatible sibling compiler builds can reuse cached objects; invalid values preserve existing behavior. The parsing and fallback behavior are covered, with no current merge-blocking risk identified.

Suggested reviewers: jdalton, thehypnoo

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the purpose and behavior of the change, but it does not follow the required template. It omits the Summary, Changes, Related issue, Test plan, Screenshots / output, and Checkl… Rewrite the description using the repository template. Add the required section headings, list the concrete changes, state the related issue or use "n/a", document the verification commands and test results, complete the checklist, and incl…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding an environment-variable override for the object-cache build ID.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (1 skipped: 1 u…
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 purpose and behavior of the change, but it does not follow the required template. It omits the Summary, Changes, Related issue, Test plan, Screenshots / output, and Checklist sections, and it does not provide the required test-plan checklist or commands.

Resolution

Rewrite the description using the repository template. Add the required section headings, list the concrete changes, state the related issue or use "n/a", document the verification commands and test results, complete the checklist, and include screenshots or output when applicable.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown
Contributor Author

Landed on main via merge train #9798 (rebase-merged, so your commits keep their authorship). Thanks!

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