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/AspectFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java
index d325445..56878b1 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java
@@ -16,6 +16,7 @@
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ListMultimap;
+import com.google.devtools.build.lib.actions.Action;
 import com.google.devtools.build.lib.analysis.CachingAnalysisEnvironment;
 import com.google.devtools.build.lib.analysis.ConfiguredAspect;
 import com.google.devtools.build.lib.analysis.ConfiguredAspectFactory;
@@ -42,6 +43,7 @@
 import com.google.devtools.build.lib.packages.RuleClassProvider;
 import com.google.devtools.build.lib.packages.SkylarkAspectClass;
 import com.google.devtools.build.lib.packages.Target;
+import com.google.devtools.build.lib.packages.TargetUtils;
 import com.google.devtools.build.lib.rules.SkylarkRuleClassFunctions.SkylarkAspect;
 import com.google.devtools.build.lib.skyframe.AspectValue.AspectKey;
 import com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.ConfiguredValueCreationException;
@@ -167,6 +169,11 @@
       throw new AspectFunctionException(e);
     }
 
+    Label aliasLabel = TargetUtils.getAliasTarget(target);
+    if (aliasLabel != null) {
+      return createAliasAspect(env, target, aliasLabel, aspect, key);
+    }
+    
     if (!(target instanceof Rule)) {
       throw new AspectFunctionException(new AspectCreationException(
           "aspects must be attached to rules"));
@@ -259,6 +266,32 @@
     }
   }
 
+  private SkyValue createAliasAspect(Environment env, Target originalTarget, Label aliasLabel,
+      Aspect aspect, AspectKey originalKey) {
+    SkyKey depKey = AspectValue.key(aliasLabel,
+        originalKey.getAspectConfiguration(),
+        originalKey.getBaseConfiguration(),
+        originalKey.getAspectClass(),
+        originalKey.getParameters());
+    AspectValue real = (AspectValue) env.getValue(depKey);
+    if (env.valuesMissing()) {
+      return null;
+    }
+
+    NestedSet<Package> transitivePackages = NestedSetBuilder.<Package>stableOrder()
+        .addTransitive(real.getTransitivePackages())
+        .add(originalTarget.getPackage())
+        .build();
+    return new AspectValue(
+        originalKey,
+        aspect,
+        originalTarget.getLabel(),
+        originalTarget.getLocation(),
+        ConfiguredAspect.forAlias(real.getConfiguredAspect()),
+        ImmutableList.<Action>of(),
+        transitivePackages);
+  }
+
   @Nullable
   private AspectValue createAspect(
       Environment env,