diff mbox series

[v2] runqueue: Fix runall all bug

Message ID 20240111172806.3311690-1-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit 966f25dfc23a6d17b2b6d3e0100e9ae264f99025
Headers show
Series [v2] runqueue: Fix runall all bug | expand

Commit Message

Richard Purdie Jan. 11, 2024, 5:28 p.m. UTC
Where chains of RDEPENDS are multiple levels deep, the runall code was not
accounting for this and recursing deeply enough to gather all dependencies.

Fix this by iterating over the result until no more dependencies are found.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/runqueue.py | 42 ++++++++++++++++++++++++------------------
 1 file changed, 24 insertions(+), 18 deletions(-)

Comments

Jonas Gorski Jan. 12, 2024, 9:06 a.m. UTC | #1
On 11.01.24 18:28, Richard Purdie wrote:
> Where chains of RDEPENDS are multiple levels deep, the runall code was not
> accounting for this and recursing deeply enough to gather all dependencies.
> 
> Fix this by iterating over the result until no more dependencies are found.
> 
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Can confirm this fixes my issue with deep RDEPENDS chains.

So in case you care about that, have a

Tested-by: Jonas Gorski <jonas.gorski@bisdn.de>

and since it was me on IRC as well a

Reported-by: Jonas Gorski <jonas.gorski@bisdn.de>

Thanks for the quick fix!

Best regards,
Jonas
diff mbox series

Patch

diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 9e3a87c0e8..af11e9a8f4 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -1004,26 +1004,32 @@  class RunQueueData:
         # Handle --runall
         if self.cooker.configuration.runall:
             # re-run the mark_active and then drop unused tasks from new list
-            reduced_tasklist = set(self.runtaskentries.keys())
-            for tid in list(self.runtaskentries.keys()):
-                if tid not in runq_build:
-                   reduced_tasklist.remove(tid)
-            runq_build = {}
 
-            for task in self.cooker.configuration.runall:
-                if not task.startswith("do_"):
-                    task = "do_{0}".format(task)
-                runall_tids = set()
-                for tid in reduced_tasklist:
-                    wanttid = "{0}:{1}".format(fn_from_tid(tid), task)
-                    if wanttid in self.runtaskentries:
-                        runall_tids.add(wanttid)
+            runall_tids = set()
+            added = True
+            while added:
+                reduced_tasklist = set(self.runtaskentries.keys())
+                for tid in list(self.runtaskentries.keys()):
+                    if tid not in runq_build:
+                       reduced_tasklist.remove(tid)
+                runq_build = {}
 
-                for tid in list(runall_tids):
-                    mark_active(tid, 1)
-                    self.target_tids.append(tid)
-                    if self.cooker.configuration.force:
-                        invalidate_task(tid, False)
+                orig = runall_tids
+                runall_tids = set()
+                for task in self.cooker.configuration.runall:
+                    if not task.startswith("do_"):
+                        task = "do_{0}".format(task)
+                    for tid in reduced_tasklist:
+                        wanttid = "{0}:{1}".format(fn_from_tid(tid), task)
+                        if wanttid in self.runtaskentries:
+                            runall_tids.add(wanttid)
+
+                    for tid in list(runall_tids):
+                        mark_active(tid, 1)
+                        self.target_tids.append(tid)
+                        if self.cooker.configuration.force:
+                            invalidate_task(tid, False)
+                added = runall_tids - orig
 
         delcount = set()
         for tid in list(self.runtaskentries.keys()):