summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-10 22:50:28 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-11 11:53:45 +0000
commit410a3e157414448bb7de613b7055a4a33ad20fae (patch)
treef0fc1357cb8e2daf43c916490fc899f2b90bba50 /bitbake
parentb2c7cc7fe54a55706f2b0d22b5102c75db3c5f92 (diff)
downloadast2050-yocto-poky-410a3e157414448bb7de613b7055a4a33ad20fae.zip
ast2050-yocto-poky-410a3e157414448bb7de613b7055a4a33ad20fae.tar.gz
bitbake: runqueue: Fix setscene hard dependency problems
Commit c54e738e2b5dc0d8e6fd8e93b284ed96e7a83051 added in the idea of hard dependencies such as the case a setscene has a hard dependency on pseudo-native and that dependency wasn't available from sstate for some reason. Unfortunately the implementation was a bit too enthusiastic, causing rebuilds of things when it wasn't necessary. A test case was: bitbake quilt-native bitbake quilt-native -c clean bitbake <some-image> and then you'd watch quilt-native get rebuilt for no good reason. The clue to the problem is in the for loop where it never depends on the item being iterated over. The fix is to include the exact list of hard dependencies rather than guessing. With these changes, the use case above works, the one in the original commit also works. This patch also adds in or cleans up various pieces of logging to allow issues like this to be more easily debugged in future. (Bitbake rev: 81bd475585ff1b44b390036b1eca0feae7c149eb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/runqueue.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 91b1f07..11bd936 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1624,7 +1624,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
sq_revdeps = []
sq_revdeps_new = []
sq_revdeps_squash = []
- self.sq_harddeps = []
+ self.sq_harddeps = {}
# We need to construct a dependency graph for the setscene functions. Intermediate
# dependencies between the setscene tasks only complicate the code. This code
@@ -1735,15 +1735,19 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
dep = self.rqdata.taskData.fn_index[depdata]
taskid = self.rqdata.get_task_id(self.rqdata.taskData.getfn_id(dep), idependtask.replace("_setscene", ""))
if taskid is None:
- bb.msg.fatal("RunQueue", "Task %s:%s depends upon non-existent task %s:%s" % (self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[realid]], self.rqdata.taskData.tasks_name[realid], dep, idependtask))
+ bb.msg.fatal("RunQueue", "Task %s_setscene depends upon non-existent task %s:%s" % (self.self.rqdata.get_user_idstring(task), dep, idependtask))
+
+ if not self.rqdata.runq_setscene.index(taskid) in self.sq_harddeps:
+ self.sq_harddeps[self.rqdata.runq_setscene.index(taskid)] = set()
+ self.sq_harddeps[self.rqdata.runq_setscene.index(taskid)].add(self.rqdata.runq_setscene.index(task))
- self.sq_harddeps.append(self.rqdata.runq_setscene.index(taskid))
sq_revdeps_squash[self.rqdata.runq_setscene.index(task)].add(self.rqdata.runq_setscene.index(taskid))
# Have to zero this to avoid circular dependencies
sq_revdeps_squash[self.rqdata.runq_setscene.index(taskid)] = set()
#for task in xrange(len(sq_revdeps_squash)):
- # print "Task %s: %s.%s is %s " % (task, self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[self.rqdata.runq_setscene[task]]], self.rqdata.runq_task[self.rqdata.runq_setscene[task]] + "_setscene", sq_revdeps_squash[task])
+ # realtask = self.rqdata.runq_setscene[task]
+ # bb.warn("Task %s: %s_setscene is %s " % (task, self.rqdata.get_user_idstring(realtask) , sq_revdeps_squash[task]))
self.sq_deps = []
self.sq_revdeps = sq_revdeps_squash
@@ -1817,7 +1821,10 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
def scenequeue_updatecounters(self, task, fail = False):
for dep in self.sq_deps[task]:
- if fail and task in self.sq_harddeps:
+ if fail and task in self.sq_harddeps and dep in self.sq_harddeps[task]:
+ realtask = self.rqdata.runq_setscene[task]
+ realdep = self.rqdata.runq_setscene[dep]
+ logger.debug(2, "%s was unavailable and is a hard dependency of %s so skipping" % (self.rqdata.get_user_idstring(realtask), self.rqdata.get_user_idstring(realdep)))
continue
self.sq_revdeps2[dep].remove(task)
if len(self.sq_revdeps2[dep]) == 0:
@@ -1930,6 +1937,12 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
self.rq.read_workers()
return self.rq.active_fds()
+ #for task in xrange(self.stats.total):
+ # if self.runq_running[task] != 1:
+ # buildable = self.runq_buildable[task]
+ # revdeps = self.sq_revdeps[task]
+ # bb.warn("Found we didn't run %s %s %s %s" % (task, buildable, str(revdeps), self.rqdata.get_user_idstring(self.rqdata.runq_setscene[task])))
+
# Convert scenequeue_covered task numbers into full taskgraph ids
oldcovered = self.scenequeue_covered
self.rq.scenequeue_covered = set()
OpenPOWER on IntegriCloud