summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2018-04-13 17:18:15 +0100
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-18 23:50:04 +0900
commit499c6f9d426d875127ea171bb75e7940f8647516 (patch)
treedffb6a05a7d432ff1200bbf0c1497713e4244919
parentae1d509383d75c1b692ebf7ab9c7b9c154752e88 (diff)
downloadbuildstream-499c6f9d426d875127ea171bb75e7940f8647516.tar.gz
frontend: Log which elements resolved new keys
It can be difficult to pick out important information in all the messages, so it's convenient to have classes of them collected into one place. One such class of important information is when the cache key of an element changes, such as when element's source is tracked or cached from a workspace, since it can be important to know what the cache key is for that artifact. Fixes issue #252
-rw-r--r--buildstream/_frontend/widget.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/buildstream/_frontend/widget.py b/buildstream/_frontend/widget.py
index a07ae0c32..b5942b91e 100644
--- a/buildstream/_frontend/widget.py
+++ b/buildstream/_frontend/widget.py
@@ -335,6 +335,7 @@ class LogLine(Widget):
self._indent = ' ' * indent
self._log_lines = log_lines
self._message_lines = message_lines
+ self._resolved_keys = None
self._space_widget = Space(content_profile, format_profile)
self._logfile_widget = LogFile(content_profile, format_profile, err_profile)
@@ -464,6 +465,13 @@ class LogLine(Widget):
starttime = datetime.datetime.now()
text = ''
+ assert self._resolved_keys is None
+ elements = set()
+ visited = {}
+ for element in pipeline.targets:
+ elements.update(element.dependencies(Scope.ALL, visited=visited))
+ self._resolved_keys = {element: element._get_cache_key() for element in elements}
+
# Main invocation context
text += '\n'
text += self.content_profile.fmt("BuildStream Version {}\n".format(bst_version), bold=True)
@@ -537,6 +545,13 @@ class LogLine(Widget):
text = ''
+ assert self._resolved_keys is not None
+ elements = sorted(e for (e, k) in self._resolved_keys.items() if k != e._get_cache_key())
+ if elements:
+ text += self.content_profile.fmt("Resolved key Summary\n", bold=True)
+ text += self.show_pipeline(elements, self._context.log_element_format)
+ text += "\n\n"
+
if self._failure_messages:
text += self.content_profile.fmt("Failure Summary\n", bold=True)
values = OrderedDict()