Exit code 137 with nixpkgs, despite not changing anything

143 Views Asked by At

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".

1

There are 1 best solutions below

0
On

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.