summaryrefslogtreecommitdiff
path: root/buildstream
diff options
context:
space:
mode:
Diffstat (limited to 'buildstream')
-rw-r--r--buildstream/element.py27
1 files changed, 10 insertions, 17 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 95468d2e0..138096caf 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1398,12 +1398,6 @@ class Element(Plugin):
# Weak cache key could not be calculated yet
return
- # Update __cached in non-strict builds now that the weak cache key is available
- if not self._get_strict() and not self.__cached:
- self.__cached = self.__artifacts.contains(self)
- if not self._get_strict() and not self.__remotely_cached:
- self.__remotely_cached = self.__artifacts.remote_contains(self)
-
if self.__strict_cache_key is None:
dependencies = [
e.__strict_cache_key for e in self.dependencies(Scope.BUILD)
@@ -1414,6 +1408,16 @@ class Element(Plugin):
# Strict cache key could not be calculated yet
return
+ # Query caches now that the weak and strict cache keys are available
+ if not self.__cached:
+ self.__cached = self.__artifacts.contains(self)
+ if not self.__remotely_cached:
+ self.__remotely_cached = self.__artifacts.remote_contains(self)
+ if not self.__strong_cached:
+ self.__strong_cached = self.__artifacts.contains(self, strength=_KeyStrength.STRONG)
+ if not self.__remotely_strong_cached:
+ self.__remotely_strong_cached = self.__artifacts.remote_contains(self, strength=_KeyStrength.STRONG)
+
if self.__cache_key is None:
# Calculate strong cache key
if self._get_strict():
@@ -1434,17 +1438,6 @@ class Element(Plugin):
# Strong cache key could not be calculated yet
return
- # Update __strong_cached for non-strict builds now that the strong cache key is available
- if not self.__strong_cached:
- self.__strong_cached = self.__artifacts.contains(self, strength=_KeyStrength.STRONG)
- if not self.__remotely_strong_cached:
- self.__remotely_strong_cached = self.__artifacts.remote_contains(self, strength=_KeyStrength.STRONG)
-
- if self._get_strict() and not self.__cached:
- self.__cached = self.__strong_cached
- if self._get_strict() and not self.__remotely_cached:
- self.__remotely_cached = self.__remotely_strong_cached
-
#############################################################
# Private Local Methods #
#############################################################