summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2017-07-07 09:33:42 +0200
committerJürg Billeter <j@bitron.ch>2017-07-14 14:13:51 +0200
commitcc05e8365c3c6034c04fc6156ccbce285200704b (patch)
tree13515ecce7c6b30cefa9466486f89e10191a7374
parent0dd72a979bf5c3269af6f162eef3b1f44eabe3e3 (diff)
downloadbuildstream-cc05e8365c3c6034c04fc6156ccbce285200704b.tar.gz
element.py: Store cache keys as artifact metadata
-rw-r--r--buildstream/element.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 65573bc48..310bf0ddc 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -942,6 +942,18 @@ class Element(Plugin):
# Store public data
_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)
+ }
+ meta = {
+ 'keys': {
+ 'strong': self._get_cache_key(_KeyStrength.STRONG),
+ 'weak': self._get_cache_key(_KeyStrength.WEAK),
+ 'dependencies': dependencies
+ }
+ }
+ _yaml.dump(_yaml.node_sanitize(meta), os.path.join(metadir, 'artifact.yaml'))
+
with self.timed_activity("Caching Artifact"):
self.__artifacts.commit(self, assembledir)