Welcome to CRUX bug tracking.

FS#1552 - pkgmk: default JOBS=nproc

Attached to Project: CRUX
Opened by Fun (fun) - Sunday, 07 January 2018, 22:10 GMT
Last edited by Tim Biermann (tb) - Saturday, 12 March 2022, 09:07 GMT
Task Type Improvement
Category tools → pkgutils
Status Closed
Assigned To CRUX Developers (crux)
Operating System CRUX
Severity Low
Priority Normal
Reported Version 3.3
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Currently, we use {JOBS:-1} in Pkgfiles, which is a downgrade from the default behavior, because the ports using ninja (and maybe others, firefox for example, from what I remember) are built with parallel jobs if "-j" is not supplied.

Not to mention that JOBS is used in ports where the build time matters and where the build system/file supports parallel jobs: firefox, boost, webkit, chromium, samba.

Having "export JOBS=$(nproc)" by default in pkgmk.conf should be a good thing for most of us (faster builds with ports using JOBS), and when the memory is scarce or the system is not properly cooled, the user can set JOBS to a lower value.

Of course, there is the choice to change ${JOBS:-1} to ${JOBS:-$(nproc)} in ports, and leave the pkgmk.conf file untouched, but I think enforcing JOBS to be set in pkgmk.conf to any positive value and use just "$JOBS" in ports where it matters is better.
This task depends upon

Closed by  Tim Biermann (tb)
Saturday, 12 March 2022, 09:07 GMT
Reason for closing:  Won't implement
Additional comments about closing:  This issue has stalled and nobody else took interest in it, closing
Comment by Fun (fun) - Sunday, 07 January 2018, 22:42 GMT
and the patch...
Comment by Juergen Daubert (jue) - Monday, 08 January 2018, 08:35 GMT
If we use $JOBS unconditionally in Pkgfile's we should consider to set the default to 1 in /usr/bin/pkgmk. This avoids a build break if JOBS is not defined in pkgmk.conf, meaning commented out by the user.
Comment by Fun (fun) - Monday, 08 January 2018, 19:52 GMT
Nice. I didn't thought of setting JOBS in /usr/bin/pkgmk. I attach one patch for JOBS=1 and one for JOBS=$(nproc).
Comment by Tim Biermann (tb) - Saturday, 18 September 2021, 15:19 GMT
I think this is perfectly fine to leave with what we have, maybe we need to promote that option more in the handbook to get new users aware of it... but that should be it?