Skip to content
Snippets Groups Projects
Commit 7ac26a30 authored by James Ennis's avatar James Ennis Committed by Phillip Smyth
Browse files

Sandbox: Ensure that we only import the sandbox subclasses when instantiate a sandbox

  - This patch was required due to not being able to execute `bst` on
  a Linux machine without Fuse or Bubblewrap available
parent dcf91bc2
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ import os ...@@ -19,7 +19,7 @@ import os
import resource import resource
from .._exceptions import PlatformError from .._exceptions import PlatformError
from ..sandbox import SandboxChroot, SandboxDummy from ..sandbox import SandboxDummy
from . import Platform from . import Platform
......
...@@ -24,7 +24,7 @@ from .. import _site ...@@ -24,7 +24,7 @@ from .. import _site
from .. import utils from .. import utils
from .._artifactcache.cascache import CASCache from .._artifactcache.cascache import CASCache
from .._message import Message, MessageType from .._message import Message, MessageType
from ..sandbox import SandboxBwrap, SandboxDummy from ..sandbox import SandboxDummy
from . import Platform from . import Platform
...@@ -52,6 +52,7 @@ class Linux(Platform): ...@@ -52,6 +52,7 @@ class Linux(Platform):
if not self._local_sandbox_available(): if not self._local_sandbox_available():
return SandboxDummy(*args, **kwargs) return SandboxDummy(*args, **kwargs)
else: else:
from ..sandbox._sandboxbwrap import SandboxBwrap
# Inform the bubblewrap sandbox as to whether it can use user namespaces or not # Inform the bubblewrap sandbox as to whether it can use user namespaces or not
kwargs['user_ns_available'] = self._user_ns_available kwargs['user_ns_available'] = self._user_ns_available
kwargs['die_with_parent_available'] = self._die_with_parent_available kwargs['die_with_parent_available'] = self._die_with_parent_available
......
...@@ -21,7 +21,6 @@ import os ...@@ -21,7 +21,6 @@ import os
from .._artifactcache.cascache import CASCache from .._artifactcache.cascache import CASCache
from .._exceptions import PlatformError from .._exceptions import PlatformError
from ..sandbox import SandboxChroot
from . import Platform from . import Platform
...@@ -41,4 +40,5 @@ class Unix(Platform): ...@@ -41,4 +40,5 @@ class Unix(Platform):
return self._artifact_cache return self._artifact_cache
def create_sandbox(self, *args, **kwargs): def create_sandbox(self, *args, **kwargs):
from ..sandbox._sandboxchroot import SandboxChroot
return SandboxChroot(*args, **kwargs) return SandboxChroot(*args, **kwargs)
...@@ -18,7 +18,5 @@ ...@@ -18,7 +18,5 @@
# Tristan Maat <tristan.maat@codethink.co.uk> # Tristan Maat <tristan.maat@codethink.co.uk>
from .sandbox import Sandbox, SandboxFlags from .sandbox import Sandbox, SandboxFlags
from ._sandboxchroot import SandboxChroot
from ._sandboxbwrap import SandboxBwrap
from ._sandboxremote import SandboxRemote from ._sandboxremote import SandboxRemote
from ._sandboxdummy import SandboxDummy from ._sandboxdummy import SandboxDummy
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment