-
Notifications
You must be signed in to change notification settings - Fork 659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot compile with ELM inside Docker on Mac M1 #2244
Comments
Thanks for reporting this! To set expectations:
Finally, please be patient with the core team. They are trying their best with limited resources. |
I am also coming across this problem. It seems that OOM killer kills elm compiler process. Around 10GB are being consumed in my case, but sometimes not. It's realy unstable. What is your Docker preference about CPU, memory, and swap? |
I have the same problem and was able to build Elm using the following article: https://dev.to/csaltos/elm-for-linux-arm64-32bc |
This is a hugely frustrating issue because the information available is very patchy, not particularly helped by the 0.19.1-4 or 0.19.1-5 approaches (i.e. 0.19.1-4 doesn't actually work), and is compounded with issues where the docker daemon itself is crashing due to memory issues in the scenario @IzumiSy mentions. I've successfully built binaries using the approach @ream88 mentions, however the binary isn't statically compiled and hence won't run, for example, on alpine. I've yet to manage to get a build working on alpine, I know zero about the Haskell tooling. if anyone can share insights on how to produce a portable binary here, it would be hugely appreciated I should also mention I've been able to install via nix-env, but then nix isn't particularly easy to install either. |
I'm running Elm inside Docker in a Mac M1 and it seems to work by installing it like this: RUN curl -L -o elm.gz https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz \
&& gunzip elm.gz \
&& chmod +x elm \
&& mv elm /usr/local/bin/ The only problem so far is that compilation takes a few seconds to start (was instantaneous in the Intel Mac) |
@sashaafm Elm still dies OoM for me with this suggestion. What base image are you using? I've tried ubuntu and alpine. |
@bwells I'm using the |
@bwells back when I posted this I was only using an M1 Mac with 16GB RAM. I now started using an M1 Mac with 8GB and did a full migration from the other Mac. In this 8GB Mac I lowered the memory limit in Docker to 4GB since I didn't want to use as many resources as the other one. However, Elm compilation started failing with OOM like you described. I found out that setting the limit to 8GB back again now works for the 8GB Mac as well. So I guess that Elm compilation in the M1 Macs require at least 8GB of memory in order to not be killed? I don't see the memory pressure going to those limits though |
Thanks so much for reaching out. I was able to determine that raising the Docker VM memory limit to 7GB with my codebase would allow successful compiles. I'm on a 24 GB M2 Air these days, so that amount of memory is workable, but still feels a bit silly. I also don't actually see the memory pressure triggering the OOM kill and this still feels like room for improvement out of Elm and/or Haskell, but I'm glad to have a working solution again. |
I'm trying to use ELM to compile a Vue App, which is inside a Docker Container, this works on Linux and Mac Intel.
Additional Details
v0.19.1-4
for NPM0.19.1/binary-for-linux-64-bit.gz
in the container before installing NPMnginx:stable-alpine
Error
The text was updated successfully, but these errors were encountered: