Re: Haskell Stack Ports on Apple Silicon

2021-08-16 Thread Steven Smith
Please see https://github.com/macports/macports-ports/pull/11897 for a working approach on both x86_64 and arm64. > On Aug 15, 2021, at 8:16 AM, Steven Smith wrote: > > I confirm that this approach does not work on an M1 Mac. > >

Re: Haskell Stack Ports on Apple Silicon

2021-08-15 Thread Ken Cunningham
> On Aug 15, 2021, at 5:16 AM, Steven Smith wrote: > >> Cannot install shellcheck for the arch 'arm64’ because IF shellcheck had supported_archs x86_64 in the Portfile, it should never try to install the arm64 arch in the first place. So I’m guessing probably that was missing. It seems

Re: Haskell Stack Ports on Apple Silicon

2021-08-15 Thread Steven Smith
I confirm that this approach does not work on an M1 Mac. Trying to install a stack portion an M1—whether or not `supported_archs x86_64` is set—throws this architecture mismatch error when trying to install on the M1: > Cannot install shellcheck for the arch 'arm64' because > It’s dependency

Re: Haskell Stack Ports on Apple Silicon

2021-08-15 Thread Steven Smith
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

Re: Haskell Stack Ports on Apple Silicon

2021-08-14 Thread Joshua Root
On 2021-8-15 14:11 , Ken Cunningham wrote: 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? Yes.

Re: Haskell Stack Ports on Apple Silicon

2021-08-14 Thread Ken Cunningham
> On Aug 14, 2021, at 7:13 PM, Joshua Root 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

Re: Haskell Stack Ports on Apple Silicon

2021-08-14 Thread Joshua Root
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

Re: Haskell Stack Ports on Apple Silicon

2021-08-14 Thread Steven Smith
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

Re: Haskell Stack Ports on Apple Silicon

2021-08-14 Thread Joshua Root
On 2021-8-15 05:43 , Ken Cunningham wrote: You could override it, in pandoc or in the PortGroup: depends_skip_archcheck-append stack What architecture is the pandoc binary you end up with though? It seems unlikely that an x86_64 stack would generate an arm64 binary, and if it generates an

Re: Haskell Stack Ports on Apple Silicon

2021-08-14 Thread Ken Cunningham
You could override it, in pandoc or in the PortGroup: depends_skip_archcheck-append stack

Re: Haskell Stack Ports on Apple Silicon

2021-08-14 Thread Steven Smith
> MacPorts base already knows this and allows the port to be installed on Apple > Silicon even when it says supported_archs x86_64. Then I believe there is a bug in the MacPorts download logic per the original post. When I try to install, e.g., pandoc, on an arm64 box, I hit this architecture

Re: Haskell Stack Ports on Apple Silicon

2021-08-13 Thread Ryan Schmidt
On Aug 13, 2021, at 10:58, Steven Smith wrote: > > If the Macports-compiled stack runs on arm64, then the prebuilt download will > too. > > The issue as far as I can tell from the internet is that stack will generate > x86_64 binaries, even if running on an M1. >

Re: Haskell Stack Ports on Apple Silicon

2021-08-13 Thread Ken Cunningham
I don't think it's overly simple to guess what might actually happen, or work. You have to try it various ways, and as Ryan says, I guess also try it when pandoc is pulled in as a dependency rather than directly installed, and see. The automatic fallback to other supported arches (eg arm64 ->

Re: Haskell Stack Ports on Apple Silicon

2021-08-13 Thread Steven Smith
If the Macports-compiled stack runs on arm64, then the prebuilt download will too. The issue as far as I can tell from the internet is that stack will generate x86_64 binaries, even if running on an M1. https://www.haskell.org/ghc/blog/20200515-ghc-on-arm.html These x86_64 binaries should run

Re: Haskell Stack Ports on Apple Silicon

2021-08-13 Thread Christopher Jones
That line is indeed limiting support to intel machines. If it works on arm add that to the list, or probably better just remove it and rely on the defaults. Chris > On 13 Aug 2021, at 1:55 pm, Steven Smith wrote: > > Is this line in the stack Portfile the issue? Ports (like pandoc) that are

Re: Haskell Stack Ports on Apple Silicon

2021-08-13 Thread Ryan Schmidt
On Aug 12, 2021, at 15:28, Ken Cunningham wrote: > It was reverted / replaced though. I was told that MacPorts did this > automatically now (MacPorts would fall back and install the Intel binary on > arm64) so it was not needed to do this any longer. As far as I could tell, this applies to

Re: Haskell Stack Ports on Apple Silicon

2021-08-12 Thread Ken Cunningham
> I’d like to start hacking a Portfile update that will either compile pandoc > on the M1 with stack, or install the x86_64 binary and hope it runs, like the > x86_64 stack binary does. You won't be surprised to find out I did that exact thing about a year ago:

Haskell Stack Ports on Apple Silicon

2021-08-12 Thread Steven Smith
I have an M1 box on which I’d like to install some haskell ports. The good news: `sudo port install stack` works and the binary runs on an M1. But when I try to install, e.g., pandoc, I hit this architecture mismatch error: > Cannot install pandoc for the arch 'arm64' because > It’s dependency