Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I always wonder why ppl do not use MacPorts? There was a great article on HN which basically drew a pretty clear picture how brew can easily mess your system up. Yet, being a new Mac user, wherever I go, I only see a reference to brew installs. I am using M1 for a over a month and it’s been a very smooth ride so far. Installing everything via MacPorts where I only had an issue with rabbitmqd which failed to build because of erlang.


I switched to Brew back in... oh, 2012 or 2013, I think, because I was sick of MacPorts breaking itself horribly during normal operations (installing/uninstalling) every 3-6 months. Brew’s huge package selection, rare breakage (sometimes on OS upgrades, usually easy to fix), decent UI, and ability to also manage nearly all the closed-source software I install, have kept me from bothering to look at MacPorts again.


I had a similar experience. I started out with macports, which seemed more familiar to me as a user of Linux package managers. But macports kept breaking in weird ways, until I finally tried homebrew, which didn't break. That was years ago, so maybe macports is better now, but homebrew has never given me a reason to switch away from it.


I have completely the opposite experience; brew would screw something up every other time I upgraded a package, and didn't cross OS updates very well at all. MacPorts has been rock-solid, possibly because it is more careful about making sure that ports have exactly the right deps.


Weird. Macports is the one I was always having to edit packages for to un-break them, with a totally normal installation. Seemed like their packages were poorly-maintained. Must have gotten better I guess.


I think this might have changed a bit over the years. I can’t remember last time I had to tinker to build a port. But you’re right, it wasn’t uncommon around 2010.


Similar here. I'm sure MacPorts has improved since then and I should probably give it a spin next time I have a fresh macOS install, but back in the late 00s and early 10s not only did I have issues with it breaking itself, but also constant issues with packages not compiling/installing, or if they did crashing due to some dependency issue.

At that point in time I was a lot less technically capable, so on the rare occasion googling the issue would turn up a relevant mailing list archive, I usually wasn't able to act on it and I'd wind up procuring the package in question through some other method or just doing without.

So when Homebrew came along and most things installed and ran fine with the rare issue that cropped up getting fixed fairly quickly, it easily stuck.


I switched from brew to macports recently, so here are my thoughts:

- before, I had generally heard of homebrew a lot, and macports very little. Brew's marketing is better. I think this is intentional (as in Macports doesn't really do any)

- The docs for macports are very poor. They are comprehensive, but barely navigable. Keyword search doesn't work well. They're obtuse.

Further context: I also find brew docs poor, but they're much more user-focused (how to install packages), whereas macports' seem more packager-focused.

- Requiring sudo is a security feature, but Macports doesn't advertise this well, so brew "seems" more secure on first impression

- Most software with cli install instructions recommend brew up top (even when there's a macports option). i.e. there's no evangelization of macports by maintainers who package for it. I don't really know why this is, but it's something macports maintainers could/should look into.


Interesting observations. Why does Brew seem more secure on first impression?


As the sibling mentioned, using sudo gives the process root, with the implication being it has full access to your system and can potentially do a lot more damage. Extend this to any arbitrary installer you're running and it becomes scary. So brew's sudo-less model seems more secure in this context.

In reality however, macports uses "privilege separation" which drops privileges for each individual install to a separate "macports" user. This is more secure than brews sudoless approach because not only does the installer not have root access, it doesn't have full access to your own user either (e.g. your HOME). Privilege separation isn't possible without initially having root privileges.


Because not using sudo implies you’re not giving anything escalated privileges. I’m aware there’s a contrary view (which I can’t recall, but will dutifully refresh my memory after I post this answer) but this reasoning still feels more intuitive to me.


I switched to brew because it goes out of its way to avoid breaking your system. I recently gave macports another try and the experience involved editing Portfiles over and over again to try to get applications to work.

The most common complaint (changing permissions on /usr/local) isn’t a problem with the arm64 version which now uses /opt/brew but, also, as far as my trust model goes, it isn’t a problem for me: I already have $HOME/bin on my path and, so, any local exploit that relies on overwriting system executables has multiple ways of tricking me into running a malicious program.


I’ve been using Macports for years, trying Homebrew every now and then without finding a good reason to jump. From my point of view Homebrew would need a serious advantage to overlook the issues caused by its architecture. I also like the fact that Macports builds are (mostly) deterministic because they depend on as many tools from Macports as possible, and not moving target frameworks from the OS itself.

Homebrew was the cool new kid at the right time, when Macs popularity amongst webdevs was growing exponentially. OTOH, Macports is still working fine; there is room for two package managers on macOS.


Or for that matter I’m looking forward to learning more about nix which promises sort of the holy grail in these matters


I tried using nix on a Mac, because I really respect what they're trying to do and it seems like a "right thing" kind of platform which I want to support.

I wasn't able to get it to work, and it left a bunch of users (like ten??) and other various junk which was a pain to clean up. This was in 2017 I think.

I keep hoping someone will chime in and say "I use nix on my Mac, and it's dreamy, everything Just Works you should try it!" because until that happens I'm going to stick with brew.

While I'm on the subject, I was also a macports user until hmm, 2013 I think. Don't recall exactly why I switched, just that I was having some kind of intractable problem, messaged a friend who knows what he's talking about, and he said "just use brew dude". So I did.


I use nix on my Mac, and it's dreamy, everything Just Works you should try it!

Well, it works now that I've set it up. But the setup is not exactly trivial. Here are the steps I used last time I set it up, a year or two ago, to get a single-user install working:

```bash

sudo vim /etc/synthetic.conf

# Insert the following line in vim (the file should be three bytes long):

nix

# Save and exit vim

echo "LABEL=Nix /nix apfs rw" | sudo tee -a /etc/fstab

# Reboot computer

sudo diskutil apfs addVolume disk1 APFSX Nix -mountpoint /nix

sudo diskutil enableOwnership /nix

sudo chown -R "$(whoami)" /nix

# Reboot computer

sh <(curl https://releases.nixos.org/nix/nix-2.3.10/install) --no-daemon ```

So not exactly pretty, but it works. And it works great. Nothing every breaks -- installations/updates may fail, but they leave the previously working version in place so that everything works as if I hadn't tried to install/update in the first place. I wouldn't want to have to set it up again, but now that I have, I don't want to use anything else to manage my packages.


I was using macports before brew really existed and switched over the brew because you didn't have to waste time compiling everything all the time and dealing with breakage. The CLI was also much nicer to use with little bits of whimsy.

Brew was a big timesaver back then (maybe now too if macports is still in 'compile everything' mode) and that is the key reason why it became the dominant package manager. Nobody has 'moved back' because macports isn't 'better enough' to induce people to switch over like they did with brew originally.


Homebrew starts from the MacOS CLI apps provided through XCode. It's a usermode package manager built on top of XCode components. MacPorts builds everything from scratch, which grants more power and optimization opportunities, but comes with many, many more rough configuration edges to deal with.

The optimization opportunities for some packages are typically on the order of 2x-5x faster, which isn't enough to deal with the headache of extra config for a personal dev box. So, my rule of thumb is, unless I know exactly the performance trade off I am trying to take advantage of by going with MacPorts, I will be better served by using Homebrew. I will wind up spending more time fixing config then I will have saved on execution processing time.


> Homebrew starts from the MacOS CLI apps provided through XCode

As does MacPorts. https://guide.macports.org/#installing.xcode

> MacPorts builds everything from scratch

This has not been true for many years: https://trac.macports.org/wiki/FAQ#fromsource


> As does MacPorts. https://guide.macports.org/#installing.xcode

For some reason, It is PITA to get MacPorts to recognize Xcode. It took me three days to get MacPorts to see it. I tried various configuration, arguments, versions, etc until it's finally working.


> failed to build because of erlang.

That specific issue sounds like a MacPorts problem where it (MacPorts) is using an outdated version of Erlang; because Erlang works just fine on the M1.


I think the reason is simply that Homebrew works fine for most people, including myself. I too have an M1 Mac and had no problems with it, although this may be a reflection of significant improvements made in Homebrew related to Apple Silicon in the past few months. That's the thing about software: things that break today can be fixed the next (or, worse, vice versa).


Brew has more packages and is more popular so stuff is more likely to be available and more likely to work. I rarely have issues with it though I do wish it wasn't so slow and good luck trying to uninstall something.


For me it was that I heard about Homebrew first, installed it, never had any problem with it. So, marketing?


Not necessarily even marketing. It’s also just the de facto Mac package manager most commonly mentioned in docs/READMEs for Mac install instructions. This is probably more a matter of convenience than anything, and anyone using other package managers can easily mentally map the instructions to their own usage.


I've always considered macports/brews as last possible solution for problems on macos because you eventually end up with broken system. Luckily you can run most of the stuff on a remote linux with containers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: