Implement targetsToSkip for Skymeld.
To figure out which targets to skip, we have to use TopLevelConstraintSemantics, which is extra-Skyframe, and itself makes Skyframe evaluations. In order to make it work with Skymeld, we adopted the various checks in TopLevelConstraintSemantics into BuildDriverFunction.
While porting these checks to Skyframe, we tried as much as possible to reuse the code, hence the refactoring of TopLevelConstraintSemantics.
PiperOrigin-RevId: 446662371
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverKey.java b/src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverKey.java
index ece15d6..f2744c4 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverKey.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverKey.java
@@ -28,49 +28,46 @@
private final TopLevelArtifactContext topLevelArtifactContext;
private final TestType testType;
private final boolean strictActionConflictCheck;
-
- public boolean isTopLevelAspectDriver() {
- return isTopLevelAspectDriver;
- }
-
- private final boolean isTopLevelAspectDriver;
+ private final boolean explicitlyRequested;
private BuildDriverKey(
ActionLookupKey actionLookupKey,
TopLevelArtifactContext topLevelArtifactContext,
boolean strictActionConflictCheck,
- TestType testType,
- boolean isTopLevelAspectDriver) {
+ boolean explicitlyRequested,
+ TestType testType) {
this.actionLookupKey = actionLookupKey;
this.topLevelArtifactContext = topLevelArtifactContext;
this.strictActionConflictCheck = strictActionConflictCheck;
this.testType = testType;
- this.isTopLevelAspectDriver = isTopLevelAspectDriver;
+ this.explicitlyRequested = explicitlyRequested;
}
public static BuildDriverKey ofTopLevelAspect(
ActionLookupKey actionLookupKey,
TopLevelArtifactContext topLevelArtifactContext,
- boolean strictActionConflictCheck) {
+ boolean strictActionConflictCheck,
+ boolean explicitlyRequested) {
return new BuildDriverKey(
actionLookupKey,
topLevelArtifactContext,
strictActionConflictCheck,
- TestType.NOT_TEST,
- /*isTopLevelAspectDriver=*/ true);
+ explicitlyRequested,
+ TestType.NOT_TEST);
}
public static BuildDriverKey ofConfiguredTarget(
ActionLookupKey actionLookupKey,
TopLevelArtifactContext topLevelArtifactContext,
boolean strictActionConflictCheck,
+ boolean explicitlyRequested,
TestType testType) {
return new BuildDriverKey(
actionLookupKey,
topLevelArtifactContext,
strictActionConflictCheck,
- testType,
- /*isTopLevelAspectDriver=*/ false);
+ explicitlyRequested,
+ testType);
}
public TopLevelArtifactContext getTopLevelArtifactContext() {
@@ -93,6 +90,10 @@
return strictActionConflictCheck;
}
+ public boolean isExplicitlyRequested() {
+ return explicitlyRequested;
+ }
+
@Override
public SkyFunctionName functionName() {
return SkyFunctions.BUILD_DRIVER;