Remove incomplete TransitiveTargetValue serialization. We have NestedSet serialization now.
@@ -16,28 +16,20 @@ package com.google.devtools.build.lib.skyframe;
import com.google.devtools.build.lib.analysis.config.BuildConfiguration;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
-import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
-import com.google.devtools.build.lib.collect.nestedset.Order;
import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
import com.google.devtools.build.lib.packages.NoSuchTargetException;
import com.google.devtools.build.skyframe.SkyValue;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
import javax.annotation.Nullable;
/**
* A <i>transitive</i> target reference that, when built in skyframe, loads the entire
* transitive closure of a target.
- *
- * <p>Note that this class drops transitive targets during serialization!
*/
@Immutable
@ThreadSafe
public class TransitiveTargetValue implements SkyValue {
- // Non-final for serialization purposes.
- private NestedSet<Label> transitiveTargets;
+ private final NestedSet<Label> transitiveTargets;
@Nullable private NestedSet<Label> transitiveRootCauses;
@Nullable private NoSuchTargetException errorLoadingTarget;
private NestedSet<Class<? extends BuildConfiguration.Fragment>> transitiveConfigFragments;
@@ -53,25 +45,6 @@ public class TransitiveTargetValue implements SkyValue {
this.transitiveConfigFragments = transitiveConfigFragments;
}
- private void writeObject(ObjectOutputStream out) throws IOException {
- // Deliberately do not write out transitiveTargets. There is a lot of those and they drive
- // serialization costs through the roof, both in terms of space and of time.
- // TODO(bazel-team): Deal with this properly once we have efficient serialization of NestedSets.
- out.writeObject(transitiveRootCauses);
- out.writeObject(errorLoadingTarget);
- out.writeObject(transitiveConfigFragments);
- }
-
- @SuppressWarnings("unchecked")
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- // TODO(bazel-team): Deal with transitiveTargets properly.
- transitiveTargets = NestedSetBuilder.emptySet(Order.STABLE_ORDER);
- transitiveRootCauses = (NestedSet<Label>) in.readObject();
- errorLoadingTarget = (NoSuchTargetException) in.readObject();
- transitiveConfigFragments =
- (NestedSet<Class<? extends BuildConfiguration.Fragment>>) in.readObject();
- }
-
static TransitiveTargetValue unsuccessfulTransitiveLoading(
NestedSet<Label> transitiveTargets,
NestedSet<Label> rootCauses, @Nullable NoSuchTargetException errorLoadingTarget,
