summaryrefslogtreecommitdiff
path: root/buildstream/_platform
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2018-10-08 11:34:29 +0100
committerRichard Maw <richard.maw@codethink.co.uk>2018-11-14 13:30:34 +0000
commite7633500995376be9d727c902408f03180d56169 (patch)
tree8846718150c1d17fa5257a83f376a2f0d71b3a98 /buildstream/_platform
parentda735e56e77846f6ea6e80809fc0bd5de7b3b657 (diff)
downloadbuildstream-e7633500995376be9d727c902408f03180d56169.tar.gz
buildstream/sandbox/_sandboxbwrap.py: Distinguish sandbox failure from command failure
If `bwrap` fails to set up the sandbox and start the payload command it won't write an exit-code in --json-status-fd, so we can report if it was a sandboxing failure if we don't get exit-code status and a payload command failure if we do and it's non-zero. Closes https://gitlab.com/BuildStream/buildstream/issues/286
Diffstat (limited to 'buildstream/_platform')
-rw-r--r--buildstream/_platform/linux.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/buildstream/_platform/linux.py b/buildstream/_platform/linux.py
index be1e9d933..33f3966c1 100644
--- a/buildstream/_platform/linux.py
+++ b/buildstream/_platform/linux.py
@@ -44,10 +44,12 @@ class Linux(Platform):
self._bwrap_exists = False
self._have_good_bwrap = False
self._die_with_parent_available = False
+ self._json_status_available = False
else:
self._bwrap_exists = True
self._have_good_bwrap = (0, 1, 2) <= bwrap_version
self._die_with_parent_available = (0, 1, 8) <= bwrap_version
+ self._json_status_available = (0, 3, 2) <= bwrap_version
self._local_sandbox_available = self._have_fuse and self._have_good_bwrap
@@ -97,6 +99,7 @@ class Linux(Platform):
# Inform the bubblewrap sandbox as to whether it can use user namespaces or not
kwargs['user_ns_available'] = self._user_ns_available
kwargs['die_with_parent_available'] = self._die_with_parent_available
+ kwargs['json_status_available'] = self._json_status_available
return SandboxBwrap(*args, **kwargs)
def _check_user_ns_available(self):