diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-10 22:50:28 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-11 11:53:45 +0000 |
commit | 410a3e157414448bb7de613b7055a4a33ad20fae (patch) | |
tree | f0fc1357cb8e2daf43c916490fc899f2b90bba50 /bitbake | |
parent | b2c7cc7fe54a55706f2b0d22b5102c75db3c5f92 (diff) | |
download | 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.py | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 91b1f07351..11bd936cb2 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -1624,7 +1624,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
1624 | sq_revdeps = [] | 1624 | sq_revdeps = [] |
1625 | sq_revdeps_new = [] | 1625 | sq_revdeps_new = [] |
1626 | sq_revdeps_squash = [] | 1626 | sq_revdeps_squash = [] |
1627 | self.sq_harddeps = [] | 1627 | self.sq_harddeps = {} |
1628 | 1628 | ||
1629 | # We need to construct a dependency graph for the setscene functions. Intermediate | 1629 | # We need to construct a dependency graph for the setscene functions. Intermediate |
1630 | # dependencies between the setscene tasks only complicate the code. This code | 1630 | # dependencies between the setscene tasks only complicate the code. This code |
@@ -1735,15 +1735,19 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
1735 | dep = self.rqdata.taskData.fn_index[depdata] | 1735 | dep = self.rqdata.taskData.fn_index[depdata] |
1736 | taskid = self.rqdata.get_task_id(self.rqdata.taskData.getfn_id(dep), idependtask.replace("_setscene", "")) | 1736 | taskid = self.rqdata.get_task_id(self.rqdata.taskData.getfn_id(dep), idependtask.replace("_setscene", "")) |
1737 | if taskid is None: | 1737 | if taskid is None: |
1738 | 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)) | 1738 | bb.msg.fatal("RunQueue", "Task %s_setscene depends upon non-existent task %s:%s" % (self.self.rqdata.get_user_idstring(task), dep, idependtask)) |
1739 | |||
1740 | if not self.rqdata.runq_setscene.index(taskid) in self.sq_harddeps: | ||
1741 | self.sq_harddeps[self.rqdata.runq_setscene.index(taskid)] = set() | ||
1742 | self.sq_harddeps[self.rqdata.runq_setscene.index(taskid)].add(self.rqdata.runq_setscene.index(task)) | ||
1739 | 1743 | ||
1740 | self.sq_harddeps.append(self.rqdata.runq_setscene.index(taskid)) | ||
1741 | sq_revdeps_squash[self.rqdata.runq_setscene.index(task)].add(self.rqdata.runq_setscene.index(taskid)) | 1744 | sq_revdeps_squash[self.rqdata.runq_setscene.index(task)].add(self.rqdata.runq_setscene.index(taskid)) |
1742 | # Have to zero this to avoid circular dependencies | 1745 | # Have to zero this to avoid circular dependencies |
1743 | sq_revdeps_squash[self.rqdata.runq_setscene.index(taskid)] = set() | 1746 | sq_revdeps_squash[self.rqdata.runq_setscene.index(taskid)] = set() |
1744 | 1747 | ||
1745 | #for task in xrange(len(sq_revdeps_squash)): | 1748 | #for task in xrange(len(sq_revdeps_squash)): |
1746 | # 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]) | 1749 | # realtask = self.rqdata.runq_setscene[task] |
1750 | # bb.warn("Task %s: %s_setscene is %s " % (task, self.rqdata.get_user_idstring(realtask) , sq_revdeps_squash[task])) | ||
1747 | 1751 | ||
1748 | self.sq_deps = [] | 1752 | self.sq_deps = [] |
1749 | self.sq_revdeps = sq_revdeps_squash | 1753 | self.sq_revdeps = sq_revdeps_squash |
@@ -1817,7 +1821,10 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
1817 | 1821 | ||
1818 | def scenequeue_updatecounters(self, task, fail = False): | 1822 | def scenequeue_updatecounters(self, task, fail = False): |
1819 | for dep in self.sq_deps[task]: | 1823 | for dep in self.sq_deps[task]: |
1820 | if fail and task in self.sq_harddeps: | 1824 | if fail and task in self.sq_harddeps and dep in self.sq_harddeps[task]: |
1825 | realtask = self.rqdata.runq_setscene[task] | ||
1826 | realdep = self.rqdata.runq_setscene[dep] | ||
1827 | 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))) | ||
1821 | continue | 1828 | continue |
1822 | self.sq_revdeps2[dep].remove(task) | 1829 | self.sq_revdeps2[dep].remove(task) |
1823 | if len(self.sq_revdeps2[dep]) == 0: | 1830 | if len(self.sq_revdeps2[dep]) == 0: |
@@ -1930,6 +1937,12 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
1930 | self.rq.read_workers() | 1937 | self.rq.read_workers() |
1931 | return self.rq.active_fds() | 1938 | return self.rq.active_fds() |
1932 | 1939 | ||
1940 | #for task in xrange(self.stats.total): | ||
1941 | # if self.runq_running[task] != 1: | ||
1942 | # buildable = self.runq_buildable[task] | ||
1943 | # revdeps = self.sq_revdeps[task] | ||
1944 | # 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]))) | ||
1945 | |||
1933 | # Convert scenequeue_covered task numbers into full taskgraph ids | 1946 | # Convert scenequeue_covered task numbers into full taskgraph ids |
1934 | oldcovered = self.scenequeue_covered | 1947 | oldcovered = self.scenequeue_covered |
1935 | self.rq.scenequeue_covered = set() | 1948 | self.rq.scenequeue_covered = set() |