elm / compiler

Compiler for Elm, a functional language for reliable webapps.
https://elm-lang.org/
BSD 3-Clause "New" or "Revised" License
7.52k stars 661 forks source link

Provide a 0.19.1 binary for linux_arm64 to be used in containers on Apple Silicon (M1) #2283

Open jsynacek opened 1 year ago

jsynacek commented 1 year ago

Quick Summary: Please, provide a binary that can be used in a linux container running on an Apple Silicon (arm64) host.

Currently, the binary asset binary-for-linux-64-bit.gz is usable, but it's really slow and can't be used if elm is specified as a project dependency:

<inside the container>

$ which elm
/usr/local/bin/elm

$ npm run build
...
npm ERR! command sh -c node install.js
npm ERR! -- ERROR -----------------------------------------------------------------------
npm ERR! 
npm ERR! I am detecting that your computer (linux_arm64) may not be compatible with any
npm ERR! of the official pre-built binaries.
npm ERR! 
npm ERR! I recommend against using the npm installer for your situation. Check out the
npm ERR! alternative installers at https://github.com/elm/compiler/releases/tag/0.19.1
npm ERR! to see if there is something that will work better for you.
npm ERR! 
npm ERR! From there I recommend asking for guidance on Slack or Discourse to find someone
npm ERR! who can help with your specific situation.
npm ERR! 
npm ERR! --------------------------------------------------------------------------------

SSCCE

Additional Details

See also https://github.com/elm/compiler/pull/2234.

github-actions[bot] commented 1 year ago

Thanks for reporting this! To set expectations:

Finally, please be patient with the core team. They are trying their best with limited resources.

alshdavid commented 1 year ago

I just tried to compile the project using docker on a Debian arm64 VM (M1 MacBook) with no luck. I am not familiar with Haskell so I wasn't able to do more

bburdette commented 1 year ago

Have you tried installing via nix? That has worked for me on arm64 (pinebook) but not specifically an M1.

supermario commented 1 year ago

@jsynacek if you've not seen it already, I built linux_arm64 binaries and Simon has made them available with @lydell/elm: https://github.com/elm/compiler/pull/2287

alshdavid commented 1 year ago

Any updates to this? :)

supermario commented 1 year ago

@alshdavid you can find linux-arm64 binaries here: https://github.com/lydell/compiler/releases/tag/0.19.1

alshdavid commented 1 year ago

Is there a way to tell the install script for the elm package not to download the binaries?

https://github.com/elm/compiler/blob/master/installers/npm/download.js#L27

It seems npm install elm will fail when running on Linux arm, even if the binaries are supplied externally, because the script will fail to match the permitted platforms.

lydell commented 1 year ago

@alshdavid If you go to https://github.com/elm/compiler/pull/2287 and scroll to the end of the PR description and expand “Aside about unsupported platforms” you can see how the discussion went about that.