Commit f90e1ce1 authored by Daniel Silverstone's avatar Daniel Silverstone
Browse files

sandbox/_sandboxremote.py: Acquire CASCache via Platform



The SandboxRemote used to construct its own CASCache which was
considered dangerous.  This patch replaces that with acquisition of
the cache via the Platform singleton, hopefully eliminating issues
from having more than one artifact cache object in a single process.

Signed-off-by: default avatarDaniel Silverstone <daniel.silverstone@codethink.co.uk>
parent 345f5f49
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ from . import Sandbox
from ..storage._filebaseddirectory import FileBasedDirectory
from ..storage._casbaseddirectory import CasBasedDirectory
from .._protos.build.bazel.remote.execution.v2 import remote_execution_pb2, remote_execution_pb2_grpc
from .._artifactcache.cascache import CASCache
from .._platform import Platform


class SandboxError(Exception):
@@ -58,7 +58,7 @@ class SandboxRemote(Sandbox):

    def _get_cascache(self):
        if self.cascache is None:
            self.cascache = CASCache(self._get_context())
            self.cascache = Platform.get_platform().artifactcache
            self.cascache.setup_remotes(use_config=True)
        return self.cascache