Make BuildConfigurationValue.Key a SkyKey. For now, it would be nice to put it inside ConfiguredTargetKey instead of having a BuildConfiguration there, so it's going to be more widely used.
@@ -17,7 +17,7 @@ import com.google.common.base.Preconditions;
import com.google.devtools.build.lib.analysis.config.BuildConfiguration;
import com.google.devtools.build.lib.analysis.config.BuildOptions;
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
-import com.google.devtools.build.skyframe.LegacySkyKey;
+import com.google.devtools.build.skyframe.SkyFunctionName;
import com.google.devtools.build.skyframe.SkyKey;
import com.google.devtools.build.skyframe.SkyValue;
import java.io.Serializable;
@@ -51,11 +51,10 @@ public class BuildConfigurationValue implements SkyValue {
@ThreadSafe
public static SkyKey key(Set<Class<? extends BuildConfiguration.Fragment>> fragments,
BuildOptions buildOptions) {
- return LegacySkyKey.create(
- SkyFunctions.BUILD_CONFIGURATION, new Key(fragments, buildOptions));
+ return new Key(fragments, buildOptions);
}
- static final class Key implements Serializable {
+ static final class Key implements SkyKey, Serializable {
private final Set<Class<? extends BuildConfiguration.Fragment>> fragments;
private final BuildOptions buildOptions;
private final boolean enableActions;
@@ -78,6 +77,11 @@ public class BuildConfigurationValue implements SkyValue {
return buildOptions;
}
+ @Override
+ public SkyFunctionName functionName() {
+ return SkyFunctions.BUILD_CONFIGURATION;
+ }
+
@Override
public boolean equals(Object o) {
if (!(o instanceof Key)) {
