summaryrefslogtreecommitdiff
path: root/src/buildstream/_pipeline.py
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.co.uk>2019-07-09 12:47:06 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-16 09:13:39 +0000
commit17091995171936d6e7bbdba8fe6ed8094226266d (patch)
tree3b97af082802382e7c2c0aaaa40a7485be7f53ea /src/buildstream/_pipeline.py
parentff6984e3b07f5d70aa7250991f6ff700004ddcde (diff)
downloadbuildstream-17091995171936d6e7bbdba8fe6ed8094226266d.tar.gz
element.py: Introduce __update_strict_cache_key_of_rdeps()
Once an Element's strict cache key is determined, we should attempt to update the strict cache key of it's reverse dependencies. The state of a reverse dependency will be updated once all of its dependencies have strict cache keys This patch introduces the potential for a RecursionError because _update_state() can now trigger further _update_state calls (on reverse dependencies). Therefore, the maximum recursion limit for our "test_max_recursion_depth" test has been lowered. If this becomes a problem, we can always consider setting a larger recursion limit, for now, this change has been tested with the Debian stack and works as expected.
Diffstat (limited to 'src/buildstream/_pipeline.py')
-rw-r--r--src/buildstream/_pipeline.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/buildstream/_pipeline.py b/src/buildstream/_pipeline.py
index a96a3f731..a9d88befd 100644
--- a/src/buildstream/_pipeline.py
+++ b/src/buildstream/_pipeline.py
@@ -124,6 +124,11 @@ class Pipeline():
#
def resolve_elements(self, targets):
with self._context.messenger.timed_activity("Resolving cached state", silent_nested=True):
+ # 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,
+ # if it does become a problem we may have to set the recursion limit to a
+ # greater value.
for element in self.dependencies(targets, Scope.ALL):
# Determine initial element state.
element._update_state()