Subject: bug#47717: guix becomes unresponsive while building the 'vigra' package

From: Mark H Weaver <[email-masked]>
Date: Wed, 14 Apr 2021 04:21:44 -0400

bo0od <[email-masked]> writes:

>  > What kind of computer are you using? Are you using swap?
>
> 4GB DDR3 rams, i7 4th generation , 20GB for Guix about 9GB swap

For the record: I don't use binary substitutes at all, and I build my
GNOME system plus IceCat locally, using Guix, on a modest Thinkpad X200
with 4GB of RAM and 8GB of swap, all while running a GNOME session with
Emacs.

I can build _most_ (but not all) packages while running IceCat.
However, some builds, e.g. IceCat and WebKitGTK, require too much memory
to build while simultaneously running a modern web browser.

I haven't tried to build Libreoffice recently, but I did so regularly a
few years ago.

* * *

I suspect that your problem is that you have too many CPUs relative to
your relatively modest 4GB of RAM.  The more CPUs you have, the more
compilers will be run concurrently (by default), and the more RAM you
will need.

In my case, I have only 2 CPUs on my system, so I have only two
instances of GCC (or whatever compiler) running at any given time.

It might help to pass --cores=2 (or perhaps even --cores=1) to
guix-daemon, which should hopefully be honored by the build systems of
most of our packages, but probably not all (bug reports welcome).

On a Guix system, you can arrange for this in your OS config with
something like the following (untested):

__ (modify-services %desktop-services
____ (guix-service-type config =>
_______________________ (guix-configuration
_________________________ (inherit config)
_________________________ (extra-options '("--cores=2")))))

       Mark