summaryrefslogtreecommitdiff
path: root/buildstream/sandbox/_sandboxchroot.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildstream/sandbox/_sandboxchroot.py')
-rw-r--r--buildstream/sandbox/_sandboxchroot.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/buildstream/sandbox/_sandboxchroot.py b/buildstream/sandbox/_sandboxchroot.py
index 7f27f50d0..de4eb46e2 100644
--- a/buildstream/sandbox/_sandboxchroot.py
+++ b/buildstream/sandbox/_sandboxchroot.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python3
#
# Copyright (C) 2017 Codethink Limited
#
@@ -59,6 +58,11 @@ class SandboxChroot(Sandbox):
if env is None:
env = self._get_environment()
+ if not self._has_command(command[0], env):
+ raise SandboxError("Staged artifacts do not provide command "
+ "'{}'".format(command[0]),
+ reason='missing-command')
+
# Command must be a list
if isinstance(command, str):
command = [command]
@@ -86,7 +90,7 @@ class SandboxChroot(Sandbox):
# Nonetheless a better solution could perhaps be found.
rootfs = stack.enter_context(utils._tempdir(dir='/var/run/buildstream'))
- stack.enter_context(self.create_devices(self.get_directory(), flags))
+ stack.enter_context(self.create_devices(self._root, flags))
stack.enter_context(self.mount_dirs(rootfs, flags, stdout, stderr))
if flags & SandboxFlags.INTERACTIVE: