diff mbox series

bitbake: knotty: report cache validity checking progress

Message ID 20250214211403.493573-3-chris.laplante@agilent.com
State New
Headers show
Series bitbake: knotty: report cache validity checking progress | expand

Commit Message

chris.laplante@agilent.com Feb. 14, 2025, 9:14 p.m. UTC
From: Chris Laplante <chris.laplante@agilent.com>

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
---
 bitbake/lib/bb/ui/knotty.py | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 2fff1b3669..92b1980f5d 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -404,7 +404,8 @@  _evt_list = [ "bb.runqueue.runQueueExitWait", "bb.event.LogExecTTY", "logging.Lo
               "bb.event.MultipleProviders", "bb.event.NoProvider", "bb.runqueue.sceneQueueTaskStarted",
               "bb.runqueue.runQueueTaskStarted", "bb.runqueue.runQueueTaskFailed", "bb.runqueue.sceneQueueTaskFailed",
               "bb.event.BuildBase", "bb.build.TaskStarted", "bb.build.TaskSucceeded", "bb.build.TaskFailedSilent",
-              "bb.build.TaskProgress", "bb.event.ProcessStarted", "bb.event.ProcessProgress", "bb.event.ProcessFinished"]
+              "bb.build.TaskProgress", "bb.event.ProcessStarted", "bb.event.ProcessProgress", "bb.event.ProcessFinished",
+              "bb.event.CheckCacheValidityStarted", "bb.event.CheckCacheValidityProgress", "bb.event.CheckCacheValidityCompleted"]
 
 def drain_events_errorhandling(eventHandler):
     # We don't have logging setup, we do need to show any events we see before exiting
@@ -796,6 +797,26 @@  def main(server, eventHandler, params, tf = TerminalFilter):
                     print("Loaded %d entries from dependency cache." % event.num_entries)
                 continue
 
+            if isinstance(event, bb.event.CheckCacheValidityStarted):
+                if params.options.quiet > 1:
+                    continue
+                cacheprogress = new_progress("Checking cache validity", event.total).start()
+                continue
+
+            if isinstance(event, bb.event.CheckCacheValidityProgress):
+                if params.options.quiet > 1:
+                    continue
+                cacheprogress.update(event.current)
+                continue
+
+            if isinstance(event, bb.event.CheckCacheValidityCompleted):
+                if params.options.quiet > 1:
+                    continue
+                cacheprogress.finish()
+                if params.options.quiet == 0:
+                    print(f"Checked {event.total:d} cache entries for validity.")
+                continue
+
             if isinstance(event, bb.command.CommandFailed):
                 return_value = event.exitcode
                 if event.error: