diff options
author | Enrico Scholz <enrico.scholz@sigma-chemnitz.de> | 2022-11-19 11:39:25 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-22 12:26:46 +0000 |
commit | 276e3af23a32d89f499e6a5390cf7a007bb2cccc (patch) | |
tree | 957f37cd16a5af5243cabffa5fa8f2dc29c95156 /meta/classes-global | |
parent | ff0183615aaeba9f1b6fbac4a6f13295913de514 (diff) | |
download | poky-276e3af23a32d89f499e6a5390cf7a007bb2cccc.tar.gz |
sstate: show progress bar again
Transition to ThreadPoolExecutor (eb6a6820928472ef194b963b606454e731f9486f)
broke the
| Checking sstate mirror object availability: ...
progress bar because the removed 'thread_worker' was still referenced
in an asynchronous function. As the result of the future is never
read, the resulting backtrace is silently discarded.
Replace the information given to 'ProcessProgress' by a counter.
(From OE-Core rev: eacd52216815e0c75e5f257b6db792afd8b1b6df)
Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global')
-rw-r--r-- | meta/classes-global/sstate.bbclass | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass index 21959ff13b..77e3ea34e1 100644 --- a/meta/classes-global/sstate.bbclass +++ b/meta/classes-global/sstate.bbclass | |||
@@ -925,6 +925,8 @@ sstate_unpack_package () { | |||
925 | BB_HASHCHECK_FUNCTION = "sstate_checkhashes" | 925 | BB_HASHCHECK_FUNCTION = "sstate_checkhashes" |
926 | 926 | ||
927 | def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True, **kwargs): | 927 | def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True, **kwargs): |
928 | import itertools | ||
929 | |||
928 | found = set() | 930 | found = set() |
929 | missed = set() | 931 | missed = set() |
930 | 932 | ||
@@ -1019,7 +1021,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True, | |||
1019 | connection_cache_pool.put(connection_cache) | 1021 | connection_cache_pool.put(connection_cache) |
1020 | 1022 | ||
1021 | if progress: | 1023 | if progress: |
1022 | bb.event.fire(bb.event.ProcessProgress(msg, len(tasklist) - thread_worker.tasks.qsize()), d) | 1024 | bb.event.fire(bb.event.ProcessProgress(msg, next(cnt_tasks_done)), d) |
1023 | 1025 | ||
1024 | tasklist = [] | 1026 | tasklist = [] |
1025 | for tid in missed: | 1027 | for tid in missed: |
@@ -1029,6 +1031,8 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True, | |||
1029 | if tasklist: | 1031 | if tasklist: |
1030 | nproc = min(int(d.getVar("BB_NUMBER_THREADS")), len(tasklist)) | 1032 | nproc = min(int(d.getVar("BB_NUMBER_THREADS")), len(tasklist)) |
1031 | 1033 | ||
1034 | ## thread-safe counter | ||
1035 | cnt_tasks_done = itertools.count(start = 1) | ||
1032 | progress = len(tasklist) >= 100 | 1036 | progress = len(tasklist) >= 100 |
1033 | if progress: | 1037 | if progress: |
1034 | msg = "Checking sstate mirror object availability" | 1038 | msg = "Checking sstate mirror object availability" |