diff options
-rw-r--r-- | src/buildstream/sandbox/_sandboxremote.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/buildstream/sandbox/_sandboxremote.py b/src/buildstream/sandbox/_sandboxremote.py index fe7812ba5..3dcbb2ccc 100644 --- a/src/buildstream/sandbox/_sandboxremote.py +++ b/src/buildstream/sandbox/_sandboxremote.py @@ -19,6 +19,7 @@ # Jim MacArthur <jim.macarthur@codethink.co.uk> import os +import shutil from collections import namedtuple from urllib.parse import urlparse from functools import partial @@ -377,12 +378,21 @@ class SandboxRemote(SandboxREAPI): # Now do a pull to ensure we have the full directory structure. cascache.pull_tree(casremote, tree_digest) + # Fetch stdout and stderr blobs + cascache.fetch_blobs(casremote, [action_result.stdout_digest, action_result.stderr_digest]) + # Forward remote stdout and stderr if stdout: - if action_result.stdout_raw: + if action_result.stdout_digest.hash: + with open(cascache.objpath(action_result.stdout_digest), "r") as f: + shutil.copyfileobj(f, stdout) + elif action_result.stdout_raw: stdout.write(str(action_result.stdout_raw, "utf-8", errors="ignore")) if stderr: - if action_result.stderr_raw: + if action_result.stderr_digest.hash: + with open(cascache.objpath(action_result.stderr_digest), "r") as f: + shutil.copyfileobj(f, stderr) + elif action_result.stderr_raw: stderr.write(str(action_result.stderr_raw, "utf-8", errors="ignore")) return action_result |