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

travis: avoid polluting path with Ruby 1.8 on 10.9 #47694

Closed
wants to merge 2 commits into from
Closed

travis: avoid polluting path with Ruby 1.8 on 10.9 #47694

wants to merge 2 commits into from

Conversation

UniqMartin
Copy link
Contributor

Putting the Ruby 1.8 we use to run tests on 10.9 into the PATH adversely affects formulae with a Ruby dependency (possibly other formulae, too). Remove this hack, as it is no longer needed.

Particularly the `bundler` Gem requires the right Ruby binary to be in
the PATH to work correctly if the Ruby binary used to run Homebrew is
overridden via `HOMEBREW_RUBY_PATH` and thus intentionally not prefixed
to the PATH (as that would affect formulae with a Ruby dependency).

The workaround here is to prefix this path only when a Gem is activated
via `Homebrew.install_gem_setup_path!` (currently used in `brew man`,
`brew style`, and `brew tests`).
Putting the Ruby 1.8 we use to run tests on 10.9 into the PATH adversely
affects formulae with a Ruby dependency (possibly other formulae, too).
Remove this hack, as it is no longer needed.
@UniqMartin
Copy link
Contributor Author

@xu-cheng
Copy link
Member

xu-cheng commented Jan 5, 2016

👍

@MikeMcQuaid
Copy link
Member

LGTM 👍

Another possible option for Travis/Jenkins (which this PR would help) would be to install Ruby to a non-/usr/local prefix so it's not cleaned up and so we don't need to deal with removing openssl CC @DomT4.

@UniqMartin
Copy link
Contributor Author

Another possible option for Travis/Jenkins (which this PR would help) would be to install Ruby to a non-/usr/local prefix so it's not cleaned up and so we don't need to deal with removing openssl

This PR is complementary to your suggestion and makes it possible to use any Ruby to run the Homebrew code without having to put this Ruby into PATH. (For the most part, it was possible before, but this now fixes the important case of brew tests. We'll see if there are more hidden subtleties.)

To make this really work in all scenarios, we ideally need a Ruby that is either completely independent of Homebrew or one that is sufficiently independent from all other formulae, i.e. has all its dependencies vendored in some way, so neither depends on other formulae nor functions as a dependency for other formulae. For efficiency reasons, we might want to strip down this Ruby as much as possible (i.e. no headers, no documentation, no bells and whistles), so we can basically just download an archive, unpack it, and then we're ready to go. (Effectively a Homebrew/homebrew-versions#1097 on steroids.)

@UniqMartin UniqMartin closed this in fb3bda6 Jan 6, 2016
@UniqMartin UniqMartin deleted the gem-ruby-harmony branch January 6, 2016 05:25
@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants