diff options
author | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-04-02 13:14:49 +0100 |
---|---|---|
committer | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-07-10 09:24:50 +0100 |
commit | 76efcbc4adb10396dd8f5628be1815a773193945 (patch) | |
tree | b9035d7f97f6f74516593882d6448c9423e38219 | |
parent | 7843544c83b18820883b3b91340dfc7da2b3fc43 (diff) | |
download | buildstream-76efcbc4adb10396dd8f5628be1815a773193945.tar.gz |
WIP: win32: _platform/win32: add support for win32
Copy the approach of 'Darwin' and provide a SandboxDummy.
-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 |