Only call filterDiscoveredHeaders() if include scanning is in effect.
This is a step towards making CppCompileAction work without input discovery.
This works because:
filterDiscoveredHeaders() is not necessary if we don't discover any
shouldPruneModules is always false if `shouldScanIncludes` is false (see CppCompileActionBuilder#shouldPruneModules())
RELNOTES: None.
@@ -437,9 +437,14 @@ public class CppCompileAction extends AbstractAction
public Iterable<Artifact> discoverInputs(ActionExecutionContext actionExecutionContext)
throws ActionExecutionException, InterruptedException {
additionalInputs = findUsedHeaders(actionExecutionContext);
+ if (!shouldScanIncludes) {
+ return additionalInputs;
+ }
+
if (!shouldScanDotdFiles()) {
additionalInputs = filterDiscoveredHeaders(actionExecutionContext, additionalInputs);
}
+
if (!shouldPruneModules) {
return additionalInputs;
}
