Skip to content

Commit bc0ddbb

Browse files
committed
RemoteExecutionService: Action.Command to set output_paths
This is a follow-up to #18198 Make Bazel compatible with newer version of Remote Api by setting output_paths along-side output_directories and output_files. The latter 2 are deprecated in newer REAPI specification.
1 parent 429ffd5 commit bc0ddbb

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@ static Command buildCommand(
236236
Collections.sort(outputFiles);
237237
Collections.sort(outputDirectories);
238238
command.addAllOutputFiles(outputFiles);
239+
command.addAllOutputPaths(outputFiles);
239240
command.addAllOutputDirectories(outputDirectories);
241+
command.addAllOutputPaths(outputDirectories);
240242

241243
if (platform != null) {
242244
command.setPlatform(platform);

src/test/java/com/google/devtools/build/lib/remote/RemoteExecutionServiceTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ public void buildRemoteAction_withRegularFileAsOutput() throws Exception {
193193
RemoteAction remoteAction = service.buildRemoteAction(spawn, context);
194194

195195
assertThat(remoteAction.getCommand().getOutputFilesList()).containsExactly(execPath.toString());
196+
assertThat(remoteAction.getCommand().getOutputPathsList()).containsExactly(execPath.toString());
196197
assertThat(remoteAction.getCommand().getOutputDirectoriesList()).isEmpty();
197198
}
198199

@@ -228,6 +229,7 @@ public void buildRemoteAction_withUnresolvedSymlinkAsOutput() throws Exception {
228229

229230
assertThat(remoteAction.getCommand().getOutputFilesList()).containsExactly("path/to/link");
230231
assertThat(remoteAction.getCommand().getOutputDirectoriesList()).isEmpty();
232+
assertThat(remoteAction.getCommand().getOutputPathsList()).containsExactly("path/to/link");
231233
}
232234

233235
@Test

src/test/java/com/google/devtools/build/lib/remote/RemoteSpawnRunnerWithGrpcRemoteExecutorTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ public int maxConcurrency() {
342342
.setValue("value")
343343
.build())
344344
.addAllOutputFiles(ImmutableList.of("bar", "foo"))
345+
.addAllOutputPaths(ImmutableList.of("bar", "foo"))
345346
.build();
346347
cmdDigest = DIGEST_UTIL.compute(command);
347348
channel.release();

0 commit comments

Comments
 (0)