Haskell Stack Ports on Apple Silicon

Joshua Root jmr at macports.org
Sun Aug 15 02:13:40 UTC 2021


On 2021-8-15 11:52 , Steven Smith wrote:
> stack (and ghc, cabal) can only build x86_64, so it’s an x86_64 binary that runs on the M1 (whether built on x86_64 or arm64).
> 
> The problem is that with the current supported_archs setting in stack, you hit this architecture mismatch error when trying to install pandoc on the M1:
> 
>> Cannot install pandoc for the arch 'arm64' because
>> It’s dependency stack is only installed for the arch 'x86_64'
>> and does not have a universal variant.
>> Unable to execute port: architecture mismatch

Then the error is correct; you can't build an arm64 pandoc with an 
x86_64 stack. The pandoc port is just following the global build_arch 
setting since it does not set supported_archs and the default is to 
assume that all archs are supported. Since it can only actually build 
for x86_64, pandoc should set supported_archs accordingly.

- Josh


More information about the macports-dev mailing list