summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/runqueue.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-21 13:36:25 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-11 17:21:46 +0000
commit6b49da40e7734e98a86aab09559e4dc50af95c25 (patch)
tree0e32ee709be8ff9902fcf71aadbd0ecc8521f7f2 /bitbake/lib/bb/runqueue.py
parent4bcf8babc4e2b9c00076882b3f1a4d0b68de82c2 (diff)
downloadpoky-6b49da40e7734e98a86aab09559e4dc50af95c25.tar.gz
bitbake: runqueue: Ensure setscene tasks with overlapping stamps don't parallel execute
In multiconfig, mutliple tasks can execute which share the same stamp file. These must not execute in parallel, the idea is the first should execute, the subsequent ones should see a valid stamp and get skipped. The normal task execution code has stamps code to handle this, this adds similar code to the setscene execute() function to handle the issue there too. (Bitbake rev: df8408a6b54fc908d4de81529b34477b8924d181) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r--bitbake/lib/bb/runqueue.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index b4f2013f0d..61036b3eb6 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1869,6 +1869,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
1869 sq_revdeps_new = {} 1869 sq_revdeps_new = {}
1870 sq_revdeps_squash = {} 1870 sq_revdeps_squash = {}
1871 self.sq_harddeps = {} 1871 self.sq_harddeps = {}
1872 self.stamps = {}
1872 1873
1873 # We need to construct a dependency graph for the setscene functions. Intermediate 1874 # We need to construct a dependency graph for the setscene functions. Intermediate
1874 # dependencies between the setscene tasks only complicate the code. This code 1875 # dependencies between the setscene tasks only complicate the code. This code
@@ -1982,6 +1983,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
1982 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) 1983 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
1983 realtid = tid + "_setscene" 1984 realtid = tid + "_setscene"
1984 idepends = self.rqdata.taskData[mc].taskentries[realtid].idepends 1985 idepends = self.rqdata.taskData[mc].taskentries[realtid].idepends
1986 self.stamps[tid] = bb.build.stampfile(taskname + "_setscene", self.rqdata.dataCaches[mc], taskfn, noextra=True)
1985 for (depname, idependtask) in idepends: 1987 for (depname, idependtask) in idepends:
1986 1988
1987 if depname not in self.rqdata.taskData[mc].build_targets: 1989 if depname not in self.rqdata.taskData[mc].build_targets:
@@ -2158,7 +2160,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
2158 if self.stats.active < self.number_tasks: 2160 if self.stats.active < self.number_tasks:
2159 # Find the next setscene to run 2161 # Find the next setscene to run
2160 for nexttask in self.rqdata.runq_setscene_tids: 2162 for nexttask in self.rqdata.runq_setscene_tids:
2161 if nexttask in self.runq_buildable and nexttask not in self.runq_running: 2163 if nexttask in self.runq_buildable and nexttask not in self.runq_running and self.stamps[nexttask] not in self.build_stamps.values():
2162 if nexttask in self.unskippable: 2164 if nexttask in self.unskippable:
2163 logger.debug(2, "Setscene task %s is unskippable" % nexttask) 2165 logger.debug(2, "Setscene task %s is unskippable" % nexttask)
2164 if nexttask not in self.unskippable and len(self.sq_revdeps[nexttask]) > 0 and self.sq_revdeps[nexttask].issubset(self.scenequeue_covered) and self.check_dependencies(nexttask, self.sq_revdeps[nexttask], True): 2166 if nexttask not in self.unskippable and len(self.sq_revdeps[nexttask]) > 0 and self.sq_revdeps[nexttask].issubset(self.scenequeue_covered) and self.check_dependencies(nexttask, self.sq_revdeps[nexttask], True):
@@ -2208,6 +2210,8 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
2208 self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, True, self.cooker.collection.get_file_appends(taskfn), None)) + b"</runtask>") 2210 self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, True, self.cooker.collection.get_file_appends(taskfn), None)) + b"</runtask>")
2209 self.rq.worker[mc].process.stdin.flush() 2211 self.rq.worker[mc].process.stdin.flush()
2210 2212
2213 self.build_stamps[task] = bb.build.stampfile(taskname, self.rqdata.dataCaches[mc], taskfn, noextra=True)
2214 self.build_stamps2.append(self.build_stamps[task])
2211 self.runq_running.add(task) 2215 self.runq_running.add(task)
2212 self.stats.taskActive() 2216 self.stats.taskActive()
2213 if self.stats.active < self.number_tasks: 2217 if self.stats.active < self.number_tasks: