Skip to content

Commit

Permalink
RemoteExecutionService: Action.Command to set output_paths
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sluongng committed Apr 27, 2023
1 parent e842fd5 commit 7dfb5b9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ static Command buildCommand(
Collections.sort(outputFiles);
Collections.sort(outputDirectories);
command.addAllOutputFiles(outputFiles);
command.addAllOutputPaths(outputFiles);
command.addAllOutputDirectories(outputDirectories);
command.addAllOutputPaths(outputDirectories);

if (platform != null) {
command.setPlatform(platform);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,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();
}

Expand Down Expand Up @@ -228,6 +229,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,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();
Expand Down

0 comments on commit 7dfb5b9

Please sign in to comment.