Skip to content

os/mac/mach: avoid delegate for dylib_id#22924

Merged
cho-m merged 2 commits into
mainfrom
dylib_id-type
Jul 3, 2026
Merged

os/mac/mach: avoid delegate for dylib_id#22924
cho-m merged 2 commits into
mainfrom
dylib_id-type

Conversation

@cho-m

@cho-m cho-m commented Jul 2, 2026

Copy link
Copy Markdown
Member

Delegate causes issues for portable Ruby testing as running brew typecheck --update on Linux will remove the RBI file causing brew typecheck failures.


  • 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 Hyperfine benchmarks.
  • 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?

  • AI was used to generate or assist with generating this PR.

Copilot AI review requested due to automatic review settings July 2, 2026 20:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Homebrew’s macOS Mach-O Pathname shim to avoid using delegate (which interferes with portable Ruby/Sorbet RBI generation on Linux) and to give MachOShim#dylib_id a stable String return type for typechecking and callers that expect string semantics.

Changes:

  • Remove the delegate-generated dylib_id method and define MachOShim#dylib_id explicitly in os/mac/mach.rb.
  • Adjust the Tapioca-generated DSL RBI for MachOShim to no longer declare a dynamic dylib_id method stub.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
Library/Homebrew/sorbet/rbi/dsl/mach_o_shim.rbi Updates the generated DSL RBI to reflect that MachOShim no longer exposes dylib_id via a dynamic/delegated method.
Library/Homebrew/os/mac/mach.rb Replaces delegate with an explicit dylib_id method implementation and signature to improve cross-platform typechecking behavior.
Files not reviewed (1)
  • Library/Homebrew/sorbet/rbi/dsl/mach_o_shim.rbi: File type not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Library/Homebrew/os/mac/mach.rb Outdated
Delegate causes issues for portable Ruby testing as running
`brew typecheck --update` on Linux will remove the RBI file causing
`brew typecheck` failures.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • Library/Homebrew/sorbet/rbi/dsl/mach_o_shim.rbi: File type not supported

Comment thread Library/Homebrew/os/mac/mach.rb
Comment thread Library/Homebrew/os/mac/mach.rb
@cho-m cho-m added this pull request to the merge queue Jul 3, 2026
Merged via the queue into main with commit d808d59 Jul 3, 2026
41 checks passed
@cho-m cho-m deleted the dylib_id-type branch July 3, 2026 01:29
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.

3 participants