diff options
-rw-r--r-- | src/buildstream/_artifactelement.py | 13 |
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 |