Second attempt: Don't build RLS on mobile (#27878)

* Revert "revert changes to not build RLS on mobile (#27875)"

This reverts commit 73ad459c51.

* new approach using multiple select() calls
reviewable/pr25586/r17^2
Mark D. Roth 3 years ago committed by GitHub
parent 9d0922e02d
commit 3bde8305cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 66
      BUILD
  2. 3
      bazel/grpc_build_system.bzl
  3. 4
      src/core/plugin_registry/grpc_plugin_registry.cc
  4. 1
      test/core/client_channel/BUILD
  5. 1
      test/cpp/end2end/BUILD

66
BUILD

@ -58,12 +58,6 @@ 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_no_xds",
match_any = [
@ -77,6 +71,22 @@ selects.config_setting_group(
],
)
selects.config_setting_group(
name = "grpc_no_rls",
match_any = [
# Disable RLS support 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"},
@ -368,6 +378,16 @@ 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 = [
@ -377,21 +397,22 @@ grpc_cc_library(
defines = select({
"grpc_no_xds": ["GRPC_NO_XDS"],
"//conditions:default": [],
}) + select({
"grpc_no_rls": ["GRPC_NO_RLS"],
"//conditions:default": [],
}),
language = "c++",
public_hdrs = GRPC_PUBLIC_HDRS + GRPC_SECURE_PUBLIC_HDRS,
select_deps = {
"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",
],
},
select_deps = [
{
"grpc_no_xds": [],
"//conditions:default": GRPC_XDS_TARGETS,
},
{
"grpc_no_rls": [],
"//conditions:default": ["grpc_lb_policy_rls"],
},
],
standalone = True,
visibility = [
"@grpc:public",
@ -402,7 +423,6 @@ 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",
@ -431,13 +451,13 @@ grpc_cc_library(
],
language = "c++",
public_hdrs = GRPCXX_PUBLIC_HDRS,
select_deps = {
select_deps = [{
"grpc_no_xds": [],
"//conditions:default": [
"grpc++_xds_client",
"grpc++_xds_server",
],
},
}],
standalone = True,
visibility = [
"@grpc:public",
@ -4034,10 +4054,10 @@ grpc_cc_library(
public_hdrs = [
"include/grpcpp/ext/admin_services.h",
],
select_deps = {
select_deps = [{
"grpc_no_xds": [],
"//conditions:default": ["//:grpcpp_csds"],
},
}],
deps = [
"gpr",
"grpc++",

@ -131,7 +131,8 @@ def grpc_cc_library(
linkopts = linkopts + if_mac(["-framework CoreFoundation"])
if select_deps:
deps += select(select_deps)
for select_deps_entry in select_deps:
deps += select(select_deps_entry)
native.cc_library(
name = name,

@ -54,8 +54,10 @@ 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
@ -101,8 +103,10 @@ 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,

@ -66,6 +66,7 @@ grpc_cc_test(
"gtest",
],
language = "C++",
tags = ["no_test_ios"],
deps = [
"//:grpc",
"//test/core/util:grpc_test_util",

@ -484,6 +484,7 @@ grpc_cc_test(
"gtest",
"absl/types:optional",
],
tags = ["no_test_ios"],
deps = [
":counted_service",
":test_service_impl",

Loading…
Cancel
Save