From ac2cd35438e13504336ced63b6a06581445b66a5 Mon Sep 17 00:00:00 2001 From: janakr Date: Wed, 20 Dec 2017 13:37:13 -0800 Subject: [PATCH] Get rid of LabelAndConfiguration class: ConfiguredTargetKey contains the same information and is more useful, since it's practically a SkyKey. PiperOrigin-RevId: 179727105 --- .../devtools/build/lib/actions/Artifact.java | 10 +-- .../build/lib/actions/ArtifactOwner.java | 27 +++--- .../lib/analysis/AnalysisFailureEvent.java | 7 +- .../lib/analysis/LabelAndConfiguration.java | 88 ------------------- .../devtools/build/lib/analysis/Util.java | 17 ++-- .../RuleConfiguredTarget.java | 8 +- .../ConfiguredTargetQueryEnvironment.java | 23 +++-- .../lib/runtime/AggregatingTestListener.java | 24 ++--- .../skyframe/ActionArtifactCycleReporter.java | 8 +- .../lib/skyframe/CompletionFunction.java | 5 +- .../skyframe/ConfiguredTargetFunction.java | 19 ++-- .../lib/skyframe/ConfiguredTargetKey.java | 15 +++- .../PostConfiguredTargetFunction.java | 3 +- .../build/lib/skyframe/SkyframeBuildView.java | 7 +- .../lib/skyframe/TargetCompletionValue.java | 16 ++-- .../lib/skyframe/TestCompletionFunction.java | 5 +- .../lib/skyframe/TestCompletionValue.java | 12 +-- .../lib/analysis/util/BuildViewTestCase.java | 17 ++-- 18 files changed, 116 insertions(+), 195 deletions(-) delete mode 100644 src/main/java/com/google/devtools/build/lib/analysis/LabelAndConfiguration.java diff --git a/src/main/java/com/google/devtools/build/lib/actions/Artifact.java b/src/main/java/com/google/devtools/build/lib/actions/Artifact.java index 7ecdede085959e..e47d0e3bd646a8 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/Artifact.java +++ b/src/main/java/com/google/devtools/build/lib/actions/Artifact.java @@ -301,11 +301,11 @@ public final String getExtension() { } /** - * Get the {@code LabelAndConfiguration} of the {@code ConfiguredTarget} that owns this artifact, - * if it was set. Otherwise, this should be a dummy value -- either {@link - * ArtifactOwner#NULL_OWNER} or a dummy owner set in tests. Such a dummy value should only occur - * for source artifacts if created without specifying the owner, or for special derived artifacts, - * such as target completion middleman artifacts, build info artifacts, and the like. + * Gets the {@code ActionLookupKey} of the {@code ConfiguredTarget} that owns this artifact, if it + * was set. Otherwise, this should be a dummy value -- either {@link ArtifactOwner#NULL_OWNER} or + * a dummy owner set in tests. Such a dummy value should only occur for source artifacts if + * created without specifying the owner, or for special derived artifacts, such as target + * completion middleman artifacts, build info artifacts, and the like. */ public final ArtifactOwner getArtifactOwner() { return owner; diff --git a/src/main/java/com/google/devtools/build/lib/actions/ArtifactOwner.java b/src/main/java/com/google/devtools/build/lib/actions/ArtifactOwner.java index 94f29632c62d4b..597893f6b59ef5 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/ArtifactOwner.java +++ b/src/main/java/com/google/devtools/build/lib/actions/ArtifactOwner.java @@ -17,23 +17,24 @@ import com.google.devtools.build.lib.cmdline.Label; /** - * An interface for {@code LabelAndConfiguration}, or at least for a {@link Label}. Only tests and - * internal {@link Artifact}-generators should implement this interface -- otherwise, - * {@code LabelAndConfiguration} should be the only implementation. + * An interface for {@code ActionLookupKey}, or at least for a {@link Label}. Only tests and + * internal {@link Artifact}-generators should implement this interface -- otherwise, {@code + * ActionLookupKey} and its subclasses should be the only implementation. */ public interface ArtifactOwner { Label getLabel(); @VisibleForTesting - public static final ArtifactOwner NULL_OWNER = new ArtifactOwner() { - @Override - public Label getLabel() { - return null; - } + ArtifactOwner NULL_OWNER = + new ArtifactOwner() { + @Override + public Label getLabel() { + return null; + } - @Override - public String toString() { - return "NULL_OWNER"; - } - }; + @Override + public String toString() { + return "NULL_OWNER"; + } + }; } diff --git a/src/main/java/com/google/devtools/build/lib/analysis/AnalysisFailureEvent.java b/src/main/java/com/google/devtools/build/lib/analysis/AnalysisFailureEvent.java index 0bc37b7d0f5f81..0893a8e4d35865 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/AnalysisFailureEvent.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/AnalysisFailureEvent.java @@ -15,6 +15,7 @@ package com.google.devtools.build.lib.analysis; import com.google.devtools.build.lib.cmdline.Label; +import com.google.devtools.build.lib.skyframe.ConfiguredTargetKey; /** * This event is fired during the build, when it becomes known that the analysis @@ -22,15 +23,15 @@ * dependencies. */ public class AnalysisFailureEvent { - private final LabelAndConfiguration failedTarget; + private final ConfiguredTargetKey failedTarget; private final Label failureReason; - public AnalysisFailureEvent(LabelAndConfiguration failedTarget, Label failureReason) { + public AnalysisFailureEvent(ConfiguredTargetKey failedTarget, Label failureReason) { this.failedTarget = failedTarget; this.failureReason = failureReason; } - public LabelAndConfiguration getFailedTarget() { + public ConfiguredTargetKey getFailedTarget() { return failedTarget; } diff --git a/src/main/java/com/google/devtools/build/lib/analysis/LabelAndConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/LabelAndConfiguration.java deleted file mode 100644 index eb527f8a58991a..00000000000000 --- a/src/main/java/com/google/devtools/build/lib/analysis/LabelAndConfiguration.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2014 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.devtools.build.lib.analysis; - -import com.google.common.base.MoreObjects; -import com.google.common.base.Preconditions; -import com.google.devtools.build.lib.analysis.config.BuildConfiguration; -import com.google.devtools.build.lib.cmdline.Label; -import java.util.Objects; -import javax.annotation.Nullable; - -/** -* A (label,configuration) pair. -*/ -public final class LabelAndConfiguration { - private final Label label; - @Nullable - private final BuildConfiguration configuration; - - private LabelAndConfiguration(Label label, @Nullable BuildConfiguration configuration) { - this.label = Preconditions.checkNotNull(label); - this.configuration = configuration; - } - - public Label getLabel() { - return label; - } - - @Nullable - public BuildConfiguration getConfiguration() { - return configuration; - } - - @Override - public int hashCode() { - int configVal = configuration == null ? 79 : configuration.hashCode(); - return 31 * label.hashCode() + configVal; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (!(obj instanceof LabelAndConfiguration)) { - return false; - } - LabelAndConfiguration other = (LabelAndConfiguration) obj; - return Objects.equals(label, other.label) && Objects.equals(configuration, other.configuration); - } - - public static LabelAndConfiguration of( - Label label, @Nullable BuildConfiguration configuration) { - return new LabelAndConfiguration(label, configuration); - } - - public static LabelAndConfiguration of(ConfiguredTarget configuredTarget) { - AliasProvider aliasProvider = configuredTarget.getProvider(AliasProvider.class); - Label label = aliasProvider != null - ? aliasProvider.getAliasChain().get(0) - : configuredTarget.getLabel(); - - return new LabelAndConfiguration(label, configuredTarget.getConfiguration()); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("label", label) - .add("configuration", configuration) - .toString(); - } -} diff --git a/src/main/java/com/google/devtools/build/lib/analysis/Util.java b/src/main/java/com/google/devtools/build/lib/analysis/Util.java index aa12b404635423..02d05b51e0fb29 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/Util.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/Util.java @@ -22,6 +22,7 @@ import com.google.devtools.build.lib.collect.compacthashset.CompactHashSet; import com.google.devtools.build.lib.packages.AttributeMap; import com.google.devtools.build.lib.packages.Target; +import com.google.devtools.build.lib.skyframe.ConfiguredTargetKey; import com.google.devtools.build.lib.vfs.PathFragment; import java.util.List; import java.util.Set; @@ -77,10 +78,10 @@ public static boolean containsHyphen(PathFragment path) { * build file and all toolchain deps. * note: nodes that are depended on both implicitly and explicitly are considered explicit. */ - public static ImmutableSet findImplicitDeps(RuleContext ruleContext) { + public static ImmutableSet findImplicitDeps(RuleContext ruleContext) { // (1) Consider rule attribute dependencies. - Set maybeImplicitDeps = CompactHashSet.create(); - Set explicitDeps = CompactHashSet.create(); + Set maybeImplicitDeps = CompactHashSet.create(); + Set explicitDeps = CompactHashSet.create(); AttributeMap attributes = ruleContext.attributes(); ListMultimap targetMap = ruleContext.getConfiguredTargetMap(); @@ -99,19 +100,19 @@ public static ImmutableSet findImplicitDeps(RuleContext r if (toolchainContext != null) { BuildConfiguration config = ruleContext.getConfiguration(); for (Label toolchain : toolchainContext.getResolvedToolchainLabels()) { - maybeImplicitDeps.add(LabelAndConfiguration.of(toolchain, config)); + maybeImplicitDeps.add(ConfiguredTargetKey.of(toolchain, config)); } maybeImplicitDeps.add( - LabelAndConfiguration.of(toolchainContext.getExecutionPlatform().label(), config)); + ConfiguredTargetKey.of(toolchainContext.getExecutionPlatform().label(), config)); maybeImplicitDeps.add( - LabelAndConfiguration.of(toolchainContext.getTargetPlatform().label(), config)); + ConfiguredTargetKey.of(toolchainContext.getTargetPlatform().label(), config)); } return ImmutableSet.copyOf(Sets.difference(maybeImplicitDeps, explicitDeps)); } private static void addLabelsAndConfigs( - Set set, List deps) { + Set set, List deps) { deps.forEach( - target -> set.add(LabelAndConfiguration.of(target.getLabel(), target.getConfiguration()))); + target -> set.add(ConfiguredTargetKey.of(target.getLabel(), target.getConfiguration()))); } } diff --git a/src/main/java/com/google/devtools/build/lib/analysis/configuredtargets/RuleConfiguredTarget.java b/src/main/java/com/google/devtools/build/lib/analysis/configuredtargets/RuleConfiguredTarget.java index d95c4d31ac11e1..30959f72be2af9 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/configuredtargets/RuleConfiguredTarget.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/configuredtargets/RuleConfiguredTarget.java @@ -20,7 +20,6 @@ import com.google.devtools.build.lib.analysis.ConfiguredTarget; import com.google.devtools.build.lib.analysis.FileProvider; import com.google.devtools.build.lib.analysis.FilesToRunProvider; -import com.google.devtools.build.lib.analysis.LabelAndConfiguration; import com.google.devtools.build.lib.analysis.RuleConfiguredTargetBuilder; import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.analysis.RunfilesProvider; @@ -38,6 +37,7 @@ import com.google.devtools.build.lib.packages.OutputFile; import com.google.devtools.build.lib.packages.Provider; import com.google.devtools.build.lib.packages.Rule; +import com.google.devtools.build.lib.skyframe.ConfiguredTargetKey; import com.google.devtools.build.lib.skylarkinterface.SkylarkPrinter; import com.google.devtools.build.lib.syntax.Printer; import java.util.function.Consumer; @@ -63,14 +63,14 @@ public enum Mode { DONT_CHECK } /** A set of this target's implicitDeps. */ - private final ImmutableSet implicitDeps; + private final ImmutableSet implicitDeps; /* * An interner for the implicitDeps set. {@link Util.findImplicitDeps} is called upon every * construction of a RuleConfiguredTarget and we expect many of these targets to contain the same * set of implicit deps so this reduces the memory load per build. */ - private static final Interner> IMPLICIT_DEPS_INTERNER = + private static final Interner> IMPLICIT_DEPS_INTERNER = BlazeInterners.newWeakInterner(); private final TransitiveInfoProviderMap providers; @@ -124,7 +124,7 @@ public ImmutableMap getConfigConditions() { return configConditions; } - public ImmutableSet getImplicitDeps() { + public ImmutableSet getImplicitDeps() { return implicitDeps; } diff --git a/src/main/java/com/google/devtools/build/lib/query2/ConfiguredTargetQueryEnvironment.java b/src/main/java/com/google/devtools/build/lib/query2/ConfiguredTargetQueryEnvironment.java index 73e253ec37cbb5..f71086733c43d3 100644 --- a/src/main/java/com/google/devtools/build/lib/query2/ConfiguredTargetQueryEnvironment.java +++ b/src/main/java/com/google/devtools/build/lib/query2/ConfiguredTargetQueryEnvironment.java @@ -21,7 +21,6 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.MoreExecutors; import com.google.devtools.build.lib.analysis.ConfiguredTarget; -import com.google.devtools.build.lib.analysis.LabelAndConfiguration; import com.google.devtools.build.lib.analysis.config.BuildConfiguration; import com.google.devtools.build.lib.analysis.configuredtargets.RuleConfiguredTarget; import com.google.devtools.build.lib.cmdline.Label; @@ -104,14 +103,14 @@ public class ConfiguredTargetQueryEnvironment private static final Function CT_TO_SKYKEY = target -> ConfiguredTargetValue.key(target.getLabel(), target.getConfiguration()); - private static final Function SKYKEY_TO_LANDC = + private static final Function SKYKEY_TO_CTKEY = skyKey -> { ConfiguredTargetKey key = (ConfiguredTargetKey) skyKey.argument(); - return LabelAndConfiguration.of(key.getLabel(), key.getConfiguration()); + return ConfiguredTargetKey.of(key.getLabel(), key.getConfiguration()); }; private static final ImmutableList ALL_PATTERNS; - private static final KeyExtractor - CONFIGURED_TARGET_KEY_EXTRACTOR = LabelAndConfiguration::of; + private static final KeyExtractor + CONFIGURED_TARGET_KEY_EXTRACTOR = ConfiguredTargetKey::of; static { TargetPattern targetPattern; @@ -310,13 +309,13 @@ private Collection getAllowedDeps( } } if (settings.contains(Setting.NO_IMPLICIT_DEPS) && target instanceof RuleConfiguredTarget) { - Set implicitDeps = ((RuleConfiguredTarget) target).getImplicitDeps(); + Set implicitDeps = ((RuleConfiguredTarget) target).getImplicitDeps(); deps = deps.stream() .filter( dep -> !implicitDeps.contains( - LabelAndConfiguration.of( + ConfiguredTargetKey.of( dep.getTarget().getLabel(), dep.getConfiguration()))) .collect(Collectors.toList()); } @@ -333,10 +332,10 @@ public ThreadSafeMutableSet getFwdDeps(Iterable> directDeps = targetifyValues(graph.getDirectDeps(targetsByKey.keySet())); if (targetsByKey.keySet().size() != directDeps.keySet().size()) { - Iterable missingTargets = + Iterable missingTargets = Sets.difference(targetsByKey.keySet(), directDeps.keySet()) .stream() - .map(SKYKEY_TO_LANDC) + .map(SKYKEY_TO_CTKEY) .collect(Collectors.toList()); eventHandler.handle(Event.warn("Targets were missing from graph: " + missingTargets)); } @@ -376,10 +375,10 @@ public Collection getReverseDeps(Iterable ta Map> reverseDepsByKey = targetifyValues(graph.getReverseDeps(targetsByKey.keySet())); if (targetsByKey.size() != reverseDepsByKey.size()) { - Iterable missingTargets = + Iterable missingTargets = Sets.difference(targetsByKey.keySet(), reverseDepsByKey.keySet()) .stream() - .map(SKYKEY_TO_LANDC) + .map(SKYKEY_TO_CTKEY) .collect(Collectors.toList()); eventHandler.handle(Event.warn("Targets were missing from graph: " + missingTargets)); } @@ -407,7 +406,7 @@ public void buildTransitiveClosure( @Override public ImmutableList getNodesOnPath(ConfiguredTarget from, ConfiguredTarget to) throws InterruptedException { - return SkyQueryUtils.getNodesOnPath(from, to, this::getFwdDeps, LabelAndConfiguration::of); + return SkyQueryUtils.getNodesOnPath(from, to, this::getFwdDeps, ConfiguredTargetKey::of); } @Override diff --git a/src/main/java/com/google/devtools/build/lib/runtime/AggregatingTestListener.java b/src/main/java/com/google/devtools/build/lib/runtime/AggregatingTestListener.java index a4a77c481417c8..b5ec577728c748 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/AggregatingTestListener.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/AggregatingTestListener.java @@ -30,7 +30,6 @@ import com.google.devtools.build.lib.analysis.AliasProvider; import com.google.devtools.build.lib.analysis.AnalysisFailureEvent; import com.google.devtools.build.lib.analysis.ConfiguredTarget; -import com.google.devtools.build.lib.analysis.LabelAndConfiguration; import com.google.devtools.build.lib.analysis.TargetCompleteEvent; import com.google.devtools.build.lib.analysis.test.TestProvider; import com.google.devtools.build.lib.analysis.test.TestResult; @@ -40,6 +39,7 @@ import com.google.devtools.build.lib.buildtool.buildevent.TestFilteringCompleteEvent; import com.google.devtools.build.lib.concurrent.ThreadSafety; import com.google.devtools.build.lib.rules.test.TestAttempt; +import com.google.devtools.build.lib.skyframe.ConfiguredTargetKey; import com.google.devtools.build.lib.view.test.TestStatus.BlazeTestStatus; import java.util.Collection; import java.util.Collections; @@ -61,8 +61,8 @@ public class AggregatingTestListener { // summaryLock guards concurrent access to these two collections, which should be kept // synchronized with each other. - private final Map summaries; - private final Multimap remainingRuns; + private final Map summaries; + private final Multimap remainingRuns; private final Object summaryLock = new Object(); public AggregatingTestListener(TestResultAnalyzer analyzer, EventBus eventBus) { @@ -122,8 +122,8 @@ public void testEvent(TestResult result) { "Duplicate result reported for an individual test shard"); ActionOwner testOwner = result.getTestAction().getOwner(); - LabelAndConfiguration targetLabel = LabelAndConfiguration.of( - testOwner.getLabel(), result.getTestAction().getConfiguration()); + ConfiguredTargetKey targetLabel = + ConfiguredTargetKey.of(testOwner.getLabel(), result.getTestAction().getConfiguration()); // If a test result was cached, then no attempts for that test were actually // executed. Hence report that fact as a cached attempt. @@ -155,17 +155,17 @@ public void testEvent(TestResult result) { } } - private void targetFailure(LabelAndConfiguration label) { + private void targetFailure(ConfiguredTargetKey configuredTargetKey) { TestSummary finalSummary; synchronized (summaryLock) { - if (!remainingRuns.containsKey(label)) { + if (!remainingRuns.containsKey(configuredTargetKey)) { // Blaze does not guarantee that BuildResult.getSuccessfulTargets() and posted TestResult // events are in sync. Thus, it is possible that a test event was posted, but the target is // not present in the set of successful targets. return; } - TestSummary.Builder summary = summaries.get(label); + TestSummary.Builder summary = summaries.get(configuredTargetKey); if (summary == null) { // Not a test target; nothing to do. return; @@ -176,7 +176,7 @@ private void targetFailure(LabelAndConfiguration label) { .build(); // These are never going to run; removing them marks the target complete. - remainingRuns.removeAll(label); + remainingRuns.removeAll(configuredTargetKey); } eventBus.post(finalSummary); } @@ -222,7 +222,7 @@ public void buildInterrupted(BuildInterruptedEvent event) { @AllowConcurrentEvents public void targetComplete(TargetCompleteEvent event) { if (event.failed()) { - targetFailure(LabelAndConfiguration.of(event.getTarget())); + targetFailure(ConfiguredTargetKey.of(event.getTarget())); } } @@ -261,8 +261,8 @@ public TestResultAnalyzer getAnalyzer() { return analyzer; } - private LabelAndConfiguration asKey(ConfiguredTarget target) { - return LabelAndConfiguration.of( + private ConfiguredTargetKey asKey(ConfiguredTarget target) { + return ConfiguredTargetKey.of( AliasProvider.getDependencyLabel(target), target.getConfiguration()); } } diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ActionArtifactCycleReporter.java b/src/main/java/com/google/devtools/build/lib/skyframe/ActionArtifactCycleReporter.java index 88082528489c3b..8c49441f25cb7f 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/ActionArtifactCycleReporter.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/ActionArtifactCycleReporter.java @@ -54,10 +54,10 @@ private String prettyPrint(SkyFunctionName skyFunctionName, Object arg) { return "action from: " + arg; } else if (arg instanceof TargetCompletionKey && skyFunctionName.equals(SkyFunctions.TARGET_COMPLETION)) { - return "configured target: " + ((TargetCompletionKey) arg).labelAndConfiguration().getLabel(); + return "configured target: " + ((TargetCompletionKey) arg).configuredTargetKey().getLabel(); } else if (arg instanceof TestCompletionKey && skyFunctionName.equals(SkyFunctions.TEST_COMPLETION)) { - return "test target: " + ((TestCompletionKey) arg).labelAndConfiguration().getLabel(); + return "test target: " + ((TestCompletionKey) arg).configuredTargetKey().getLabel(); } throw new IllegalStateException( "Argument is not Action, TargetCompletion, TestCompletion or OwnedArtifact: " + arg); @@ -72,10 +72,10 @@ protected Label getLabel(SkyKey key) { return ((ActionLookupData) arg).getLabelForErrors(); } else if (arg instanceof TargetCompletionKey && key.functionName().equals(SkyFunctions.TARGET_COMPLETION)) { - return ((TargetCompletionKey) arg).labelAndConfiguration().getLabel(); + return ((TargetCompletionKey) arg).configuredTargetKey().getLabel(); } else if (arg instanceof TestCompletionKey && key.functionName().equals(SkyFunctions.TEST_COMPLETION)) { - return ((TestCompletionKey) arg).labelAndConfiguration().getLabel(); + return ((TestCompletionKey) arg).configuredTargetKey().getLabel(); } throw new IllegalStateException( "Argument is not Action, TargetCompletion, TestCompletion or OwnedArtifact: " + arg); diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/CompletionFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/CompletionFunction.java index 68533985cc09dd..103fd73167b576 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/CompletionFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/CompletionFunction.java @@ -19,7 +19,6 @@ import com.google.devtools.build.lib.actions.MissingInputFileException; import com.google.devtools.build.lib.analysis.AspectCompleteEvent; import com.google.devtools.build.lib.analysis.ConfiguredTarget; -import com.google.devtools.build.lib.analysis.LabelAndConfiguration; import com.google.devtools.build.lib.analysis.TargetCompleteEvent; import com.google.devtools.build.lib.analysis.TopLevelArtifactContext; import com.google.devtools.build.lib.analysis.TopLevelArtifactHelper; @@ -101,7 +100,7 @@ private static class TargetCompletor public ConfiguredTargetValue getValueFromSkyKey(SkyKey skyKey, Environment env) throws InterruptedException { TargetCompletionKey tcKey = (TargetCompletionKey) skyKey.argument(); - LabelAndConfiguration lac = tcKey.labelAndConfiguration(); + ConfiguredTargetKey lac = tcKey.configuredTargetKey(); return (ConfiguredTargetValue) env.getValue(ConfiguredTargetValue.key(lac.getLabel(), lac.getConfiguration())); } @@ -151,7 +150,7 @@ public SkyValue createFailed(ConfiguredTargetValue value, NestedSet rootC @Override public String extractTag(SkyKey skyKey) { return Label.print( - ((TargetCompletionKey) skyKey.argument()).labelAndConfiguration().getLabel()); + ((TargetCompletionKey) skyKey.argument()).configuredTargetKey().getLabel()); } } 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 51584f2d8e8914..af83e3c9a68851 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 @@ -30,7 +30,6 @@ import com.google.devtools.build.lib.analysis.ConfiguredTargetFactory; import com.google.devtools.build.lib.analysis.Dependency; import com.google.devtools.build.lib.analysis.DependencyResolver.InconsistentAspectOrderException; -import com.google.devtools.build.lib.analysis.LabelAndConfiguration; import com.google.devtools.build.lib.analysis.TargetAndConfiguration; import com.google.devtools.build.lib.analysis.ToolchainContext; import com.google.devtools.build.lib.analysis.config.BuildConfiguration; @@ -141,13 +140,12 @@ public SkyValue compute(SkyKey key, Environment env) throws ConfiguredTargetFunc storeTransitivePackagesForPackageRootResolution ? NestedSetBuilder.stableOrder() : null; NestedSetBuilder