summaryrefslogtreecommitdiff
path: root/src/buildstream/element.py
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2020-09-07 21:06:11 +0200
committerJürg Billeter <j@bitron.ch>2020-09-08 19:49:19 +0200
commit68e9025185b5770016cbe6a5e7eaf4388a629e4c (patch)
tree915b450a1e53e8b891d46736da6dfc095d59cbb2 /src/buildstream/element.py
parentf884b111dd238d3c6ed824716300d3facda900bf (diff)
downloadbuildstream-68e9025185b5770016cbe6a5e7eaf4388a629e4c.tar.gz
element.py: Fix dependency cache key check in non-strict mode
The `None` check in `_calculate_cache_key()` was working for the strict cache key calculation but not for the strong cache key in non-strict mode.
Diffstat (limited to 'src/buildstream/element.py')
-rw-r--r--src/buildstream/element.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index 442920b75..bdac7054d 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -2066,6 +2066,10 @@ class Element(Plugin):
#
# Calculates the cache key
#
+ # Args:
+ # dependencies (List[List[str]]): list of dependencies with project name,
+ # element name and optional cache key
+ #
# Returns:
# (str): A hex digest cache key for this Element, or None
#
@@ -2073,7 +2077,7 @@ class Element(Plugin):
#
def _calculate_cache_key(self, dependencies):
# No cache keys for dependencies which have no cache keys
- if None in dependencies:
+ if any(not all(dep) for dep in dependencies):
return None
# Generate dict that is used as base for all cache keys
@@ -3001,10 +3005,7 @@ class Element(Plugin):
return
if self.__strict_cache_key is None:
- dependencies = [
- [e.project_name, e.name, e.__strict_cache_key] if e.__strict_cache_key is not None else None
- for e in self._dependencies(_Scope.BUILD)
- ]
+ dependencies = [[e.project_name, e.name, e.__strict_cache_key] for e in self._dependencies(_Scope.BUILD)]
self.__strict_cache_key = self._calculate_cache_key(dependencies)
if self.__strict_cache_key is not None: