From 73ad459c512e5554421fc72eb0d9e9b7db423c04 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 29 Oct 2021 12:00:00 -0700 Subject: [PATCH] revert changes to not build RLS on mobile (#27875) * Revert "fix mobile builds to properly exclude xDS (#27855)" This reverts commit 64d026e23485104a763414c93834dd449a865726. * Revert "don't build RLS on mobile (#27838)" This reverts commit 2a69c525b8f746c3fce2ca53806af5ce555d8adf. --- BUILD | 58 ++++++++----------- .../plugin_registry/grpc_plugin_registry.cc | 4 -- test/core/client_channel/BUILD | 1 - test/cpp/end2end/BUILD | 1 - 4 files changed, 24 insertions(+), 40 deletions(-) diff --git a/BUILD b/BUILD index 181a9fb83f7..1ced959fc1f 100644 --- a/BUILD +++ b/BUILD @@ -44,7 +44,7 @@ config_setting( ) config_setting( - name = "grpc_no_xds", + name = "grpc_no_xds_define", values = {"define": "grpc_no_xds=true"}, ) @@ -58,20 +58,25 @@ config_setting( values = {"apple_platform_type": "ios"}, ) +# Fuzzers can be built as fuzzers or as tests +config_setting( + name = "grpc_build_fuzzers", + values = {"define": "grpc_build_fuzzers=true"}, +) + selects.config_setting_group( - name = "grpc_mobile", + name = "grpc_no_xds", match_any = [ + ":grpc_no_xds_define", + # In addition to disabling XDS support when --define=grpc_no_xds=true is + # specified, we also disable it on mobile platforms where it is not + # likely to be needed and where reducing the binary size is more + # important. ":android", ":ios", ], ) -# Fuzzers can be built as fuzzers or as tests -config_setting( - name = "grpc_build_fuzzers", - values = {"define": "grpc_build_fuzzers=true"}, -) - config_setting( name = "grpc_allow_exceptions", values = {"define": "GRPC_ALLOW_EXCEPTIONS=1"}, @@ -363,16 +368,6 @@ grpc_cc_library( ], ) -GRPC_XDS_TARGETS = [ - "grpc_lb_policy_cds", - "grpc_lb_policy_xds_cluster_impl", - "grpc_lb_policy_xds_cluster_manager", - "grpc_lb_policy_xds_cluster_resolver", - "grpc_resolver_xds", - "grpc_resolver_c2p", - "grpc_xds_server_config_fetcher", -] - grpc_cc_library( name = "grpc", srcs = [ @@ -380,25 +375,22 @@ grpc_cc_library( "src/core/plugin_registry/grpc_plugin_registry.cc", ], defines = select({ - # On mobile, don't build RLS or xDS. - "grpc_mobile": [ - "GRPC_NO_XDS", - "GRPC_NO_RLS", - ], - # Don't build xDS if --define=grpc_no_xds=true is used. "grpc_no_xds": ["GRPC_NO_XDS"], - # By default, build both RLS and xDS. "//conditions:default": [], }), language = "c++", public_hdrs = GRPC_PUBLIC_HDRS + GRPC_SECURE_PUBLIC_HDRS, select_deps = { - # On mobile, don't build RLS or xDS. - "grpc_mobile": [], - # Don't build xDS if --define=grpc_no_xds=true is used. - "grpc_no_xds": ["grpc_lb_policy_rls"], - # By default, build both RLS and xDS. - "//conditions:default": ["grpc_lb_policy_rls"] + GRPC_XDS_TARGETS, + "grpc_no_xds": [], + "//conditions:default": [ + "grpc_lb_policy_cds", + "grpc_lb_policy_xds_cluster_impl", + "grpc_lb_policy_xds_cluster_manager", + "grpc_lb_policy_xds_cluster_resolver", + "grpc_resolver_xds", + "grpc_resolver_c2p", + "grpc_xds_server_config_fetcher", + ], }, standalone = True, visibility = [ @@ -410,6 +402,7 @@ grpc_cc_library( "grpc_base", "grpc_common", "grpc_lb_policy_grpclb_secure", + "grpc_lb_policy_rls", "grpc_secure", "grpc_trace", "grpc_transport_chttp2_client_secure", @@ -440,7 +433,6 @@ grpc_cc_library( public_hdrs = GRPCXX_PUBLIC_HDRS, select_deps = { "grpc_no_xds": [], - "grpc_mobile": [], "//conditions:default": [ "grpc++_xds_client", "grpc++_xds_server", @@ -4037,7 +4029,6 @@ grpc_cc_library( hdrs = [], defines = select({ "grpc_no_xds": ["GRPC_NO_XDS"], - "grpc_mobile": ["GRPC_NO_XDS"], "//conditions:default": [], }), external_deps = [ @@ -4049,7 +4040,6 @@ grpc_cc_library( ], select_deps = { "grpc_no_xds": [], - "grpc_mobile": [], "//conditions:default": ["//:grpcpp_csds"], }, deps = [ diff --git a/src/core/plugin_registry/grpc_plugin_registry.cc b/src/core/plugin_registry/grpc_plugin_registry.cc index 8fb0d54ff7c..734c585da23 100644 --- a/src/core/plugin_registry/grpc_plugin_registry.cc +++ b/src/core/plugin_registry/grpc_plugin_registry.cc @@ -54,10 +54,8 @@ void FaultInjectionFilterInit(void); void FaultInjectionFilterShutdown(void); void GrpcLbPolicyRingHashInit(void); void GrpcLbPolicyRingHashShutdown(void); -#ifndef GRPC_NO_RLS void RlsLbPluginInit(); void RlsLbPluginShutdown(); -#endif // !GRPC_NO_RLS void ServiceConfigParserInit(void); void ServiceConfigParserShutdown(void); } // namespace grpc_core @@ -103,10 +101,8 @@ void grpc_register_built_in_plugins(void) { grpc_register_plugin(grpc_resolver_fake_init, grpc_resolver_fake_shutdown); grpc_register_plugin(grpc_lb_policy_grpclb_init, grpc_lb_policy_grpclb_shutdown); -#ifndef GRPC_NO_RLS grpc_register_plugin(grpc_core::RlsLbPluginInit, grpc_core::RlsLbPluginShutdown); -#endif // !GRPC_NO_RLS grpc_register_plugin(grpc_lb_policy_priority_init, grpc_lb_policy_priority_shutdown); grpc_register_plugin(grpc_lb_policy_weighted_target_init, diff --git a/test/core/client_channel/BUILD b/test/core/client_channel/BUILD index c5b6b05b723..e9e4c75ec39 100644 --- a/test/core/client_channel/BUILD +++ b/test/core/client_channel/BUILD @@ -66,7 +66,6 @@ grpc_cc_test( "gtest", ], language = "C++", - tags = ["no_test_ios"], deps = [ "//:grpc", "//test/core/util:grpc_test_util", diff --git a/test/cpp/end2end/BUILD b/test/cpp/end2end/BUILD index e59d371b80c..e19c3927d36 100644 --- a/test/cpp/end2end/BUILD +++ b/test/cpp/end2end/BUILD @@ -484,7 +484,6 @@ grpc_cc_test( "gtest", "absl/types:optional", ], - tags = ["no_test_ios"], deps = [ ":counted_service", ":test_service_impl",