summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-11-24 14:41:01 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-11-24 14:41:01 +0000
commit18547df12b8931dc3207cbcb07ded155f3b04f96 (patch)
tree3be5275c3e108469daaad096164e46bc910c1423
parent4c4b32a28183f417eaee2724e58760d0584c6736 (diff)
downloadmorph-18547df12b8931dc3207cbcb07ded155f3b04f96.tar.gz
Tell morph the max number of jobs in parallel explicitly
We run morph in a chroot, where it has no access to /proc/cpuinfo, and that makes it not be able to count the CPUs correctly, so it thinks it only has one. When we tell it the count explicitly (from outside the chroot, where we do have /proc/cpuinfo), things'll work better.
-rwxr-xr-xbaserock-bootstrap1
-rw-r--r--morphlib/builder.py3
2 files changed, 4 insertions, 0 deletions
diff --git a/baserock-bootstrap b/baserock-bootstrap
index 8bb806bb..bb5efb9c 100755
--- a/baserock-bootstrap
+++ b/baserock-bootstrap
@@ -765,6 +765,7 @@ python ./morph --verbose build \
--bootstrap \
--cachedir=/baserock/cache \
--log=/baserock/morph.log \
+ --max-jobs=$JOBS \
--git-base-url=file:///baserock/gits/
EOF
chmod +x "$LFS/baserock/build.sh"
diff --git a/morphlib/builder.py b/morphlib/builder.py
index 9f8d59bf..3a88e470 100644
--- a/morphlib/builder.py
+++ b/morphlib/builder.py
@@ -155,10 +155,13 @@ class Chunk(BinaryBlob):
if self.morph.max_jobs:
max_jobs = int(self.morph.max_jobs)
+ logging.debug('max_jobs from morph: %s' % max_jobs)
elif self.settings['max-jobs']:
max_jobs = self.settings['max-jobs']
+ logging.debug('max_jobs from settings: %s' % max_jobs)
else:
max_jobs = morphlib.util.make_concurrency()
+ logging.debug('max_jobs from cpu count: %s' % max_jobs)
self.ex.env['MAKEFLAGS'] = '-j%d' % max_jobs
if not self.settings['no-ccache']: