[patch]: support -jX in jail builds, -DNO_CLEAN

Philip M. Gollucci pgollucci at p6m7g8.com
Tue Jun 2 00:12:13 EDT 2009


1) -DNO_CLEAN is always safe here b/c

buildJail() {
   ...
   # clean up after any previous build attempts
   cleanDirs ${jailName} ${J_OBJDIR} ${J_TMPDIR}
   ...
   make world
   ...
}

So J_OBJDIR is *always* empty.

2) Add -jX based on number of cpus * 2 + 1
   (note: on my single quad core, -j12 is better,
    this is probably a good 'default')



Index: lib/tc_command.sh
===================================================================
RCS file: /space/cvs/marcuscom-cvs/portstools/tinderbox/lib/tc_command.sh,v
retrieving revision 1.122
diff -u -r1.122 tc_command.sh
--- lib/tc_command.sh   11 May 2009 19:31:54 -0000      1.122
+++ lib/tc_command.sh   2 Jun 2009 04:09:04 -0000

@@ -698,8 +698,12 @@
     if [ "${jailArch}" != "${myArch}" ]; then
        crossEnv="TARGET_ARCH=${jailArch}"
     fi
+
+    ncpus=$(/sbin/sysctl hw.ncpu |awk '{print $2 }')
+    factor=$(echo "$ncpus*2+1" | /usr/bin/bc -q)
+
     cd ${SRCBASE} && env DESTDIR=${J_TMPDIR} ${crossEnv} \
-       make world > ${jailBase}/world.tmp 2>&1
+       make -j${factor} -DNO_CLEAN world > ${jailBase}/world.tmp 2>&1
     rc=$?
     execute_hook "postJailBuild" "JAIL=${jailName} DESTDIR=${J_TMPDIR}
JAIL_ARCH=${jailArch} MY_ARCH=${myArch} JAIL_OBJDIR=${JAIL_OBJDIR}
SRCBASE=${SRCBASE} PB=${pb} RC=${rc}"
     if [ ${rc} -ne 0 ]; then


More information about the tinderbox-list mailing list