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-05 11:52:08 +0000
commit7bbcf7fd53bfdabd62394e551f022893b6c2350b (patch)
treeb10413e1c0d9ff2c9f4dcecf52ca6f7a06fb1f23
parent4d486b6e7af9a0c2546256e1c871eb35bb4ef8d1 (diff)
downloadbuildstream-7bbcf7fd53bfdabd62394e551f022893b6c2350b.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)