diff options
author | Jürg Billeter <j@bitron.ch> | 2020-02-11 19:12:13 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2020-06-03 13:49:39 +0200 |
commit | b487a11f6ee529c9cba505106d054c92c16e864c (patch) | |
tree | 714a62624ea172bfe234bce525866ad7acdf5c81 | |
parent | 316e65807cb80b4c8ad2067e20477e2745838eff (diff) | |
download | buildstream-b487a11f6ee529c9cba505106d054c92c16e864c.tar.gz |
sandbox: Drop _use_cas_based_directory()
It is always true.
-rw-r--r-- | src/buildstream/sandbox/_sandboxreapi.py | 4 | ||||
-rw-r--r-- | src/buildstream/sandbox/sandbox.py | 24 |
2 files changed, 2 insertions, 26 deletions
diff --git a/src/buildstream/sandbox/_sandboxreapi.py b/src/buildstream/sandbox/_sandboxreapi.py index 43d00a357..5c2851580 100644 --- a/src/buildstream/sandbox/_sandboxreapi.py +++ b/src/buildstream/sandbox/_sandboxreapi.py @@ -34,10 +34,6 @@ class SandboxREAPI(Sandbox): self._output_node_properties = kwargs.get("output_node_properties") - def _use_cas_based_directory(self): - # Always use CasBasedDirectory for REAPI - return True - def _run(self, command, flags, *, cwd, env): context = self._get_context() cascache = context.get_cascache() diff --git a/src/buildstream/sandbox/sandbox.py b/src/buildstream/sandbox/sandbox.py index fc8e4f1d0..d82e86061 100644 --- a/src/buildstream/sandbox/sandbox.py +++ b/src/buildstream/sandbox/sandbox.py @@ -38,7 +38,6 @@ from typing import Dict, Generator, List, Optional, TYPE_CHECKING from .._exceptions import ImplError, BstError, SandboxError from .._message import Message, MessageType from ..storage.directory import Directory -from ..storage._filebaseddirectory import FileBasedDirectory from ..storage._casbaseddirectory import CasBasedDirectory if TYPE_CHECKING: @@ -167,11 +166,8 @@ class Sandbox: """ if self._vdir is None: - if self._use_cas_based_directory(): - cascache = self.__context.get_cascache() - self._vdir = CasBasedDirectory(cascache) - else: - self._vdir = FileBasedDirectory(self._root) + cascache = self.__context.get_cascache() + self._vdir = CasBasedDirectory(cascache) return self._vdir def set_environment(self, environment: Dict[str, str]) -> None: @@ -363,22 +359,6 @@ class Sandbox: def _create_batch(self, main_group, flags, *, collect=None): return _SandboxBatch(self, main_group, flags, collect=collect) - # _use_cas_based_directory() - # - # Whether to use CasBasedDirectory as sandbox root. If this returns `False`, - # FileBasedDirectory will be used. - # - # Returns: - # (bool): Whether to use CasBasedDirectory - # - def _use_cas_based_directory(self): - # Use CasBasedDirectory as sandbox root if Sandbox.run() is not used. - # This allows faster staging. - if not self.__allow_run: - return True - - return "BST_CAS_DIRECTORIES" in os.environ - # _fetch_missing_blobs() # # Fetch required file blobs missing from the local cache for sandboxes using |