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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for installing a vendored Ruby #510

Closed
wants to merge 107 commits into from

Conversation

mistydemeo
Copy link
Owner

@mistydemeo mistydemeo commented May 11, 2017

This is based mostly on the upstream vendor-ruby code, using an i386/ppc Ruby I built.

TODOs:

@mistydemeo
Copy link
Owner Author

Added vendored openssl and curl, too. This is pretty close to shippable, and will fix a lot of problems. Two remaining things to do, which I've added to the PR summary.

miniupnp and others added 2 commits May 22, 2017 23:39
also update homepage for https

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
@ranma42
Copy link
Contributor

ranma42 commented May 23, 2017

Modern Ruby versions should provide both sha256 and flock.
Would it be possible to use the Perl implementations only for the bootstrap and then use the internal Ruby implementation? This would probably avoid some Tiger-specific code paths in the main codebase (they would still be present in the bootstrap/install-vendor steps)

@mistydemeo
Copy link
Owner Author

Would it be possible to use the Perl implementations only for the bootstrap and then use the internal Ruby implementation?

Yup, planning on using either the Perl or Python version. Unfortunately, nothing shipped on Tiger supports sha256 - the modern openssl is needed to do that.

@mistydemeo
Copy link
Owner Author

flock fix merged upstream.

@mistydemeo mistydemeo force-pushed the vendor_ruby branch 2 times, most recently from 4d42127 to 959c9a2 Compare May 27, 2017 00:21
mistydemeo and others added 2 commits May 30, 2017 09:06
Turns out this was here all along! Just with a slightly different
API from modern versions of Ruby.
@EricFromCanada
Copy link
Contributor

Looking forward to this. Currently this branch fails on my 10.5 Intel VM with "Failed to install vendor ruby". When done, will this allow commands like brew's test-bot, test, tests, audit to start working?

# Universal 10.4 build
if [[ "$HOMEBREW_OSX_VERSION_NUMERIC" -lt "100500" || "$HOMEBREW_PROCESSOR" != "Intel" ]]
then
ruby_URL="https://archive.org/download/tigerbrew/portable-ruby-2.2.7.tiger.bottle.tar.gz"
Copy link
Contributor

Choose a reason for hiding this comment

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

May be worth going for 2.3.3p222 here to match High Sierra.

MikeMcQuaid and others added 3 commits September 15, 2017 16:35
This allows a curl that cannot handle modern SSL certificates to install a newer version.

Fixes #506

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
Update URL to Alpine information and source code
@mistydemeo
Copy link
Owner Author

I've got this set up with a confirmed-working-on-G3 Ruby and Curl, along with i386 builds of both packages as well.

@EricFromCanada Mind giving this a second go? I think I'm ready to ship this.

@EricFromCanada
Copy link
Contributor

On G3/10.4 & Intel/10.5, after running git checkout vendor_ruby in /usr/local and then any brew command, it populates /usr/local/Library/Homebrew/vendor as expected. Would be nice if there was some output while it's pulling down the portables, though.

brew audit git
brew test git
brew install xtitle
⛔️ brew doctor

Warning: You have uncommitted modifications to Tigerbrew
If this a surprise to you, then you should stash these modifications.
Stashing returns Tigerbrew to a pristine state but can be undone
should you later need to do so for some reason.
    cd /usr/local/Library && git stash && git clean -d -f

Warning: Ruby version 2.3.3 is unsupported on 10.5. Tigerbrew
is developed and tested on Ruby 1.8, and may not work correctly
on other Rubies. Patches are accepted as long as they don't cause breakage
on supported Rubies.
$ git status
On branch vendor_ruby
Your branch is up-to-date with 'origin/vendor_ruby'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)

	Library/Homebrew/vendor/portable-curl/
	Library/Homebrew/vendor/portable-ruby/

nothing added to commit but untracked files present (use "git add" to track)

⛔️ brew tests

ERROR:  While executing gem ... (OptionParser::InvalidOption)
    invalid option: --user-install
Error: Failure while executing: gem install --no-ri --no-rdoc --user-install bundler

although running it manually worked, sort of:

$ /usr/local/Library/Homebrew/vendor/portable-ruby/current/bin/gem install --no-ri --no-rdoc --user-install bundler
WARNING:  You don't have /Users/serveradmin/.gem/ruby/2.3.0/bin in your PATH,
	  gem executables will not run.
Successfully installed bundler-1.16.1
1 gem installed

One more note: brew install --verbose <formula> shows curl still sending a user agent string with the old version number, i.e.

/usr/local/Library/Homebrew/vendor/portable-curl/current/bin/curl -fLA Homebrew/0.9.5 (Macintosh; powerpc Mac OS X 10.4.11) curl/7.16.3 …

@mistydemeo
Copy link
Owner Author

One more note: brew install --verbose shows curl still sending a user agent string with the old version number, i.e.

Oops - this is a bug. That value is set before the vendored curl is set up, which means the user agent references a different curl from the one that's used. I'll fix that!

brew tests

I'll look into this.

brew doctor

Silly bug, but easy fix. 😅 I'll remove the bad test.

@mistydemeo
Copy link
Owner Author

brew tests

Aha - this is because the portable Ruby doesn't include Bundler. I'm not sure which bundle it ended up running.

@mistydemeo mistydemeo closed this Mar 6, 2018
@mistydemeo mistydemeo deleted the vendor_ruby branch March 6, 2018 04:40
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.

None yet