Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

RbConfig: fix broken MacOS SDK paths #9452

Merged

Conversation

mistydemeo
Copy link
Member

@mistydemeo mistydemeo commented Dec 7, 2020

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew tests with your changes locally?
  • Have you successfully run brew man locally and committed any changes?

This is ugly, but it works. 馃槄

This is an alternate fix for #9410. #9442 attempted to fix this by changing the macOS versions whose Rubies we consider too old, but that didn't work: ruby.sh has a check for the Ruby version of the first ruby in the PATH in the case that HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH is unset, and that accepted the system Ruby.

That leaves us more or less two choices: updating the brew.sh/ruby.sh logic to reject the system Ruby regardless of Ruby version, or ensure that the system Ruby can install gems. This PR does the latter.

This inserts a shim to monkey-patch values in RbConfig before we run Bundler. The SDK paths that this alters are the same ones that I identified in #9410 as being faulty because they point to header paths that don't exist. Since this is only called on macOS, and it verifies that the new target paths exist before making the alterations, it should be basically pretty safe. I've tested this and it allows gems to be installed on macOS 10.15's system Ruby.

I'll also look at creating a smaller PR that introduces a harder force for the vendored Ruby on 10.15.

@BrewTestBot
Copy link
Member

Review period will end on 2020-12-08 at 18:13:04 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label Dec 7, 2020
@mistydemeo mistydemeo force-pushed the ruby_fix_up_broken_system_headers branch from d543c1f to 6370029 Compare December 7, 2020 18:17
@mistydemeo mistydemeo force-pushed the ruby_fix_up_broken_system_headers branch from 6370029 to 11445e0 Compare December 7, 2020 18:34
@mistydemeo mistydemeo added the critical Critical change which should be shipped as soon as possible. label Dec 7, 2020
@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Dec 7, 2020
@BrewTestBot
Copy link
Member

BrewTestBot commented Dec 7, 2020

Review period ended.

sjackman added a commit to sjackman/homebrew-bio that referenced this pull request Dec 7, 2020
@sjackman sjackman added the bug Reproducible Homebrew/brew bug label Dec 7, 2020
@mistydemeo
Copy link
Member Author

Merging. There are less-invasive fixes we can look into, but I'd rather ship this now to unblock people and deal with alternatives later, if we decide we want them.

@mistydemeo mistydemeo merged commit 08be577 into Homebrew:master Dec 8, 2020
@mistydemeo mistydemeo deleted the ruby_fix_up_broken_system_headers branch December 8, 2020 00:18
@MikeMcQuaid
Copy link
Member

Opened a simpler fix in #9465

@MikeMcQuaid
Copy link
Member

Thanks for the quick turnaround on this too, @mistydemeo!

@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Jan 8, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Jan 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/brew bug critical Critical change which should be shipped as soon as possible. outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants