summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.co.uk>2019-07-11 15:55:03 +0100
committerJames Ennis <james.ennis@codethink.co.uk>2019-07-12 14:29:33 +0100
commit444da8d0230a2471d9cd684ab83902d9b859e845 (patch)
tree54cab59d0d9221952b9e6849c8de0cba6d350733
parent129944d0a82b0b59e3f38cff6af8458941cd5e2f (diff)
downloadbuildstream-444da8d0230a2471d9cd684ab83902d9b859e845.tar.gz
element.py: Cache whether we've resolved the initial state
-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 f9065997b..51a143113 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -253,6 +253,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)
@@ -1196,6 +1197,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