0

I'm using Miso, a Haskell backend for JS, and my code was compiling fine yesterday. However, as I try to compile today I get this:

Preprocessing executable 'simple' for miso-1.8.0.0..
Building executable 'simple' for miso-1.8.0.0..
[1 of 1] Compiling Main             ( exe/Main.hs, dist/build/simple/simple-tmp/Main.js_o )
Linking dist/build/simple/simple.jsexe (Main)
/nix/store/7crry947d1xvp1f15c6q089l0gcy5hpc-stdenv-linux/setup: line 1315:  3887 Killed                  ./Setup build
error: builder for '/nix/store/zaw5k6i7lqgxlw7i8aaxvqhknjky3f5x-miso-1.8.0.0.drv' failed with exit code 137

It seems like code 137 is a memory error, but the only thing open was my terminal. I've tried uninstalling and reinstalling nix, reinstalling Haskell, but no dice.

EDIT: Here an excerpt of the script.

    for curPhase in $phases; do
        if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then continue; fi
        if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then continue; fi
        if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then continue; fi
        if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then continue; fi
        if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then continue; fi
        if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then continue; fi

        if [[ -n $NIX_LOG_FD ]]; then
            echo "@nix { \"action\": \"setPhase\", \"phase\": \"$curPhase\" }" >&$NIX_LOG_FD
        fi

        showPhaseHeader "$curPhase"
        dumpVars

        # Evaluate the variable named $curPhase if it exists, otherwise the
        # function named $curPhase.
        local oldOpts="$(shopt -po nounset)"
        set +u
        eval "${!curPhase:-$curPhase}"
        eval "$oldOpts"

        if [ "$curPhase" = unpackPhase ]; then
            cd "${sourceRoot:-.}"
        fi
    done
}

Line 1315 is eval "$oldOpts".

ness64
  • 31
  • 6
  • Please read and apply: [Under what circumstances may I add "urgent" or other similar phrases to my question, in order to obtain faster answers?](https://meta.stackoverflow.com/q/326569/11107541) – starball Jan 05 '23 at 22:57
  • Looks like an important process executed by line 1315 of the `setup` script got terminated. Could you provide an excerpt of that part of the script to help us understand what it is doing? Is your computer running out of memory or disk space? Is there a message in `dmesg` about terminating processes to free memory? Are you trying to link a very large executable? Maybe you just need to reboot. – David Grayson Jan 05 '23 at 23:24
  • @DavidGrayson Sure! I'll update the question with it – ness64 Jan 06 '23 at 02:47
  • Ah, I fixed it. I left the fix in my answer. – ness64 Jan 06 '23 at 15:48

1 Answers1

0

I fixed it by changing the amount of memory the Ubuntu virtual machine used by editing .wslconfig. Even though it was enough before, 8 GB couldn't cut it, so doubling it to 16 worked.

ness64
  • 31
  • 6