Skip to contentSkip to conversation

runqueue: Sanity check BB_NUMBER_THREADS

PATCH New Richard Purdie 1 participant 1 message Jun 19, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 runqueue: Sanity check BB_NUMBER_THREADS

Bitbake does really weird things with negative or zero numbers of threads which is confusing to the user. Add a sanity check for this.

When you have code doing arithmetic on the values and a VM reconfigures to only a single thread, negative numbers are easier than you'd think.

bitbake/lib/bb/runqueue.py +3 -0
index a5ae42b..3f62453 100644
@@ -1333,6 +1333,9 @@ class RunQueueExecute:
         if rq.fakeworkerpipe:
             rq.fakeworkerpipe.setrunqueueexec(self)
 
+        if self.number_tasks <= 0:
+             bb.fatal("Invalid BB_NUMBER_THREADS %s" % self.number_tasks)
+
     def runqueue_process_waitpid(self, task, status):
 
         # self.build_stamps[pid] may not exist when use shared work directory.