summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-12-04 18:02:56 +0100
committerJürg Billeter <j@bitron.ch>2019-12-04 19:22:05 +0100
commit7315a414d14da0198392e130fa7042d29011e2de (patch)
treeb6749430d910faef197d6933572d93570d98172b
parent272a2063b889014c4f6e28c5aa8c8a3de3507e48 (diff)
downloadbuildstream-7315a414d14da0198392e130fa7042d29011e2de.tar.gz
_sandboxreapi.py: Use CasBasedDirectory._reset()
Calling _reset() instead of completely replacing the object fixes element plugins that use a virtual directory object across Sandbox.run() calls such as the compose plugin with integration commands.
-rw-r--r--src/buildstream/sandbox/_sandboxreapi.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/buildstream/sandbox/_sandboxreapi.py b/src/buildstream/sandbox/_sandboxreapi.py
index d2cd1b3bc..834cdd8e0 100644
--- a/src/buildstream/sandbox/_sandboxreapi.py
+++ b/src/buildstream/sandbox/_sandboxreapi.py
@@ -21,7 +21,6 @@ from .sandbox import Sandbox, SandboxCommandError, _SandboxBatch
from .. import utils
from .._exceptions import ImplError, SandboxError
from .._protos.build.bazel.remote.execution.v2 import remote_execution_pb2
-from ..storage._casbaseddirectory import CasBasedDirectory
# SandboxREAPI()
@@ -143,8 +142,8 @@ class SandboxREAPI(Sandbox):
# to replace the sandbox's virtual directory with that. Creating a new virtual directory object
# from another hash will be interesting, though...
- new_dir = CasBasedDirectory(cascache, digest=dir_digest)
- self._set_virtual_directory(new_dir)
+ vdir = self.get_virtual_directory()
+ vdir._reset(digest=dir_digest)
def _create_batch(self, main_group, flags, *, collect=None):
return _SandboxREAPIBatch(self, main_group, flags, collect=collect)