summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-02-24 18:45:08 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-02-24 18:47:20 +0900
commit077b29ea43ee7c1f02afd511c62ed7a95b3b4db6 (patch)
tree8c11ffa427402a619bb12de8befc10360f69268d
parent79bbefe26a3fcd13d3de558aed6b5b4d5bc1235a (diff)
downloadbuildstream-077b29ea43ee7c1f02afd511c62ed7a95b3b4db6.tar.gz
element.py: Force resolve intermediate dependency cache keys
When a cache key is discovered (e.g.: due to a workspace build completing), then we have no guarantee that reverse dependency cache keys will be updated in order. As such, we must ensure that `Element._update_state()` serializes this and ensures that cache keys for intermediate dependencies get resolved. This fixes #919
-rw-r--r--buildstream/element.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index bc939bc92..92c9d0181 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1092,6 +1092,18 @@ class Element(Plugin):
return
if self.__strict_cache_key is None:
+
+ # We cannot make the assumption that dependency cache keys
+ # have already been resolved if possible.
+ #
+ # If a cache key was recently discovered, we need to be sure
+ # that the interemediate dependencies get their cache keys
+ # resolved before calculating this element's cache key.
+ #
+ for e in self.dependencies(Scope.BUILD):
+ if e.__strict_cache_key is None:
+ e._update_state()
+
dependencies = [
e.__strict_cache_key for e in self.dependencies(Scope.BUILD)
]