summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.co.uk>2019-06-10 11:44:57 +0100
committerJames Ennis <james.ennis@codethink.co.uk>2019-06-24 15:20:51 +0100
commit176a3057d075aa7e0f47a98ad489f5cf5cfc8129 (patch)
tree5492549b63b9f1ff90f271c74be841099a45233f
parent2a51df59ee899d65d1ad9ed74d2e05163988b6d9 (diff)
downloadbuildstream-176a3057d075aa7e0f47a98ad489f5cf5cfc8129.tar.gz
element.py: cache key should be set in __update_cache_keys
-rw-r--r--src/buildstream/element.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index 25fcccd5f..60e72f201 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -3007,6 +3007,8 @@ class Element(Plugin):
# has changed.
#
def __update_cache_keys(self):
+ context = self._get_context()
+
if self.__weak_cache_key is None:
# Calculate weak cache key
# Weak cache key includes names of direct build dependencies
@@ -3034,6 +3036,10 @@ class Element(Plugin):
]
self.__strict_cache_key = self._calculate_cache_key(dependencies)
+ # In strict mode, the strong cache key always matches the strict cache key
+ if context.get_strict():
+ self.__cache_key = self.__strict_cache_key
+
if self.__strict_cache_key is not None and self.__can_query_cache_callback is not None:
self.__can_query_cache_callback(self)
self.__can_query_cache_callback = None
@@ -3069,7 +3075,6 @@ class Element(Plugin):
# In strict mode, the strong cache key always matches the strict cache key
if context.get_strict():
- self.__cache_key = self.__strict_cache_key
self.__artifact = self.__strict_artifact
# __update_cache_key_non_strict()