Rosetta2 and supported_archs
Ryan Schmidt
ryandesign at macports.org
Tue Jan 12 02:07:02 UTC 2021
On Jan 11, 2021, at 19:38, Craig Treleaven wrote:
> A user with a new Apple Silicon-based Mac had a go at building mythtv.28. It failed thusly:
>
> ---> Computing dependencies for mythtv.28
> Error: Cannot install mythtv-core.28 for the arch 'x86_64' because
> Error: its dependency logrotate does not build for the required arch by
> default
>
> https://trac.macports.org/ticket/62027
>
> Given Rosetta2 on these systems, isn’t this a bogus error? On M1 Macs, we might warn that a dependency is being built for an arch different from that of the main target but why should it be a fatal error?
>
> What was done during the PPC to Intel transition? Did we try to force all deps of a port to build with the same arch?
MacPorts 2.6.4 is supposed to support all possible arch demotions. On arm64, you're supposed to be able to run x86_64. On x86_64, you're supposed to be able to run i386. On i386, you're supposed to be able to run ppc. Some of this was already in place before, and it was enhanced for 2.6.4 in this commit:
https://github.com/macports/macports-base/commit/94f428eda6bd58b57c670c20fb2362ad7012310a
See this ticket:
https://trac.macports.org/ticket/61430
Installing a port for a demoted architecture would require its dependencies to be installed universal. MacPorts is trying to install the dependencies universal and is failing on logrotate because it does not have a universal variant. The solution is to add a universal variant to logrotate. Alternately, if logrotate does not install any libraries (and it looks like it does not), add "installs_libs no" to the logrotate portfile so that MacPorts knows it does not need to check its architecture. Or if logrotate does install libraries but whichever one of mythtv.28's dependencies depends on logrotate (looks like it's mythtv-core.28) doesn't link with any of its libraries, add "depends_skip_archcheck logrotate" to mythtv-core.28.
More information about the macports-dev
mailing list