Live data from Hacker News

Ask HN: Best Alternative to Homebrew in 2021?

news.ycombinator.com

141–150 of 314 posts

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

#141
post #83

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.

It's hard to pinpoint what the problem really is, but me and a few colleagues had corrupted brew installations lately, where various things would just randomly stop working after updating a single package. The trick of disabling auto updates doesn't really work when you do want things to be updated. Sometimes there are conflicts and the usual path was to upgrade everything. Not that it matters: it seems that the usua…

> Also, the maintainers have a super weird aversion to everything that is "too simple". I've seen packages rejected because "the build process was too simple and there are no dependencies". The excuse was that "users can build it themselves". This is not for silly stuff random people wrote on weekend, this is for 20 year old tools used in production written in C.

wtf? What could be the possible motivation for this? Is their build farm really straining or something?

Can you point me to this example?

> I'm also using download links straight from language websites (Rust, Ruby, Python, DotNet, Haskell).

this sounds downright medieval to me, like why even use macOS for development if the software management tools are so bad that that's what you're doing

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

#142

Earlier quoted context omitted.

So you're saying use nix flakes instead of `nix env -i`? I've been using `nix env -i` without any issues till now, but I'll explore nix flakes.

nix-env -i package by package? I think the next step in the journey is describing what you've got installed with a package: https://nixos.org/manual/nixpkgs/stable/#sec-declarative-pac...

Package by package, yes. I had followed this tutorial: https://youtu.be/NYyImy-lqaA

What your link describes though looks better. I’ll give it a try, thanks.

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

#145
post #31

I started using nix. It’s difficult and search results are not often helpful.

Your honesty is refreshing. I've seen countless people trying a new technology/tool, and overselling it as 'amazing' and super easy. Seeing a post like yours helps to keep the discussion grounded in reality, with tools that looks nice on paper but have practical downsides as well.

Nix IS amazing. It is NOT super easy.

Parts of it are getting easier, and it has an exceptionally smart and helpful community. But it's not smooth and pretty and easy to pick up like Homebrew is. (And that does suck)

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

#146
post #56

> At this point I should know better than to install postgres via homebrew. No. At this point you should know better and read the documentation. Whatever you switch to next, you are going to have similar issues and surprises.

I've had big Postgres issues with Homebrew. I've never had "similar issues and surprises" with Postgres.app.

Postgres.app is not a package manager.

If you pin Postgres in brew, not installing `postgres` but instead `postgres@11.3` instead, then you won't have any auto upgrade issues. You can then upgrade on your own schedule. Brew will keep Postgres at your selected version.

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

#147

nix. It's confusing, but we'll get there. You'll need/want: - nix, the tool/build system. - nixpkgs, the world's most up-to-date and underfunded package repository. - nix-darwin, bringing a NixOS experience to Darwin. Not perfect, but pretty damn great. And optionally, - home-manager, a nix-based opinionated tool to manage dotfiles and other stuff in your home directory. And finally, some things to avoid and experime…

I disagree with "don't use nix-env --install; use instead". I see "nix-env --install" as a gateway drug to using Nix. It's effortless, and already easy to see benefits from using Nix (like you can easily get the same set of packages on different OSs). Rather, it's worth explaining why it's bad to use. The footgun I ran into was that I'd caused a messy state by installing something and forgetting I'd installed it. May…

You never want `nix-env --install` without it being `nix-env --install --attr`, though, because `nix-env -i` is like a billion times slower than `nix-env -iA`, and that gives people a really bad first impression.

But yeah I agree, it's fine to use `nix-env -iA ` or whatever. It's fine when you're getting started, and it's fine for a slightly more persistent way of trying things out than `nix-shell`.

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

#148

Earlier quoted context omitted.

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 t…

Genuinely, is this attested as the project philosophy anywhere? Because right now https://brew.sh leads with "The Missing Package Manager for macOS", which would lead anyone to think it does the same as a package manager for Linux, and they're _full_ of developer dependency packages.

The thing is, you also shouldn't be using apt or whatever for managing project dependencies, unless you and all your fellow devs match Prod exactly, both with distro and exact versions of everything. People do it anyway, but it's bad practice for exactly the same reason that using Brew for it is bad practice, and it's barely easier than doing things right (and, very early in the life of a project, it'll become less easy than doing it right).

It's not about project philosophy, it's about using the right tool for the job. Now, since people keep running into this problem, maybe they ought to put a warning about that right up top in a big banner on the site, I dunno, but it's not specific to Homebrew.

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

#149

Earlier quoted context omitted.

I also tried Nix (as well as NixOS) but it's obviously difficult to use and has a very steep learning curve. But actually it might be the most flexible and stable package manager out there. So probably the problems mentioned can be fixed by custom configuration but that might require deep-diving into Nix and using Functional Programming for package configs... For some time I also used to just ./configure && make && m…

I think the problem with Nix is that it is actually not a package manager but a build tool (that provides some package management utilities). People try Nix with the assumption that it should be as easy as apt-get (for example), but found tutorials with a block of code in a weird language... Sure, you will eventually need to use the Nix language if you want to have complex and reusable configurations, but this is act…

> I think the problem with Nix is that it is actually not a package manager but a build tool (that provides some package management utilities). People try Nix with the assumption that it should be as easy as apt-get (for example), but found tutorials with a block of code in a weird language...

Indeed, I've been using Nix for many years (on Ubuntu, NixOS and macOS), and I now find the apt-get style 'considered harmful'.

Instead, I define a single Nix derivation ("package") which provides everything I want in its 'bin/' directory, e.g.

    with nixpkgs;
    buildEnv {
      name = "my-macbook-programs";
      paths = [ bash gimp /* etc */ ];
    }
The nix-build command creates a symlink called `result`, so I put `/path/to/my/git/repo/result/bin` in my $PATH.

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

#150
When I first started using Macs 5 years ago, I explored both macports and homebrew. As soon as I saw how homebrew screwed around with root, and how it installed itself in /usr/local and required strange machinations I looked more at Macports.

Ports have a long history from the BSD Unices and Macports keeps that ethos. It installs neatly in /opt and doesn't screw around with MacOS except in the approved ways (eg for Java and Python frameworks).

I still use Macports and it's had everything I've needed and when I hit bugs during the Big Sur beta, they were fixed quickly and directly, while still complying with Apple's beta policies.

I've dabbled with Nix, but it's a bit too* prescriptive for me.

Post reply on HN