Skip to content

Use runtime platform for vendored gem extensions - #24159

Merged
MikeMcQuaid merged 1 commit into
mainfrom
portable-gem-load-paths
Oct 4, 2026
Merged

MikeMcQuaid merged 1 commit into
mainfrom
portable-gem-load-paths

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • Resolve native extensions with Gem::Platform.local so installed gems load their matching binaries on Linux and macOS.
  • Preserve the portable paths when regenerating setup.rb.

Fixes #24158


  • 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.


- Resolve native extensions with `Gem::Platform.local` so installed
  gems load their matching binaries on Linux and macOS.
- Preserve the portable paths when regenerating `setup.rb`.

Fixes #24158
Copilot AI lite review requested due to automatic review settings October 3, 2026 19:41

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.

Copilot review overview

🟡 Changes recommended

setup.rb can raise NameError when loaded without RubyGems.

Review effort: Lite
Findings: None

What changed in this PR

Updates vendored Bundler paths to use the runtime platform for native extensions.

Changes:

  • Uses Gem::Platform.local for extension paths.
  • Preserves dynamic paths during regeneration.
  • Adds runtime-platform test coverage.
  • A critical RubyGems-disabled loading issue remains unresolved.
File Description
Library/​Homebrew/​vendor/​bundle/​bundler/​setup.rb Uses runtime platform paths; requires a fallback when RubyGems is unavailable.
Library/​Homebrew/​test/​dev-cmd/​vendor-gems_spec.rb Tests platform-specific extension paths.
Library/​Homebrew/​dev-cmd/​vendor-gems.rb Preserves dynamic paths during regeneration.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@MikeMcQuaid
MikeMcQuaid enabled auto-merge October 3, 2026 20:29
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Oct 3, 2026
Merged via the queue into main with commit 1299da9 Oct 4, 2026
56 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the portable-gem-load-paths branch October 4, 2026 00:14
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.

Linux: undefined method 'default_sort_keys_proc=' (setup.rb hardcodes arm64-darwin-20 extension paths)

3 participants

⌂ 换网址