summaryrefslogtreecommitdiff
path: root/src/buildstream/element.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildstream/element.py')
-rw-r--r--src/buildstream/element.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index f7d49d57f..4a29fd8f2 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -2014,6 +2014,7 @@ class Element(Plugin):
self.__cache_key_dict = {
"core-artifact-version": BST_CORE_ARTIFACT_VERSION,
+ "element-base-key": self.__get_base_key(),
"element-plugin-key": self.get_unique_key(),
"element-plugin-name": self.get_kind(),
"element-plugin-version": self.BST_ARTIFACT_VERSION,
@@ -2370,6 +2371,17 @@ class Element(Plugin):
self.__sources.preflight()
+ # __get_base_key()
+ #
+ # Gets the base key for this element, the base key
+ # is the part of the cache key which is element instance
+ # specific and automatically generated by BuildStream core.
+ #
+ def __get_base_key(self):
+ return {
+ "build-root": self.get_variable("build-root"),
+ }
+
# __assert_cached()
#
# Raises an error if the artifact is not cached.