aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java12
1 files changed, 12 insertions, 0 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 b4ded0ef29..851aaf25a9 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
@@ -408,6 +408,18 @@ public final class CcCommon {
ruleContext.attributeError("includes",
"Path references a path above the execution root.");
}
+ if (!includesPath.startsWith(packageFragment)) {
+ ruleContext.attributeWarning(
+ "includes",
+ "'"
+ + includesAttr
+ + "' resolves to '"
+ + includesPath
+ + "' not below the relative path of its package '"
+ + packageFragment
+ + "'. This will be an error in the future");
+ // TODO(janakr): Add a link to a page explaining the problem and fixes?
+ }
result.add(includesPath);
result.add(ruleContext.getConfiguration().getGenfilesFragment().getRelative(includesPath));
}