From 4344d7693dce5b9cd47e499b4dfcccdd79b494c3 Mon Sep 17 00:00:00 2001 From: Lukacs Berki Date: Tue, 5 Apr 2016 08:03:37 +0000 Subject: Add the preinclude files to the mandatory input list of C++ compile actions. Then less special-casing is needed and these files are always read by the compiler anyway, so we don't lose any incrementality. -- MOS_MIGRATED_REVID=119023956 --- .../devtools/build/lib/rules/cpp/CppCompileAction.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java') 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 abbd13aecc..2a18617710 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 @@ -238,7 +238,8 @@ public class CppCompileAction extends AbstractAction implements IncludeScannable boolean usePic, RuleContext ruleContext) { super(owner, - createInputs(mandatoryInputs, context.getCompilationPrerequisites(), optionalSourceFile), + createInputs(ruleContext, + mandatoryInputs, context.getCompilationPrerequisites(), optionalSourceFile), CollectionUtils.asListWithoutNulls(outputFile, (dotdFile == null ? null : dotdFile.artifact()), gcnoFile, dwoFile)); @@ -312,13 +313,16 @@ public class CppCompileAction extends AbstractAction implements IncludeScannable } private static NestedSet createInputs( + RuleContext ruleContext, NestedSet mandatoryInputs, - Set prerequisites, Artifact optionalSourceFile) { + Set prerequisites, + Artifact optionalSourceFile) { NestedSetBuilder builder = NestedSetBuilder.stableOrder(); if (optionalSourceFile != null) { builder.add(optionalSourceFile); } builder.addAll(prerequisites); + builder.addAll(CppHelper.getToolchain(ruleContext).getBuiltinIncludeFiles()); builder.addTransitive(mandatoryInputs); return builder.build(); } @@ -1108,10 +1112,6 @@ public class CppCompileAction extends AbstractAction implements IncludeScannable f.addPaths(getDeclaredIncludeSrcsInStableOrder()); f.addPaths(getExtraSystemIncludePrefixes()); f.addPaths(Artifact.asSortedPathFragments(getMandatoryInputs())); - // I'm not sure if getBuiltInIncludeFiles() is necessary here, since before an action cache hit - // is reported, include scanning needs to be run, and thus the changed set of files would be - // noticed. Better be safe than sorry. - f.addPaths(Artifact.asSortedPathFragments(getBuiltInIncludeFiles())); return f.hexDigestAndReset(); } -- cgit v1.2.3