diff options
author | 2017-02-10 13:50:01 +0000 | |
---|---|---|
committer | 2017-02-10 15:36:54 +0000 | |
commit | 5a5bd8a06d6aeda3aa1c358d3ad86b87cc52dccf (patch) | |
tree | fd61309b618f7a1738c17f659e43cc9ae040a4f1 /src/main/java/com/google/devtools/build/lib/buildtool | |
parent | ae3ee253136fffe9767829694b45ec07e676b502 (diff) |
Rollback of commit 49d97f9bb4dd04ef62198ded7b53b2a8f8c603db.
*** Reason for rollback ***
--
PiperOrigin-RevId: 147146321
MOS_MIGRATED_REVID=147146321
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/buildtool')
3 files changed, 20 insertions, 21 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/BuildResultPrinter.java b/src/main/java/com/google/devtools/build/lib/buildtool/BuildResultPrinter.java index c8d79b0b4d..8ef4a38ec9 100644 --- a/src/main/java/com/google/devtools/build/lib/buildtool/BuildResultPrinter.java +++ b/src/main/java/com/google/devtools/build/lib/buildtool/BuildResultPrinter.java @@ -138,7 +138,8 @@ class BuildResultPrinter { + OutputDirectoryLinksUtils.getPrettyPath(temp.getPath(), env.getWorkspaceName(), env.getWorkspace(), - request.getBuildOptions().getSymlinkPrefix(productName))); + request.getBuildOptions().getSymlinkPrefix(productName), + productName)); } } } @@ -156,7 +157,7 @@ class BuildResultPrinter { String productName = env.getRuntime().getProductName(); return " " + OutputDirectoryLinksUtils.getPrettyPath(artifact.getPath(), env.getWorkspaceName(), env.getWorkspace(), - request.getBuildOptions().getSymlinkPrefix(productName)); + request.getBuildOptions().getSymlinkPrefix(productName), productName); } /** diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java index 971800b600..48bc11c8d9 100644 --- a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java +++ b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java @@ -352,16 +352,13 @@ public class ExecutionTool { BuildConfiguration targetConfiguration = targetConfigurations.size() == 1 ? targetConfigurations.get(0) : null; if (targetConfigurations.size() == 1) { + String productName = runtime.getProductName(); String dirName = env.getWorkspaceName(); String workspaceName = analysisResult.getWorkspaceName(); OutputDirectoryLinksUtils.createOutputDirectoryLinks( - dirName, - env.getWorkspace(), - env.getDirectories().getExecRoot(workspaceName), - env.getDirectories().getOutputPath(workspaceName), - getReporter(), - targetConfiguration, - request.getBuildOptions().getSymlinkPrefix(runtime.getProductName())); + dirName, env.getWorkspace(), env.getDirectories().getExecRoot(workspaceName), + env.getDirectories().getOutputPath(workspaceName), getReporter(), targetConfiguration, + request.getBuildOptions().getSymlinkPrefix(productName), productName); } ActionCache actionCache = getActionCache(); 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 5ee110e688..ae085ed2bf 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 @@ -38,12 +38,12 @@ public class OutputDirectoryLinksUtils { private static final String NO_CREATE_SYMLINKS_PREFIX = "/"; - public static String getOutputSymlinkName(String symlinkPrefix) { - return symlinkPrefix + "out"; + public static String getOutputSymlinkName(String productName) { + return productName + "-out"; } - private static String execRootSymlink(String symlinkPrefix, String workspaceName) { - return symlinkPrefix + workspaceName; + private static String execRootSymlink(String productName, String workspaceName) { + return productName + "-" + workspaceName; } /** * Attempts to create convenience symlinks in the workspaceDirectory and in @@ -53,7 +53,8 @@ public class OutputDirectoryLinksUtils { */ static void createOutputDirectoryLinks(String workspaceName, Path workspace, Path execRoot, Path outputPath, - EventHandler eventHandler, @Nullable BuildConfiguration targetConfig, String symlinkPrefix) { + EventHandler eventHandler, @Nullable BuildConfiguration targetConfig, + String symlinkPrefix, String productName) { if (NO_CREATE_SYMLINKS_PREFIX.equals(symlinkPrefix)) { return; } @@ -62,10 +63,10 @@ public class OutputDirectoryLinksUtils { // Make the two non-specific links from the workspace to the output area, // and the configuration-specific links in both the workspace and the execution root dirs. // NB! Keep in sync with removeOutputDirectoryLinks below. - createLink(workspace, getOutputSymlinkName(symlinkPrefix), outputPath, failures); + createLink(workspace, getOutputSymlinkName(productName), outputPath, failures); // Points to execroot - createLink(workspace, execRootSymlink(symlinkPrefix, workspaceName), execRoot, failures); + createLink(workspace, execRootSymlink(productName, workspaceName), execRoot, failures); if (targetConfig != null) { createLink(workspace, symlinkPrefix + "bin", @@ -92,7 +93,7 @@ public class OutputDirectoryLinksUtils { * before, the pretty path may be incorrect if the symlinks end up pointing somewhere new. */ public static PathFragment getPrettyPath(Path file, String workspaceName, - Path workspaceDirectory, String symlinkPrefix) { + Path workspaceDirectory, String symlinkPrefix, String productName) { for (String link : LINKS) { PathFragment result = relativize(file, workspaceDirectory, symlinkPrefix + link); if (result != null) { @@ -101,12 +102,12 @@ public class OutputDirectoryLinksUtils { } PathFragment result = relativize(file, workspaceDirectory, - execRootSymlink(symlinkPrefix, workspaceName)); + execRootSymlink(productName, workspaceName)); if (result != null) { return result; } - result = relativize(file, workspaceDirectory, getOutputSymlinkName(symlinkPrefix)); + result = relativize(file, workspaceDirectory, getOutputSymlinkName(productName)); if (result != null) { return result; } @@ -149,8 +150,8 @@ public class OutputDirectoryLinksUtils { } List<String> failures = new ArrayList<>(); - removeLink(workspace, getOutputSymlinkName(symlinkPrefix), failures); - removeLink(workspace, execRootSymlink(symlinkPrefix, workspaceName), failures); + removeLink(workspace, getOutputSymlinkName(productName), failures); + removeLink(workspace, execRootSymlink(productName, workspaceName), failures); removeLink(workspace, symlinkPrefix + "bin", failures); removeLink(workspace, symlinkPrefix + "testlogs", failures); removeLink(workspace, symlinkPrefix + "genfiles", failures); |