I am trying to run nixpkgs-review on my own PR just to learn things.
Unfortunately, my machine runs out of memory very quickly and starts killing processes. This happens even if I try to limit packages to build using following command:
nixpkgs-review pr -p qgis 204148
I have no problem to build any package using nix-build -A. My laptop is fairly new Lenovo T14s with 16G of RAM. What I am doing wrong ?
When running nixpkgs-review pr -p qgis 204148 OOM starts during the build process. I saw following lines just about the time when my machine went in to troubles:
[10/0/30 built (3 failed), 0.0 MiB DL] building mapnik-unstable-2022-10-18 (buildPhase): | [10/0/30 built (3 failed), 0.0 MiB DL] building mapnik-unstable-2022-10-18 (buildPhase): |
From what I saw before, it looks like it tried to build multiple packages at once.
That’s strange. Looks like you are building all packages (without filtering them using -p). In my case running nixpkgs-review pr -p qgis 204148 runs out of memory in very few minutes .
Actually, I have services.earlyoom.enable = true;, but checking memory consumption during the build my machine was really going out of memory.
I don’t set boot.tmpOnTmpfs, so it should be false by default.
mount | grep "tmp"
devtmpfs on /dev type devtmpfs (rw,nosuid,size=779508k,nr_inodes=1944518,mode=755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,size=7795060k)
tmpfs on /run type tmpfs (rw,nosuid,nodev,size=3897532k,mode=755)
tmpfs on /run/wrappers type tmpfs (rw,nodev,relatime,size=7795060k,mode=755)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1559008k,nr_inodes=389752,mode=700,uid=1000,gid=100)
df -h /tmp will tell you stats about the drive that bakes the folder, though in the snippet you pasted, there is nothing obvious to see, unless some linking happens…
What I am wondering though is, might this perhaps be related to many jobs running at once? Would it work if you were using a lower cores/max-jobs setting for nix?
And when you do nix-build, do you make sure you build from your local clone or do you build from your channel, which then might be easily substitutable.
As you say, there is still the build happen on nixpkgs-review, I doubt you ever nbuilt the exact thing that review is building now, or review wouldn’t try to rebuild it again…
I went to my local nixpkgs clone and ran nixpkgs-review pr -p qgis 204148. Now it wants to download 3GB and to build 535 which it didn’t wanted one hour ago. Is it because some big change was merged to master in a meanwhile ?
If ofborg has evaluated your PR (the action “ofborg-eval” has succeeded), then nixpkgs-review will automatically download ofborgs’ evaluation result and use that. Then you don’t need that much RAM.
With I earlyoom disabled, my machine crashed during build process as before - just little bit later. It ran until all 16GB of RAM and 16gb of swap was taken then crashed.
@vcunat , I think, I am running out of memory during the build not during evaluation.
I suppose I missed the mentioned possibility of caching evals from OfBorg. Builds can also get expensive, of course.
Personally I simply… don’t develop on machines under 32G RAM and add zramSwap.enable = true; as a cushion, but I understand that it’s not trivial for everyone.