diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-12-21 13:36:25 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-12-22 12:36:40 +0000 |
commit | fe11d18ffd2105ea899332415089b4bb122cc4d9 (patch) | |
tree | 76885d481a7f80dbea1cae3dd3e200ef4b1ab922 | |
parent | f048db1c6444d93578b4648938da18f22985e389 (diff) | |
download | poky-fe11d18ffd2105ea899332415089b4bb122cc4d9.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: 937acf267fa9e45f538695b2cf8aa83232a96240)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 10c5c2e667..ef14347e15 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -1886,6 +1886,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
1886 | sq_revdeps_new = {} | 1886 | sq_revdeps_new = {} |
1887 | sq_revdeps_squash = {} | 1887 | sq_revdeps_squash = {} |
1888 | self.sq_harddeps = {} | 1888 | self.sq_harddeps = {} |
1889 | self.stamps = {} | ||
1889 | 1890 | ||
1890 | # We need to construct a dependency graph for the setscene functions. Intermediate | 1891 | # We need to construct a dependency graph for the setscene functions. Intermediate |
1891 | # dependencies between the setscene tasks only complicate the code. This code | 1892 | # dependencies between the setscene tasks only complicate the code. This code |
@@ -1999,6 +2000,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
1999 | (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) | 2000 | (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) |
2000 | realtid = tid + "_setscene" | 2001 | realtid = tid + "_setscene" |
2001 | idepends = self.rqdata.taskData[mc].taskentries[realtid].idepends | 2002 | idepends = self.rqdata.taskData[mc].taskentries[realtid].idepends |
2003 | self.stamps[tid] = bb.build.stampfile(taskname + "_setscene", self.rqdata.dataCaches[mc], taskfn, noextra=True) | ||
2002 | for (depname, idependtask) in idepends: | 2004 | for (depname, idependtask) in idepends: |
2003 | 2005 | ||
2004 | if depname not in self.rqdata.taskData[mc].build_targets: | 2006 | if depname not in self.rqdata.taskData[mc].build_targets: |
@@ -2175,7 +2177,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
2175 | if self.stats.active < self.number_tasks: | 2177 | if self.stats.active < self.number_tasks: |
2176 | # Find the next setscene to run | 2178 | # Find the next setscene to run |
2177 | for nexttask in self.rqdata.runq_setscene_tids: | 2179 | for nexttask in self.rqdata.runq_setscene_tids: |
2178 | if nexttask in self.runq_buildable and nexttask not in self.runq_running: | 2180 | if nexttask in self.runq_buildable and nexttask not in self.runq_running and self.stamps[nexttask] not in self.build_stamps.values(): |
2179 | if nexttask in self.unskippable: | 2181 | if nexttask in self.unskippable: |
2180 | logger.debug(2, "Setscene task %s is unskippable" % nexttask) | 2182 | logger.debug(2, "Setscene task %s is unskippable" % nexttask) |
2181 | 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): | 2183 | 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): |
@@ -2227,6 +2229,8 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
2227 | self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, True, self.cooker.collection.get_file_appends(taskfn), taskdepdata, False)) + b"</runtask>") | 2229 | self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, True, self.cooker.collection.get_file_appends(taskfn), taskdepdata, False)) + b"</runtask>") |
2228 | self.rq.worker[mc].process.stdin.flush() | 2230 | self.rq.worker[mc].process.stdin.flush() |
2229 | 2231 | ||
2232 | self.build_stamps[task] = bb.build.stampfile(taskname, self.rqdata.dataCaches[mc], taskfn, noextra=True) | ||
2233 | self.build_stamps2.append(self.build_stamps[task]) | ||
2230 | self.runq_running.add(task) | 2234 | self.runq_running.add(task) |
2231 | self.stats.taskActive() | 2235 | self.stats.taskActive() |
2232 | if self.stats.active < self.number_tasks: | 2236 | if self.stats.active < self.number_tasks: |