Fix xds_end2end_test dyld (#28133)
diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl
index 84e24cd..46abf42 100644
--- a/bazel/grpc_build_system.bzl
+++ b/bazel/grpc_build_system.bzl
@@ -252,7 +252,7 @@
deps = ios_test_deps,
)
-def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data = [], uses_polling = True, language = "C++", size = "medium", timeout = None, tags = [], exec_compatible_with = [], exec_properties = {}, shard_count = None, flaky = None, copts = []):
+def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data = [], uses_polling = True, language = "C++", size = "medium", timeout = None, tags = [], exec_compatible_with = [], exec_properties = {}, shard_count = None, flaky = None, copts = [], linkstatic = None):
"""A cc_test target for use in the gRPC repo.
Args:
@@ -274,6 +274,7 @@
shard_count: The number of shards for this test.
flaky: Whether this test is flaky.
copts: Add these to the compiler invocation.
+ linkstatic: link the binary in static mode
"""
copts = copts + if_mac(["-DGRPC_CFSTREAM"])
if language.upper() == "C":
@@ -294,6 +295,7 @@
"exec_properties": exec_properties,
"shard_count": shard_count,
"flaky": flaky,
+ "linkstatic": linkstatic,
}
if uses_polling:
# the vanilla version of the test should run on platforms that only
diff --git a/test/cpp/end2end/xds/BUILD b/test/cpp/end2end/xds/BUILD
index b30451f..3c5bc1a 100644
--- a/test/cpp/end2end/xds/BUILD
+++ b/test/cpp/end2end/xds/BUILD
@@ -64,6 +64,7 @@
"gtest",
],
flaky = True, # TODO(b/144705388)
+ linkstatic = True, # Fixes dyld error on MacOS
shard_count = 50,
tags = [
"no_test_ios",