diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java | 7 |
1 files changed, 6 insertions, 1 deletions
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 5d273fe816..bb2149e004 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,7 +947,12 @@ 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)) { - execPathFragment = execPath.relativeTo(execRoot); // funky but tolerable path + // funky but tolerable path + execPathFragment = execPath.relativeTo(execRoot); + } else if (execPath.startsWith(execRoot.getParentDirectory())) { + // External repository. + execPathFragment = new PathFragment("..") + .getRelative(execPath.relativeTo(execRoot.getParentDirectory())); } else { problems.add(execPathFragment.getPathString()); continue; |