This is an automated email from the ASF dual-hosted git repository.

root pushed a commit to branch tristan/fix-workspace-build-all-1.2
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 077b29ea43ee7c1f02afd511c62ed7a95b3b4db6
Author: Tristan Van Berkom <[email protected]>
AuthorDate: Sun Feb 24 18:45:08 2019 +0900

    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 bc939bc..92c9d01 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)
             ]

Reply via email to