From 2629bdd01197451cde59c94fa52f0d928b5401cf Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Sun, 24 Feb 2019 18:45:08 +0900 Subject: 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 --- buildstream/element.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/buildstream/element.py b/buildstream/element.py index 5c06065b4..dac020abb 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -1190,6 +1190,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) ] -- cgit v1.2.1