diff options
author | Svilen Kanev <svilen.kanev@gmail.com> | 2016-04-26 14:38:44 +0000 |
---|---|---|
committer | Yun Peng <pcloudy@google.com> | 2016-04-27 11:46:06 +0000 |
commit | ebde9a267486fc2573eeb4d17f8f8e9c4099a132 (patch) | |
tree | a4526803c360dfd18949349616719c2ef9bc46e6 /src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupport.java | |
parent | 0ba25552dc4a640c2616394975dca9aaa724fb92 (diff) |
cpp fdo: Use correct PRODUCT_NAME for path when extracting a profile.
Profiles with a root 'blaze-fdo' didn't get correctly symlinked to execRoot/_fdo in bazel.
TESTED=./compile.sh all; +manual FDO builds.
--
Change-Id: I5cd69970523db4de15d5b6ddf7af4a072bbca0f5
Reviewed-on: https://bazel-review.googlesource.com/#/c/3490/
MOS_MIGRATED_REVID=120811529
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupport.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupport.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupport.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupport.java index 18f2cf18df..545619e4dc 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupport.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupport.java @@ -20,6 +20,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; +import com.google.devtools.build.lib.Constants; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.actions.Root; import com.google.devtools.build.lib.analysis.AnalysisEnvironment; @@ -253,9 +254,10 @@ public class FdoSupport { lipoMode = LipoMode.OFF; } - Root fdoRoot = (fdoProfile == null) - ? null - : Root.asDerivedRoot(execRoot, execRoot.getRelative("blaze-fdo")); + Root fdoRoot = + (fdoProfile == null) + ? null + : Root.asDerivedRoot(execRoot, execRoot.getRelative(Constants.PRODUCT_NAME + "-fdo")); PathFragment fdoRootExecPath = fdoProfile == null ? null @@ -331,9 +333,12 @@ public class FdoSupport { execRoot.getRelative(getLLVMProfilePath(fdoProfile, fdoRootExecPath)), fdoProfile); } else { Path zipFilePath = new ZipFileSystem(fdoProfile).getRootDirectory(); - if (!zipFilePath.getRelative("blaze-out").isDirectory()) { - throw new ZipException("FDO zip files must be zipped directly above 'blaze-out' " + - "for the compiler to find the profile"); + String outputSymlinkName = Constants.PRODUCT_NAME + "-out"; + if (!zipFilePath.getRelative(outputSymlinkName).isDirectory()) { + throw new ZipException( + "FDO zip files must be zipped directly above '" + + outputSymlinkName + + "' for the compiler to find the profile"); } ImmutableSet.Builder<PathFragment> gcdaFilesBuilder = ImmutableSet.builder(); ImmutableMultimap.Builder<PathFragment, PathFragment> importsBuilder = |