aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar laszlocsomor <laszlocsomor@google.com>2018-01-12 07:32:13 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-01-12 08:22:04 -0800
commite5436745e1732f5e43fc55f0deb5b19e23ce8524 (patch)
treefe8477b018b15548e18187e8a786f0a09b901590
parentd90a0054b902c771a80efcbcfabde7e34db6fafd (diff)
windows: fix --symlink_prefix=/ throwing exception
Fixes https://github.com/bazelbuild/bazel/issues/4421 RELNOTES: none PiperOrigin-RevId: 181742216
-rw-r--r--src/main/java/com/google/devtools/build/lib/buildtool/OutputDirectoryLinksUtils.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/OutputDirectoryLinksUtils.java b/src/main/java/com/google/devtools/build/lib/buildtool/OutputDirectoryLinksUtils.java
index 7211b916db..5c16e7941f 100644
--- a/src/main/java/com/google/devtools/build/lib/buildtool/OutputDirectoryLinksUtils.java
+++ b/src/main/java/com/google/devtools/build/lib/buildtool/OutputDirectoryLinksUtils.java
@@ -154,6 +154,10 @@ public class OutputDirectoryLinksUtils {
*/
public static PathFragment getPrettyPath(Path file, String workspaceName,
Path workspaceDirectory, String symlinkPrefix, String productName) {
+ if (NO_CREATE_SYMLINKS_PREFIX.equals(symlinkPrefix)) {
+ return file.asFragment();
+ }
+
for (String link : LINKS) {
PathFragment result = relativize(file, workspaceDirectory, symlinkPrefix + link);
if (result != null) {