Home > Software engineering >  How can I run stack haskell app on Mac M1?
How can I run stack haskell app on Mac M1?

Time:08-05

When stack run there is an error:

No setup information found for ghc-8.10.3 on your platform.
This probably means a GHC bindist has not yet been added for OS key 'macosx-aarch64'.
Supported versions: ghc-8.10.5, ghc-8.10.6, ghc-8.10.7, ghc-9.0.2, ghc-9.2.1, ghc- 
9.2.2, ghc-9.2.3

But ghci works well, how is it possible to fix?

CodePudding user response:

As you can see, m1 mac requires at least ghc-8.10.5, but you are using ghc-8.10.3. It may be because your project's stack.yaml specified ghc-8.10.3, try to change it to 8.10.7 to resolve it. Or select a lts version as an alternative(recommend).

From https://www.stackage.org/, LTS-18.28 uses ghc-8.10.7 as default.

CodePudding user response:

Works for me:

  1. In stack.yaml set resolver: ghc-9.2.3
  2. Execute stack run under bash (exec bash in zsh terminal)
  • Related