runqueue: Make the "Initialising tasks" progress bar finish properly
PATCH 1/1 runqueue: Make the "Initialising tasks" progress bar finish properly
The "Initialising tasks" progress bar needs to be finished before update_scenequeue_data() creates another progress bar.
--- bitbake/lib/bb/runqueue.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
bitbake/lib/bb/runqueue.py +4 -1
@@ -1610,7 +1610,6 @@ class RunQueue: if self.state == RunQueueState.SCENE_INIT: self.start_worker(self.rqexe) - self.rqdata.init_progress_reporter.finish() # If we don't have any setscene functions, skip execution if not self.rqdata.runq_setscene_tids:
@@ -1948,6 +1947,10 @@ class RunQueueExecute: self.sqdata = SQData() build_scenequeue_data(self.sqdata, self.rqdata, self) + # Finish the "Initialising tasks" progress bar before + # update_scenequeue_data() creates another one. + self.rqdata.init_progress_reporter.finish() + update_scenequeue_data(self.sqdata.sq_revdeps, self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=True) # Compute a list of 'stale' sstate tasks where the current hash does not match the one
Quoted 23 lines · Peter Kjellerstedt via lists.openembedded.org
The "Initialising tasks" progress bar needs to be finished before
update_scenequeue_data()creates another progress bar.Signed-off-by Peter Kjellerstedt <[email protected]>---
bitbake/lib/bb/runqueue.py | 5 ++++-1 file changed, 4 insertions(+), 1 deletion(-)bitbake/lib/bb/runqueue.py +0
-0@@ -1610,7 +1610,6 @@ class RunQueue:
if self.state == RunQueueState.SCENE_INIT:
self.start_worker(self.rqexe)
-self.rqdata.init_progress_reporter.finish()
# If we don't have any setscene functions, skip execution if not self.rqdata.runq_setscene_tids:bitbake/lib/bb/runqueue.py +0
-0@@ -1948,6 +1947,10 @@ class RunQueueExecute: self.sqdata = SQData() build_scenequeue_data(self.sqdata, self.rqdata, self)
Quoted 8 lines
+ # Finish the "Initialising tasks" progress bar before
+ #update_scenequeue_data()creates another one.
+self.rqdata.init_progress_reporter.finish()
+
update_scenequeue_data(self.sqdata.sq_revdeps, self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=True)
# Compute a list of 'stale' sstate tasks where the current hash does not match the one
Having this call buried inside RunQueueExecute is not going to improve code readability or maintainability.
Also, whilst I agree update_scenequeue_data() *may* trigger a progress bar update but it is far from clear how it does that. I suspect it does so via code that is sstate_checkhashes() in sstate.bbclass in OE-Core but that is metadata dependent, may not always happen and subject to change totally out of sync with the code in bitbake.
I think the progress bar handling code needs to understand how to run multiple bars in parallel, or close any existing bars if present when a new one is triggered.
So I don't think this patch makes sense in this form, sorry.
Cheers,
Richard
Quoted 48 lines
-----Original Message-----
From: Richard Purdie <[email protected]>
Sent: den 9 oktober 2025 13:48
To: Peter Kjellerstedt <[email protected]>; [email protected]
Subject: Re: [bitbake-devel] [PATCH] runqueue: Make the "Initialising tasks" progress bar finish properlyQuoted 21 lines · Peter Kjellerstedt via lists.openembedded.org
The "Initialising tasks" progress bar needs to be finished before
update_scenequeue_data()creates another progress bar.Signed-off-by Peter Kjellerstedt <[email protected]>---
bitbake/lib/bb/runqueue.py | 5 ++++-1 file changed, 4 insertions(+), 1 deletion(-)bitbake/lib/bb/runqueue.py +0
-0@@ -1610,7 +1610,6 @@ class RunQueue:if self.state == RunQueueState.SCENE_INIT:
self.start_worker(self.rqexe)
-self.rqdata.init_progress_reporter.finish()# If we don't have any setscene functions, skip execution if not self.rqdata.runq_setscene_tids:
bitbake/lib/bb/runqueue.py class RunQueueExecute: · line 1956
Quoted 10 lines
bitbake/lib/bb/runqueue.py +4
-0@@ -1948,6 +1947,10 @@ class RunQueueExecute: self.sqdata = SQData() build_scenequeue_data(self.sqdata, self.rqdata, self) + # Finish the "Initialising tasks" progress bar before + # update_scenequeue_data() creates another one. + self.rqdata.init_progress_reporter.finish() + update_scenequeue_data(self.sqdata.sq_revdeps, self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=True) # Compute a list of 'stale' sstate tasks where the current hash does not match the oneHaving this call buried inside RunQueueExecute is not going to improve code readability or maintainability.
Also, whilst I agree
update_scenequeue_data()*may* trigger a progress bar update but it is far from clear how it does that. I suspect it does so via code that issstate_checkhashes()in sstate.bbclass in OE-Core but that is metadata dependent, may not always happen and subject to change totally out of sync with the code in bitbake.
Quoted 5 lines
I think the progress bar handling code needs to understand how to run multiple bars in parallel, or close any existing bars if present when a new one is triggered.
So I don't think this patch makes sense in this form, sorry.
And you were of course correct in that assessment. The solution proposed above was definitely not the correct way to solve this. I have now dug deeper into this, and while I would have loved to make a solution that supported multiple progress bars, that would only really have been possible with the interactive Knotty UI. So in the end I went with a solution that finishes any active process progress bar before starting a new.
I will send it along with a couple of minor improvements that I made while digging into the code. There is also a small tweak needed for sstate.bbclass to avoid the sstate summary from potentially overwriting an active progress bar.
Quoted 3 lines
Cheers,
Richard
//Peter