From 1575652972d80f224fb3f7398eef3439e4f5a5dd Mon Sep 17 00:00:00 2001 From: Dmitry Lomov Date: Fri, 16 Dec 2016 16:52:37 +0000 Subject: 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 --- .../google/devtools/build/lib/skyframe/AspectFunction.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/AspectFunction.java') 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 4bf0f81c5d..4f8835befb 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 @@ public final class AspectFunction implements SkyFunction { ConfiguredTarget associatedTarget = configuredTargetValue.getConfiguredTarget(); - ImmutableList.Builder aspectPath = ImmutableList.builder(); + ImmutableList.Builder aspectPathBuilder = ImmutableList.builder(); if (key.getBaseKey() != null) { ImmutableList aspectKeys = getSkyKeysForAspects(key.getBaseKey()); @@ -227,7 +227,7 @@ public final class AspectFunction implements SkyFunction { } 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 @@ public final class AspectFunction implements SkyFunction { } } - aspectPath.add(aspect); + aspectPathBuilder.add(aspect); SkyframeDependencyResolver resolver = view.createDependencyResolver(env); @@ -249,6 +249,7 @@ public final class AspectFunction implements SkyFunction { // will be present this way. TargetAndConfiguration originalTargetAndAspectConfiguration = new TargetAndConfiguration(target, key.getAspectConfiguration()); + ImmutableList aspectPath = aspectPathBuilder.build(); try { // Get the configuration targets that trigger this rule's configurable attributes. ImmutableMap configConditions = @@ -266,7 +267,7 @@ public final class AspectFunction implements SkyFunction { env, resolver, originalTargetAndAspectConfiguration, - aspectPath.build(), + aspectPath, configConditions, ruleClassProvider, view.getHostConfiguration(originalTargetAndAspectConfiguration.getConfiguration()), @@ -286,7 +287,7 @@ public final class AspectFunction implements SkyFunction { return createAspect( env, key, - target, + aspectPath, aspect, aspectFactory, associatedTarget, @@ -387,7 +388,7 @@ public final class AspectFunction implements SkyFunction { private AspectValue createAspect( Environment env, AspectKey key, - Target baseTarget, + ImmutableList aspectPath, Aspect aspect, ConfiguredAspectFactory aspectFactory, ConfiguredTarget associatedTarget, @@ -410,6 +411,7 @@ public final class AspectFunction implements SkyFunction { view.getConfiguredTargetFactory().createAspect( analysisEnvironment, associatedTarget, + aspectPath, aspectFactory, aspect, directDeps, -- cgit v1.2.3