summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-02-06 16:22:37 +0000
committerJürg Billeter <j@bitron.ch>2018-02-07 10:26:15 +0000
commit5c6cfe10274b6588d8bbc785574d215a35305d80 (patch)
tree27eb5c6ec2232a68e5833efabe909ff3d058b195
parent37f3c9269e10ea5dd3644fe674501467ca1efac8 (diff)
downloadbuildstream-5c6cfe10274b6588d8bbc785574d215a35305d80.tar.gz
element.py: Consider execution environment in cache key
Do this by default for every element, later we will have to handle it differently when supporting projects which build on specific arches with virtualization or networked workers.
-rw-r--r--buildstream/element.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index afcfcee95..608c6e8c0 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -910,12 +910,22 @@ class Element(Plugin):
context = self._get_context()
project = self._get_project()
+ operating_system, _, _, _, machine_arch = os.uname()
+
self.__cache_key_dict = {
'artifact-version': "{}.{}".format(BST_CORE_ARTIFACT_VERSION,
self.BST_ARTIFACT_VERSION),
'context': context._get_cache_key(),
'project': project._get_cache_key(),
'element': self.get_unique_key(),
+
+ # The execution environment may later be delegated
+ # to sandboxes which support virtualization
+ #
+ 'execution-environment': {
+ 'os': operating_system,
+ 'arch': machine_arch
+ },
'environment': cache_env,
'sources': [s._get_unique_key() for s in self.__sources],
'public': self.__public,