Co-existance of MacPorts and Brew?

Clemens Lang cal at macports.org
Wed Feb 15 22:59:35 UTC 2023


Hi,

On Wed, Feb 15, 2023 at 02:54:40PM -0500, André-John Mas wrote:
> What is the current status of co-existence of Brew and MacPorts on the
> same machine? Previously this was meant to be a problem.

It's less of a problem these days on Apple Silicon, because Homebrew
moved away from /usr/local, which was in the default search path for
compilers.

However, many software packages automatically look for software in
Homebrew locations, and that can and will still cause issues in
MacPorts. We used to have trace mode as a tool to mitigate most of these
issues, but Apple's most recent security measures broke this again, so
it currently doesn't work on Ventura, or any Apple Silicon machines:
https://trac.macports.org/ticket/66358


> The latest one I ran into was Vagrant, which indicates how to use Brew
> to install, but nothing for MacPorts:
> 
> https://developer.hashicorp.com/vagrant/downloads

That's because brew doesn't build Vagrant from source but installs
hashicorp's prebuilt binary [1]. This isn't MacPorts' policy, as we
always want to build software we ship from source on our build machines.
Installing vagrant from brew is no different from installing their dmg
directly.


> Also, there doesn't seem to a version of Vagrant in MacPorts.

Vagrant is actively hostile to others building and packaging their
software. You *can* build it yourself, and it's not very complicated
either, since it just uses ruby bundler, but any copy you build yourself
will print this warning *on* *every* *single* *command* *you* *run*,
sometimes even breaking usability in the process, such as when running
vagrant ssh-config, which will clobber stdout with this warning:

| You appear to be running Vagrant outside of the official installers.
| Note that the installers are what ensure that Vagrant has all required
| dependencies, and Vagrant assumes that these dependencies exist. By
| running outside of the installer environment, Vagrant may not function
| properly. To remove this warning, install Vagrant using one of the
| official packages from vagrantup.com.

I know it's sometimes a useful tool, but let me tell you, if I didn't
have to use it for what I'm currently doing, I'd actively avoid it like
the plague for this behavior that's IMO open source in writing only, not
in spirit.


[1]: https://github.com/hashicorp/homebrew-tap/blob/master/Casks/hashicorp-vagrant.rb

-- 
Clemens



More information about the macports-users mailing list