Help building the elm compiler on an Apple Silicon

I just noticed this project which I believe is absolutely awesome.

I’ve never done this before, so I tried building the compiler by following the regular path. Ended up with all sorts of errors. I’d kindly ask for instructions on building this on an Apple Silicon machine.

This is what I tried:

  • curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
  • press enter for all defaults
  • cabal build
  • got a bunch of errors:

Could it be related to this topic? Elm init tls issue
The error looks the same.

I would recommend building the Lamdera compiler instead. It has a stack based build which might go a little smoother. compiler/extra/readme.md at lamdera-next · lamdera/compiler · GitHub

I am building it on an M1 Mac by just pinning tls in elm.cabal:
tls ==1.9.0,

❯ cabal --version
cabal-install version 3.10.3.0
compiled using version 3.10.3.0 of the Cabal library 

❯ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.4.8

cabal build with some warnings still but it does build a working binary.

1 Like

That worked! Thanks Mika. I even have different cabal and ghc versions.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.