From ebde9a267486fc2573eeb4d17f8f8e9c4099a132 Mon Sep 17 00:00:00 2001 From: Svilen Kanev Date: Tue, 26 Apr 2016 14:38:44 +0000 Subject: 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 --- .../google/devtools/build/lib/rules/cpp/FdoSupport.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupport.java') 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 gcdaFilesBuilder = ImmutableSet.builder(); ImmutableMultimap.Builder importsBuilder = -- cgit v1.2.3