summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-14 16:03:45 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-14 17:08:40 +0100
commit6c058341f9b0bee6af2554d897a2623a2ea9a479 (patch)
treec5dd807b62d878b9ed9f1fc3a991350236ed7416 /bitbake/lib
parentf3e8982dfd587e196b0b2d9559ea25d82160b4ea (diff)
downloadpoky-6c058341f9b0bee6af2554d897a2623a2ea9a479.tar.gz
bitbake: runqueue: Improve handling of failing setscene tasks with hard dependencies
If a setscene task has a hard dependency on a task like pseudo-native, its expected that the setscene task will not run unless the dependency is met. This adds code to ensure that is the case, otherwise a bug would show up with a usecase like: bitbake gnome-common bitbake pseudo-native -c cleansstate bitbake gnome-common -c clean bitbake gnome-common With the double wrapper script environment, we'd not see issues like this as it would be masked. The problem theoretically affects code like useradd too as well as anything using a sstate postinstall. (Bitbake rev: c54e738e2b5dc0d8e6fd8e93b284ed96e7a83051) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/runqueue.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index bd42538688..dcf90044a2 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1392,6 +1392,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
1392 sq_revdeps = [] 1392 sq_revdeps = []
1393 sq_revdeps_new = [] 1393 sq_revdeps_new = []
1394 sq_revdeps_squash = [] 1394 sq_revdeps_squash = []
1395 self.sq_harddeps = []
1395 1396
1396 # We need to construct a dependency graph for the setscene functions. Intermediate 1397 # We need to construct a dependency graph for the setscene functions. Intermediate
1397 # dependencies between the setscene tasks only complicate the code. This code 1398 # dependencies between the setscene tasks only complicate the code. This code
@@ -1504,6 +1505,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
1504 if taskid is None: 1505 if taskid is None:
1505 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)) 1506 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))
1506 1507
1508 self.sq_harddeps.append(self.rqdata.runq_setscene.index(taskid))
1507 sq_revdeps_squash[self.rqdata.runq_setscene.index(task)].add(self.rqdata.runq_setscene.index(taskid)) 1509 sq_revdeps_squash[self.rqdata.runq_setscene.index(task)].add(self.rqdata.runq_setscene.index(taskid))
1508 # Have to zero this to avoid circular dependencies 1510 # Have to zero this to avoid circular dependencies
1509 sq_revdeps_squash[self.rqdata.runq_setscene.index(taskid)] = set() 1511 sq_revdeps_squash[self.rqdata.runq_setscene.index(taskid)] = set()
@@ -1581,8 +1583,10 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
1581 1583
1582 self.rq.state = runQueueSceneRun 1584 self.rq.state = runQueueSceneRun
1583 1585
1584 def scenequeue_updatecounters(self, task): 1586 def scenequeue_updatecounters(self, task, fail = False):
1585 for dep in self.sq_deps[task]: 1587 for dep in self.sq_deps[task]:
1588 if fail and task in self.sq_harddeps:
1589 continue
1586 self.sq_revdeps2[dep].remove(task) 1590 self.sq_revdeps2[dep].remove(task)
1587 if len(self.sq_revdeps2[dep]) == 0: 1591 if len(self.sq_revdeps2[dep]) == 0:
1588 self.runq_buildable[dep] = 1 1592 self.runq_buildable[dep] = 1
@@ -1609,7 +1613,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
1609 self.stats.taskFailed() 1613 self.stats.taskFailed()
1610 bb.event.fire(sceneQueueTaskFailed(task, self.stats, result, self), self.cfgData) 1614 bb.event.fire(sceneQueueTaskFailed(task, self.stats, result, self), self.cfgData)
1611 self.scenequeue_notcovered.add(task) 1615 self.scenequeue_notcovered.add(task)
1612 self.scenequeue_updatecounters(task) 1616 self.scenequeue_updatecounters(task, True)
1613 1617
1614 def task_failoutright(self, task): 1618 def task_failoutright(self, task):
1615 self.runq_running[task] = 1 1619 self.runq_running[task] = 1
@@ -1618,7 +1622,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
1618 self.stats.taskSkipped() 1622 self.stats.taskSkipped()
1619 index = self.rqdata.runq_setscene[task] 1623 index = self.rqdata.runq_setscene[task]
1620 self.scenequeue_notcovered.add(task) 1624 self.scenequeue_notcovered.add(task)
1621 self.scenequeue_updatecounters(task) 1625 self.scenequeue_updatecounters(task, True)
1622 1626
1623 def task_skip(self, task): 1627 def task_skip(self, task):
1624 self.runq_running[task] = 1 1628 self.runq_running[task] = 1