summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2017-07-12 15:38:58 +0200
committerJürg Billeter <j@bitron.ch>2017-07-14 10:26:34 +0200
commit5d24f6ea0ca8b660404c43d81b2cf153a3c42764 (patch)
tree29d32c4e0a8d8f94efbf6aa59f95cfc8396ec324
parentf61b268d8981e183029c5b71b42ef87a4c505b39 (diff)
downloadbuildstream-5d24f6ea0ca8b660404c43d81b2cf153a3c42764.tar.gz
element.py: Use appropriate cache key in _get_full_display_key()
-rw-r--r--buildstream/element.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index bba679bc3..6ac3554a1 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -860,13 +860,22 @@ class Element(Plugin):
#
def _get_full_display_key(self):
context = self.get_context()
- cache_key = self._get_cache_key()
- dim_key = False
+ cache_key = None
+ dim_key = True
+
+ if self._consistency() == Consistency.INCONSISTENT:
+ cache_key = None
+ elif context.strict_build_plan or self._cached(strength=_KeyStrength.STRONG):
+ cache_key = self._get_cache_key()
+ elif self._cached():
+ cache_key = self._get_cache_key_from_artifact()
+ elif self._buildable():
+ cache_key = self._get_cache_key_for_build()
if not cache_key:
cache_key = "{:?<64}".format('')
- # Show unresolved cache keys as dim
- dim_key = True
+ elif self._get_cache_key() == cache_key:
+ dim_key = False
length = min(len(cache_key), context.log_key_length)
return (cache_key, cache_key[0:length], dim_key)