aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/collect/nestedset/BUILD
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2018-06-04 15:48:09 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-06-04 15:49:47 -0700
commit95010e41d44161244fbd30bc729c3e55b5417a47 (patch)
tree3058213c9fc270476f66e5fe96d4eb9bf2297a1c /src/main/java/com/google/devtools/build/lib/collect/nestedset/BUILD
parentc3495858f097451e06044778bc806e94e06d6da7 (diff)
Add cache to NestedSetCodecWithStore to merge NestedSets that should be reference-equal on deserialization. We cannot just intern NestedSets because NestedSets with the same underlying children may still not be equal, so we wrap them in an object that does consider their children when calculating equality.
We wish to preserve the invariant that if NestedSets inside two different objects are reference-equal, they will continue to be reference-equal after deserialization. Not doing that causes bugs. Unfortunately, because Artifact#equals does not take ArtifactOwner into account, this introduces a new bug (exposed via a disabled test here) where unequal singleton NestedSets may be considered equal. I will clean this up in the future by fixing Artifact#equals. PiperOrigin-RevId: 199208045
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/collect/nestedset/BUILD')
-rw-r--r--src/main/java/com/google/devtools/build/lib/collect/nestedset/BUILD1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/collect/nestedset/BUILD b/src/main/java/com/google/devtools/build/lib/collect/nestedset/BUILD
index e9a487f281..134eaca919 100644
--- a/src/main/java/com/google/devtools/build/lib/collect/nestedset/BUILD
+++ b/src/main/java/com/google/devtools/build/lib/collect/nestedset/BUILD
@@ -20,6 +20,7 @@ java_library(
],
deps = [
"//src/main/java/com/google/devtools/build/lib/collect/compacthashset",
+ "//src/main/java/com/google/devtools/build/lib/concurrent",
"//src/main/java/com/google/devtools/build/lib/skyframe/serialization",
"//src/main/java/com/google/devtools/build/lib/skyframe/serialization:constants",
"//src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec",