diff options
author | ulfjack <ulfjack@google.com> | 2017-04-18 20:24:17 +0200 |
---|---|---|
committer | Klaus Aehlig <aehlig@google.com> | 2017-04-19 10:47:20 +0200 |
commit | f4408f6be00667684d000aa97ad4e142b752efa4 (patch) | |
tree | 473954709c468ec2622e3fb33fcd42fb54d2705f /src/main/java | |
parent | 8b715ee304268138cf2725f6049598299cebb9ed (diff) |
Fix RemoteSpawnStrategy to upload stdout/stderr to the remote cache
This is already fixed in the CachedLocalSpawnRunner, with tests there, which
will replace RemoteSpawnStrategy in the near future. For now, I'd like to get
this in in time for 0.5.0 to get test caching working.
Fixes #1413.
PiperOrigin-RevId: 153486592
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java index 0391baddb2..05c9b92d8c 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java +++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java @@ -152,6 +152,15 @@ final class RemoteSpawnStrategy implements SpawnActionContext { try { ActionResult.Builder result = ActionResult.newBuilder(); actionCache.uploadAllResults(execRoot, outputFiles, result); + FileOutErr outErr = actionExecutionContext.getFileOutErr(); + if (outErr.getErrorPath().exists()) { + ContentDigest stderr = actionCache.uploadFileContents(outErr.getErrorPath()); + result.setStderrDigest(stderr); + } + if (outErr.getOutputPath().exists()) { + ContentDigest stdout = actionCache.uploadFileContents(outErr.getOutputPath()); + result.setStdoutDigest(stdout); + } actionCache.setCachedActionResult(actionKey, result.build()); // Handle all cache errors here. } catch (IOException e) { |