Skip to content

Commit

Permalink
Fix RemoteSpawnStrategy to upload stdout/stderr to the remote cache
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ulfjack authored and aehlig committed Apr 19, 2017
1 parent 8b715ee commit f4408f6
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ private void execLocally(
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) {
Expand Down

0 comments on commit f4408f6

Please sign in to comment.