aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/runqueue.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r--bitbake/lib/bb/runqueue.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 7aca42224a0..00d838fffbd 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -924,6 +924,7 @@ class RunQueue:
"buildname" : self.cfgData.getVar("BUILDNAME", True),
"date" : self.cfgData.getVar("DATE", True),
"time" : self.cfgData.getVar("TIME", True),
+ "makefifo" : self.cfgData.getVar("BB_MAKEFIFO", True),
}
worker.stdin.write("<cookerconfig>" + pickle.dumps(self.cooker.configuration) + "</cookerconfig>")
@@ -1050,6 +1051,27 @@ class RunQueue:
cache[task] = iscurrent
return iscurrent
+ def setup_make_fifo(self):
+ fifoname = "/tmp/makefifo"
+ self.cfgData.setVar("BB_MAKEFIFO", fifoname)
+ m = re.search(r'-j (\d+)', self.cfgData.getVar("PARALLEL_MAKE", True))
+ if m:
+ threads = int(m.group(1))
+ else:
+ threads = 1
+
+ if os.path.exists(fifoname):
+ os.remove(fifoname)
+ os.mkfifo(fifoname)
+
+ # Has to be open for read and writing
+ self.makereadfd = os.open(fifoname, os.O_RDONLY|os.O_NONBLOCK)
+ self.makewritefd = os.open(fifoname, os.O_WRONLY)
+ wfd = os.fdopen(self.makewritefd, 'w')
+
+ for x in range(0, threads):
+ wfd.write('+')
+
def _execute_runqueue(self):
"""
Run the tasks in a queue prepared by rqdata.prepare()
@@ -1071,6 +1093,8 @@ class RunQueue:
depgraph = self.cooker.buildDependTree(self, self.rqdata.taskData)
bb.event.fire(bb.event.DepTreeGenerated(depgraph), self.cooker.data)
+ self.setup_make_fifo()
+
if self.state is runQueueSceneInit:
dump = self.cooker.configuration.dump_signatures
if dump: