Start separating dependency resolution into two parts:
- A part that depends on the rule where the edge originates from
- A part that depends on the target the edge points to
The separation is still not perfect: aspect calculations require knowledge of the attribute and error reporting requires knowledge of the location of the originating rule.
Both of these issues can be fixed, but let's take small steps. It's a complex area.
RELNOTES: None.
PiperOrigin-RevId: 232438428
diff --git a/src/main/java/com/google/devtools/build/lib/packages/AspectDefinition.java b/src/main/java/com/google/devtools/build/lib/packages/AspectDefinition.java
index 937d19f..da5161f 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/AspectDefinition.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/AspectDefinition.java
@@ -147,13 +147,10 @@
return requiredProvidersForAspects;
}
-
- /**
- * Returns the set of required aspects for a given attribute.
- */
- public boolean propagateAlong(Attribute attribute) {
+ /** Returns the set of required aspects for a given attribute. */
+ public boolean propagateAlong(String attributeName) {
if (restrictToAttributes != null) {
- return restrictToAttributes.contains(attribute.getName());
+ return restrictToAttributes.contains(attributeName);
}
return true;
}