Skip to content

Commit 519eef4

Browse files
fmeumcopybara-github
authored andcommitted
Fix crash on multiple output symlinks with BwoB
Fixes an issue introduced by ca30372. Fixes bazel-contrib/rules_go#3545 Closes bazelbuild#18207. PiperOrigin-RevId: 527160752 Change-Id: I8baa3b8f855e22226ba83155e56fd9889a1f2051
1 parent a92ce14 commit 519eef4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ private boolean shouldDownloadOutputsFor(
13081308
String.format(
13091309
"Symlinks in action outputs are not yet supported by --remote_download_minimal,"
13101310
+ " falling back to downloading all action outputs due to output symlink %s",
1311-
Iterables.getOnlyElement(metadata.symlinks()).path())));
1311+
Iterables.get(metadata.symlinks(), 0).path())));
13121312
return true;
13131313
}
13141314
return false;

src/test/shell/bazel/remote/build_without_the_bytes_test.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,8 @@ EOF
418418
genrule(
419419
name = "foo",
420420
srcs = ["input.txt"],
421-
outs = ["output.txt", "output_symlink"],
422-
cmd = "cp $< $(location :output.txt) && ln -s output.txt $(location output_symlink)",
421+
outs = ["output.txt", "output_symlink", "output_symlink_2"],
422+
cmd = "cp $< $(location :output.txt) && ln -s output.txt $(location output_symlink) && ln -s output.txt $(location output_symlink_2)",
423423
)
424424
EOF
425425

0 commit comments

Comments
 (0)