Full system Guix installation fails while building GHC due to out-of-memory error on 8GB RAM laptop

Installing full Guix system first-time using the video installation guide from the channel (I used the latest image from the systemcrafters github for installation with a full Linux kernel), the process eventually fails while building ghc (even though it proceeds to 100% check stage) and shows an out-of-memory error, kills the process and stops the installation. The last few dozen lines in the suggested build log (which is enormous by itself) are about tests some of which fail. ‘top’ shows 19,4 Gib mem our of my 7,6 while ‘free’ shows several Gigabytes of free memory (I have 8GB RAM total). Anyway I tried creating a swap file for 3Gb (maybe should have more?) but got a ‘swapon failed: Invalid argument’ error for some reason when trying to activate it. How can I successfully finish building the system? I understand it aims for some finished ‘state’ but it means it will keep trying to build GHC and keep failing like that? And anyway, why would a distro build need a Haskell compiler? It’s hardly a necessary thing to have for a general-purpose installation, and I seriously doubt it’s normal for it to eat up so much memory.

Any help would be appreciated.

P.S. ci.guix.gnu.org also always fails to connect but bordeaux substitute (as well as others) were used during installation so I guess that’s fine and has nothing to do with the problem, right? It’s not like anything critical failed to download from the ci repo and was just downloaded from other sources instead?

UPD: eventually fixed by using the https://cuirass.genenetwork.org substitute server

1 Like

Looks like you solved it, great :slight_smile:
My laptop also has 8gb ram and it is usually enough but some packages (e.g. firefox) are too large and need a substitute server… :thinking:

I still wonder what was the problem with creating the swapfile though. Also apparently not everything on ci is present on cuirass (though most is) so it’s more reliable to have direct mirrors rather than just more substitute servers

Looks like not everything is well yet, tried doing sudo -E system reconfigure ~/.config/guix/system.scm —substitute-urls=‘https : //ci . guix . trop . in https : //bordeaux . guix . gnu . org https : //cuirass.genenetwork . org https : //substitutes . nonguix . org’ and got this after a while, from /var/log/guix/drvs/rj/9mnrqjsshrqicw3501c14spxp9ymg9-linux-6.11.11.drv.gz

end of file relating to failure:

LD [M]  drivers/iio/pressure/st_pressure.o
  AR      built-in.a
  AR      vmlinux.a
  LD      vmlinux.o
  OBJCOPY modules.builtin.modinfo
  GEN     modules.builtin
  GEN     .vmlinux.objs
  MODPOST Module.symvers
  CC      .vmlinux.export.o
  UPD     include/generated/utsversion.h
  CC      init/version-timestamp.o
  KSYMS   .tmp_vmlinux0.kallsyms.S
  AS      .tmp_vmlinux0.kallsyms.o
  LD      .tmp_vmlinux1
  BTF     .tmp_vmlinux1.btf.o
scripts/link-vmlinux.sh: line 109:  5629 Killed                  LLVM_OBJCOPY="${OBJCOPY}" ${PAHOLE} -J ${PAHOLE_FLAGS} ${1}
  NM      .tmp_vmlinux1.syms
  KSYMS   .tmp_vmlinux1.kallsyms.S
  AS      .tmp_vmlinux1.kallsyms.o
  LD      .tmp_vmlinux2
  NM      .tmp_vmlinux2.syms
  KSYMS   .tmp_vmlinux2.kallsyms.S
  AS      .tmp_vmlinux2.kallsyms.o
  LD      vmlinux
  BTFIDS  vmlinux
libbpf: failed to find '.BTF' ELF section in vmlinux
FAILED: load BTF from vmlinux: No data available
make[2]: *** [scripts/Makefile.vmlinux:34: vmlinux] Error 255
make[2]: *** Deleting file 'vmlinux'
make[1]: *** [/tmp/guix-build-linux-6.11.11.drv-0/linux-6.11.11/Makefile:1157: vmlinux] Error 2
make: *** [Makefile:224: __sub-make] Error 2
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("-j" "4") exit-status: 2 term-signal: #f stop-signal: #f> 
phase `build' failed after 39748.7 seconds
command "make" "-j" "4" failed with status 2
build process 6 exited with status 256

UPD: figured out eventually, not trying to conceptualize what is installed where and how, what gnu store is and so on

Hey @lister
You should read this about sudo -E

1 Like