summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-03-02 11:29:39 +0100
committerJürg Billeter <j@bitron.ch>2019-03-06 11:30:51 +0100
commit6df7d7b8a32ee2b67bcf4dbbe0802317b0b54e70 (patch)
tree27aadb621e948289cd432b67df872e80b73cddfb
parent9dbc2e887f2607a43d7edaa2856c89db9033cb25 (diff)
downloadbuildstream-6df7d7b8a32ee2b67bcf4dbbe0802317b0b54e70.tar.gz
_sandboxremote.py: Request the whole directory tree as output
process_job_output() currently expects the whole directory tree as output. Match this in the request by asking for the whole directory tree.
-rw-r--r--buildstream/sandbox/_sandboxremote.py17
1 files changed, 5 insertions, 12 deletions
diff --git a/buildstream/sandbox/_sandboxremote.py b/buildstream/sandbox/_sandboxremote.py
index bd9f4633b..9e58b095a 100644
--- a/buildstream/sandbox/_sandboxremote.py
+++ b/buildstream/sandbox/_sandboxremote.py
@@ -283,17 +283,6 @@ class SandboxRemote(Sandbox):
if dir_digest is None or not dir_digest.hash or not dir_digest.size_bytes:
raise SandboxError("Output directory structure pulling from remote failed.")
- path_components = os.path.split(self._output_directory)
-
- # Now what we have is a digest for the output. Once we return, the calling process will
- # attempt to descend into our directory and find that directory, so we need to overwrite
- # that.
-
- if not path_components:
- # The artifact wants the whole directory; we could just return the returned hash in its
- # place, but we don't have a means to do that yet.
- raise SandboxError("Unimplemented: Output directory is empty or equal to the sandbox root.")
-
# At the moment, we will get the whole directory back in the first directory argument and we need
# to replace the sandbox's virtual directory with that. Creating a new virtual directory object
# from another hash will be interesting, though...
@@ -413,11 +402,15 @@ class SandboxRemote(Sandbox):
environment_variables = [remote_execution_pb2.Command.
EnvironmentVariable(name=k, value=v)
for (k, v) in environment.items()]
+
+ # Request the whole directory tree as output
+ output_directory = os.path.relpath(os.path.sep, start=working_directory)
+
return remote_execution_pb2.Command(arguments=command,
working_directory=working_directory,
environment_variables=environment_variables,
output_files=[],
- output_directories=[self._output_directory],
+ output_directories=[output_directory],
platform=None)
@staticmethod