Add a "nonce version" fingerprint to ActionLookupValue, potentially populated for the ActionLookupValues that need it: *ConfiguredTargetValue and AspectValue. These need it because they contain objects that use reference equality for comparisons (notably, CcLinkingParams). Following an idea coming from shahan@.
PiperOrigin-RevId: 231319823
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 eb525be..c5f3242 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
@@ -36,6 +36,7 @@
import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec;
import com.google.devtools.build.lib.syntax.SkylarkImport;
import com.google.devtools.build.skyframe.SkyFunctionName;
+import java.math.BigInteger;
import javax.annotation.Nullable;
/** An aspect in the context of the Skyframe graph. */
@@ -442,8 +443,9 @@
Label label,
Location location,
ConfiguredAspect configuredAspect,
- NestedSet<Package> transitivePackagesForPackageRootResolution) {
- super(configuredAspect.getActions(), configuredAspect.getGeneratingActionIndex());
+ NestedSet<Package> transitivePackagesForPackageRootResolution,
+ BigInteger nonceVersion) {
+ super(configuredAspect.getActions(), configuredAspect.getGeneratingActionIndex(), nonceVersion);
this.label = Preconditions.checkNotNull(label, actions);
this.aspect = Preconditions.checkNotNull(aspect, label);
this.location = Preconditions.checkNotNull(location, label);
@@ -489,6 +491,11 @@
transitivePackagesForPackageRootResolution = null;
}
+ @Override
+ public final boolean mustBeReferenceComparedOnRecomputation() {
+ return true;
+ }
+
/**
* Returns the set of packages transitively loaded by this value. Must only be used for
* constructing the package -> source root map needed for some builds. If the caller has not