Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Use Current symlink instead of hardcoding 1.8 (mavericks-related) #20564

Closed
wants to merge 1 commit into from

Conversation

wfarr
Copy link
Contributor

@wfarr wfarr commented Jun 17, 2013

Currently, homebrew hardcodes the use of the actual system ruby to mitigate bad user behavior causing problems. This is absolutely fine.

Right now, though, homebrew hardcodes 1.8 specifically.

This is evidenced in a few spots:

/opt/boxen/homebrew[master] (0) » git grep '#!/System/Library/Frameworks/Ruby.framework'
Library/Contributions/cmd/brew-server:#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Library/ENV/4.3/cc:#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
Library/ENV/4.3/xcrun:#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
Library/Homebrew/build.rb:#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
Library/brew.rb:#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0

While 1.8.7 is available (for now at least) under Xcode and the CLTs in Mavericks, as far as I understand, it's going to be going away.

Luckily for us, Apple provides a symlink that always points to the current system version at /System/Library/Frameworks/Ruby.framework/Versions/Current:

/opt/boxen/homebrew[master] (0) » ls -ahl /System/Library/Frameworks/Ruby.framework/Versions/Current
lrwxr-xr-x  1 root  wheel     3B Jun 12 14:28 /System/Library/Frameworks/Ruby.framework/Versions/Current -> 2.0

I have a Mountain Lion machine sitting next to me confirming this symlink exists under both versions.
This lets homebrew utilize the new default 2.0.0 under Mavericks without breaking existing behavior on older OS X versions.

@adamv
Copy link
Contributor

adamv commented Jun 17, 2013

Can we get a statement from Apple about whether 1.8.x will still be around? Switching to Ruby 2.0 probably breaks things in goofy ways.

@jacknagel
Copy link
Contributor

Can we just leave this alone for now, please?

@adamv
Copy link
Contributor

adamv commented Jun 17, 2013

Closing, as we're not doing anything this drastic before Mavericks actually releases.

@adamv adamv closed this Jun 17, 2013
@wfarr
Copy link
Contributor Author

wfarr commented Jun 17, 2013

"This drastic?" It doesn't change any behavior under existing stable releases. All it does is properly use the system Ruby that Apple intends you to under the new release.

The whole point of all this sort of work is to have Homebrew working when Mavericks releases rather than weeks after-the-fact.

@jacknagel
Copy link
Contributor

Rest assured Homebrew will work when 10.9 is released, but there isn't any reason to do this today.

@adamv
Copy link
Contributor

adamv commented Jun 17, 2013

Historically, I'm a Python fan more than a Ruby fan. Python is pretty good about not breaking things in micro-releases, say 2.7.1 to 2.7.2. Ruby, on the other hand, changes things in these version levels, for instance, between 1.8.6 and 1.8.7, which we currently both support.

Some Homebrew users have forced the use of Ruby 1.9.x, and we've incorporated some non-breaking fixes where they don't break 1.8.x usage, but bumping Ruby versions does change behavior.

Certainly we can't leave Homebrew broken when 10.9 finally comes out, but we're not going to make changes to the Ruby we use before then, as it will require lots of testing to make sure something isn't subtly broken by the change.

Do please run against Ruby 2.0 in the meanwhile and let us know if specific things break, though!

@MikeMcQuaid
Copy link
Member

Also let us know if 1.8 gets removed in a release before GM.

@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants