Hypothetically I have two machines that I want to build out and give to developers. One machine arrives on Monday. My script runs "brew install postgresql" (no version), because of when I ran that script postgresql@10 gets installed. Tests pass, I hand that machine off to a new developer. The second machine arrives on Wednesday. I run the same script, but because v11 of postgres was added to homebrew on Tuesday, the second machine receives postgresql@11 even though the first machine received @10. Same script, two days apart, different major version of postgresql.
Yes, I can write my scripts carefully to avoid this. But consider this scenario: a new developer encounters a problem, tries to solve it themselves, finds a seemingly helpful blog, and ends up with postgresql@13 and node@15 when everyone else in their team is using postgresql@11 and node@12. Now tests are failing, but only for this one developer and only locally...
Debian is really strict about its releases and won't push a breaking change in a specific version of the OS.
For instance, `apt install htop` will only ever install the 2.X version of htop in Buster. Including security patches and all, but you won't get a 3.0.0 version without going sideways and add a specific repository for that. Debian will ship with htop version 3 in the next release, but you'll have to upgrade the entire distro for that.
Brew is different in that it allows anybody to merge a new breaking version of the software you use, so `brew install htop` on Monday could give you the 2.x version, and on Tuesday will install the 3.0.0 version.
You could maybe compare it to the rolling releases of Arch. But Arch has a better way of handling it than Brew: they test, they prepare, they communicate for bug changes..
Brew would benefit from segmenting their offering, but you'd lose the bleeding-edginess of it. Really, if you want reproducible packaging on Mac, I'd use nix or docker. If you want convenience and edge, use brew and deal with it.
Debian has an official backports repository if you want that behavior. It just gives you the freedom to choose.
There are exceptions to that, for example browsers like Firefox and Chromium, but upgrading the major version of Firefox is much less risky than upgrading the major version of postgresql.
Rolling release distros like Debian Sid (and archlinux, though that doesn't use apt) don't work this way, which is why rolling release distros have a reputation for being less stable.
I feel like as a new dev there’s so much in engineering I could learn from that’s already been solved and re-solved again and again or at least addressed by existing distribution systems.
However the reading materials to learn about some of this stuff seems far and few or very niche, sitting on some cached blog post from the 90s..
I think it should work like almost Linux distros where the major version is fixed for a release lifecycle, and any other installations require modification. So say brew install postgresql should always install 12, and if you want something else you have to add the version modifier.
But I agree that's nothing to do with brew conversation.
Containerized Postgres is a real win, but running OpenLDAP (+ custom schema) as a containerized application has measurably improved my quality of life. Kudos and great gratitude to the people behind https://github.com/osixia/docker-openldap
Alternatively, you can create your own 'tap' to gain more control over some packages.
For databases, I'd stick to running them as containers, too.
Homebrew is not ideal, of course, but there are ways to achieve desired goals until we have something better.
If they don't do this then there is no easy way to install an older version of a package, you will have to get the old .rb file from the brew git history and execute it yourself.
If want to use a version of postgres other than 10.x, you can either use a different version of Ubuntu or install a custom PPA.
Apt's target audience is systems administrators. Homebrew's target audience is independent developers who might need to have four different versions of Postgresql installed simultaneously on their laptop, because they maintain Rails/Django/Node apps for four different clients who are each unwilling to upgrade for whatever reason.
IMO homebrew is "messy" because it is trying to solve a harder problem. If there is such a thing as an average enterprise software developer, I would argue that homebrew is trying to solve problems that the enterprise developer does not have.
Mac OS itself doesn’t really have this problem since applications can bundle the exact version of their required frameworks, a bit like Ubuntu Snaps.
It's been a while since I used apt, but if I remember correctly you'd have the same problem the parent described, right?
-------------------
And regarding the 'name@version' criticism: If you want to stick to a version, how can you do it without specifying it?
Only if you are running Debian Sid or equivalent.
Tests failing.
Brew upgrade usually breaks stuff if it hasn't been updated in a couple of months, which is not the case for other package managers.
Forced update on any command is really bad behavior.
The Arch wiki was so good that it inevitably included the exact problem and resolution already, but since I didn't have any important running systems I also might as well have reinstalled the whole thing. In which case I'd run into installation problems that were also perfectly covered in the Arch wiki.
NixOS has a similar strategy.
Or just install informant from AUR, to force you to read the Archlinux package news before proceeding with any pacman operation.
I had packages installed by brew that used readline 7. This went on fine for a while. At some point, brew installed something (at my direction) and moved to readline 8. Unbeknownst to me, readline 7 disappeared from my system! Tada, a pile of tools require reinstallation. Oh, and I didn't notice until weeks later when psql stopped working.
I'm not the only one, at least... https://news.ycombinator.com/item?id=19063175
It's worth using nix on macos - takes a few hoops to get running, but it's worlds better than brew. Albeit, a fair bit more complex than docker.
- updating the package index on each operation. I just want to install stuff, dammit. I don't need you to run git pull to update the gazillion package definitions
- `brew update` and `brew upgrade` dichotomy. 99.9999999999% of the time I need to update/upgrade a package, not brew. If I ever needed to upgrade brew, I could run `brew update --brew` or something
Homebrew actually went the other direction and embedded non-consensual spyware directly into the package manager itself.