summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormilloni <milloni@milloni.org>2018-05-07 14:05:35 +0100
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2018-05-07 13:51:16 +0000
commitf8952d6b8a775026d8a566969dd2570badf838fe (patch)
tree93f24e33bf8d49e8bd41b6741dcefe5cc139a347
parent03823d124f61c18346dd2d8282055ab25d6f9aa6 (diff)
downloadbuildstream-f8952d6b8a775026d8a566969dd2570badf838fe.tar.gz
Replace bwrap checks with calls to check_bwrap_version
See: #373
-rw-r--r--buildstream/_platform/linux.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/buildstream/_platform/linux.py b/buildstream/_platform/linux.py
index c4e87de1d..26dafb995 100644
--- a/buildstream/_platform/linux.py
+++ b/buildstream/_platform/linux.py
@@ -20,6 +20,7 @@
import subprocess
+from .. import _site
from .. import utils
from .._artifactcache.ostreecache import OSTreeCache
from .._message import Message, MessageType
@@ -34,8 +35,8 @@ class Linux(Platform):
super().__init__(context, project)
+ self._die_with_parent_available = _site.check_bwrap_version(0, 1, 8)
self._user_ns_available = self._check_user_ns_available(context)
- self._die_with_parent_available = self._check_die_with_parent_available(context)
self._artifact_cache = OSTreeCache(context, enable_push=self._user_ns_available)
@property
@@ -81,20 +82,3 @@ class Linux(Platform):
detail="Some builds may not function due to lack of uid / gid 0, " +
"artifacts created will not be trusted for push purposes."))
return False
-
- def _check_die_with_parent_available(self, context):
-
- # bwrap supports --die-with-parent since 0.1.8.
- # Let's check whether the host bwrap supports it.
- bwrap = utils.get_host_tool('bwrap')
-
- try:
- subprocess.check_call([
- bwrap,
- '--ro-bind', '/', '/',
- '--die-with-parent',
- 'true'
- ], stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
- return True
- except subprocess.CalledProcessError:
- return False