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 14:13:51 +0200
commit0cdd17413a74e1745ae95da93c16b7dbc57451a3 (patch)
tree272400a9ec00c303269db503053eb942011766d5
parentf43aa7bbbf8cc02faecbeb7a279d47bf97f6beca (diff)
downloadbuildstream-0cdd17413a74e1745ae95da93c16b7dbc57451a3.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 4993b6700..b864d8f8c 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)