Live data from Hacker News

Ask HN: Best Alternative to Homebrew in 2021?

news.ycombinator.com

121–130 of 314 posts

Re: Ask HN: Best Alternative to Homebrew in 2021?

#121
post #17

I think, you don't need to choose any other package manager because homebrew is the most mature thing on macos. Just disable autoupdate when installing something: HOMEBREW_NO_AUTO_UPDATE=1 brew install

Homebrew stinks of over-optimization and deletionism. In contrast to how it used to be, Homebrew now seems designed for people that only want popular bleeding edge packages, and nobody else. If I just wanted to install google-chrome, sublime, and skype, I would use the app store. I used to use Homebrew to install more obscure packages that were useful to me, like Arduino, Processing, and some specialized bluetooth to…

You may be interested in MacPorts, which literally supports back to Tiger. (Some of the stuff they do to make this happen is actually nuts, e.g. https://github.com/macports/macports-legacy-support.)

Re: Ask HN: Best Alternative to Homebrew in 2021?

#122

A lot of the usual "it's bad" "it's not bad for me" discourse in these threads. Could people raise the bar a bit and talk about specific problems they have had with homebrew - other than the auto-update, which we've already noted can be changed by setting HOMEBREW_NO_AUTO_UPDATE=1? Thanks.

My preference for MacPorts starts from the fact MacPorts keeps their files separate from the system files. To uninstall, just delete the folders.

I’ve seen homebrew overwriting system files and thoroughly breaking machines (that’s no longer that easy, but more thanks to Apple).

Haven’t tried many other package managers (Fink, when G3 was bleeding edge), but MacPorts has the feel of an exquisitely well engineered tool.

Re: Ask HN: Best Alternative to Homebrew in 2021?

#123
post #34

After years of dealing with it I just run most of the software from docker containers and use homebrew for random cli tools.

Homebrew needs to do a better job of communicating that you shouldn't use it for project dependencies, because every time there's a Brew thread on here, a bunch of people come out complaining about this kind of thing. "Homebrew broke my build by updating PostgreSQL and Redis". They shouldn't need to communicate that, but clearly, they do.

Use Docker, probably. Homebrew is for your tools, not your dependencies. Is the system you're deploying to a Mac with Homebrew? Do all your collaborators use Macs with Homebrew? If the answer to either is no, why were you trying to use Homebrew for that in the first place, even if it were otherwise good for that? Would you use Homebrew to install Node modules for your project? Python packages? No? When why are you letting it define which version of PostgreSQL this project depends on?

Re: Ask HN: Best Alternative to Homebrew in 2021?

#124
MacPorts and Nix are fine to use alongside each other.

I recommend using Nix alongside a couple other systems so you have escape hatches.

  - Nix
  - pkgsrc or MacPorts ‘just in case’ they're more convenient for some package for any reason
  - Homebrew, exclusively to use for Casks (which are really a separate system from the rest of Homebrew)
To get the most out of Nix, you'll need to take some time to really learn it. For managing services like postgres, it's nicest to use Nix-Darwin (a module system for managing services and programs, including automatic startup via LaunchD) but if you want to always keep the same Postgres with Nix-Darwin, you'll have to learn how to pin packages.

If you use Nix with Flakes, it'll feel a lot faster (much faster than Homebrew). If you use old-school Nix, it'll be slow if you call some deprecated commands.

Re: Ask HN: Best Alternative to Homebrew in 2021?

#125

Earlier quoted context omitted.

For PostgreSQL on macOS I use and suggest https://postgresapp.com/ which is free and able to manage multiple Postgres major versions. It's also self-contained in a folder in /Applications. Also, version 14 of Postgres in the app has m1 native support.

For “infrastructure” apps like databases, caches, etc, I’ve been using Docker containers. Very easy to setup and tear down in a repeatable way. Unless I’m modifying the app itself, of course.

Exactly. I have a few build tools on my machine but any service installed locally has been long gone. Even the apps I work on - I just have the code locally and compile/package it up for testing within a container, which resembles the actual production landing spot. No more "it works on my machine".

Re: Ask HN: Best Alternative to Homebrew in 2021?

#126
post #20

Earlier quoted context omitted.

Yeah, macports still works fine. It has an equivalent to the OpenBSD flavors and does versioning fine. The only pain point is OS upgrades.

And the fact that it "needs" Xcode installed.

It does not, it does need the "command line tools" installed. Certain ports require full Xcode but not too many.

Re: Ask HN: Best Alternative to Homebrew in 2021?

#127
It is really simple to compile Postgres from source and it only takes a few minutes. You can have multiple versions running on a single machine and installed in your preferred directory.

If you forget to include the extensions, you can add them all later.

Re: Ask HN: Best Alternative to Homebrew in 2021?

#128
post #84
post #23

Earlier quoted context omitted.

They have a separate env var with language that matches OP's experience: HOMEBREW_NO_INSTALL_UPGRADE If set, brew install will not automatically upgrade installed but outdated formulae https://docs.brew.sh/Manpage#HOMEBREW_NO_INSTALL_UPGRADE (that's a fake hyperlink cause they don't put named anchors on their for some reason) updated with an actual hyperlink : https://github.com/Homebrew/brew/blob/3.3.2/docs/Manpage.…

Wow, terrible misfeature. Why is that the default? I could maybe understand it if it were just dependencies, but upgrading everything is insane.

It doesn't upgrade everything. It upgrades dependencies and dependents of those dependencies (which, admittedly, can feel like everything). It does this because the alternative is sometimes breaking things.

A "breaking things without this example": - you want to install something that depends on `readline` - the binary package for the thing you want requires the latest `readline` - this upgrades `readline` on installation

Now, we have a choice. Either we upgrade _everything_ that depends on `readline` that you have installed or we knowingly break some of the things you have installed that depend on `readline`. We choose the safer option by default.

If you leave it a long time between updating: you are more likely to have more dependencies updated which requires more dependents to be updated.

Re: Ask HN: Best Alternative to Homebrew in 2021?

#129
Brew's package selection is unmatched and it works great for a particular purpose. Keep using it, but stop using your dev machine's system package manager to manage project dependencies. There are a bunch of good reasons not to do that, anyway. For server stuff, probably use Docker. Brew is for your tools you personally use, that you mostly want to be at latest. If a project needs, say, a compiler and library at a specific version, define that in the project and use something that will manage that for you, which will typically be language-specific—damn near every language has an "Xvm" now, where X is the first letter of the language or platform, or else something equivalent, right? That's not to cater to Mac with Brew, it's because that's a very good idea on any platform.

You shouldn't use the system package manager on Ubuntu or Red Hat or whatever the way you're using Brew, either, unless you're exactly matched to your deployment target—same distro, same version, and you don't upgrade locally unless the servers are getting upgraded—and are scripting your local package installations and upgrades with the same script you use to deploy on the server.

Re: Ask HN: Best Alternative to Homebrew in 2021?

#130
My experience with MacPorts has been generally good, apart from dealing with OS upgrades which are more painful than necessary, but I've honestly never tried Homebrew so I can't compare them directly.

Personally, I find that the whole Homebrew "theme" where every command/thing is named after something alcohol/brewing-related (cask, bottle, formulae, tap, keg, etc) is a huge turnoff.

Post reply on HN