diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java index e258594981f804..a2cf4ae1597505 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java +++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java @@ -222,6 +222,7 @@ static Command buildCommand( Command.Builder command = Command.newBuilder(); ArrayList outputFiles = new ArrayList<>(); ArrayList outputDirectories = new ArrayList<>(); + ArrayList outputPaths = new ArrayList<>(); for (ActionInput output : outputs) { String pathString = decodeBytestringUtf8(remotePathResolver.localPathToOutputPath(output)); if (output.isDirectory()) { @@ -229,11 +230,14 @@ static Command buildCommand( } else { outputFiles.add(pathString); } + outputPaths.add(pathString); } Collections.sort(outputFiles); Collections.sort(outputDirectories); + Collections.sort(outputPaths); command.addAllOutputFiles(outputFiles); command.addAllOutputDirectories(outputDirectories); + command.addAllOutputPaths(outputPaths); if (platform != null) { command.setPlatform(platform); diff --git a/src/test/java/com/google/devtools/build/lib/remote/RemoteExecutionServiceTest.java b/src/test/java/com/google/devtools/build/lib/remote/RemoteExecutionServiceTest.java index 793020b9ced4b4..8b17b1433feaff 100644 --- a/src/test/java/com/google/devtools/build/lib/remote/RemoteExecutionServiceTest.java +++ b/src/test/java/com/google/devtools/build/lib/remote/RemoteExecutionServiceTest.java @@ -191,6 +191,7 @@ public void buildRemoteAction_withRegularFileAsOutput() throws Exception { RemoteAction remoteAction = service.buildRemoteAction(spawn, context); assertThat(remoteAction.getCommand().getOutputFilesList()).containsExactly(execPath.toString()); + assertThat(remoteAction.getCommand().getOutputPathsList()).containsExactly(execPath.toString()); assertThat(remoteAction.getCommand().getOutputDirectoriesList()).isEmpty(); } @@ -226,6 +227,7 @@ public void buildRemoteAction_withUnresolvedSymlinkAsOutput() throws Exception { assertThat(remoteAction.getCommand().getOutputFilesList()).containsExactly("path/to/link"); assertThat(remoteAction.getCommand().getOutputDirectoriesList()).isEmpty(); + assertThat(remoteAction.getCommand().getOutputPathsList()).containsExactly("path/to/link"); } @Test diff --git a/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnRunnerWithGrpcRemoteExecutorTest.java b/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnRunnerWithGrpcRemoteExecutorTest.java index 8c3c003826eca3..7ec09f6218da8b 100644 --- a/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnRunnerWithGrpcRemoteExecutorTest.java +++ b/src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnRunnerWithGrpcRemoteExecutorTest.java @@ -350,6 +350,7 @@ public int maxConcurrency() { .setValue("value") .build()) .addAllOutputFiles(ImmutableList.of("bar", "foo")) + .addAllOutputPaths(ImmutableList.of("bar", "foo")) .build(); cmdDigest = DIGEST_UTIL.compute(command); channel.release();