summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.co.uk>2019-08-29 15:23:29 +0100
committerJames Ennis <james.ennis@codethink.co.uk>2019-08-29 15:23:29 +0100
commitd12a3f15dcbf9b254fd6212de3888d674cc71625 (patch)
tree1099841f44dfcf433940d6c7c8daaf71356c35aa
parent3211ebf006ad553e15b327ca7493ff819106bb48 (diff)
downloadbuildstream-jennis/test_failure_2.tar.gz
-rw-r--r--src/buildstream/_artifactelement.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/buildstream/_artifactelement.py b/src/buildstream/_artifactelement.py
index b8ea4c1e8..04b24efc2 100644
--- a/src/buildstream/_artifactelement.py
+++ b/src/buildstream/_artifactelement.py
@@ -127,14 +127,27 @@ class ArtifactElement(Element):
# sandbox (Sandbox)
#
def configure_sandbox(self, sandbox):
+ build_root = self.get_variable('build-root')
install_root = self.get_variable('install-root')
# Tell the sandbox to mount the build root and install root
+ sandbox.mark_directory(build_root)
sandbox.mark_directory(install_root)
+ # Allow running all commands in a specified subdirectory
+ command_subdir = self.get_variable('command-subdir')
+ if command_subdir:
+ command_dir = os.path.join(build_root, command_subdir)
+ else:
+ command_dir = build_root
+ sandbox.set_work_directory(command_dir)
+
# Tell sandbox which directory is preserved in the finished artifact
sandbox.set_output_directory(install_root)
+ # Setup environment
+ sandbox.set_environment(self.get_environment())
+
# Override Element._calculate_cache_key
def _calculate_cache_key(self, dependencies=None):
return self._key