summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.co.uk>2019-07-11 15:55:03 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-16 09:13:39 +0000
commit452fdce3d0f80e1fec671237c97d7e43b0773d5f (patch)
tree79fe8aed5284958bec1b12d994007dd937358cef /src
parent027750df1733b34fc8aabce8f3c7dbfca4fc8ec8 (diff)
downloadbuildstream-452fdce3d0f80e1fec671237c97d7e43b0773d5f.tar.gz
element.py: Cache whether we've resolved the initial state
Diffstat (limited to 'src')
-rw-r--r--src/buildstream/_pipeline.py3
-rw-r--r--src/buildstream/element.py3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/buildstream/_pipeline.py b/src/buildstream/_pipeline.py
index a9d88befd..af60ffde5 100644
--- a/src/buildstream/_pipeline.py
+++ b/src/buildstream/_pipeline.py
@@ -131,7 +131,8 @@ class Pipeline():
# greater value.
for element in self.dependencies(targets, Scope.ALL):
# Determine initial element state.
- element._update_state()
+ if not element._resolved_initial_state:
+ element._update_state()
# We may already have Elements which are cached and have their runtimes
# cached, if this is the case, we should immediately notify their reverse
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index c02562ee6..a08ec571c 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -254,6 +254,7 @@ class Element(Plugin):
self.__buildable_callback = None # Callback to BuildQueue
self._depth = None # Depth of Element in its current dependency graph
+ self._resolved_initial_state = False # Whether the initial state of the Element has been resolved
# Ensure we have loaded this class's defaults
self.__init_defaults(project, plugin_conf, meta.kind, meta.is_junction)
@@ -1151,6 +1152,8 @@ class Element(Plugin):
# This must be called whenever the state of an element may have changed.
#
def _update_state(self):
+ if not self._resolved_initial_state:
+ self._resolved_initial_state = True
context = self._get_context()
# Compute and determine consistency of sources