Haskell Stack Ports on Apple Silicon
ken.cunningham.webuse at gmail.com
Sun Aug 15 04:11:55 UTC 2021
> On Aug 14, 2021, at 7:13 PM, Joshua Root <jmr at macports.org> wrote:
> 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
IF pandoc set it’s supported_archs to x86_64 (which then matches stack) — would that now install properly on an M1 Mac, using the fallback archs?
that would be just right, if that’s how it works, and a proper fix for it all…
More information about the macports-dev