diff options
author | Jürg Billeter <j@bitron.ch> | 2018-09-26 09:59:03 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2018-09-27 10:18:03 +0100 |
commit | 7aec8b0f0b205b83a266c4542163394cd34256f5 (patch) | |
tree | d5bd0adf7eccf568c1cad4c914454fa07c3d1a51 /buildstream/_platform | |
parent | 10ed9158f0ce91bc18ba4e78f6a44a8595af731e (diff) | |
download | buildstream-7aec8b0f0b205b83a266c4542163394cd34256f5.tar.gz |
Move artifact cache creation to Context
The artifact cache is no longer platform-specific.
Diffstat (limited to 'buildstream/_platform')
-rw-r--r-- | buildstream/_platform/linux.py | 6 | ||||
-rw-r--r-- | buildstream/_platform/platform.py | 6 | ||||
-rw-r--r-- | buildstream/_platform/unix.py | 6 |
3 files changed, 2 insertions, 16 deletions
diff --git a/buildstream/_platform/linux.py b/buildstream/_platform/linux.py index 119f13605..2dfe72ac7 100644 --- a/buildstream/_platform/linux.py +++ b/buildstream/_platform/linux.py @@ -22,7 +22,6 @@ import subprocess from .. import _site from .. import utils -from .._artifactcache.cascache import CASCache from .._message import Message, MessageType from ..sandbox import SandboxBwrap @@ -40,11 +39,6 @@ class Linux(Platform): self._die_with_parent_available = _site.check_bwrap_version(0, 1, 8) self._user_ns_available = self._check_user_ns_available() - self._artifact_cache = CASCache(context) - - @property - def artifactcache(self): - return self._artifact_cache def create_sandbox(self, *args, **kwargs): # Inform the bubblewrap sandbox as to whether it can use user namespaces or not diff --git a/buildstream/_platform/platform.py b/buildstream/_platform/platform.py index 8dcfe95e5..153ff34c4 100644 --- a/buildstream/_platform/platform.py +++ b/buildstream/_platform/platform.py @@ -29,8 +29,7 @@ class Platform(): # Platform() # # A class to manage platform-specific details. Currently holds the - # sandbox factory, the artifact cache and staging operations, as - # well as platform helpers. + # sandbox factory as well as platform helpers. # # Args: # context (context): The project context @@ -71,8 +70,7 @@ class Platform(): ################################################################## @property def artifactcache(self): - raise ImplError("Platform {platform} does not implement an artifactcache" - .format(platform=type(self).__name__)) + return self.context.artifactcache ################################################################## # Sandbox functions # diff --git a/buildstream/_platform/unix.py b/buildstream/_platform/unix.py index e356fc89c..3bd86e0ac 100644 --- a/buildstream/_platform/unix.py +++ b/buildstream/_platform/unix.py @@ -19,7 +19,6 @@ import os -from .._artifactcache.cascache import CASCache from .._exceptions import PlatformError from ..sandbox import SandboxChroot @@ -31,7 +30,6 @@ class Unix(Platform): def __init__(self, context): super().__init__(context) - self._artifact_cache = CASCache(context) self._uid = os.geteuid() self._gid = os.getegid() @@ -40,10 +38,6 @@ class Unix(Platform): if self._uid != 0: raise PlatformError("Root privileges are required to run without bubblewrap.") - @property - def artifactcache(self): - return self._artifact_cache - def create_sandbox(self, *args, **kwargs): return SandboxChroot(*args, **kwargs) |