miso icon indicating copy to clipboard operation
miso copied to clipboard

sample-app won't build

Open phersu42 opened this issue 9 months ago • 1 comments

I am very new to web development in Haskell and wanted to try miso, but nix-build fails in miso/sample-app with the same output as described in #684.

Following the instructions and ran into the same problem with similar output as mentioned in #684. A rollback solved the problem an building with jsaddle worked as well (apart from that clicking does nothing and running the app eats up lots of memory, but I am not sure if this is an unexpected behaviour).

Since #684 was closed after the issuer said that they won't deploy for a long time, I am not sure what to do now because I need a web app for a project for university. Am I doing something wrong here? Should this already be fixed? I read about memory usage issues with nix but I don't know where to start troubleshooting because I am also very new to nix.

System specifications: Linux 6.8.2-1-MANJARO nix (Nix) 2.22.0

phersu42 avatar Apr 28 '24 18:04 phersu42

@phersu42 how much memory does your build machine have? GHCJS takes up a lot of memory during linking which occasionally causes OOMs in CI. Can you paste the commands used and your build output when building w/ ghcjs ?

dmjio avatar Apr 28 '24 19:04 dmjio

Sorry for my late answer. I seem to have fixed the problem, thank you!

I ran

git clone https://github.com/dmjio/miso.git
cd miso/sample-app
nix-build

last lines of the output:

Preprocessing executable 'app' for app-0.1.0.0..
Building executable 'app' for app-0.1.0.0..
[1 of 1] Compiling Main             ( Main.hs, dist/build/app/app-tmp/Main.js_o )
Linking dist/build/app/app.jsexe (Main)
/nix/store/7crry947d1xvp1f15c6q089l0gcy5hpc-stdenv-linux/setup: line 1315:  3920 Killed                  ./Setup build
error: builder for '/nix/store/14a59nbvznfx14nvdkczdrcq3d6srd7m-app-0.1.0.0.drv' failed with exit code 137;

My total Memory is 14.5G As you said, linking eats up all my memory, so I stopped everything possible that was running in the background and ran nix-build again. Memory usage went up to over 90%, but the build process completed successfully. Having to close the guide you're following while doing the instructions is a bit annoying, but it's not something I should complain about :)

phersu42 avatar May 05 '24 14:05 phersu42