Wouldn’t the best solution be to combine Ken’s two good ideas from this thread 
and add `supported_archs x86_64` to the haskell_stack portgroup, which would 
handle all ports built using stack?

> 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?


> On Aug 15, 2021, at 00:12, Ken Cunningham <ken.cunningham.web...@gmail.com> 
> wrote:
> 
> 
> 
>> On Aug 14, 2021, at 7:13 PM, Joshua Root <j...@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…
> 
> K

Reply via email to