Skip to content

Honour installed formula rpath preservation - #24402

Merged
krehel merged 1 commit into
mainfrom
preserve-installed-rpaths
Oct 30, 2026
Merged

krehel merged 1 commit into
mainfrom
preserve-installed-rpaths

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member

Read preserve_rpath from the installed formula because API metadata omits it and rewriting bundled dylib IDs can overflow their Mach-O headers.


  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

Codex with GPT 6 Astra at Extra High effort, with local review and testing.


- Read `preserve_rpath` from the installed formula because API
  metadata omits it and rewriting bundled dylib IDs can overflow
  their Mach-O headers.
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c2232119-7d8a-4834-970d-a3a70bb9764e
Commits

Reviewing files that changed from the base of the PR and between 6969bb3 and 60d111f.

Files selected for processing: 3
  • Library/Homebrew/extend/os/mac/keg_relocate.rb
  • Library/Homebrew/keg_relocate.rb
  • Library/Homebrew/test/keg_spec.rb
Files with no reviewable changes: 1
  • Library/Homebrew/extend/os/mac/keg_relocate.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Improved macOS library relocation so Swift library identifiers and @rpath identifiers are preserved when enabled by a formula.
    • Improved handling when formula information is unavailable, allowing relocation to continue without applying the preservation setting.

formula_preserve_rpath? moved from the macOS Keg extension to the shared Keg implementation. The method checks the installed formula first, falls back to lookup by formula name, and returns false when the formula is unavailable. Specs cover each lookup outcome.

Changes: Formula preserve_rpath lookup

Layer / File(s) Summary
Formula lookup and fallback behaviour
Library/Homebrew/keg_relocate.rb, Library/Homebrew/extend/os/mac/keg_relocate.rb, Library/Homebrew/test/keg_spec.rb
The shared Keg implementation checks the installed formula’s preserve_rpath? value, then falls back to lookup by formula name. It returns false if formula loading raises FormulaUnavailableError. The specs cover installed-formula preference, fallback lookup, and unavailable formulas.

Priority: Normal

Merge Risk: Minimal · up to 60d11

The change reads preserve_rpath from the installed formula and falls back to name lookup. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly describes the main change: using the installed formula to honour rpath preservation.
Description check Passed The description explains what the change does and why it is needed. It directly relates to the changeset and mentions the associated Mach-O header risk.
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.

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.

@krehel

krehel commented Oct 30, 2026

Copy link
Copy Markdown
Member

Thanks!

@krehel
krehel added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 411ad3e Oct 30, 2026
54 checks passed
@krehel
krehel deleted the preserve-installed-rpaths branch October 30, 2026 11:51
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.

2 participants

⌂ 换网址