Names of extra-action protos now take into account all aspect names.
If an Aspect registered an action that an extra-action is
shadowing, its name is used when creating the extra-action's ID and
name.
Since recently, an aspect can see other aspects applied to the same
target. This CL record the names of other aspects applied to the target
as well, disambiguating the action owners.
--
PiperOrigin-RevId: 142264153
MOS_MIGRATED_REVID=142264153
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 4bf0f81..4f8835b 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
@@ -216,7 +216,7 @@
ConfiguredTarget associatedTarget =
configuredTargetValue.getConfiguredTarget();
- ImmutableList.Builder<Aspect> aspectPath = ImmutableList.builder();
+ ImmutableList.Builder<Aspect> aspectPathBuilder = ImmutableList.builder();
if (key.getBaseKey() != null) {
ImmutableList<SkyKey> aspectKeys = getSkyKeysForAspects(key.getBaseKey());
@@ -227,7 +227,7 @@
}
try {
associatedTarget = getBaseTargetAndCollectPath(
- associatedTarget, aspectKeys, values, aspectPath);
+ associatedTarget, aspectKeys, values, aspectPathBuilder);
} catch (DuplicateException e) {
env.getListener().handle(
Event.error(associatedTarget.getTarget().getLocation(), e.getMessage()));
@@ -237,7 +237,7 @@
}
}
- aspectPath.add(aspect);
+ aspectPathBuilder.add(aspect);
SkyframeDependencyResolver resolver = view.createDependencyResolver(env);
@@ -249,6 +249,7 @@
// will be present this way.
TargetAndConfiguration originalTargetAndAspectConfiguration =
new TargetAndConfiguration(target, key.getAspectConfiguration());
+ ImmutableList<Aspect> aspectPath = aspectPathBuilder.build();
try {
// Get the configuration targets that trigger this rule's configurable attributes.
ImmutableMap<Label, ConfigMatchingProvider> configConditions =
@@ -266,7 +267,7 @@
env,
resolver,
originalTargetAndAspectConfiguration,
- aspectPath.build(),
+ aspectPath,
configConditions,
ruleClassProvider,
view.getHostConfiguration(originalTargetAndAspectConfiguration.getConfiguration()),
@@ -286,7 +287,7 @@
return createAspect(
env,
key,
- target,
+ aspectPath,
aspect,
aspectFactory,
associatedTarget,
@@ -387,7 +388,7 @@
private AspectValue createAspect(
Environment env,
AspectKey key,
- Target baseTarget,
+ ImmutableList<Aspect> aspectPath,
Aspect aspect,
ConfiguredAspectFactory aspectFactory,
ConfiguredTarget associatedTarget,
@@ -410,6 +411,7 @@
view.getConfiguredTargetFactory().createAspect(
analysisEnvironment,
associatedTarget,
+ aspectPath,
aspectFactory,
aspect,
directDeps,