* [PATCH] runqueue.py: Allow recrdeptasks that have self references
@ 2012-07-02 12:29 Richard Purdie
0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2012-07-02 12:29 UTC (permalink / raw)
To: bitbake-devel
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>
---
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index f457ec2..212d297 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/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])
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-07-02 12:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-02 12:29 [PATCH] runqueue.py: Allow recrdeptasks that have self references Richard Purdie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.