aboutsummaryrefslogtreecommitdiff
path: root/test_defs.bzl
diff options
context:
space:
mode:
authorBrad Corso <bcorso@google.com>2021-06-04 15:18:10 -0700
committerDagger Team <dagger-dev+copybara@google.com>2021-06-04 15:19:36 -0700
commit627dc7a1f2bbf0cfff76738265728a4e9d65cb9c (patch)
tree46e44f1e6710384ee813d3b5526e4dfacdced268 /test_defs.bzl
parente33297d77bb77bb3cdbc3739035b0029112c152f (diff)
downloaddagger2-627dc7a1f2bbf0cfff76738265728a4e9d65cb9c.tar.gz
Extend sharding to default mode.
This CL changes the BindingExpressions and CreationExpressions for a given binding to contribute to its corresponding shard. In addition, this CL removes the ability to contribute directly to a ComponentImplementation to force using a shard to contribute code. The shard for a binding is calculated upfront using Tarjan's algorithm for calculating strongly connected components. This algorithm has two benefits 1) it groups the bindings in the graph into strongly connected components so that we can ensure that bindings participating in a cycle belong to the same shard and 2) it returns the groups in reverse topological order so that initializing Shard{i} before Shard{i+1} ensures all of Shard{i+1} dependencies have already been created. RELNOTES=N/A PiperOrigin-RevId: 377600402
Diffstat (limited to 'test_defs.bzl')
-rw-r--r--test_defs.bzl2
1 files changed, 2 insertions, 0 deletions
diff --git a/test_defs.bzl b/test_defs.bzl
index 6f2308877..6e5463900 100644
--- a/test_defs.bzl
+++ b/test_defs.bzl
@@ -19,7 +19,9 @@ load("@rules_java//java:defs.bzl", "java_library", "java_test")
# Defines a set of build variants and the list of extra javacopts to build with.
# The key will be appended to the generated test names to ensure uniqueness.
BUILD_VARIANTS = {
+ "Shards": ["-Adagger.keysPerComponentShard=2"],
"FastInit": ["-Adagger.fastInit=enabled"],
+ "FastInit_Shards": ["-Adagger.fastInit=enabled", "-Adagger.keysPerComponentShard=2"],
}
# TODO(ronshapiro): convert this to use bazel_common