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

Homebrew install is not supported with nvm #1942

Open
puppycodes opened this issue Aug 13, 2022 · 7 comments
Open

Homebrew install is not supported with nvm #1942

puppycodes opened this issue Aug 13, 2022 · 7 comments
Assignees
Labels
good first issue Good for newcomers Type: Bug Something isn't working Type: Plumbing Internal product improvements

Comments

@puppycodes
Copy link
Contributor

puppycodes commented Aug 13, 2022

nvm installation isn't homebrew supported, initially I opened a pr but I realized we should probably update the macos-setup.sh to something that isn't piping curl to bash?

https://github.com/nvm-sh/nvm#installing-and-updating

Homebrew installation is not supported. If you have issues with homebrew-installed nvm, please brew uninstall it, and install it using the instructions below, before filing an issue.

@puppycodes puppycodes added Type: Bug Something isn't working Type: Question Further information is requested Type: Plumbing Internal product improvements labels Aug 13, 2022
@Shadowfiend
Copy link
Contributor

Does it not work or is it just unsupported? The simplicity of brew trumps them not wanting to answer questions about it imo, unless we run into issues with it.

@puppycodes
Copy link
Contributor Author

puppycodes commented Aug 14, 2022

this is the only part that concerned me after reading the docs? but maybe an edge case

Homebrew makes zsh directories unsecure

zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]? y
Homebrew causes insecure directories like /usr/local/share/zsh/site-functions and /usr/local/share/zsh. This is not an nvm problem - it is a homebrew problem. Refer zsh-users/zsh-completions#680 for some solutions related to the issue.

yes it does work so perhaps its non-issue. Only other thing I can think of is that the brew list &>/dev/null wont catch a previously curl'd install and you'll get a double nvm complication, so maybe switching to command -v could be helpful

@Shadowfiend
Copy link
Contributor

https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh seems to be the recommended path here. Overall torn as it's good to be default friendly to a macOS install in our install scripts though, and since zsh is the default now...

But curl and go isn't really a strategy I enjoy, which is partly why I've leaned on homebrew so heavily in install scripts.

Hmmm 🤔

@puppycodes
Copy link
Contributor Author

puppycodes commented Aug 19, 2022

One thing i've considered as an alternative (solving the reproducibility vs repeatability problem) is https://nixos.org. https://nixos.org/manual/nix/stable/ I love the idea, feels like the right amount of containerization with vagrant-esq builds https://nixos.org/guides/towards-reproducibility-pinning-nixpkgs.html#pinning-nixpkgs. In terms of security I believe Nix packages are checked against hashes to ensure they are unmodified which makes curl a lot more palatable

@tallysam
Copy link

Why wouldn't we simply remove the broken brew command and install nvm the recommended way?

@Shadowfiend
Copy link
Contributor

The answer, btw, is because curl-and-pipe is how you get pwned, and ideally you should do it when you know you're doing it as opposed to hidden behind an install script.

If we want to use nvm and install it this way, I suggest making the install script stop and warn the user it's about to pipe the specific URL on over.

@tallysam
Copy link

I agree that curl and bash is how you get owned. We don't want to take that kind of responsibility.

I suggest the following:

  1. A check in the install script for a valid nvm. If it fails then we bail out and point the user to the nvm instructions with our added security warnings.
  2. Update the README under the quick-start section. Place a similar piece of text about the nvm requirement and subsequent security warnings about curl-bash type installs.

@tallysam tallysam reopened this Feb 20, 2023
@tallysam tallysam self-assigned this Feb 20, 2023
@tallysam tallysam added good first issue Good for newcomers and removed Type: Question Further information is requested labels Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Type: Bug Something isn't working Type: Plumbing Internal product improvements
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

4 participants