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 <[email protected]>
---

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:
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#231438): 
https://lists.openembedded.org/g/openembedded-core/message/231438
Mute This Topic: https://lists.openembedded.org/mt/117897874/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to