summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.co.uk>2019-08-30 11:47:11 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-09-04 12:05:49 +0000
commite91df0811aac70a3c7d9adfde4f44268f8a210c7 (patch)
tree3c10686e3db24b64ddf408ec3c2ee0a68c4d2a24
parent6b3da9429b18d93e2f1348b5758536e981e3bec2 (diff)
downloadbuildstream-e91df0811aac70a3c7d9adfde4f44268f8a210c7.tar.gz
_pipeline.py: Add task progress to resolve_elements()
Resolving the initial cached state of Elements could potentially take a while, especially for large projects or local caches which are on a latent filesystem. We should report progress.
-rw-r--r--src/buildstream/_pipeline.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/buildstream/_pipeline.py b/src/buildstream/_pipeline.py
index 4b0c6ad94..b5711109e 100644
--- a/src/buildstream/_pipeline.py
+++ b/src/buildstream/_pipeline.py
@@ -138,7 +138,11 @@ class Pipeline():
# targets (list of Element): The list of toplevel element targets
#
def resolve_elements(self, targets):
- with self._context.messenger.timed_activity("Resolving cached state", silent_nested=True):
+ with self._context.messenger.simple_task("Resolving cached state", silent_nested=True) as task:
+ # We need to go through the project to access the loader
+ if task:
+ task.set_maximum_progress(self._project.loader.loaded)
+
# XXX: Now that Element._update_state() can trigger recursive update_state calls
# it is possible that we could get a RecursionError. However, this is unlikely
# to happen, even for large projects (tested with the Debian stack). Although,
@@ -154,6 +158,9 @@ class Pipeline():
# dependencies.
element._update_ready_for_runtime_and_cached()
+ if task:
+ task.add_current_progress()
+
# check_remotes()
#
# Check if the target artifact is cached in any of the available remotes