diff options
author | Jürg Billeter <j@bitron.ch> | 2017-07-07 09:53:02 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2017-07-14 14:13:51 +0200 |
commit | f43aa7bbbf8cc02faecbeb7a279d47bf97f6beca (patch) | |
tree | 0580d220f3211d25d1db43195f93d9f540fbe9ec | |
parent | cb225c2aaabef6ef1627ca68caeeb2d0b99af78e (diff) | |
download | buildstream-f43aa7bbbf8cc02faecbeb7a279d47bf97f6beca.tar.gz |
element.py: Use _get_cache_key_for_build() for artifact.yaml
This will only make a difference when building with weak cache keys.
-rw-r--r-- | buildstream/element.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/buildstream/element.py b/buildstream/element.py index 3a652d657..4993b6700 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -832,6 +832,21 @@ class Element(Plugin): return self.__cache_key_from_artifact + # _get_cache_key_for_build(): + # + # Returns the strong cache key using cached artifacts as dependencies + # + # Returns: + # (str): A hex digest cache key for this Element + # + # This is the cache key for a fresh build of this element. + # + def _get_cache_key_for_build(self): + dependencies = [ + e._get_cache_key_from_artifact() for e in self.dependencies(Scope.BUILD) + ] + return self.__calculate_cache_key(dependencies) + # _get_full_display_key(): # # Returns cache keys for display purposes @@ -968,11 +983,11 @@ class Element(Plugin): _yaml.dump(_yaml.node_sanitize(self.__dynamic_public), os.path.join(metadir, 'public.yaml')) dependencies = { - e.name: e._get_cache_key() for e in self.dependencies(Scope.BUILD) + e.name: e._get_cache_key_from_artifact() for e in self.dependencies(Scope.BUILD) } meta = { 'keys': { - 'strong': self._get_cache_key(_KeyStrength.STRONG), + 'strong': self._get_cache_key_for_build(), 'weak': self._get_cache_key(_KeyStrength.WEAK), 'dependencies': dependencies } |