diff options
author | Jürg Billeter <j@bitron.ch> | 2017-07-25 17:11:39 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2017-07-25 17:14:06 +0100 |
commit | bd19c93beb07d8b9ce08d515920078f6628f950f (patch) | |
tree | 1813f1667f057aee57e9fc2b919d270d2ce62fcc | |
parent | 14a8b5aa28db973243b58a9ecb1ac9b26afa0994 (diff) | |
download | buildstream-bd19c93beb07d8b9ce08d515920078f6628f950f.tar.gz |
element.py: Check consistency before recursion in _get_cache_key()
-rw-r--r-- | buildstream/element.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/buildstream/element.py b/buildstream/element.py index 60e81fda1..a4fa696a1 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -811,14 +811,6 @@ class Element(Plugin): # None is returned if information for the cache key is missing. # def __calculate_cache_key(self, dependencies): - # It is not really necessary to check if the Source object's - # local mirror has the ref cached locally or not, it's only important - # to know if the source has a ref specified or not, in order to - # produce a cache key. - # - if self._consistency() == Consistency.INCONSISTENT: - return None - # No cache keys for dependencies which have no cache keys if None in dependencies: return None @@ -856,6 +848,14 @@ class Element(Plugin): # def _get_cache_key(self, strength=_KeyStrength.STRONG): if self.__cache_key is None: + # It is not really necessary to check if the Source object's + # local mirror has the ref cached locally or not, it's only important + # to know if the source has a ref specified or not, in order to + # produce a cache key. + # + if self._consistency() == Consistency.INCONSISTENT: + return None + # Calculate strong cache key dependencies = [ e._get_cache_key() for e in self.dependencies(Scope.BUILD) |