From 1575652972d80f224fb3f7398eef3439e4f5a5dd Mon Sep 17 00:00:00 2001 From: Dmitry Lomov Date: Fri, 16 Dec 2016 16:52:37 +0000 Subject: [PATCH] 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 --- .../build/lib/actions/AbstractAction.java | 27 +++++++++-- .../build/lib/actions/ActionOwner.java | 18 +++----- .../build/lib/analysis/BuildView.java | 4 +- .../build/lib/analysis/ConfiguredAspect.java | 1 + .../lib/analysis/ConfiguredTargetFactory.java | 19 ++++++-- .../build/lib/analysis/Dependency.java | 1 + .../lib/analysis/DependencyResolver.java | 1 + .../lib/analysis/MergedConfiguredTarget.java | 1 + .../build/lib/analysis/RuleContext.java | 45 +++++++------------ .../analysis/config/BuildConfiguration.java | 2 +- .../devtools/build/lib/packages/Aspect.java | 21 ++++----- .../build/lib/packages/AspectClass.java | 4 +- .../AspectDescriptor.java | 9 ++-- .../build/lib/rules/SkylarkRuleContext.java | 2 +- .../lib/rules/extra/ExtraActionSpec.java | 9 ++-- .../build/lib/skyframe/AspectFunction.java | 14 +++--- .../build/lib/skyframe/AspectValue.java | 2 +- .../skyframe/ConfiguredTargetFunction.java | 3 +- .../build/lib/skyframe/SkyframeExecutor.java | 2 +- .../lib/skyframe/SkylarkAspectFactory.java | 2 +- .../ToplevelSkylarkAspectFunction.java | 2 +- src/main/protobuf/extra_actions_base.proto | 26 ++++++++++- .../lib/actions/util/ActionsTestUtil.java | 4 +- .../lib/analysis/AspectDescriptorTest.java | 1 + .../build/lib/analysis/AspectTest.java | 3 +- .../build/lib/analysis/AspectValueTest.java | 2 +- .../build/lib/analysis/BuildViewTest.java | 1 + .../lib/analysis/DependencyResolverTest.java | 1 + .../build/lib/analysis/DependencyTest.java | 6 +-- .../lib/analysis/util/BuildViewTestCase.java | 2 +- .../runtime/ExperimentalStateTrackerTest.java | 11 +++-- 31 files changed, 149 insertions(+), 97 deletions(-) rename src/main/java/com/google/devtools/build/lib/{analysis => packages}/AspectDescriptor.java (94%) diff --git a/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java b/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java index 3dc3e4be40046b..a0dda9e7a18249 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java +++ b/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java @@ -27,6 +27,7 @@ import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe; import com.google.devtools.build.lib.events.Event; import com.google.devtools.build.lib.events.EventHandler; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable; import com.google.devtools.build.lib.skylarkinterface.SkylarkModule; import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory; @@ -44,6 +45,7 @@ import java.io.IOException; import java.util.Collection; import java.util.Map; +import java.util.Map.Entry; import javax.annotation.Nullable; /** @@ -470,12 +472,29 @@ public ExtraActionInfo.Builder getExtraActionInfo() { .setOwner(owner.getLabel().toString()) .setId(getKey()) .setMnemonic(getMnemonic()); - if (owner.getAspectName() != null) { - result.setAspectName(owner.getAspectName()); + Iterable aspectDescriptors = owner.getAspectDescriptors(); + AspectDescriptor lastAspect = null; + + for (AspectDescriptor aspectDescriptor : aspectDescriptors) { + ExtraActionInfo.AspectDescriptor.Builder builder = + ExtraActionInfo.AspectDescriptor.newBuilder() + .setAspectName(aspectDescriptor.getAspectClass().getName()); + for (Entry> entry : + aspectDescriptor.getParameters().getAttributes().asMap().entrySet()) { + builder.putAspectParameters( + entry.getKey(), + ExtraActionInfo.AspectDescriptor.StringList.newBuilder() + .addAllValue(entry.getValue()) + .build() + ); + } + lastAspect = aspectDescriptor; } - if (owner.getAspectParameters() != null) { + if (lastAspect != null) { + result.setAspectName(lastAspect.getAspectClass().getName()); + for (Map.Entry> entry : - owner.getAspectParameters().getAttributes().asMap().entrySet()) { + lastAspect.getParameters().getAttributes().asMap().entrySet()) { result.putAspectParameters( entry.getKey(), ExtraActionInfo.StringList.newBuilder().addAllValue(entry.getValue()).build()); diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionOwner.java b/src/main/java/com/google/devtools/build/lib/actions/ActionOwner.java index b641a4d31a909e..72ca914811afc8 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/ActionOwner.java +++ b/src/main/java/com/google/devtools/build/lib/actions/ActionOwner.java @@ -14,10 +14,11 @@ package com.google.devtools.build.lib.actions; import com.google.auto.value.AutoValue; +import com.google.common.collect.ImmutableList; import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; import com.google.devtools.build.lib.events.Location; -import com.google.devtools.build.lib.packages.AspectParameters; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.util.Preconditions; import javax.annotation.Nullable; @@ -33,12 +34,12 @@ public abstract class ActionOwner { /** An action owner for special cases. Usage is strongly discouraged. */ public static final ActionOwner SYSTEM_ACTION_OWNER = - ActionOwner.create(null, null, null, null, "system", "empty target kind", "system", null); + ActionOwner.create(null, ImmutableList.of(), + null, "system", "empty target kind", "system", null); public static ActionOwner create( @Nullable Label label, - @Nullable String aspectName, - @Nullable AspectParameters aspectParameters, + ImmutableList aspectDescriptors, @Nullable Location location, @Nullable String mnemonic, @Nullable String targetKind, @@ -47,8 +48,7 @@ public static ActionOwner create( return new AutoValue_ActionOwner( location, label, - aspectName, - aspectParameters, + aspectDescriptors, mnemonic, Preconditions.checkNotNull(configurationChecksum), targetKind, @@ -63,11 +63,7 @@ public static ActionOwner create( @Nullable public abstract Label getLabel(); - @Nullable - public abstract String getAspectName(); - - @Nullable - public abstract AspectParameters getAspectParameters(); + public abstract ImmutableList getAspectDescriptors(); /** Returns the configuration's mnemonic. */ @Nullable diff --git a/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java b/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java index 8f065efa4d298c..19e972c4febbbd 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java @@ -51,6 +51,7 @@ import com.google.devtools.build.lib.events.EventHandler; import com.google.devtools.build.lib.events.StoredEventHandler; import com.google.devtools.build.lib.packages.AspectClass; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.AspectParameters; import com.google.devtools.build.lib.packages.Attribute; import com.google.devtools.build.lib.packages.BuildType; @@ -1105,8 +1106,7 @@ public RuleContext getRuleContextForTesting(EventHandler eventHandler, Configure return new RuleContext.Builder( env, (Rule) target.getTarget(), - null, - null, + ImmutableList.of(), targetConfig, configurations.getHostConfiguration(), ruleClassProvider.getPrerequisiteValidator(), diff --git a/src/main/java/com/google/devtools/build/lib/analysis/ConfiguredAspect.java b/src/main/java/com/google/devtools/build/lib/analysis/ConfiguredAspect.java index 6196bce78c512f..ff90a87a64fb8b 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/ConfiguredAspect.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/ConfiguredAspect.java @@ -27,6 +27,7 @@ import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; import com.google.devtools.build.lib.events.Location; import com.google.devtools.build.lib.packages.AspectClass; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.AspectParameters; import com.google.devtools.build.lib.packages.SkylarkClassObject; import com.google.devtools.build.lib.packages.SkylarkClassObjectConstructor.Key; diff --git a/src/main/java/com/google/devtools/build/lib/analysis/ConfiguredTargetFactory.java b/src/main/java/com/google/devtools/build/lib/analysis/ConfiguredTargetFactory.java index fdc0c74684d5e6..11d03fa1175dd0 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/ConfiguredTargetFactory.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/ConfiguredTargetFactory.java @@ -14,7 +14,11 @@ package com.google.devtools.build.lib.analysis; +import static com.google.common.collect.Iterables.transform; + +import com.google.common.base.Function; import com.google.common.base.Joiner; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.actions.ArtifactFactory; @@ -32,6 +36,7 @@ import com.google.devtools.build.lib.events.Event; import com.google.devtools.build.lib.events.EventHandler; import com.google.devtools.build.lib.packages.Aspect; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.Attribute; import com.google.devtools.build.lib.packages.ConfigurationFragmentPolicy; import com.google.devtools.build.lib.packages.ConfigurationFragmentPolicy.MissingFragmentPolicy; @@ -227,8 +232,7 @@ private ConfiguredTarget createRule( new RuleContext.Builder( env, rule, - null, - null, + ImmutableList.of(), configuration, hostConfiguration, ruleClassProvider.getPrerequisiteValidator(), @@ -304,6 +308,13 @@ private String missingFragmentError( return result.toString(); } + private static final Function ASPECT_TO_DESCRIPTOR = + new Function() { + @Override + public AspectDescriptor apply(Aspect aspect) { + return aspect.getDescriptor(); + } + }; /** * Constructs an {@link ConfiguredAspect}. Returns null if an error occurs; in that case, * {@code aspectFactory} should call one of the error reporting methods of {@link RuleContext}. @@ -311,6 +322,7 @@ private String missingFragmentError( public ConfiguredAspect createAspect( AnalysisEnvironment env, ConfiguredTarget associatedTarget, + ImmutableList aspectPath, ConfiguredAspectFactory aspectFactory, Aspect aspect, OrderedSetMultimap prerequisiteMap, @@ -321,8 +333,7 @@ public ConfiguredAspect createAspect( RuleContext.Builder builder = new RuleContext.Builder( env, associatedTarget.getTarget().getAssociatedRule(), - aspect.getAspectClass().getName(), - aspect.getParameters(), + ImmutableList.copyOf(transform(aspectPath, ASPECT_TO_DESCRIPTOR)), aspectConfiguration, hostConfiguration, ruleClassProvider.getPrerequisiteValidator(), diff --git a/src/main/java/com/google/devtools/build/lib/analysis/Dependency.java b/src/main/java/com/google/devtools/build/lib/analysis/Dependency.java index 755b991d86663b..d72bced27a2b9a 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/Dependency.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/Dependency.java @@ -17,6 +17,7 @@ import com.google.common.collect.ImmutableSet; import com.google.devtools.build.lib.analysis.config.BuildConfiguration; import com.google.devtools.build.lib.cmdline.Label; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.Attribute; import com.google.devtools.build.lib.util.Preconditions; import java.util.Map; diff --git a/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java b/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java index 9fadc28fc394c3..60d274787a4b2b 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java @@ -28,6 +28,7 @@ import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; import com.google.devtools.build.lib.packages.Aspect; import com.google.devtools.build.lib.packages.AspectClass; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.Attribute; import com.google.devtools.build.lib.packages.Attribute.LateBoundDefault; import com.google.devtools.build.lib.packages.AttributeMap; diff --git a/src/main/java/com/google/devtools/build/lib/analysis/MergedConfiguredTarget.java b/src/main/java/com/google/devtools/build/lib/analysis/MergedConfiguredTarget.java index e0676128351a22..d5a483767c8e72 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/MergedConfiguredTarget.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/MergedConfiguredTarget.java @@ -16,6 +16,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.SkylarkClassObject; import com.google.devtools.build.lib.packages.SkylarkClassObjectConstructor.Key; import java.util.ArrayList; diff --git a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java index 202be7b6335b7f..937cf74c454930 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java @@ -53,7 +53,7 @@ import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; import com.google.devtools.build.lib.events.Event; import com.google.devtools.build.lib.events.Location; -import com.google.devtools.build.lib.packages.AspectParameters; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.Attribute; import com.google.devtools.build.lib.packages.Attribute.ConfigurationTransition; import com.google.devtools.build.lib.packages.Attribute.SplitTransition; @@ -151,8 +151,7 @@ public ImmutableList getFiles() { private static final String HOST_CONFIGURATION_PROGRESS_TAG = "for host"; private final Rule rule; - @Nullable private final String aspectName; - @Nullable private final AspectParameters aspectParameters; + private final ImmutableList aspectDescriptors; private final ListMultimap targetMap; private final ListMultimap filesetEntryMap; private final ImmutableMap configConditions; @@ -183,8 +182,7 @@ private RuleContext( super(builder.env, builder.rule, builder.configuration, builder.prerequisiteMap.get(null), builder.visibility); this.rule = builder.rule; - this.aspectName = builder.getAspectName(); - this.aspectParameters = builder.getAspectParameters(); + this.aspectDescriptors = builder.aspectDescriptors; this.configurationFragmentPolicy = builder.configurationFragmentPolicy; this.universalFragment = universalFragment; this.targetMap = targetMap; @@ -334,7 +332,7 @@ public ListMultimap getFilesetEntryMap() { @Override public ActionOwner getActionOwner() { if (actionOwner == null) { - actionOwner = createActionOwner(rule, aspectName, aspectParameters, getConfiguration()); + actionOwner = createActionOwner(rule, aspectDescriptors, getConfiguration()); } return actionOwner; } @@ -412,13 +410,11 @@ public ImmutableList getBuildInfo(BuildInfoKey key) throws Interrupted @VisibleForTesting public static ActionOwner createActionOwner( Rule rule, - @Nullable String aspectName, - @Nullable AspectParameters aspectParameters, + ImmutableList aspectDescriptors, BuildConfiguration configuration) { return ActionOwner.create( rule.getLabel(), - aspectName, - aspectParameters, + aspectDescriptors, rule.getLocation(), configuration.getMnemonic(), rule.getTargetKind(), @@ -1434,28 +1430,25 @@ public static final class Builder implements RuleErrorConsumer { private final BuildConfiguration configuration; private final BuildConfiguration hostConfiguration; private final PrerequisiteValidator prerequisiteValidator; - @Nullable private final String aspectName; - @Nullable private final AspectParameters aspectParameters; private final ErrorReporter reporter; private OrderedSetMultimap prerequisiteMap; private ImmutableMap configConditions; private NestedSet visibility; private ImmutableMap aspectAttributes; private ImmutableBiMap> skylarkProviderRegistry; + private ImmutableList aspectDescriptors; Builder( AnalysisEnvironment env, Rule rule, - @Nullable String aspectName, - @Nullable AspectParameters aspectParameters, + ImmutableList aspectDescriptors, BuildConfiguration configuration, BuildConfiguration hostConfiguration, PrerequisiteValidator prerequisiteValidator, ConfigurationFragmentPolicy configurationFragmentPolicy) { this.env = Preconditions.checkNotNull(env); this.rule = Preconditions.checkNotNull(rule); - this.aspectName = aspectName; - this.aspectParameters = aspectParameters; + this.aspectDescriptors = aspectDescriptors; this.configurationFragmentPolicy = Preconditions.checkNotNull(configurationFragmentPolicy); this.configuration = Preconditions.checkNotNull(configuration); this.hostConfiguration = Preconditions.checkNotNull(hostConfiguration); @@ -1736,7 +1729,7 @@ private void validateDirectPrerequisiteType(ConfiguredTarget prerequisite, /** Returns whether the context being constructed is for the evaluation of an aspect. */ public boolean forAspect() { - return aspectName != null; + return !aspectDescriptors.isEmpty(); } public Rule getRule() { @@ -1747,9 +1740,11 @@ public Rule getRule() { * Returns a rule class name suitable for log messages, including an aspect name if applicable. */ public String getRuleClassNameForLogging() { - return aspectName != null - ? aspectName + " aspect on " + rule.getRuleClass() - : rule.getRuleClass(); + if (aspectDescriptors.isEmpty()) { + return rule.getRuleClass(); + } + + return Joiner.on(",").join(aspectDescriptors) + " aspect on " + rule.getRuleClass(); } public BuildConfiguration getConfiguration() { @@ -1959,16 +1954,6 @@ private void validateDirectPrerequisite(Attribute attribute, ConfiguredTarget pr prerequisiteValidator.validate(this, prerequisite, attribute); } } - - @Nullable - public AspectParameters getAspectParameters() { - return aspectParameters; - } - - @Nullable - public String getAspectName() { - return aspectName; - } } /** diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java index c4689c90f25299..05da5c83cb83ca 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java @@ -33,7 +33,6 @@ import com.google.common.collect.Multimap; import com.google.common.collect.MutableClassToInstanceMap; import com.google.devtools.build.lib.actions.Root; -import com.google.devtools.build.lib.analysis.AspectDescriptor; import com.google.devtools.build.lib.analysis.BlazeDirectories; import com.google.devtools.build.lib.analysis.ConfiguredRuleClassProvider; import com.google.devtools.build.lib.analysis.Dependency; @@ -44,6 +43,7 @@ import com.google.devtools.build.lib.cmdline.RepositoryName; import com.google.devtools.build.lib.events.Event; import com.google.devtools.build.lib.events.EventHandler; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.Attribute; import com.google.devtools.build.lib.packages.Attribute.Configurator; import com.google.devtools.build.lib.packages.Attribute.SplitTransition; diff --git a/src/main/java/com/google/devtools/build/lib/packages/Aspect.java b/src/main/java/com/google/devtools/build/lib/packages/Aspect.java index 8e0be0cfe17649..817bc3c69c931f 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/Aspect.java +++ b/src/main/java/com/google/devtools/build/lib/packages/Aspect.java @@ -30,20 +30,17 @@ public final class Aspect implements DependencyFilter.AttributeInfoProvider { /** */ public static final String INJECTING_RULE_KIND_PARAMETER_KEY = "$injecting_rule_kind"; - // TODO(bazel-team): class objects are not really hashable or comparable for equality other than - // by reference. We should identify the aspect here in a way that does not rely on comparison - // by reference so that keys can be serialized and deserialized properly. - private final AspectClass aspectClass; - private final AspectParameters parameters; + private final AspectDescriptor aspectDescriptor; private final AspectDefinition aspectDefinition; private Aspect( AspectClass aspectClass, AspectDefinition aspectDefinition, AspectParameters parameters) { - this.aspectClass = Preconditions.checkNotNull(aspectClass); + this.aspectDescriptor = new AspectDescriptor( + Preconditions.checkNotNull(aspectClass), + Preconditions.checkNotNull(parameters)); this.aspectDefinition = Preconditions.checkNotNull(aspectDefinition); - this.parameters = Preconditions.checkNotNull(parameters); } public static Aspect forNative( @@ -66,19 +63,23 @@ public static Aspect forSkylark( * Returns the aspectClass required for building the aspect. */ public AspectClass getAspectClass() { - return aspectClass; + return aspectDescriptor.getAspectClass(); } /** * Returns parameters for evaluation of the aspect. */ public AspectParameters getParameters() { - return parameters; + return aspectDescriptor.getParameters(); + } + + public AspectDescriptor getDescriptor() { + return aspectDescriptor; } @Override public String toString() { - return String.format("Aspect %s(%s)", aspectClass, parameters); + return String.format("Aspect %s", aspectDescriptor.toString()); } public AspectDefinition getDefinition() { diff --git a/src/main/java/com/google/devtools/build/lib/packages/AspectClass.java b/src/main/java/com/google/devtools/build/lib/packages/AspectClass.java index 2d615e1f6f7c80..e8c8cbe2d53b1e 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/AspectClass.java +++ b/src/main/java/com/google/devtools/build/lib/packages/AspectClass.java @@ -72,7 +72,7 @@ * *
  • {@link AspectParameters} is a (key,value) pair list that can be used to * parameterize aspect classes
  • - *
  • {@link com.google.devtools.build.lib.analysis.AspectDescriptor} is a pair + *
  • {@link AspectDescriptor} is a pair * of {@code AspectClass} and {@link AspectParameters}. It uniquely identifies * the aspect and can be used in SkyKeys. *
  • @@ -89,7 +89,7 @@ * * * - * {@link com.google.devtools.build.lib.analysis.AspectDescriptor}, or in general, a tuple + * {@link AspectDescriptor}, or in general, a tuple * of ({@link AspectClass}, {@link AspectParameters}) is an identifier that should be * used in SkyKeys or in other contexts that need equality for aspects. * See also {@link com.google.devtools.build.lib.skyframe.AspectFunction} for details diff --git a/src/main/java/com/google/devtools/build/lib/analysis/AspectDescriptor.java b/src/main/java/com/google/devtools/build/lib/packages/AspectDescriptor.java similarity index 94% rename from src/main/java/com/google/devtools/build/lib/analysis/AspectDescriptor.java rename to src/main/java/com/google/devtools/build/lib/packages/AspectDescriptor.java index 2f56abbc15e1b9..0d6e7435bd767f 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/AspectDescriptor.java +++ b/src/main/java/com/google/devtools/build/lib/packages/AspectDescriptor.java @@ -12,12 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -package com.google.devtools.build.lib.analysis; +package com.google.devtools.build.lib.packages; import com.google.common.collect.ImmutableMultimap; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; -import com.google.devtools.build.lib.packages.AspectClass; -import com.google.devtools.build.lib.packages.AspectParameters; import com.google.protobuf.TextFormat; import java.util.Map.Entry; import java.util.Objects; @@ -70,6 +68,11 @@ public boolean equals(Object obj) { && Objects.equals(aspectParameters, that.aspectParameters); } + @Override + public String toString() { + return getDescription(); + } + /** * Creates a presentable description of this aspect, avaliable * to Skylark via "Target.aspects". diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java index 5042338d5fdf4b..71aae066e35ed9 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java +++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkRuleContext.java @@ -24,7 +24,6 @@ import com.google.devtools.build.lib.actions.Root; import com.google.devtools.build.lib.analysis.ActionsProvider; import com.google.devtools.build.lib.analysis.AnalysisUtils; -import com.google.devtools.build.lib.analysis.AspectDescriptor; import com.google.devtools.build.lib.analysis.ConfigurationMakeVariableContext; import com.google.devtools.build.lib.analysis.FilesToRunProvider; import com.google.devtools.build.lib.analysis.LabelExpander; @@ -38,6 +37,7 @@ import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.collect.nestedset.NestedSet; import com.google.devtools.build.lib.events.Location; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.Attribute; import com.google.devtools.build.lib.packages.Attribute.ConfigurationTransition; import com.google.devtools.build.lib.packages.BuildType; diff --git a/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionSpec.java b/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionSpec.java index 745cea01bd2363..748a7a5fc83fb0 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionSpec.java +++ b/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionSpec.java @@ -28,6 +28,7 @@ import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.util.Fingerprint; import com.google.devtools.build.lib.vfs.PathFragment; import java.util.ArrayList; @@ -236,10 +237,10 @@ private static String getOwnerDigest(RuleContext ruleContext) { public static String getActionId(ActionOwner owner, Action action) { Fingerprint f = new Fingerprint(); f.addString(owner.getLabel().toString()); - f.addNullableString(owner.getAspectName()); - f.addBoolean(owner.getAspectParameters() != null); - if (owner.getAspectParameters() != null) { - f.addString(owner.getAspectParameters().toString()); + ImmutableList aspectDescriptors = owner.getAspectDescriptors(); + f.addInt(aspectDescriptors.size()); + for (AspectDescriptor aspectDescriptor : aspectDescriptors) { + f.addString(aspectDescriptor.getDescription()); } f.addString(action.getKey()); return f.hexDigestAndReset(); 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 4bf0f81c5d94fe..4f8835befbd633 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 SkyValue compute(SkyKey skyKey, Environment env) 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 SkyValue compute(SkyKey skyKey, Environment env) } 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 SkyValue compute(SkyKey skyKey, Environment env) } } - aspectPath.add(aspect); + aspectPathBuilder.add(aspect); SkyframeDependencyResolver resolver = view.createDependencyResolver(env); @@ -249,6 +249,7 @@ public SkyValue compute(SkyKey skyKey, Environment env) // 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 SkyValue compute(SkyKey skyKey, Environment env) env, resolver, originalTargetAndAspectConfiguration, - aspectPath.build(), + aspectPath, configConditions, ruleClassProvider, view.getHostConfiguration(originalTargetAndAspectConfiguration.getConfiguration()), @@ -286,7 +287,7 @@ public SkyValue compute(SkyKey skyKey, Environment env) return createAspect( env, key, - target, + aspectPath, aspect, aspectFactory, associatedTarget, @@ -387,7 +388,7 @@ private static SkyValue createAliasAspect( private AspectValue createAspect( Environment env, AspectKey key, - Target baseTarget, + ImmutableList aspectPath, Aspect aspect, ConfiguredAspectFactory aspectFactory, ConfiguredTarget associatedTarget, @@ -410,6 +411,7 @@ private AspectValue createAspect( view.getConfiguredTargetFactory().createAspect( analysisEnvironment, associatedTarget, + aspectPath, aspectFactory, aspect, directDeps, diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/AspectValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/AspectValue.java index d4366fa6a84aff..7accbc1cb00d10 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/AspectValue.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/AspectValue.java @@ -16,7 +16,6 @@ import com.google.common.base.Objects; import com.google.devtools.build.lib.actions.ActionAnalysisMetadata; -import com.google.devtools.build.lib.analysis.AspectDescriptor; import com.google.devtools.build.lib.analysis.ConfiguredAspect; import com.google.devtools.build.lib.analysis.config.BuildConfiguration; import com.google.devtools.build.lib.cmdline.Label; @@ -24,6 +23,7 @@ import com.google.devtools.build.lib.events.Location; import com.google.devtools.build.lib.packages.Aspect; import com.google.devtools.build.lib.packages.AspectClass; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.AspectParameters; import com.google.devtools.build.lib.packages.Package; import com.google.devtools.build.lib.syntax.SkylarkImport; diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java index cc62260279dee2..134cea24a82297 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java @@ -31,7 +31,6 @@ import com.google.devtools.build.lib.actions.Actions; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.actions.MutableActionGraph.ActionConflictException; -import com.google.devtools.build.lib.analysis.AspectDescriptor; import com.google.devtools.build.lib.analysis.CachingAnalysisEnvironment; import com.google.devtools.build.lib.analysis.ConfiguredAspect; import com.google.devtools.build.lib.analysis.ConfiguredTarget; @@ -56,6 +55,7 @@ import com.google.devtools.build.lib.events.StoredEventHandler; import com.google.devtools.build.lib.packages.Aspect; import com.google.devtools.build.lib.packages.AspectDefinition; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.Attribute; import com.google.devtools.build.lib.packages.BuildType; import com.google.devtools.build.lib.packages.NoSuchTargetException; @@ -78,7 +78,6 @@ import com.google.devtools.build.skyframe.SkyValue; import com.google.devtools.build.skyframe.ValueOrException; import com.google.devtools.build.skyframe.ValueOrException2; - import java.util.ArrayList; import java.util.Collection; import java.util.Collections; diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java index a21158a10f86f0..a93ee6b5a42085 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java @@ -50,7 +50,6 @@ import com.google.devtools.build.lib.actions.PackageRootResolutionException; import com.google.devtools.build.lib.actions.ResourceManager; import com.google.devtools.build.lib.actions.Root; -import com.google.devtools.build.lib.analysis.AspectDescriptor; import com.google.devtools.build.lib.analysis.BlazeDirectories; import com.google.devtools.build.lib.analysis.BuildView.Options; import com.google.devtools.build.lib.analysis.ConfiguredAspect; @@ -79,6 +78,7 @@ import com.google.devtools.build.lib.events.EventHandler; import com.google.devtools.build.lib.events.Reporter; import com.google.devtools.build.lib.exec.OutputService; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.Attribute; import com.google.devtools.build.lib.packages.BuildFileContainsErrorsException; import com.google.devtools.build.lib.packages.NoSuchPackageException; diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkAspectFactory.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkAspectFactory.java index 2608c7f535c267..e80a788aef6b4c 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkAspectFactory.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkAspectFactory.java @@ -15,13 +15,13 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import com.google.devtools.build.lib.analysis.AspectDescriptor; import com.google.devtools.build.lib.analysis.ConfiguredAspect; import com.google.devtools.build.lib.analysis.ConfiguredAspectFactory; import com.google.devtools.build.lib.analysis.ConfiguredTarget; import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.analysis.SkylarkProviderValidationUtil; import com.google.devtools.build.lib.events.Location; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.AspectParameters; import com.google.devtools.build.lib.packages.SkylarkAspect; import com.google.devtools.build.lib.packages.SkylarkClassObject; diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ToplevelSkylarkAspectFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/ToplevelSkylarkAspectFunction.java index 4d6dbf23efbf7a..cc1aa442fe7be8 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/ToplevelSkylarkAspectFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/ToplevelSkylarkAspectFunction.java @@ -17,9 +17,9 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; -import com.google.devtools.build.lib.analysis.AspectDescriptor; import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.events.Event; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.AspectParameters; import com.google.devtools.build.lib.packages.SkylarkAspect; import com.google.devtools.build.lib.skyframe.AspectFunction.AspectCreationException; diff --git a/src/main/protobuf/extra_actions_base.proto b/src/main/protobuf/extra_actions_base.proto index 857e25e81f7ca1..3c63e8b854c823 100644 --- a/src/main/protobuf/extra_actions_base.proto +++ b/src/main/protobuf/extra_actions_base.proto @@ -55,15 +55,37 @@ message ExtraActionInfo { // Only set if the owner is an Aspect. // Corresponds to AspectValue.AspectKey.getAspectClass.getName() - optional string aspect_name = 6; + // This field is deprecated as there might now be + // multiple aspects applied to the same target. + // This is the aspect name of the last aspect + // in 'aspects' (8) field. + optional string aspect_name = 6 [deprecated = true]; // Only set if the owner is an Aspect. // Corresponds to AspectValue.AspectKey.getParameters() - map aspect_parameters = 7; + // This field is deprecated as there might now be + // multiple aspects applied to the same target. + // These are the aspect parameters of the last aspect + // in 'aspects' (8) field. + map aspect_parameters = 7 [deprecated = true]; message StringList { + option deprecated = true; repeated string value = 1; } + message AspectDescriptor { + // Corresponds to AspectDescriptor.getName() + optional string aspect_name = 1; + // Corresponds to AspectDescriptor.getParameters() + map aspect_parameters = 2; + message StringList { + repeated string value = 1; + } + } + + // If the owner is an aspect, all aspects applied to the target + repeated AspectDescriptor aspects = 8; + // An id uniquely describing the shadowed action at the ActionOwner level. optional string id = 2; diff --git a/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java b/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java index 81fbd6c0dc3cfd..d11392e7edb4f4 100644 --- a/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java +++ b/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java @@ -46,6 +46,7 @@ import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.events.EventHandler; import com.google.devtools.build.lib.exec.SingleBuildFileCache; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.util.FileType; import com.google.devtools.build.lib.util.Preconditions; import com.google.devtools.build.lib.util.ResourceUsage; @@ -191,8 +192,7 @@ public boolean inErrorBubblingForTesting() { public static final ActionOwner NULL_ACTION_OWNER = ActionOwner.create( NULL_LABEL, - null, - null, + ImmutableList.of(), null, "dummy-configuration-mnemonic", null, diff --git a/src/test/java/com/google/devtools/build/lib/analysis/AspectDescriptorTest.java b/src/test/java/com/google/devtools/build/lib/analysis/AspectDescriptorTest.java index c0ea194dd18dfe..1e890f03230579 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/AspectDescriptorTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/AspectDescriptorTest.java @@ -19,6 +19,7 @@ import com.google.devtools.build.lib.packages.AspectClass; import com.google.devtools.build.lib.packages.AspectDefinition; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.AspectParameters; import com.google.devtools.build.lib.packages.NativeAspectClass; import org.junit.Test; 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 2ad695227497e0..c3748fea6d45b8 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 @@ -549,6 +549,7 @@ public void extraActionsFromDifferentAspectsDontConflict() throws Exception { scratch.file( "x/BUILD", "load(':extension.bzl', 'injector1', 'injector2', 'null_rule')", + "injector2(name='i2_a', deps = [':i1_a'])", "injector1(name='i1_a', deps=[':n'], param = 'a')", "injector1(name='i1_b', deps=[':n'], param = 'b')", "injector2(name='i2', deps=[':n'])", @@ -575,7 +576,7 @@ public void extraActionsFromDifferentAspectsDontConflict() throws Exception { "extra_action(name='xa', cmd='echo dont-care')", "action_listener(name='listener', mnemonics=['Mnemonic'], extra_actions=[':xa'])"); - update("//x:i1_a", "//x:i1_b", "//x:i2"); + update("//x:i1_a", "//x:i1_b", "//x:i2", "//x:i2_a"); // Implicitly check that update() didn't throw an exception because of two actions producing // the same outputs. diff --git a/src/test/java/com/google/devtools/build/lib/analysis/AspectValueTest.java b/src/test/java/com/google/devtools/build/lib/analysis/AspectValueTest.java index b5e3bcda49c4a6..25477bd844a51e 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/AspectValueTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/AspectValueTest.java @@ -20,11 +20,11 @@ import com.google.devtools.build.lib.analysis.util.TestAspects.AttributeAspect; import com.google.devtools.build.lib.analysis.util.TestAspects.ExtraAttributeAspect; import com.google.devtools.build.lib.cmdline.Label; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.AspectParameters; import com.google.devtools.build.lib.packages.NativeAspectClass; import com.google.devtools.build.lib.skyframe.ActionLookupValue; import com.google.devtools.build.lib.skyframe.AspectValue; - import com.google.devtools.build.lib.skyframe.AspectValue.AspectKey; import com.google.devtools.build.skyframe.SkyKey; import org.junit.Test; diff --git a/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java b/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java index a73032f9072fac..63e7484e6d03d8 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java @@ -44,6 +44,7 @@ import com.google.devtools.build.lib.analysis.util.BuildViewTestBase; import com.google.devtools.build.lib.analysis.util.ExpectedDynamicConfigurationErrors; import com.google.devtools.build.lib.cmdline.Label; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.Attribute; import com.google.devtools.build.lib.packages.Rule; import com.google.devtools.build.lib.skyframe.SkyFunctions; diff --git a/src/test/java/com/google/devtools/build/lib/analysis/DependencyResolverTest.java b/src/test/java/com/google/devtools/build/lib/analysis/DependencyResolverTest.java index 2d50ef7e77cc7d..eb6b55194c187c 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/DependencyResolverTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/DependencyResolverTest.java @@ -26,6 +26,7 @@ import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; import com.google.devtools.build.lib.packages.Aspect; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.Attribute; import com.google.devtools.build.lib.packages.NativeAspectClass; import com.google.devtools.build.lib.packages.NoSuchPackageException; diff --git a/src/test/java/com/google/devtools/build/lib/analysis/DependencyTest.java b/src/test/java/com/google/devtools/build/lib/analysis/DependencyTest.java index e2b0fa7754e6a8..82e14721b41e18 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/DependencyTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/DependencyTest.java @@ -24,14 +24,14 @@ import com.google.devtools.build.lib.analysis.util.AnalysisTestCase; import com.google.devtools.build.lib.analysis.util.TestAspects; import com.google.devtools.build.lib.cmdline.Label; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.Attribute.ConfigurationTransition; +import java.util.LinkedHashSet; +import java.util.Set; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.util.LinkedHashSet; -import java.util.Set; - /** * Tests for {@link Dependency}. * diff --git a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java index d9dd9ae4aec925..a653991f4b59cf 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java @@ -48,7 +48,6 @@ import com.google.devtools.build.lib.actions.util.ActionsTestUtil; import com.google.devtools.build.lib.analysis.AnalysisEnvironment; import com.google.devtools.build.lib.analysis.AnalysisUtils; -import com.google.devtools.build.lib.analysis.AspectDescriptor; import com.google.devtools.build.lib.analysis.BlazeDirectories; import com.google.devtools.build.lib.analysis.BuildView; import com.google.devtools.build.lib.analysis.BuildView.AnalysisResult; @@ -95,6 +94,7 @@ import com.google.devtools.build.lib.exec.ExecutionOptions; import com.google.devtools.build.lib.flags.InvocationPolicyEnforcer; import com.google.devtools.build.lib.packages.AspectClass; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.packages.AspectParameters; import com.google.devtools.build.lib.packages.Attribute.ConfigurationTransition; import com.google.devtools.build.lib.packages.AttributeMap; diff --git a/src/test/java/com/google/devtools/build/lib/runtime/ExperimentalStateTrackerTest.java b/src/test/java/com/google/devtools/build/lib/runtime/ExperimentalStateTrackerTest.java index e841310da1eeec..7d47a8d1621ff5 100644 --- a/src/test/java/com/google/devtools/build/lib/runtime/ExperimentalStateTrackerTest.java +++ b/src/test/java/com/google/devtools/build/lib/runtime/ExperimentalStateTrackerTest.java @@ -18,6 +18,7 @@ import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.when; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.devtools.build.lib.actions.Action; import com.google.devtools.build.lib.actions.ActionCompletionEvent; @@ -30,6 +31,7 @@ import com.google.devtools.build.lib.analysis.ConfiguredTarget; import com.google.devtools.build.lib.buildtool.buildevent.TestFilteringCompleteEvent; import com.google.devtools.build.lib.cmdline.Label; +import com.google.devtools.build.lib.packages.AspectDescriptor; import com.google.devtools.build.lib.skyframe.LoadingPhaseStartedEvent; import com.google.devtools.build.lib.skyframe.PackageProgressReceiver; import com.google.devtools.build.lib.testutil.FoundationTestCase; @@ -390,7 +392,8 @@ public void testSensibleShortening() throws Exception { "/home/user/bazel/out/abcdef/some/very/very/long/path/for/some/library/directory/foo.jar"); Label label = Label.parseAbsolute("//some/very/very/long/path/for/some/library/directory:libfoo"); - ActionOwner owner = ActionOwner.create(label, null, null, null, null, null, "fedcba", null); + ActionOwner owner = ActionOwner.create( + label, ImmutableList.of(), null, null, null, "fedcba", null); when(action.getOwner()).thenReturn(owner); clock.advanceMillis(TimeUnit.SECONDS.toMillis(3)); @@ -518,7 +521,8 @@ public void testAggregation() throws Exception { ConfiguredTarget targetFooTest = Mockito.mock(ConfiguredTarget.class); when(targetFooTest.getLabel()).thenReturn(labelFooTest); ActionOwner fooOwner = - ActionOwner.create(labelFooTest, null, null, null, null, null, "abcdef", null); + ActionOwner.create(labelFooTest, + ImmutableList.of(), null, null, null, "abcdef", null); Label labelBarTest = Label.parseAbsolute("//baz:bartest"); ConfiguredTarget targetBarTest = Mockito.mock(ConfiguredTarget.class); @@ -527,7 +531,8 @@ public void testAggregation() throws Exception { when(filteringComplete.getTestTargets()) .thenReturn(ImmutableSet.of(targetFooTest, targetBarTest)); ActionOwner barOwner = - ActionOwner.create(labelBarTest, null, null, null, null, null, "fedcba", null); + ActionOwner.create(labelBarTest, + ImmutableList.of(), null, null, null, "fedcba", null); stateTracker.testFilteringComplete(filteringComplete);