Make aspects work through bind().
bind() is assumed to be able to provide any provider. This is suboptimal, but beats the alternative of traversing the dependency graph to an arbitrary depth.
The reason for the removal of the iteration ability in TransitiveInfoCollection is that now aspects can be attached to BindConfiguredTarget, too, which is not a RuleConfiguredTarget. Whereas I could have implemented the iterator, it was used only in BindConfiguredTarget anyway, so there didn't seem to be much reason to.
Some work towards #952.
--
MOS_MIGRATED_REVID=120549877
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/TransitiveTraversalFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/TransitiveTraversalFunction.java
index 338d9c0..1852793 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/TransitiveTraversalFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/TransitiveTraversalFunction.java
@@ -32,7 +32,6 @@
import java.util.Collection;
import java.util.Map.Entry;
-import java.util.Set;
import javax.annotation.Nullable;
@@ -96,8 +95,8 @@
}
// Retrieve the providers of the dep from the TransitiveTraversalValue, so we can avoid
// issuing a dep on its defining Package.
- Set<String> providers = traversalVal.getProviders();
- return AspectDefinition.visitAspectsIfRequired(fromRule, attr, providers,
+ return AspectDefinition.visitAspectsIfRequired(fromRule, attr,
+ traversalVal.canHaveAnyProvider(), traversalVal.getProviders(),
DependencyFilter.ALL_DEPS).values();
} catch (NoSuchThingException e) {
// Do nothing. This error was handled when we computed the corresponding
@@ -107,8 +106,8 @@
}
@Override
- SkyValue computeSkyValue(
- TargetAndErrorIfAny targetAndErrorIfAny, FirstErrorMessageAccumulator accumulator) {
+ SkyValue computeSkyValue(TargetAndErrorIfAny targetAndErrorIfAny,
+ FirstErrorMessageAccumulator accumulator) {
boolean targetLoadedSuccessfully = targetAndErrorIfAny.getErrorLoadingTarget() == null;
String firstErrorMessage = accumulator.getFirstErrorMessage();
return targetLoadedSuccessfully