diff options
-rw-r--r-- | src/buildstream/_platform/platform.py | 4 | ||||
-rw-r--r-- | src/buildstream/_platform/win32.py | 31 |
2 files changed, 35 insertions, 0 deletions
diff --git a/src/buildstream/_platform/platform.py b/src/buildstream/_platform/platform.py index 5f2b7081a..42c379eaf 100644 --- a/src/buildstream/_platform/platform.py +++ b/src/buildstream/_platform/platform.py @@ -48,6 +48,8 @@ class Platform(): backend = 'linux' elif sys.platform.startswith('darwin'): backend = 'darwin' + elif sys.platform == 'win32': + backend = 'win32' else: backend = 'unix' @@ -55,6 +57,8 @@ class Platform(): from .linux import Linux as PlatformImpl # pylint: disable=cyclic-import elif backend == 'darwin': from .darwin import Darwin as PlatformImpl # pylint: disable=cyclic-import + elif backend == 'win32': + from .win32 import Win32 as PlatformImpl # pylint: disable=cyclic-import elif backend == 'unix': from .unix import Unix as PlatformImpl # pylint: disable=cyclic-import else: diff --git a/src/buildstream/_platform/win32.py b/src/buildstream/_platform/win32.py new file mode 100644 index 000000000..db70e4a4f --- /dev/null +++ b/src/buildstream/_platform/win32.py @@ -0,0 +1,31 @@ +import os + +from .._exceptions import PlatformError +from ..sandbox import SandboxNone + +from . import Platform + + +class Win32(Platform): + + def __init__(self): + + super().__init__() + + def create_sandbox(self, *args, **kwargs): + kwargs['dummy_reason'] = \ + "There are no supported sandbox " + \ + "technologies for Win32 at this time" + return SandboxNone(*args, **kwargs) + + def check_sandbox_config(self, config): + # Check host os and architecture match + if config.build_os != self.get_host_os(): + raise PlatformError("Configured and host OS don't match.") + elif config.build_arch != self.get_host_arch(): + raise PlatformError("Configured and host architecture don't match.") + + return True + + def maximize_open_file_limit(self): + pass |