public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCHv2] sstate.bbclass: Always show a progress bar if an sstate summary is wanted
@ 2026-02-19 19:01 Peter Kjellerstedt
  0 siblings, 0 replies; only message in thread
From: Peter Kjellerstedt @ 2026-02-19 19:01 UTC (permalink / raw)
  To: openembedded-core

In case sstate_checkhashes() is expected to show an sstate summary, then
always show the "Checking sstate mirror object availability" progress
bar regardless of how long the task list is. Without this, the sstate
summary could unintentionally overwrite the "Initialising tasks"
progress bar, which may still be active. Forcing the "Checking sstate
mirror object availability" progress bar to show will make sure the
"Initialising tasks" progress bar is finalized before the sstate summary
is shown, and the output of the progress bars and the sstate summary
will be as expected.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---

PATCHv2: Make sure the case when the tasklist is empty is also handled
         correctly.

 meta/classes-global/sstate.bbclass | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass
index 2fd29d7323..3b2e307134 100644
--- a/meta/classes-global/sstate.bbclass
+++ b/meta/classes-global/sstate.bbclass
@@ -1043,15 +1043,16 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
             sstatefile = d.expand(getsstatefile(tid, siginfo, d))
             tasklist.append((tid, sstatefile))
 
+        progress = summary or len(tasklist) >= 100
+        if progress:
+            msg = "Checking sstate mirror object availability"
+            bb.event.fire(bb.event.ProcessStarted(msg, len(tasklist)), d)
+
         if tasklist:
             nproc = min(int(d.getVar("BB_NUMBER_THREADS")), len(tasklist))
 
             ## thread-safe counter
             cnt_tasks_done = itertools.count(start = 1)
-            progress = len(tasklist) >= 100
-            if progress:
-                msg = "Checking sstate mirror object availability"
-                bb.event.fire(bb.event.ProcessStarted(msg, len(tasklist)), d)
 
             # Have to setup the fetcher environment here rather than in each thread as it would race
             fetcherenv = bb.fetch2.get_fetcher_environment(d)
@@ -1066,8 +1067,8 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
                 checkstatus_end()
                 bb.event.disable_threadlock()
 
-            if progress:
-                bb.event.fire(bb.event.ProcessFinished(msg), d)
+        if progress:
+            bb.event.fire(bb.event.ProcessFinished(msg), d)
 
     inheritlist = d.getVar("INHERIT")
     if "toaster" in inheritlist:


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-02-19 19:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-19 19:01 [PATCHv2] sstate.bbclass: Always show a progress bar if an sstate summary is wanted Peter Kjellerstedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox