diff options
author | James Ennis <james.ennis@codethink.co.uk> | 2019-06-10 11:44:57 +0100 |
---|---|---|
committer | James Ennis <james.ennis@codethink.co.uk> | 2019-06-10 11:44:57 +0100 |
commit | 2c9825918e0d56663779b6da727bfb3527a33538 (patch) | |
tree | c7b19e4bb7f0f0d18606b8c667169d7b061b7907 /src | |
parent | bb0b3e44af6f90c4fa8471c042e3b51cef6bc65d (diff) | |
download | buildstream-2c9825918e0d56663779b6da727bfb3527a33538.tar.gz |
element.py: cache key should be set in __update_cache_keys
Diffstat (limited to 'src')
-rw-r--r-- | src/buildstream/element.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py index a60546084..a448b867c 100644 --- a/src/buildstream/element.py +++ b/src/buildstream/element.py @@ -3006,6 +3006,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 @@ -3033,6 +3035,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 self.__strict_cache_key is not None and 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 @@ -3068,7 +3074,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() |