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

Port installer to Bash #217

Closed
MikeMcQuaid opened this issue Jul 25, 2019 · 14 comments · Fixed by #256
Closed

Port installer to Bash #217

MikeMcQuaid opened this issue Jul 25, 2019 · 14 comments · Fixed by #256

Comments

@MikeMcQuaid
Copy link
Member

The installer should be ported (with identical logic on macOS to begin with) to Bash for:

  1. future versions of macOS that don't include Ruby
  2. avoid failing with messed up ruby in the users' $PATH
  3. allow using the same installer for Homebrew on Linux (CC @Homebrew/linux).

The best strategy to begin with would be a line-by-line port.

Ideally the same thing would be done for the uninstaller but this isn't essential for a first PR.

@sjackman
Copy link
Member

Note that the Linuxbrew installer works for both macOS and Linux:
https://github.com/Linuxbrew/install/blob/master/install

@MikeMcQuaid
Copy link
Member Author

@sjackman A PR replacing this one with that would probably be a good starting point? Will likely need some review/tweaking.

@sjackman
Copy link
Member

sjackman commented Jul 29, 2019

Okay, I can take that on, adding support for Linux to this repo.

@joehorsnell
Copy link
Contributor

joehorsnell commented Sep 3, 2019

  1. future versions of macOS that don't include Ruby

My first thought when I initially saw this was, "that seems unlikely to me, given how long Ruby has been included with macOS", but then I read this! https://tidbits.com/2019/06/25/apple-to-deprecate-scripting-languages-in-future-versions-of-macos/

Was that point above based on reading the 10.15 beta notes @MikeMcQuaid, or just great prescience?!

Also, out of interest, what's your reasoning for wanting to port the installer to bash, rather than keep it in Ruby but dynamically install a vendor Ruby, like Linuxbrew install does? Homebrew itself and all the formulae need Ruby anyway, so that seems like a good approach?

@MikeMcQuaid
Copy link
Member Author

Was that point above based on reading the 10.15 beta notes @MikeMcQuaid, or just great prescience?!

Beta notes 😁

Also, out of interest, what's your reasoning for wanting to port the installer to bash, rather than keep it in Ruby but dynamically install a vendor Ruby, like Linuxbrew install does? Homebrew itself and all the formulae need Ruby anyway, so that seems like a good approach?

It avoids duplicating the Homebrew Ruby vendoring process and there's nothing in this installer that needs to be in Ruby.

@joehorsnell
Copy link
Contributor

Ah, ok. I didn't realise Homebrew had a Ruby vendoring process, I just assumed it would use the system Ruby, but obviously it woks on Linux too, so that makes sense.

No sense in extracting the vendoring process out into the installer, so it can be shared? Or is it too ingrained into Homebrew?

@sjackman
Copy link
Member

sjackman commented Sep 5, 2019

Linuxbrew uses a quick and dirty reimplementation of the vendoring process. See https://github.com/Linuxbrew/install/blob/master/install-ruby
I agree with Mike that I'd probably prefer to see the installer rewritten in shell.

@MikeMcQuaid
Copy link
Member Author

No sense in extracting the vendoring process out into the installer, so it can be shared?

We can't meaningfully share code between both in a way that's not going to cause duplication. I also don't see the advantage, personally, other than Ruby being nicer to write in.

@mikesep
Copy link
Contributor

mikesep commented Dec 4, 2019

I've been starting to work on a shell version of a combined mac/linux homebrew installer. I'm not quite sticking to a line-by-line port, since some concepts don't translate well, in my opinion.

If anyone else has been looking into this, or if we've changed our mind and don't actually want a shell rewrite, please let me know. 😄

@sjackman
Copy link
Member

sjackman commented Dec 4, 2019

I'm looking forward to seeing the PR, @mikesep! Feel free to open a draft or work-in-progress PR if you'd like some intermediate feedback before blazing through to the end.

@sjackman
Copy link
Member

sjackman commented Dec 4, 2019

The installer on Linux supports both macOS and Linux. https://github.com/Linuxbrew/install

@mikesep
Copy link
Contributor

mikesep commented Dec 4, 2019

The installer on Linux supports both macOS and Linux. Linuxbrew/install

Yup, I'm using that (and the diff between this repo) as the basis for my work. 👍 The Linuxbrew installer has drifted a very tiny amount from the Homebrew one (just in supported versions, last time I checked).

@sjackman
Copy link
Member

sjackman commented Dec 5, 2019

I've opened PR Linuxbrew#79 to merge Homebrew/master into Linuxbrew/master.

@itchyny itchyny mentioned this issue Jan 24, 2020
@MikeMcQuaid
Copy link
Member Author

#256 is almost ready to 🚢 and is a good implementation. If anyone here wants to give it some review: we'd appreciate that.

After it's merged we can start looking at making this installer support both macOS and Linux.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants