After scouring the web for a solution to ninja overrunning my meager RAM when compiling qtwebengine I discovered there is no easy one. People have been looking for a solution for a long time. Apparently the ninja developers have no intention of providing an environment variable even though they've had patches volunteered. They seem think that a wrapper is the solutions. It is not a good solution for all situations. Some Arch users have switched to samurai, a controllable replacment for ninja but I'm not ready to try that. I don't know if samurai will keep pace with ninja changes. Because I wanted to control parallelism from pkgmk.conf I wrote this wrapper. Normally I let everything use the number returned by nproc. This doesn't work well for qtwebengine. It will begin swapping terribly and takes about 8 hours to compile with 16GB of RAM. nproc returns 8 on my machine. If I set JOBS=4 in pkgmk.conf qtwebengine will compile in about 4 hours with no swapping using this wrapper. The wrapper is: #!/bin/bash # to use this wrapper: # mv /usr/bin/ninja /usr/bin/ninja-piggy # put this script in /usr/bin/ninja # # in pkgmk.conf add: # export JOBS=n # whenever ninja should be restricted to 'n' processors. # # if JOBS is not set, below will default to the results from 'nproc'. JOBS=${JOBS:-$(nproc)} newargs=\"$(echo $@ | sed -e "s/-j[ ]\{0,\}[0-9]\{1,\}/-j$JOBS/g")\" exec ninja-piggy "$newargs" # End of file The downside is: it gets overlayed every time the ninja port is updated. Sigh. So I keep a copy of it in /usr/bin/ninja-lite. Cheers, Daryl