diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules')
3 files changed, 13 insertions, 28 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 ed88bebca5..150eced0fd 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 @@ -526,14 +526,21 @@ public class CppCompileAction extends AbstractAction } if (initialResult == null) { - // We will find inputs during execution. Store an empty list to show we did try to discover - // inputs and return null to inform the caller that inputs will be discovered later. - this.additionalInputs = ImmutableList.of(); - return null; + NestedSetBuilder<Artifact> result = NestedSetBuilder.stableOrder(); + if (useHeaderModules) { + // Here, we cannot really know what the top-level modules are, so we just mark all + // transitive modules as "top level". + topLevelModules = Sets.newLinkedHashSet(context.getTransitiveModules(usePic) + .toCollection()); + result.addTransitive(context.getTransitiveModules(usePic)); + } + result.addTransitive(includesExemptFromDiscovery); + additionalInputs = result.build(); + return result.build(); } Set<Artifact> initialResultSet = Sets.newLinkedHashSet(initialResult); - Iterables.addAll(initialResultSet, includesExemptFromDiscovery); + if (shouldPruneModules) { usedModules = Sets.newLinkedHashSet(); topLevelModules = null; @@ -609,20 +616,6 @@ public class CppCompileAction extends AbstractAction } @Override - public Iterable<Artifact> getInputsWhenSkippingInputDiscovery() { - NestedSetBuilder<Artifact> result = NestedSetBuilder.stableOrder(); - if (useHeaderModules) { - // Here, we cannot really know what the top-level modules are, so we just mark all - // transitive modules as "top level". - topLevelModules = Sets.newLinkedHashSet(context.getTransitiveModules(usePic).toCollection()); - result.addTransitive(context.getTransitiveModules(usePic)); - } - result.addTransitive(includesExemptFromDiscovery); - additionalInputs = result.build(); - return result.build(); - } - - @Override public Artifact getPrimaryInput() { return getSourceFile(); } diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java index 5d513a516d..886da30f05 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java @@ -30,7 +30,6 @@ import com.google.devtools.build.lib.analysis.config.BuildConfiguration; import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.collect.nestedset.NestedSet; import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; -import com.google.devtools.build.lib.collect.nestedset.Order; import com.google.devtools.build.lib.rules.cpp.CcToolchainFeatures.FeatureConfiguration; import com.google.devtools.build.lib.rules.cpp.CppCompileAction.DotdFile; import com.google.devtools.build.lib.rules.cpp.CppCompileAction.SpecialInputsHandler; @@ -282,9 +281,7 @@ public class CppCompileActionBuilder { NestedSet<Artifact> realMandatoryInputs = realMandatoryInputsBuilder.build(); - NestedSet<Artifact> includesExemptFromDiscovery = shouldScanIncludes - ? NestedSetBuilder.<Artifact>emptySet(Order.STABLE_ORDER) - : context.getDeclaredIncludeSrcs(); + NestedSet<Artifact> includesExemptFromDiscovery = context.getDeclaredIncludeSrcs(); // Copying the collections is needed to make the builder reusable. if (fake) { diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCompileAction.java index 4eb7a6927e..49a741ac98 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCompileAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCompileAction.java @@ -178,11 +178,6 @@ public class ObjcCompileAction extends SpawnAction { @Override public Iterable<Artifact> discoverInputs(ActionExecutionContext actionExecutionContext) { - return null; - } - - @Override - public Iterable<Artifact> getInputsWhenSkippingInputDiscovery() { return filterHeaderFiles(); } |