diff --git a/src/main/java/com/google/devtools/build/lib/analysis/constraints/IncompatibleTargetChecker.java b/src/main/java/com/google/devtools/build/lib/analysis/constraints/IncompatibleTargetChecker.java index 0519a1f0f897f9..1f49e9a7be74e4 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/constraints/IncompatibleTargetChecker.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/constraints/IncompatibleTargetChecker.java @@ -45,6 +45,7 @@ import com.google.devtools.build.lib.events.ExtendedEventHandler; import com.google.devtools.build.lib.packages.BuildType; import com.google.devtools.build.lib.packages.ConfiguredAttributeMapper; +import com.google.devtools.build.lib.packages.ConfiguredAttributeMapper.ValidationException; import com.google.devtools.build.lib.packages.Package; import com.google.devtools.build.lib.packages.PackageSpecification; import com.google.devtools.build.lib.packages.PackageSpecification.PackageGroupContents; @@ -56,6 +57,7 @@ import com.google.devtools.build.lib.util.OrderedSetMultimap; import com.google.devtools.build.skyframe.SkyValue; import com.google.devtools.build.skyframe.state.StateMachine; +import java.util.List; import java.util.Optional; import java.util.function.Consumer; import javax.annotation.Nullable; @@ -115,6 +117,8 @@ public static class IncompatibleTargetProducer implements StateMachine, Consumer /** Sink for the output of this state machine. */ public interface ResultSink { void accept(Optional incompatibleTarget); + + void acceptValidationException(ValidationException e); } public IncompatibleTargetProducer( @@ -148,8 +152,16 @@ public StateMachine step(Tasks tasks, ExtendedEventHandler listener) { return DONE; } - // Resolves the constraint labels. - for (Label label : attrs.get("target_compatible_with", BuildType.LABEL_LIST)) { + // Resolves the constraint labels, checking for invalid configured attributes. + List