Remove unneeded dependencies in BuildInfoCollectionValue.
@@ -18,7 +18,6 @@ import com.google.common.collect.Interner;
import com.google.devtools.build.lib.actions.Actions.GeneratingActions;
import com.google.devtools.build.lib.actions.BasicActionLookupValue;
import com.google.devtools.build.lib.analysis.buildinfo.BuildInfoCollection;
-import com.google.devtools.build.lib.analysis.buildinfo.BuildInfoFactory;
import com.google.devtools.build.lib.analysis.buildinfo.BuildInfoKey;
import com.google.devtools.build.lib.analysis.config.BuildConfiguration;
import com.google.devtools.build.lib.cmdline.Label;
@@ -26,10 +25,12 @@ import com.google.devtools.build.lib.concurrent.BlazeInterners;
import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec;
import com.google.devtools.build.skyframe.SkyFunctionName;
import java.util.Objects;
+import javax.annotation.Nullable;
/**
- * Value that stores {@link BuildInfoCollection}s generated by {@link BuildInfoFactory} instances.
- * These collections are used during analysis (see {@code CachingAnalysisEnvironment}).
+ * Value that stores {@link BuildInfoCollection}s generated by {@link
+ * com.google.devtools.build.lib.analysis.buildinfo.BuildInfoFactory} instances. These collections
+ * are used during analysis (see {@code CachingAnalysisEnvironment}).
*/
public class BuildInfoCollectionValue extends BasicActionLookupValue {
private final BuildInfoCollection collection;
@@ -48,8 +49,9 @@ public class BuildInfoCollectionValue extends BasicActionLookupValue {
return getStringHelper().add("collection", collection).toString();
}
- public static BuildInfoKeyAndConfig key(BuildInfoKey key, BuildConfiguration config) {
- return BuildInfoKeyAndConfig.create(key, ConfiguredTargetKey.keyFromConfiguration(config).key);
+ public static BuildInfoKeyAndConfig key(BuildInfoKey key, @Nullable BuildConfiguration config) {
+ return BuildInfoKeyAndConfig.create(
+ key, config == null ? null : BuildConfigurationValue.key(config));
}
/** Key for BuildInfoCollectionValues. */
