From 34c5ef22e88eba60238ad3735b74ea71db1c993e Mon Sep 17 00:00:00 2001 From: Googler Date: Tue, 22 Aug 2023 16:14:09 -0700 Subject: [PATCH] make sure IdempotencyChecker use the correct rule transition and remove redundant computeTransition calls. PiperOrigin-RevId: 559252770 Change-Id: Iab6c893c25aae081ff35407c6650b12bdd214607 --- .../TargetAndConfigurationProducer.java | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/analysis/producers/TargetAndConfigurationProducer.java b/src/main/java/com/google/devtools/build/lib/analysis/producers/TargetAndConfigurationProducer.java index fbd2579cc2e75d..6e554aca213bf2 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/producers/TargetAndConfigurationProducer.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/producers/TargetAndConfigurationProducer.java @@ -229,14 +229,7 @@ private StateMachine determineConfiguration(Tasks tasks) { return DONE; } - ConfigurationTransition transition = - computeTransition(target.getAssociatedRule(), trimmingTransitionFactory); - if (transition == null) { - lookUpConfigurationValue(tasks); - return DONE; - } - - return new RuleTransitionApplier(transition); + return new RuleTransitionApplier(); } private void delegateTo(Tasks tasks, ActionLookupKey delegate) { @@ -274,19 +267,12 @@ private class RuleTransitionApplier TransitionApplier.ResultSink, ConfigConditionsProducer.ResultSink, PlatformInfoProducer.ResultSink { - // -------------------- Input -------------------- - private final ConfigurationTransition transition; // -------------------- Internal State -------------------- - private BuildConfigurationKey configurationKey; - - private RuleTransitionApplier(ConfigurationTransition transition) { - this.transition = transition; - } - - private ConfigConditions configConditions; - @Nullable private PlatformInfo platformInfo; - + private ConfigConditions configConditions; + private ConfigurationTransition ruleTransition; + private BuildConfigurationKey configurationKey; + @Override public StateMachine step(Tasks tasks) throws InterruptedException { @@ -316,6 +302,7 @@ public StateMachine step(Tasks tasks) throws InterruptedException { return DONE; } + // TODO: @aranguyen b/297077082 public UnloadedToolchainContextsInputs getUnloadedToolchainContextsInputs( Target target, @Nullable Label parentExecutionPlatformLabel) throws InterruptedException { if (!(target instanceof Rule)) { @@ -450,6 +437,7 @@ private ImmutableSet