During Migration to Arm64 mac, should I null out archs='x86_64' from installed ports list?
cal at macports.org
Sat Apr 16 10:44:09 UTC 2022
On Thu, Apr 14, 2022 at 04:10:26PM -0500, Ryan Schmidt wrote:
> On Apr 14, 2022, at 14:34, Daniel J. Luke wrote:
> > Once you do step 2, the port command works again (and you should
> > follow the rest of the instructions, but if you're prepared to live
> > with the consequences of things maybe breaking because you didn't
> > follow good advice, even things like 'port install' and 'port
> > upgrade outdated' mostly work at that point).
> Exactly. This is how I do MacPorts upgrades after an OS upgrade; I
> don't follow the migration instructions. I like the benefit of being
> able to upgrade a few ports at a time without affecting other ports,
> and keeping older ports installed that can no longer be built on the
> current OS, and I'm prepared to investigate and work around the issues
> that arise.
FWIW, that's also what I do, albeit with trace mode enabled. The danger
of doing this, and the reason why we're recommending the migration
procedure is that old binaries, libraries or headers which were not yet
recompiled for the new OS version may not work yet.
Now usually, MacPorts would upgrade those dependencies first, so it
should not be a problem at all. However, some ports opportunistically
pick up installed libraries and headers if they are present, which has
the potential to fail. For example, let's assume that an OS upgrade came
with a change of architecture, like the recent move from x86_64 to
arm64. You attempt to upgrade port ABC, which depends on library DEF,
and optionally uses library GHI. If you run port upgrade outdated or
port upgrade ABC, MacPorts will upgrade DEF first, because the ABC port
depends on DEF. It will not upgrade GHI, if ABC does not depend on it.
If you run port upgrade outdated without doing the migration
instructions, an old copy of GHI may be around without the arm64
architecture, and rebuilding ABC may fail if it determines a copy of GHI
is present, because the linker will refuse to link an x86_64 library
into an arm64 binary. This situation can be avoided using trace mode,
because that will hide the old copy of GHI from the ABC build.
For that reason, I consider migration and port -t upgrade outdated
mostly equivalent, but we still recommend migration because it is the
safer default and does not come with trace mode's performance penalty.
Additionally, trace mode does not work with all ports (it does break go,
More information about the macports-users