aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-02 13:29:53 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-04 14:42:28 +0100
commita5324da9b8a0c9307a6c511ea9009f34be70c92b (patch)
treef62ee5e20d60e50d1f7a9a5916ecff7680520b14
parent73801f571e040dcdfeb15a15b9a484cbefaae70c (diff)
downloadbitbake-a5324da9b8a0c9307a6c511ea9009f34be70c92b.tar.gz
bitbake-a5324da9b8a0c9307a6c511ea9009f34be70c92b.tar.bz2
bitbake-a5324da9b8a0c9307a6c511ea9009f34be70c92b.zip
runqueue.py: Allow recrdeptasks that have self references
In some cases we want to pull in DEPENDS and RDEPENDS of recrdeptask dependencies but we need a way to trigger or avoid this behaviour depending on context. The logical syntax to trigger such behaviour would be a self referencing recrdeptask: do_a[recrdeptask] = "do_a do_b" The dependency chains already recurse this kind of expression correctly, the missing piece is to avoid any circular reference errors. Since the dependencies have already been recursively resolved, simply removing any recrdeptask references is enough to break the circular references. This patch therefore removes any circular references using the set difference_update() operator. There will be metadata tweaks required to add any references needed to the extra taskname. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/runqueue.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index f457ec21..212d297a 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -510,7 +510,7 @@ class RunQueueData:
# We need to do this separately since we need all of self.runq_depends to be complete before this is processed
extradeps = {}
for task in recursivetasks:
- extradeps[task] = set()
+ extradeps[task] = set(self.runq_depends[task])
tasknames = recursivetasks[task]
seendeps = set()
seenfnid = []
@@ -527,10 +527,15 @@ class RunQueueData:
generate_recdeps(n)
generate_recdeps(task)
+ # Remove circular references so that do_a[recrdeptask] = "do_a do_b" can work
+ recursivetaskset = set(recursivetasks.keys())
+ for task in recursivetasks:
+ extradeps[task].difference_update(recursivetaskset)
+
for task in xrange(len(taskData.tasks_name)):
# Add in extra dependencies
if task in extradeps:
- self.runq_depends[task].update(extradeps[task])
+ self.runq_depends[task] = extradeps[task]
# Remove all self references
if task in self.runq_depends[task]:
logger.debug(2, "Task %s (%s %s) contains self reference! %s", task, taskData.fn_index[taskData.tasks_fnid[task]], taskData.tasks_name[task], self.runq_depends[task])