diff options
| author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-02-24 18:45:08 +0900 |
|---|---|---|
| committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-02-24 18:48:00 +0900 |
| commit | 2629bdd01197451cde59c94fa52f0d928b5401cf (patch) | |
| tree | 19de9e1b543cf6881732ef5dddb6dbcfb3c76409 | |
| parent | c8c598b1d63b6a3ab1b14d2b181d47498100bf21 (diff) | |
| download | buildstream-2629bdd01197451cde59c94fa52f0d928b5401cf.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.py | 12 |
1 files changed, 12 insertions, 0 deletions
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) ] |
