public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Peter Kjellerstedt <pkj@axis.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCHv2] sstate.bbclass: Always show a progress bar if an sstate summary is wanted
Date: Thu, 19 Feb 2026 20:01:04 +0100	[thread overview]
Message-ID: <20260219190104.1374827-1-pkj@axis.com> (raw)

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:


                 reply	other threads:[~2026-02-19 19:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260219190104.1374827-1-pkj@axis.com \
    --to=pkj@axis.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox