Mark `ArtifactNestedSetKey` as never shareable.
I'm working toward declaring shareability only from the key instead of having methods in each of the function, key, and value.
@@ -17,6 +17,7 @@ import com.google.common.base.MoreObjects;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.skyframe.ExecutionPhaseSkyKey;
+import com.google.devtools.build.skyframe.ShareabilityOfValue;
import com.google.devtools.build.skyframe.SkyFunctionName;
/** SkyKey for {@code NestedSet<Artifact>}. */
@@ -45,6 +46,13 @@ public final class ArtifactNestedSetKey implements ExecutionPhaseSkyKey {
return set;
}
+ @Override
+ public ShareabilityOfValue getShareabilityOfValue() {
+ // ArtifactNestedSetValue is just a promise that data is available in memory. Not meant for
+ // cross-server sharing.
+ return ShareabilityOfValue.NEVER;
+ }
+
@Override
public int hashCode() {
return node.hashCode();
@@ -52,6 +60,9 @@ public final class ArtifactNestedSetKey implements ExecutionPhaseSkyKey {
@Override
public boolean equals(Object that) {
+ if (this == that) {
+ return true;
+ }
return that instanceof ArtifactNestedSetKey
&& this.node.equals(((ArtifactNestedSetKey) that).node);
}
