summaryrefslogtreecommitdiff
path: root/buildstream
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-03-02 11:29:39 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-03-08 14:55:39 +0000
commit213310e3e1890859ba5c93b15c8bdbfcafb86cd4 (patch)
treead1905127399a58c17de378cc6f81fec319dd950 /buildstream
parentf96d93c6f150e904ee2bfad7f1938cfcdc5e7112 (diff)
downloadbuildstream-213310e3e1890859ba5c93b15c8bdbfcafb86cd4.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.
Diffstat (limited to 'buildstream')
-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