Live data from Hacker News

Ask HN: Best Alternative to Homebrew in 2021?

news.ycombinator.com

261–270 of 314 posts

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

#261
post #235
post #195

Earlier quoted context omitted.

No, the problem is that Python's packaging system (like Homebrew's!) was created without adequate reference to prior art, has undergone much more evolution than design, and has suffered in every attempt to improve it from the fact of its adoption by a large userbase which democratically manages it so that changes must be conservative. As a result, Python packaging has an utterly insane design that it can't evolve its…

I think of those sorts of things as paradoxical people requirements. To wit, only people interested in new languages spend lots of effort building new languages (and their associated ecosystems). People who have been using an existing language for years, long enough to internalize the design decisions and flaws, have little incentive to stop using something they're an expert at, to build something new. Ergo, the pers…

Yep. This is definitely a factor.

The insight that the technical is not entirely separable from the social is an important one, imo.

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

#262

Earlier quoted context omitted.

On Debian-based systems, I get a preview of what's going to be installed/updated when I do something with `apt`. With homebrew, I never know how many packages will be updated and how long it will take, so sometimes when I just need a small utility, suddenly it'll update a bunch of packages and it takes 45 minutes. It's a UI problem.

Did you use brew outdated after performing brew update ? brew outdated will list outdated app/dependencies that need to be updated. If you want to know the app's dependencies, use the info argument. For example brew info ffmpeg will list the information about FFmpeg and list the dependencies that it uses along with status indication if the dependencies is installed or not. Am I missing something here? I am not sure i…

> Am I missing something here?

Yes. The principle of least astonishment.

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

#263
Before I used homebrew, I was a MacPorts user and that was a terrible experience for me.

Been running with homebrew for at least a decade since, and I cannot recall any negative encounter other than the hassle of grabbing xcode command line tools when I upgrade a major version of Mac OS, which is a minor detail.

I get the appeal of MacPorts & a dedicated separate package path but it caused all sorts of problems for me v. the integrated approach of homebrew.

O there was another negative now I remember -- had to uninstall brew version of MacVim & install manually. But that not a big issue either & typically, all of the brew packages are CLI only for me.

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

#264

Homebrew project leader here: I hope you're able to find a package manager that better fits your needs and I'm sorry that Homebrew is not currently doing so. --- Homebrew upgrades dependencies and dependents of those dependencies (which, admittedly, can feel like unrelated) on installation and upgrade. As mentioned in other comments, you can customise this behaviour with `HOMEBREW_NO_INSTALL_UPGRADE` or `HOMEBREW_NO_…

First, wanted to say thanks for heading a wonderful project. I personally love Homebrew! What’s the difference in what Homebrew is doing from what normally happens with something like Pacman or Apt? My impression is that “core” binaries, like Python might be, don’t get updated as often as they would on Homebrew, and perhaps those dependency chains are less frequent. Is it because (e.g.) python versions change rarely…

`brew` lives across (at least) one fundamental divide from `apt`.

Homebrew is a source-based package manager, where packages are built from a single shared source of build recipes, and distribution of software happens by distributing the whole collection of recipes. Support for a binary cache is added through the identification of build recipes with the hashes of archives of binaries.

APT is what's called a binary package management system. While build recipes can be stored in a central repository, they don't have to be, as binary package management systems typically identify two kinds of packages: source packages and binary packages, which can be distributed separately. (Some repositories may not even include source packages.) Source packages contain metadata like build recipes, but things like archives of the upstream source code, patches, and sometimes helper scripts that might be usd in building. Binary packages include the actual built artifacts; they're installable packages.

In the source-based package management world, if packages can be added to the main collection through external sources, this is typically done by pretending that those packages were embedded in (some particular version of) the main repository of build recipes. Collections of packages that are ‘injected’ into the main package collection like this are typically called ‘overlays’.

In binary package management systems, an external package is not expected to have access to some copy of a complete collection of build recipes from some ‘master’ repository. Instead, source packages are distributed individually using the same mechanisms as binary packages. This means that the global namespace of terms which refer to packages can't be navigated implicitly at build time like on source-based systems, the identification of actual source code and build instructions with some package name happens both at build time and at install time. And in both cases, explicit metadata (package names, package versions, equivalency classes, lists of conflicting packages, etc.) is used to determine what versions of dependencies get pulled in.

As a result, binary package management systems always include dependency solving at install time, and usually include some explicit version constraint for every single dependency declared in a package's build recipe. This means they have the resources to look at what's going to be installed, what's already installed, and say ‘oh, the new installee requires Python = 3.10.2 and you already have python-3.10.3 installed, we don't have to touch Python to install this new package unless you ask us to’.

Pacman is somewhat atypical. The build system is essentially source-based and monolithic (there's no source package format) and the AUR is essentially an overlay, but the high-level CLI tool acts like a binary packager and uses the language of repositories to describe dealing with multiple package sources. Pacman's dependency resolution behavior is also unusually unreliable, and probably closer to what `brew` does than what `apt` does. Pacman has the resources to describe and test version constraints, both in its build system and in its CLI tools, but they're underutilized in a way that's more typical of source-based package management systems than binary ones. Homebrew is similar in that such constraints are radically underutilized (they're totally absent).

The main difference between Homebrew's behavior and Pacman's in this instance is that by default, just `pacman -S` doesn't update pacman's collection of package definitions (pacman -Sy does) and Homebrew always tries to install from the latest build recipes.

I imagine that Pacman's capacity for handling version constraints means that the story with `pacman` will usually be a bit better than with `brew`, but that otherwise `brew install` will be similar to `pacman -Sy` and `HOMEBREW_NO_INSTALL_UPGRADE=1 brew install` will be similar to `pacman -S`. (Pacman also sometimes makes the opposite tradeoff that Howell describes for Homebrew sometimes; it's not unheard of for installing new software or updating software using Pacman to break installed software.)

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

#265

Earlier quoted context omitted.

Just wondering, what is the benefit of doing this over nix-env for system-wide applications? For project specific environments, I usually use `shell.nix` (maybe I should switch to flakes now) together with direnv that runs nix-shell automatically when you enter the directory. For beginners to Nix, I think they should do the transition gradually, there are so many concepts in Nix that may be unfamiliar to them. I thin…

`nix-env` is an imperative command, whilst writing a .nix file is declarative. In particular, the latter can be managed using git, e.g. here's mine: https://github.com/chriswarbo/dotfiles/blob/41c5c4643845f437... That's actually over-complicated, since I used to use nix-darwin and haven't bothered to un-pick it yet.

You could use nix-env to install the file with `nix-env --install --file default.nix` rather than using nix-build + symlinking the result.

What are the advantages of just nix-build, and adding the result/bin/ to path? Arguably, `nix-env --install` modifies the underlying profiles which manage symlinks. (nix-build + add to PATH is imperative invocation; but `nix-env --install` is and imperative invocation with a stateful effect).

e.g. of "how could that be bad?". I'd managed to get myself into a confusing state with `nix-env --install`. When setting up NixOS, I'd installed firefox as the root user. Months later, in my normal user account, I was confused why such an old firefox was installed (since my profile didn't install firefox). I can't remember exactly, but this also somehow caused problems with fontconfig. -- Probably easily avoidable; but if you don't know what you were doing, you might also try all sorts of install commands and forget.

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

#266

Came here hoping to see some recommendations on getting started with nix on MacOS, or maybe a favorite blog post or series. I've tried the nix.dev installation + nix-darwin instructions 4 or 5 times but never make it very far. Seems like I should generally prefer a multi-user install? Does nix-darwin play well with that? As I supposed to `sudo -i nix-channel --add / update` or not use sudo? Is unstable the generally…

> Seems like I should generally prefer a multi-user install? Does nix-darwin play well with that?

On my macOS computer, I don't have a multi-user install. Never had issues with it (but I also only just use one user account for everything).

Just tried running the nix-darwin installer, and it sets up some extra users as part of that anyway.

> Am I supposed to `sudo -i nix-channel --add / update` or not use sudo? Is unstable the generally recommended channel? Do I use sudo with nix-darwin, since it's supposed to be kind of like NixOS / system-wide?

Once you've got nix installed, in general you don't want to "sudo nix ...". Unstable is fine; but if things break, it's easy to rollback changes with Nix, so that you can use the versions which worked.

There's no need to start out with wrangling with nix-darwin. Just starting out with "nix-env --install --attr nixpkgs." will be closest to how homebrew is used.

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

#268

Earlier quoted context omitted.

I don’t get how that thread demonstrates what you say. It just looks like awscli 2 is a pain to package; what am I missing?

Well, one will observe that brew manages to package it, without any similar stone throwing about the project's "hatred for pypi" or other meta commentary. It seems every project has *some* kind of quirk, but if the packaging system pays that cost once, then its users get "brew install awscli" instead of waiting 18 months for the AWS team to "see the error of their ways" or whatever one is expecting to change about th…

My read of that ticket is it's a bunch of people saying "this looks hard, I don't want to do it." But if someone wrote a (good) pull request, I expect MacPorts would accept it.

The thing about MacPorts is that it's a very community-driven project. Things happen when someone decides to go do them.

(Individual maintainers are sometimes opinionated, but I wouldn't say they speak for the whole of MacPorts.)

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

#269
I've found that `brew pin` is becoming a necessity for things not breaking on my machines. after Postgres breakage that cost me a half day of work, and fish breakage that cost me a bunch of personal time, I try to pin things that have the high probability of breaking due to an update.

not optimal, but sadly necessary.

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

#270

Homebrew project leader here: I hope you're able to find a package manager that better fits your needs and I'm sorry that Homebrew is not currently doing so. --- Homebrew upgrades dependencies and dependents of those dependencies (which, admittedly, can feel like unrelated) on installation and upgrade. As mentioned in other comments, you can customise this behaviour with `HOMEBREW_NO_INSTALL_UPGRADE` or `HOMEBREW_NO_…

> HOMEBREW_NO_AUTO_UPDATE

My life became much better after setting this.

I wouldn't be averse to a HOMEBREW_AUTO_UPDATE_INTERVAL=180d either, or HOMEBREW_AUTO_UPDATE_ASK=y .

Post reply on HN