diff options
| author | Peter Kjellerstedt <pkj@axis.com> | 2025-10-25 05:25:50 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-07 13:15:34 +0000 |
| commit | 128035f46082562583b74fbfb89faed03be8fd5b (patch) | |
| tree | 03dd7a9936eabb498fb6d9f7123b5beb829271d8 /bitbake/lib | |
| parent | 55efa6caa605a34dba3077a5bcd75131f1057fec (diff) | |
| download | poky-128035f46082562583b74fbfb89faed03be8fd5b.tar.gz | |
bitbake: knotty, teamcity, tinfoil: Only allow one process progress bar at once
In case a process progress bar (e.g., "Initialising tasks") is active
when a new one (e.g., "Checking sstate mirror object availability") is
started, then finish the first one before starting the second. Also
ignore ProcessProgress and ProcessFinished events that are not for the
currently active progress bar.
This also adds an id to BBProgress (initialized to the initial msg),
which is not affected by calls to setmessage().
(Bitbake rev: aff617880ff2c48fd1d28586e2623963b87a3118)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
| -rw-r--r-- | bitbake/lib/bb/tinfoil.py | 10 | ||||
| -rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 12 | ||||
| -rw-r--r-- | bitbake/lib/bb/ui/teamcity.py | 14 |
3 files changed, 23 insertions, 13 deletions
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py index e7fbcbca0a..d9e985c612 100644 --- a/bitbake/lib/bb/tinfoil.py +++ b/bitbake/lib/bb/tinfoil.py | |||
| @@ -91,23 +91,23 @@ def wait_for(f): | |||
| 91 | if isinstance(event, bb.event.ProcessStarted): | 91 | if isinstance(event, bb.event.ProcessStarted): |
| 92 | if self.quiet > 1: | 92 | if self.quiet > 1: |
| 93 | continue | 93 | continue |
| 94 | if parseprogress: | ||
| 95 | parseprogress.finish() | ||
| 94 | parseprogress = bb.ui.knotty.new_progress(event.processname, event.total) | 96 | parseprogress = bb.ui.knotty.new_progress(event.processname, event.total) |
| 95 | parseprogress.start(False) | 97 | parseprogress.start(False) |
| 96 | continue | 98 | continue |
| 97 | if isinstance(event, bb.event.ProcessProgress): | 99 | if isinstance(event, bb.event.ProcessProgress): |
| 98 | if self.quiet > 1: | 100 | if self.quiet > 1: |
| 99 | continue | 101 | continue |
| 100 | if parseprogress: | 102 | if parseprogress and parseprogress.id == event.processname: |
| 101 | parseprogress.update(event.progress) | 103 | parseprogress.update(event.progress) |
| 102 | else: | ||
| 103 | bb.warn("Got ProcessProgress event for something that never started?") | ||
| 104 | continue | 104 | continue |
| 105 | if isinstance(event, bb.event.ProcessFinished): | 105 | if isinstance(event, bb.event.ProcessFinished): |
| 106 | if self.quiet > 1: | 106 | if self.quiet > 1: |
| 107 | continue | 107 | continue |
| 108 | if parseprogress: | 108 | if parseprogress and parseprogress.id == event.processname: |
| 109 | parseprogress.finish() | 109 | parseprogress.finish() |
| 110 | parseprogress = None | 110 | parseprogress = None |
| 111 | continue | 111 | continue |
| 112 | if isinstance(event, bb.command.CommandCompleted): | 112 | if isinstance(event, bb.command.CommandCompleted): |
| 113 | result = True | 113 | result = True |
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 6f03bf2faa..4bcf6bd12f 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
| @@ -39,6 +39,7 @@ interactive = sys.stdout.isatty() | |||
| 39 | 39 | ||
| 40 | class BBProgress(progressbar.ProgressBar): | 40 | class BBProgress(progressbar.ProgressBar): |
| 41 | def __init__(self, msg, maxval, widgets=None, extrapos=-1, resize_handler=None): | 41 | def __init__(self, msg, maxval, widgets=None, extrapos=-1, resize_handler=None): |
| 42 | self.id = msg | ||
| 42 | self.msg = msg | 43 | self.msg = msg |
| 43 | self.extrapos = extrapos | 44 | self.extrapos = extrapos |
| 44 | if not widgets: | 45 | if not widgets: |
| @@ -84,6 +85,7 @@ class NonInteractiveProgress(object): | |||
| 84 | fobj = sys.stdout | 85 | fobj = sys.stdout |
| 85 | 86 | ||
| 86 | def __init__(self, msg, maxval): | 87 | def __init__(self, msg, maxval): |
| 88 | self.id = msg | ||
| 87 | self.msg = msg | 89 | self.msg = msg |
| 88 | self.maxval = maxval | 90 | self.maxval = maxval |
| 89 | self.finished = False | 91 | self.finished = False |
| @@ -886,23 +888,23 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
| 886 | if params.options.quiet > 1: | 888 | if params.options.quiet > 1: |
| 887 | continue | 889 | continue |
| 888 | termfilter.clearFooter() | 890 | termfilter.clearFooter() |
| 891 | if parseprogress: | ||
| 892 | parseprogress.finish() | ||
| 889 | parseprogress = new_progress(event.processname, event.total) | 893 | parseprogress = new_progress(event.processname, event.total) |
| 890 | parseprogress.start(False) | 894 | parseprogress.start(False) |
| 891 | continue | 895 | continue |
| 892 | if isinstance(event, bb.event.ProcessProgress): | 896 | if isinstance(event, bb.event.ProcessProgress): |
| 893 | if params.options.quiet > 1: | 897 | if params.options.quiet > 1: |
| 894 | continue | 898 | continue |
| 895 | if parseprogress: | 899 | if parseprogress and parseprogress.id == event.processname: |
| 896 | parseprogress.update(event.progress) | 900 | parseprogress.update(event.progress) |
| 897 | else: | ||
| 898 | bb.warn("Got ProcessProgress event for someting that never started?") | ||
| 899 | continue | 901 | continue |
| 900 | if isinstance(event, bb.event.ProcessFinished): | 902 | if isinstance(event, bb.event.ProcessFinished): |
| 901 | if params.options.quiet > 1: | 903 | if params.options.quiet > 1: |
| 902 | continue | 904 | continue |
| 903 | if parseprogress: | 905 | if parseprogress and parseprogress.id == event.processname: |
| 904 | parseprogress.finish() | 906 | parseprogress.finish() |
| 905 | parseprogress = None | 907 | parseprogress = None |
| 906 | continue | 908 | continue |
| 907 | 909 | ||
| 908 | # ignore | 910 | # ignore |
diff --git a/bitbake/lib/bb/ui/teamcity.py b/bitbake/lib/bb/ui/teamcity.py index 7eeaab8d63..3177f4aaf4 100644 --- a/bitbake/lib/bb/ui/teamcity.py +++ b/bitbake/lib/bb/ui/teamcity.py | |||
| @@ -200,6 +200,7 @@ def main(server, eventHandler, params): | |||
| 200 | logger.error("XMLRPC Fault getting commandline: {0}".format(x)) | 200 | logger.error("XMLRPC Fault getting commandline: {0}".format(x)) |
| 201 | return 1 | 201 | return 1 |
| 202 | 202 | ||
| 203 | active_process = None | ||
| 203 | active_process_total = None | 204 | active_process_total = None |
| 204 | is_tasks_running = False | 205 | is_tasks_running = False |
| 205 | 206 | ||
| @@ -300,16 +301,23 @@ def main(server, eventHandler, params): | |||
| 300 | 301 | ||
| 301 | if isinstance(event, bb.event.ProcessStarted): | 302 | if isinstance(event, bb.event.ProcessStarted): |
| 302 | if event.processname in ["Initialising tasks", "Checking sstate mirror object availability"]: | 303 | if event.processname in ["Initialising tasks", "Checking sstate mirror object availability"]: |
| 304 | if active_process: | ||
| 305 | ui.progress(active_process, 100) | ||
| 306 | ui.block_end() | ||
| 307 | active_process = event.processname | ||
| 303 | active_process_total = event.total | 308 | active_process_total = event.total |
| 304 | ui.block_start(event.processname) | 309 | ui.block_start(event.processname) |
| 305 | if isinstance(event, bb.event.ProcessFinished): | 310 | if isinstance(event, bb.event.ProcessFinished): |
| 306 | if event.processname in ["Initialising tasks", "Checking sstate mirror object availability"]: | 311 | if event.processname in ["Initialising tasks", "Checking sstate mirror object availability"]: |
| 307 | ui.progress(event.processname, 100) | 312 | if active_process and active_process == event.processname: |
| 308 | ui.block_end() | 313 | ui.progress(event.processname, 100) |
| 314 | ui.block_end() | ||
| 315 | active_process = None | ||
| 309 | if isinstance(event, bb.event.ProcessProgress): | 316 | if isinstance(event, bb.event.ProcessProgress): |
| 310 | if event.processname in ["Initialising tasks", | 317 | if event.processname in ["Initialising tasks", |
| 311 | "Checking sstate mirror object availability"] and active_process_total != 0: | 318 | "Checking sstate mirror object availability"] and active_process_total != 0: |
| 312 | ui.progress(event.processname, event.progress * 100 / active_process_total) | 319 | if active_process and active_process == event.processname: |
| 320 | ui.progress(event.processname, event.progress * 100 / active_process_total) | ||
| 313 | if isinstance(event, bb.event.CacheLoadStarted): | 321 | if isinstance(event, bb.event.CacheLoadStarted): |
| 314 | ui.block_start("Loading cache") | 322 | ui.block_start("Loading cache") |
| 315 | if isinstance(event, bb.event.CacheLoadProgress): | 323 | if isinstance(event, bb.event.CacheLoadProgress): |
