diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-02 13:29:53 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-04 14:48:14 +0100 |
commit | 34889669265f341ccd7425fe121948b13e5b7c38 (patch) | |
tree | d4e8583d7e47796733f310fb5b825627e22043c9 /bitbake/lib/bb/runqueue.py | |
parent | 5d79175b87fe352c3f4d62a1e49df2a7052488d9 (diff) | |
download | poky-34889669265f341ccd7425fe121948b13e5b7c38.tar.gz |
bitbake: 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.
(Bitbake rev: a5324da9b8a0c9307a6c511ea9009f34be70c92b)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index f457ec21ef..212d297af4 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -510,7 +510,7 @@ class RunQueueData: | |||
510 | # We need to do this separately since we need all of self.runq_depends to be complete before this is processed | 510 | # We need to do this separately since we need all of self.runq_depends to be complete before this is processed |
511 | extradeps = {} | 511 | extradeps = {} |
512 | for task in recursivetasks: | 512 | for task in recursivetasks: |
513 | extradeps[task] = set() | 513 | extradeps[task] = set(self.runq_depends[task]) |
514 | tasknames = recursivetasks[task] | 514 | tasknames = recursivetasks[task] |
515 | seendeps = set() | 515 | seendeps = set() |
516 | seenfnid = [] | 516 | seenfnid = [] |
@@ -527,10 +527,15 @@ class RunQueueData: | |||
527 | generate_recdeps(n) | 527 | generate_recdeps(n) |
528 | generate_recdeps(task) | 528 | generate_recdeps(task) |
529 | 529 | ||
530 | # Remove circular references so that do_a[recrdeptask] = "do_a do_b" can work | ||
531 | recursivetaskset = set(recursivetasks.keys()) | ||
532 | for task in recursivetasks: | ||
533 | extradeps[task].difference_update(recursivetaskset) | ||
534 | |||
530 | for task in xrange(len(taskData.tasks_name)): | 535 | for task in xrange(len(taskData.tasks_name)): |
531 | # Add in extra dependencies | 536 | # Add in extra dependencies |
532 | if task in extradeps: | 537 | if task in extradeps: |
533 | self.runq_depends[task].update(extradeps[task]) | 538 | self.runq_depends[task] = extradeps[task] |
534 | # Remove all self references | 539 | # Remove all self references |
535 | if task in self.runq_depends[task]: | 540 | if task in self.runq_depends[task]: |
536 | 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]) | 541 | 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]) |