summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-07 12:04:45 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-08 10:32:21 +0000
commitad11076737e3bc7aae94b795b5caae285cc294ea (patch)
tree53bfe75af73cd3903a5f48e763db273d9a4f5ff9 /bitbake/lib
parentc77e7021d7ecec1635913c83e257d62f6b6aed77 (diff)
downloadpoky-ad11076737e3bc7aae94b795b5caae285cc294ea.tar.gz
bitbake: runqueue: Send BB_TASKDEPDATA for setscene tasks
We now have code in OE that needs BB_TASKDEPDATA for setscene tasks. Therefore generate and send this data. In this case its a "pre collapsed" tree but that is fine for the use cases in question. (Bitbake rev: 38b857d086af43af6ea3aa60d3876a2c9b225401) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/runqueue.py44
1 files changed, 42 insertions, 2 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index f00a3ce226..389df4f1bc 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -2212,14 +2212,16 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
2212 startevent = sceneQueueTaskStarted(task, self.stats, self.rq) 2212 startevent = sceneQueueTaskStarted(task, self.stats, self.rq)
2213 bb.event.fire(startevent, self.cfgData) 2213 bb.event.fire(startevent, self.cfgData)
2214 2214
2215 taskdepdata = self.build_taskdepdata(task)
2216
2215 taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn] 2217 taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn]
2216 if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not self.cooker.configuration.dry_run: 2218 if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not self.cooker.configuration.dry_run:
2217 if not self.rq.fakeworker: 2219 if not self.rq.fakeworker:
2218 self.rq.start_fakeworker(self) 2220 self.rq.start_fakeworker(self)
2219 self.rq.fakeworker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, True, self.cooker.collection.get_file_appends(taskfn), None)) + b"</runtask>") 2221 self.rq.fakeworker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, True, self.cooker.collection.get_file_appends(taskfn), taskdepdata)) + b"</runtask>")
2220 self.rq.fakeworker[mc].process.stdin.flush() 2222 self.rq.fakeworker[mc].process.stdin.flush()
2221 else: 2223 else:
2222 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>") 2224 self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, True, self.cooker.collection.get_file_appends(taskfn), taskdepdata)) + b"</runtask>")
2223 self.rq.worker[mc].process.stdin.flush() 2225 self.rq.worker[mc].process.stdin.flush()
2224 2226
2225 self.runq_running.add(task) 2227 self.runq_running.add(task)
@@ -2252,6 +2254,44 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
2252 def runqueue_process_waitpid(self, task, status): 2254 def runqueue_process_waitpid(self, task, status):
2253 RunQueueExecute.runqueue_process_waitpid(self, task, status) 2255 RunQueueExecute.runqueue_process_waitpid(self, task, status)
2254 2256
2257
2258 def build_taskdepdata(self, task):
2259 def getsetscenedeps(tid):
2260 deps = set()
2261 (mc, fn, taskname, _) = split_tid_mcfn(tid)
2262 realtid = fn + ":" + taskname + "_setscene"
2263 idepends = self.rqdata.taskData[mc].taskentries[realtid].idepends
2264 for (depname, idependtask) in idepends:
2265 if depname not in self.rqdata.taskData[mc].build_targets:
2266 continue
2267
2268 depfn = self.rqdata.taskData[mc].build_targets[depname][0]
2269 if depfn is None:
2270 continue
2271 deptid = depfn + ":" + idependtask.replace("_setscene", "")
2272 deps.add(deptid)
2273 return deps
2274
2275 taskdepdata = {}
2276 next = getsetscenedeps(task)
2277 next.add(task)
2278 while next:
2279 additional = []
2280 for revdep in next:
2281 (mc, fn, taskname, taskfn) = split_tid_mcfn(revdep)
2282 pn = self.rqdata.dataCaches[mc].pkg_fn[taskfn]
2283 deps = getsetscenedeps(revdep)
2284 provides = self.rqdata.dataCaches[mc].fn_provides[taskfn]
2285 taskhash = self.rqdata.runtaskentries[revdep].hash
2286 taskdepdata[revdep] = [pn, taskname, fn, deps, provides, taskhash]
2287 for revdep2 in deps:
2288 if revdep2 not in taskdepdata:
2289 additional.append(revdep2)
2290 next = additional
2291
2292 #bb.note("Task %s: " % task + str(taskdepdata).replace("], ", "],\n"))
2293 return taskdepdata
2294
2255class TaskFailure(Exception): 2295class TaskFailure(Exception):
2256 """ 2296 """
2257 Exception raised when a task in a runqueue fails 2297 Exception raised when a task in a runqueue fails