summaryrefslogtreecommitdiff
path: root/src/buildstream/element.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildstream/element.py')
-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()