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/test/java/com/google/devtools/build/lib/analysis/AspectTest.java b/src/test/java/com/google/devtools/build/lib/analysis/AspectTest.java
index ea9e4bb..253ac66 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/AspectTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/AspectTest.java
@@ -96,9 +96,7 @@
assertThat(a.getProvider(RuleInfo.class).getData()).containsExactly("rule //a:a");
}
- // Disabled because this is a bug. Also note that if we fix this, query also needs to be fixed
- // so that it reports implicit dependencies reached through these aspects.
- //@Test
+ @Test
public void aspectCreationWorksThroughBind() throws Exception {
setRules(new TestAspects.BaseRule(), new TestAspects.HonestRule(),
new TestAspects.AspectRequiringProviderRule());