diff options
author | Laurent Le Brun <laurentlb@google.com> | 2016-06-17 13:36:24 +0000 |
---|---|---|
committer | Philipp Wollermann <philwo@google.com> | 2016-06-20 09:34:06 +0000 |
commit | f3cf98faa44f3b647956868422a11074aff0e9ee (patch) | |
tree | 93a361a853b3ebccd0af7074c993c29618ddf0e4 /src/main/java/com/google/devtools/build/lib/rules/cpp | |
parent | 48f2470b3cc60c11e46a95872a409341c4224096 (diff) |
Rollback of commit bdfd58a8ca2ed5735d6aaa5b238fb0f689515724.
--
MOS_MIGRATED_REVID=125160288
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java | 7 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java | 7 |
2 files changed, 3 insertions, 11 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java index fb1ca8c96d..8ccd6e1dea 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java @@ -397,12 +397,9 @@ public final class CcCommon { continue; } PathFragment includesPath = packageFragment.getRelative(includesAttr).normalize(); - // It's okay for the includes path to start with ../workspace-name for external repos. - if ((packageIdentifier.getRepository().isMain() && !includesPath.isNormalized()) - || (!packageIdentifier.getRepository().isMain() - && !includesPath.startsWith(packageIdentifier.getRepository().getPathFragment()))) { + if (!includesPath.isNormalized()) { ruleContext.attributeError("includes", - includesAttr + " references a path above the execution root (" + includesPath + ")."); + "Path references a path above the execution root."); } if (includesPath.segmentCount() == 0) { ruleContext.attributeError( diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java index bb2149e004..5d273fe816 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java @@ -947,12 +947,7 @@ public class CppCompileAction extends AbstractAction // are, it's probably due to a non-hermetic #include, & we should stop // the build with an error. if (execPath.startsWith(execRoot)) { - // funky but tolerable path - execPathFragment = execPath.relativeTo(execRoot); - } else if (execPath.startsWith(execRoot.getParentDirectory())) { - // External repository. - execPathFragment = new PathFragment("..") - .getRelative(execPath.relativeTo(execRoot.getParentDirectory())); + execPathFragment = execPath.relativeTo(execRoot); // funky but tolerable path } else { problems.add(execPathFragment.getPathString()); continue; |