summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknownexus <phillip.smyth@codethink.co.uk>2018-08-30 11:56:23 +0100
committerJürg Billeter <j@bitron.ch>2018-09-27 15:22:09 +0100
commit80ebdd2cbf3ddb5f4bb9b2078b2ffe86d20a74c8 (patch)
tree11777693d64438c076ab9a7b20c751ad665c82a3
parentfcf37f9c02d38352ce4e03c0ad9c45a4c5ab5694 (diff)
downloadbuildstream-80ebdd2cbf3ddb5f4bb9b2078b2ffe86d20a74c8.tar.gz
Added FUSE check, as WSL does not support FUSE yet
_platform/linux.py: Add FUSE check And Ensure exception is not raised when performing sandbox availability check Without this check, WSL would error upon finding FUSE missing This must be bypassed to allow remote execution
-rw-r--r--buildstream/_platform/linux.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/buildstream/_platform/linux.py b/buildstream/_platform/linux.py
index 7af1a2283..2763259c8 100644
--- a/buildstream/_platform/linux.py
+++ b/buildstream/_platform/linux.py
@@ -38,7 +38,11 @@ class Linux(Platform):
self._gid = os.getegid()
self._die_with_parent_available = _site.check_bwrap_version(0, 1, 8)
- self._user_ns_available = self._check_user_ns_available()
+
+ if self._local_sandbox_available():
+ self._user_ns_available = self._check_user_ns_available()
+ else:
+ self._user_ns_available = False
def create_sandbox(self, *args, **kwargs):
# Inform the bubblewrap sandbox as to whether it can use user namespaces or not
@@ -58,8 +62,13 @@ class Linux(Platform):
################################################
# Private Methods #
################################################
- def _check_user_ns_available(self):
+ def _local_sandbox_available(self):
+ try:
+ return os.path.exists(utils.get_host_tool('bwrap')) and os.path.exists('/dev/fuse')
+ except utils.ProgramNotFoundError:
+ return False
+ def _check_user_ns_available(self):
# Here, lets check if bwrap is able to create user namespaces,
# issue a warning if it's not available, and save the state
# locally so that we can inform the sandbox to not try it