jkachmar / alpine-haskell-stack

Demonstrating how GHC, Alpine, Stack, and Docker can be used together
BSD 3-Clause "New" or "Revised" License
111 stars 19 forks source link

Build problem #3

Closed xgrommx closed 5 years ago

xgrommx commented 5 years ago

After command make docker-build-gmp I got

utils/genprimopcode/ghc.mk:19: utils/genprimopcode/dist/package-data.mk: No such file or directory
make[1]: *** [utils/ghc-cabal/ghc.mk:56: utils/ghc-cabal/dist/build/tmp/ghc-cabal] Killed
make: *** [Makefile:123: all] Error 2
Failed to install, consider updating this script via:
    ghcup upgrade
Also check https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Linux for build requirements and follow the instructions.
The command '/bin/sh -c echo "Compiling and installing GHC" &&    ghcup -v compile -j $(nproc) -c /tmp/build.mk ${GHC_VERSION} ghc-8.4.3 &&    rm /tmp/build.mk &&    echo "Uninstalling GHC bootstrapping compiler" &&    apk del ghc &&    ghcup set ${GHC_VERSION}' returned a non-zero code: 2
make: *** [docker-ghc-gmp] Error 2

How can I fix it?

symbiont-joseph-kachmar commented 5 years ago

Unfortunately it looks like you're running into an error here: https://github.com/ghc/ghc/blob/master/utils/genprimopcode/ghc.mk#L19 and here: https://github.com/ghc/ghc/blob/master/utils/ghc-cabal/ghc.mk#L55-L81

I'm not sure how you could be running into this on your system, though, since everything should be Dockerized...

What OS are you running this on, and is there anything special about your environment?

jkachmar commented 5 years ago

Closed due to inactivity.

Feel free to reopen if you can provide some steps to reproduce this error or want to walk through the process at some point in the future.

itkach commented 4 years ago

I was getting the same error on Mac OS X. Line 2 in @xgrommx's output ("Killed") was a clue that compiler process was killed by out-of-memory killer and prompted me to check Docker settings (Docker Desktop > Preferences > Advanced). Memory for docker engine was set to 2 GiB - apparently insufficient. After bumping it to 8GiB image was built successfully.