Skip to content
This repository was archived by the owner on Aug 3, 2023. It is now read-only.

[WIP][RFC] Use Homebrew instead of NPM #298

Closed
wants to merge 1 commit into from

Conversation

xortive
Copy link
Contributor

@xortive xortive commented Jul 2, 2019

Using npm to distribute our binary is prone to issues (#240) since misconfigured npm installs are common. Fixing this opens a whole can of worms, due to the way npm treats postinstall scripts. Making this work would require making our own cross-platform installer for wrangler and maintaining it.

Homebrew does a nice job of handling this, works on Linux, macOS, and Windows (for WSL users), and will also install our dependencies (node and [email protected]) for the user. Users who prefer nvm can just put nvm's node in front of brew node in their PATH. Users who dislike homebrew can use our manual install method for now.

While we evaluate the pros/cons of creating our own installer, I believe this is a potential solution to provide a consistent cross-platform solution for users.

My proposed brew formula cf-wrangler:

class CfWrangler < Formula
  desc "Management tool for Cloudflare Workers"
  homepage "https://github.com/cloudflare/wrangler/"
  url "https://github.com/cloudflare/wrangler/archive/v1.0.0.tar.gz"
  sha256 "f3cfd04c0d69372fa1bb09e8e23200e7da7988cd9767f107daa73771a380d096"

  depends_on "rust" => :build
  depends_on "node"
  depends_on "[email protected]"

  def install
    system "cargo", "install", "--root", prefix, "--path", "."
  end

  test do
    system "wrangler", "generate"
    system "cd", "worker"
    system "wrangler", "build"
  end
end

Using npm to distribute our binary is prone to issues since misconfigured npm installs are common. Homebrew does a better job of handling this, works on linux, macOS, and windows (for WSL users), and will also install our dependencies (node and [email protected]) for the user.
@xtuc
Copy link
Member

xtuc commented Jul 2, 2019

Could we remove the npm package entirely then?

@xortive xortive changed the title [RFC] Use Homebrew instead of NPM [WIP][RFC] Use Homebrew instead of NPM Jul 2, 2019
@xortive xortive changed the title [WIP][RFC] Use Homebrew instead of NPM [WIP][RFC] Use Homebrew Jul 2, 2019
@xortive xortive changed the title [WIP][RFC] Use Homebrew [WIP][RFC] Use Homebrew instead of NPM Jul 2, 2019
@steveklabnik
Copy link
Contributor

As far as I'm concerned, recommending only homebrew is a non-starter for Windows. Its usage is extremely tiny, and asking people to install a whole package management system in order to install our thing will cause people to bounce off.

@ashleygwilliams
Copy link
Contributor

Homebrew is first and foremost understood in the community as a MacOS operating system package manager. This tool needs to support Windows and Linux. I do not think that the burden of asking folks to install a node version manager for correct behavior (has multiple other benefits to them) is more than the burden of asking a Windows or Linux user to use brew (has little to no other benefits and support on Windows is only via WSL, which is a non starter). As a result, we cannot take this path at this time.

I am going to close this RFC. I would recommend that we move forward with the standalone installer and focus our design efforts on improving that experience.

@xortive xortive deleted the malonso/use-brew-for-install branch August 7, 2019 15:44
@nataliescottdavidson nataliescottdavidson requested review from nataliescottdavidson, ags799 and a team and removed request for ashleygwilliams and ashleymichal January 14, 2021 20:47
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