diff --git a/.clang_complete b/.clang_complete index 1448b01342d..f789455ea95 100644 --- a/.clang_complete +++ b/.clang_complete @@ -1,18 +1,19 @@ -Wall -Wc++-compat --Ithird_party/googletest/include --Ithird_party/googletest --Iinclude --Igens -I. --Ithird_party/boringssl/include --Ithird_party/benchmark/include --Ithird_party/zlib --Ithird_party/protobuf/src +-Igens +-Iinclude +-Isrc/core/ext/upb-generated -Ithird_party/abseil-cpp --Ithird_party/cares/cares +-Ithird_party/benchmark/include +-Ithird_party/boringssl/include -Ithird_party/cares --Ithird_party/googletest/googletest/include +-Ithird_party/cares/cares +-Ithird_party/googletest -Ithird_party/googletest/googlemock/include +-Ithird_party/googletest/googletest/include +-Ithird_party/googletest/include -Ithird_party/nanopb - +-Ithird_party/protobuf/src +-Ithird_party/upb +-Ithird_party/zlib diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE/bug_report.md old mode 100755 new mode 100644 similarity index 90% rename from .github/ISSUE_TEMPLATE.md rename to .github/ISSUE_TEMPLATE/bug_report.md index acfcdc14845..6eafaacd034 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,3 +1,11 @@ +--- +name: Report a bug +about: Create a report to help us improve +labels: kind/bug +assignees: AspirinSJL + +--- + - + ### What version of gRPC and what language are you using? - - + + ### What operating system (Linux, Windows,...) and version? - - + + ### What runtime / compiler are you using (e.g. python version or version of gcc) - - + + ### What did you do? If possible, provide a recipe for reproducing the error. Try being specific and include code snippets if helpful. - + ### What did you expect to see? - - + + ### What did you see instead? - + Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs). See [TROUBLESHOOTING.md](https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md) for how to diagnose problems better. - -### Anything else we should know about your project / environment? +### Anything else we should know about your project / environment? diff --git a/.github/ISSUE_TEMPLATE/cleanup_request.md b/.github/ISSUE_TEMPLATE/cleanup_request.md new file mode 100644 index 00000000000..65e56772541 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/cleanup_request.md @@ -0,0 +1,18 @@ +--- +name: Request a cleanup +about: Suggest a cleanup in our repository +labels: kind/internal cleanup +assignees: AspirinSJL + +--- + + + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000000..2be15ac785c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,29 @@ +--- +name: Request a feature +about: Suggest an idea for this project +labels: kind/enhancement +assignees: AspirinSJL + +--- + + + +### Is your feature request related to a problem? Please describe. +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +### Describe the solution you'd like +A clear and concise description of what you want to happen. + +### Describe alternatives you've considered +A clear and concise description of any alternative solutions or features you've considered. + +### Additional context +Add any other context about the feature request here. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000000..31f574ef60d --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,5 @@ + + + + +@AspirinSJL \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4a400b4e3b4..dfb7054bfeb 100644 --- a/.gitignore +++ b/.gitignore @@ -94,6 +94,7 @@ DerivedData # Objective-C generated files *.pbobjc.* *.pbrpc.* +src/objective-c/**/Build # Cocoapods artifacts Pods/ @@ -148,4 +149,4 @@ bm_*.json cmake-build-debug/ # Benchmark outputs -BenchmarkDotNet.Artifacts/ \ No newline at end of file +BenchmarkDotNet.Artifacts/ diff --git a/BUILD b/BUILD index af411526c31..2aab90ce373 100644 --- a/BUILD +++ b/BUILD @@ -74,11 +74,11 @@ config_setting( ) # This should be updated along with build.yaml -g_stands_for = "gangnam" +g_stands_for = "ganges" core_version = "7.0.0" -version = "1.23.0-dev" +version = "1.24.0-dev" GPR_PUBLIC_HDRS = [ "include/grpc/support/alloc.h", @@ -343,7 +343,6 @@ grpc_cc_library( ], ) - grpc_cc_library( name = "grpc++_public_hdrs", hdrs = GRPCXX_PUBLIC_HDRS, @@ -995,6 +994,7 @@ grpc_cc_library( "grpc_resolver_fake", "grpc_resolver_dns_native", "grpc_resolver_sockaddr", + "grpc_resolver_xds", "grpc_transport_chttp2_client_insecure", "grpc_transport_chttp2_server_insecure", "grpc_transport_inproc", @@ -1068,7 +1068,7 @@ grpc_cc_library( "grpc_base", "grpc_client_authority_filter", "grpc_deadline_filter", - "health_proto", + "grpc_health_upb", "inlined_vector", "orphanable", "ref_counted", @@ -1196,38 +1196,6 @@ grpc_cc_library( ], ) -grpc_cc_library( - name = "health_proto", - srcs = [ - "src/core/ext/filters/client_channel/health/health.pb.c", - ], - hdrs = [ - "src/core/ext/filters/client_channel/health/health.pb.h", - ], - external_deps = [ - "nanopb", - ], - language = "c++", -) - -grpc_cc_library( - name = "grpclb_proto", - srcs = [ - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c", - ], - hdrs = [ - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h", - ], - external_deps = [ - "nanopb", - ], - language = "c++", -) - grpc_cc_library( name = "grpc_lb_policy_grpclb", srcs = [ @@ -1244,15 +1212,12 @@ grpc_cc_library( "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h", ], - external_deps = [ - "nanopb", - ], language = "c++", deps = [ "grpc_base", "grpc_client_channel", + "grpc_lb_upb", "grpc_resolver_fake", - "grpclb_proto", ], ) @@ -1272,16 +1237,13 @@ grpc_cc_library( "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h", ], - external_deps = [ - "nanopb", - ], language = "c++", deps = [ "grpc_base", "grpc_client_channel", + "grpc_lb_upb", "grpc_resolver_fake", "grpc_secure", - "grpclb_proto", ], ) @@ -1299,15 +1261,12 @@ grpc_cc_library( "src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h", "src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h", ], - external_deps = [ - "nanopb", - ], language = "c++", deps = [ + "envoy_ads_upb", "grpc_base", "grpc_client_channel", "grpc_resolver_fake", - "grpclb_proto", ], ) @@ -1325,16 +1284,13 @@ grpc_cc_library( "src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h", "src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h", ], - external_deps = [ - "nanopb", - ], language = "c++", deps = [ + "envoy_ads_upb", "grpc_base", "grpc_client_channel", "grpc_resolver_fake", "grpc_secure", - "grpclb_proto", ], ) @@ -1575,6 +1531,18 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "grpc_resolver_xds", + srcs = [ + "src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc", + ], + language = "c++", + deps = [ + "grpc_base", + "grpc_client_channel", + ], +) + grpc_cc_library( name = "grpc_secure", srcs = [ @@ -1901,24 +1869,6 @@ grpc_cc_library( ], ) -grpc_cc_library( - name = "alts_proto", - srcs = [ - "src/core/tsi/alts/handshaker/altscontext.pb.c", - "src/core/tsi/alts/handshaker/handshaker.pb.c", - "src/core/tsi/alts/handshaker/transport_security_common.pb.c", - ], - hdrs = [ - "src/core/tsi/alts/handshaker/altscontext.pb.h", - "src/core/tsi/alts/handshaker/handshaker.pb.h", - "src/core/tsi/alts/handshaker/transport_security_common.pb.h", - ], - external_deps = [ - "nanopb", - ], - language = "c++", -) - grpc_cc_library( name = "alts_util", srcs = [ @@ -1929,24 +1879,17 @@ grpc_cc_library( "src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc", "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc", "src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc", "src/core/tsi/alts/handshaker/transport_security_common_api.cc", ], hdrs = [ "src/core/lib/security/credentials/alts/check_gcp_environment.h", "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api.h", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h", "src/core/tsi/alts/handshaker/transport_security_common_api.h", ], - external_deps = [ - "nanopb", - ], language = "c++", public_hdrs = GRPC_SECURE_PUBLIC_HDRS, deps = [ - "alts_proto", + "alts_upb", "gpr", "grpc_base", ], @@ -2005,7 +1948,7 @@ grpc_cc_library( deps = [ "grpc", "grpc++_codegen_base", - "health_proto", + "grpc_health_upb", ], ) @@ -2017,8 +1960,8 @@ grpc_cc_library( public_hdrs = GRPCXX_PUBLIC_HDRS + GRPC_SECURE_PUBLIC_HDRS, deps = [ "grpc++_codegen_base", + "grpc_health_upb", "grpc_unsecure", - "health_proto", ], ) @@ -2080,6 +2023,7 @@ grpc_cc_library( "include/grpcpp/impl/codegen/config.h", "include/grpcpp/impl/codegen/core_codegen_interface.h", "include/grpcpp/impl/codegen/create_auth_context.h", + "include/grpcpp/impl/codegen/delegating_channel.h", "include/grpcpp/impl/codegen/grpc_library.h", "include/grpcpp/impl/codegen/intercepted_channel.h", "include/grpcpp/impl/codegen/interceptor.h", @@ -2279,60 +2223,253 @@ grpc_cc_library( ], ) -grpc_upb_proto_library( - name = "upb_load_report", - deps = ["@envoy_api//envoy/api/v2/endpoint:load_report_export"] -) +# Once upb code-gen issue is resolved, use the targets commented below to replace the ones using +# upb-generated files. -grpc_upb_proto_library( - name = "upb_lrs", - deps = ["@envoy_api//envoy/service/load_stats/v2:lrs_export"] -) +# grpc_upb_proto_library( +# name = "upb_load_report", +# deps = ["@envoy_api//envoy/api/v2/endpoint:load_report_export"], +# ) +# +# grpc_upb_proto_library( +# name = "upb_lrs", +# deps = ["@envoy_api//envoy/service/load_stats/v2:lrs_export"], +# ) +# +# grpc_upb_proto_library( +# name = "upb_cds", +# deps = ["@envoy_api//envoy/api/v2:cds_export"], +# ) + +# grpc_cc_library( +# name = "envoy_lrs_upb", +# external_deps = [ +# "upb_lib", +# ], +# language = "c++", +# tags = ["no_windows"], +# deps = [ +# ":upb_load_report", +# ":upb_lrs", +# ], +# ) + +# grpc_cc_library( +# name = "envoy_ads_upb", +# external_deps = [ +# "upb_lib", +# ], +# language = "c++", +# tags = ["no_windows"], +# deps = [ +# ":upb_cds", +# ], +# ) -grpc_upb_proto_library( - name = "upb_cds", - deps = ["@envoy_api//envoy/api/v2:cds_export"] +grpc_cc_library( + name = "envoy_ads_upb", + srcs = [ + "src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/cds.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/eds.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c", + "src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c", + "src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c", + ], + hdrs = [ + "src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/cds.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/eds.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h", + "src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h", + "src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h", + ], + external_deps = [ + "upb_lib", + ], + language = "c++", + deps = [ + ":envoy_core_upb", + ":envoy_type_upb", + ":google_api_upb", + ":proto_gen_validate_upb", + ], ) -#TODO: Get this into build.yaml once we start using it. grpc_cc_library( - name = "envoy_lrs_upb", + name = "envoy_core_upb", + srcs = [ + "src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c", + ], + hdrs = [ + "src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h", + ], + external_deps = [ + "upb_lib", + ], language = "c++", + deps = [ + ":envoy_type_upb", + ":google_api_upb", + ":proto_gen_validate_upb", + ], +) + +grpc_cc_library( + name = "envoy_type_upb", + srcs = [ + "src/core/ext/upb-generated/envoy/type/percent.upb.c", + "src/core/ext/upb-generated/envoy/type/range.upb.c", + ], + hdrs = [ + "src/core/ext/upb-generated/envoy/type/percent.upb.h", + "src/core/ext/upb-generated/envoy/type/range.upb.h", + ], external_deps = [ "upb_lib", ], + language = "c++", deps = [ - ":upb_load_report", - ":upb_lrs" + ":google_api_upb", + ":proto_gen_validate_upb", ], - tags = ["no_windows"], ) grpc_cc_library( - name = "envoy_ads_upb", + name = "proto_gen_validate_upb", + srcs = [ + "src/core/ext/upb-generated/gogoproto/gogo.upb.c", + "src/core/ext/upb-generated/validate/validate.upb.c", + ], + hdrs = [ + "src/core/ext/upb-generated/gogoproto/gogo.upb.h", + "src/core/ext/upb-generated/validate/validate.upb.h", + ], external_deps = [ "upb_lib", ], language = "c++", deps = [ - ":upb_cds", + ":google_api_upb", ], - tags = ["no_windows"], ) -grpc_upb_proto_library( +# Once upb code-gen issue is resolved, replace grpc_health_upb with this. +# grpc_upb_proto_library( +# name = "grpc_health_upb", +# deps = ["//src/proto/grpc/health/v1:health_proto_descriptor"], +# ) + +grpc_cc_library( name = "grpc_health_upb", - deps = ["//src/proto/grpc/health/v1:health_proto_descriptor"] + srcs = [ + "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c", + ], + hdrs = [ + "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h", + ], + external_deps = [ + "upb_lib", + ], + language = "c++", ) -grpc_upb_proto_library( +# Once upb code-gen issue is resolved, remove this. +grpc_cc_library( + name = "google_api_upb", + srcs = [ + "src/core/ext/upb-generated/google/api/annotations.upb.c", + "src/core/ext/upb-generated/google/api/http.upb.c", + "src/core/ext/upb-generated/google/protobuf/any.upb.c", + "src/core/ext/upb-generated/google/protobuf/descriptor.upb.c", + "src/core/ext/upb-generated/google/protobuf/duration.upb.c", + "src/core/ext/upb-generated/google/protobuf/empty.upb.c", + "src/core/ext/upb-generated/google/protobuf/struct.upb.c", + "src/core/ext/upb-generated/google/protobuf/timestamp.upb.c", + "src/core/ext/upb-generated/google/protobuf/wrappers.upb.c", + "src/core/ext/upb-generated/google/rpc/status.upb.c", + ], + hdrs = [ + "src/core/ext/upb-generated/google/api/annotations.upb.h", + "src/core/ext/upb-generated/google/api/http.upb.h", + "src/core/ext/upb-generated/google/protobuf/any.upb.h", + "src/core/ext/upb-generated/google/protobuf/descriptor.upb.h", + "src/core/ext/upb-generated/google/protobuf/duration.upb.h", + "src/core/ext/upb-generated/google/protobuf/empty.upb.h", + "src/core/ext/upb-generated/google/protobuf/struct.upb.h", + "src/core/ext/upb-generated/google/protobuf/timestamp.upb.h", + "src/core/ext/upb-generated/google/protobuf/wrappers.upb.h", + "src/core/ext/upb-generated/google/rpc/status.upb.h", + ], + external_deps = [ + "upb_lib", + ], + language = "c++", +) + +# Once upb code-gen issue is resolved, replace grpc_lb_upb with this. +# grpc_upb_proto_library( +# name = "grpc_lb_upb", +# deps = ["//src/proto/grpc/lb/v1:load_balancer_proto_descriptor"], +# ) + +grpc_cc_library( name = "grpc_lb_upb", - deps = ["//src/proto/grpc/lb/v1:load_balancer_proto_descriptor"] + srcs = [ + "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c", + ], + hdrs = [ + "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h", + ], + external_deps = [ + "upb_lib", + ], + language = "c++", + deps = [ + "google_api_upb", + ], ) -grpc_upb_proto_library( +# Once upb code-gen issue is resolved, replace alts_upb with this. +# grpc_upb_proto_library( +# name = "alts_upb", +# deps = ["//src/proto/grpc/gcp:alts_handshaker_proto"], +# ) + +grpc_cc_library( name = "alts_upb", - deps = ["//src/proto/grpc/gcp:alts_handshaker_proto"] + srcs = [ + "src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c", + "src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c", + "src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c", + ], + hdrs = [ + "src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h", + "src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h", + "src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h", + ], + external_deps = [ + "upb_lib", + ], + language = "c++", ) grpc_generate_one_off_targets() diff --git a/BUILD.gn b/BUILD.gn index 1ae9ebe14fc..9a30d1667e2 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -33,25 +33,6 @@ config("grpc_config") { - source_set("health_proto") { - sources = [ - "src/core/ext/filters/client_channel/health/health.pb.c", - "src/core/ext/filters/client_channel/health/health.pb.h", - ] - deps = [ - ":nanopb", - ] - - public_configs = [ - ":grpc_config", - ] - include_dirs = [ - "third_party/nanopb", - ] - } - - - source_set("nanopb") { sources = [ "third_party/nanopb/pb.h", @@ -282,12 +263,6 @@ config("grpc_config") { "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc", "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h", "src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc", "src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc", "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h", @@ -330,6 +305,7 @@ config("grpc_config") { "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc", "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h", "src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc", + "src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc", "src/core/ext/filters/client_channel/resolver_factory.h", "src/core/ext/filters/client_channel/resolver_registry.cc", "src/core/ext/filters/client_channel/resolver_registry.h", @@ -429,6 +405,76 @@ config("grpc_config") { "src/core/ext/transport/inproc/inproc_plugin.cc", "src/core/ext/transport/inproc/inproc_transport.cc", "src/core/ext/transport/inproc/inproc_transport.h", + "src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/cds.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/cds.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/eds.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/eds.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h", + "src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c", + "src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h", + "src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c", + "src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h", + "src/core/ext/upb-generated/envoy/type/percent.upb.c", + "src/core/ext/upb-generated/envoy/type/percent.upb.h", + "src/core/ext/upb-generated/envoy/type/range.upb.c", + "src/core/ext/upb-generated/envoy/type/range.upb.h", + "src/core/ext/upb-generated/gogoproto/gogo.upb.c", + "src/core/ext/upb-generated/gogoproto/gogo.upb.h", + "src/core/ext/upb-generated/google/api/annotations.upb.c", + "src/core/ext/upb-generated/google/api/annotations.upb.h", + "src/core/ext/upb-generated/google/api/http.upb.c", + "src/core/ext/upb-generated/google/api/http.upb.h", + "src/core/ext/upb-generated/google/protobuf/any.upb.c", + "src/core/ext/upb-generated/google/protobuf/any.upb.h", + "src/core/ext/upb-generated/google/protobuf/descriptor.upb.c", + "src/core/ext/upb-generated/google/protobuf/descriptor.upb.h", + "src/core/ext/upb-generated/google/protobuf/duration.upb.c", + "src/core/ext/upb-generated/google/protobuf/duration.upb.h", + "src/core/ext/upb-generated/google/protobuf/empty.upb.c", + "src/core/ext/upb-generated/google/protobuf/empty.upb.h", + "src/core/ext/upb-generated/google/protobuf/struct.upb.c", + "src/core/ext/upb-generated/google/protobuf/struct.upb.h", + "src/core/ext/upb-generated/google/protobuf/timestamp.upb.c", + "src/core/ext/upb-generated/google/protobuf/timestamp.upb.h", + "src/core/ext/upb-generated/google/protobuf/wrappers.upb.c", + "src/core/ext/upb-generated/google/protobuf/wrappers.upb.h", + "src/core/ext/upb-generated/google/rpc/status.upb.c", + "src/core/ext/upb-generated/google/rpc/status.upb.h", + "src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c", + "src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h", + "src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c", + "src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h", + "src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c", + "src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h", + "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c", + "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h", + "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c", + "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h", + "src/core/ext/upb-generated/validate/validate.upb.c", + "src/core/ext/upb-generated/validate/validate.upb.h", "src/core/lib/avl/avl.cc", "src/core/lib/avl/avl.h", "src/core/lib/backoff/backoff.cc", @@ -826,10 +872,6 @@ config("grpc_config") { "src/core/tsi/alts/frame_protector/frame_handler.h", "src/core/tsi/alts/handshaker/alts_handshaker_client.cc", "src/core/tsi/alts/handshaker/alts_handshaker_client.h", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api.h", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h", "src/core/tsi/alts/handshaker/alts_shared_resource.cc", "src/core/tsi/alts/handshaker/alts_shared_resource.h", "src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc", @@ -837,12 +879,6 @@ config("grpc_config") { "src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h", "src/core/tsi/alts/handshaker/alts_tsi_utils.cc", "src/core/tsi/alts/handshaker/alts_tsi_utils.h", - "src/core/tsi/alts/handshaker/altscontext.pb.c", - "src/core/tsi/alts/handshaker/altscontext.pb.h", - "src/core/tsi/alts/handshaker/handshaker.pb.c", - "src/core/tsi/alts/handshaker/handshaker.pb.h", - "src/core/tsi/alts/handshaker/transport_security_common.pb.c", - "src/core/tsi/alts/handshaker/transport_security_common.pb.h", "src/core/tsi/alts/handshaker/transport_security_common_api.cc", "src/core/tsi/alts/handshaker/transport_security_common_api.h", "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc", @@ -874,6 +910,20 @@ config("grpc_config") { "src/core/tsi/transport_security_grpc.cc", "src/core/tsi/transport_security_grpc.h", "src/core/tsi/transport_security_interface.h", + "third_party/upb/upb/decode.c", + "third_party/upb/upb/decode.h", + "third_party/upb/upb/encode.c", + "third_party/upb/upb/encode.h", + "third_party/upb/upb/generated_util.h", + "third_party/upb/upb/msg.c", + "third_party/upb/upb/msg.h", + "third_party/upb/upb/port.c", + "third_party/upb/upb/port_def.inc", + "third_party/upb/upb/port_undef.inc", + "third_party/upb/upb/table.c", + "third_party/upb/upb/table.int.h", + "third_party/upb/upb/upb.c", + "third_party/upb/upb/upb.h", ] deps = [ "//third_party/boringssl", @@ -881,8 +931,6 @@ config("grpc_config") { ":gpr", "//third_party/cares", ":address_sorting", - ":nanopb", - ":health_proto", ] public_configs = [ @@ -1076,6 +1124,7 @@ config("grpc_config") { "include/grpcpp/impl/codegen/core_codegen.h", "include/grpcpp/impl/codegen/core_codegen_interface.h", "include/grpcpp/impl/codegen/create_auth_context.h", + "include/grpcpp/impl/codegen/delegating_channel.h", "include/grpcpp/impl/codegen/grpc_library.h", "include/grpcpp/impl/codegen/intercepted_channel.h", "include/grpcpp/impl/codegen/interceptor.h", @@ -1162,6 +1211,8 @@ config("grpc_config") { "include/grpcpp/support/time.h", "include/grpcpp/support/validate_service_config.h", "src/core/ext/transport/inproc/inproc_transport.h", + "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c", + "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h", "src/core/lib/avl/avl.h", "src/core/lib/backoff/backoff.h", "src/core/lib/channel/channel_args.h", @@ -1392,14 +1443,26 @@ config("grpc_config") { "src/cpp/util/status.cc", "src/cpp/util/string_ref.cc", "src/cpp/util/time_cc.cc", + "third_party/upb/upb/decode.c", + "third_party/upb/upb/decode.h", + "third_party/upb/upb/encode.c", + "third_party/upb/upb/encode.h", + "third_party/upb/upb/generated_util.h", + "third_party/upb/upb/msg.c", + "third_party/upb/upb/msg.h", + "third_party/upb/upb/port.c", + "third_party/upb/upb/port_def.inc", + "third_party/upb/upb/port_undef.inc", + "third_party/upb/upb/table.c", + "third_party/upb/upb/table.int.h", + "third_party/upb/upb/upb.c", + "third_party/upb/upb/upb.h", ] deps = [ "//third_party/boringssl", "//third_party/protobuf:protobuf_lite", ":grpc", ":gpr", - ":nanopb", - ":health_proto", ] public_configs = [ diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e60b6f816d..53e6ad1d2e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ cmake_minimum_required(VERSION 3.5.1) set(PACKAGE_NAME "grpc") -set(PACKAGE_VERSION "1.23.0-dev") +set(PACKAGE_VERSION "1.24.0-dev") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") @@ -137,14 +137,15 @@ else() set(_gRPC_CORE_NOSTDCXX_FLAGS "") endif() -include(cmake/zlib.cmake) +include(cmake/address_sorting.cmake) +include(cmake/benchmark.cmake) include(cmake/cares.cmake) -include(cmake/protobuf.cmake) -include(cmake/ssl.cmake) include(cmake/gflags.cmake) -include(cmake/benchmark.cmake) -include(cmake/address_sorting.cmake) include(cmake/nanopb.cmake) +include(cmake/protobuf.cmake) +include(cmake/ssl.cmake) +include(cmake/upb.cmake) +include(cmake/zlib.cmake) if(NOT MSVC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") @@ -237,13 +238,13 @@ add_custom_target(tools_c grpc_create_jwt grpc_print_google_default_creds_token grpc_verify_jwt - gen_hpack_tables - gen_legal_metadata_characters - gen_percent_encoding_tables ) add_custom_target(tools_cxx DEPENDS + gen_hpack_tables + gen_legal_metadata_characters + gen_percent_encoding_tables ) add_custom_target(tools @@ -527,7 +528,6 @@ add_dependencies(buildtests_cxx alts_frame_handler_test) add_dependencies(buildtests_cxx alts_frame_protector_test) add_dependencies(buildtests_cxx alts_grpc_record_protocol_test) add_dependencies(buildtests_cxx alts_handshaker_client_test) -add_dependencies(buildtests_cxx alts_handshaker_service_api_test) add_dependencies(buildtests_cxx alts_iovec_record_protocol_test) add_dependencies(buildtests_cxx alts_security_connector_test) add_dependencies(buildtests_cxx alts_tsi_handshaker_test) @@ -595,6 +595,9 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_cxx bm_pollset) endif() if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) +add_dependencies(buildtests_cxx bm_threadpool) +endif() +if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_cxx bm_timer) endif() add_dependencies(buildtests_cxx byte_stream_test) @@ -624,6 +627,7 @@ add_dependencies(buildtests_cxx cxx_byte_buffer_test) add_dependencies(buildtests_cxx cxx_slice_test) add_dependencies(buildtests_cxx cxx_string_ref_test) add_dependencies(buildtests_cxx cxx_time_test) +add_dependencies(buildtests_cxx delegating_channel_test) add_dependencies(buildtests_cxx end2end_test) add_dependencies(buildtests_cxx error_details_test) add_dependencies(buildtests_cxx exception_test) @@ -637,6 +641,7 @@ add_dependencies(buildtests_cxx grpc_cli) add_dependencies(buildtests_cxx grpc_core_map_test) add_dependencies(buildtests_cxx grpc_fetch_oauth2) add_dependencies(buildtests_cxx grpc_linux_system_roots_test) +add_dependencies(buildtests_cxx grpc_spiffe_security_connector_test) add_dependencies(buildtests_cxx grpc_tool_test) add_dependencies(buildtests_cxx grpclb_api_test) add_dependencies(buildtests_cxx grpclb_end2end_test) @@ -783,14 +788,17 @@ endif() target_include_directories(address_sorting PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) # avoid dependency on libstdc++ if (_gRPC_CORE_NOSTDCXX_FLAGS) @@ -835,14 +843,17 @@ endif() target_include_directories(alts_test_util PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) # avoid dependency on libstdc++ if (_gRPC_CORE_NOSTDCXX_FLAGS) @@ -917,14 +928,17 @@ endif() target_include_directories(gpr PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) # avoid dependency on libstdc++ if (_gRPC_CORE_NOSTDCXX_FLAGS) @@ -1241,16 +1255,17 @@ add_library(grpc src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc - src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc - src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc src/core/tsi/alts/handshaker/alts_tsi_utils.cc src/core/tsi/alts/handshaker/transport_security_common_api.cc - src/core/tsi/alts/handshaker/altscontext.pb.c - src/core/tsi/alts/handshaker/handshaker.pb.c - src/core/tsi/alts/handshaker/transport_security_common.pb.c - third_party/nanopb/pb_common.c - third_party/nanopb/pb_decode.c - third_party/nanopb/pb_encode.c + src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c + src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c + src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c + third_party/upb/upb/decode.c + third_party/upb/upb/encode.c + third_party/upb/upb/msg.c + third_party/upb/upb/port.c + third_party/upb/upb/table.c + third_party/upb/upb/upb.c src/core/tsi/transport_security.cc src/core/ext/transport/chttp2/client/insecure/channel_create.cc src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc @@ -1283,7 +1298,7 @@ add_library(grpc src/core/ext/filters/client_channel/subchannel.cc src/core/ext/filters/client_channel/subchannel_pool_interface.cc src/core/ext/filters/deadline/deadline_filter.cc - src/core/ext/filters/client_channel/health/health.pb.c + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c src/core/tsi/fake_transport_security.cc src/core/tsi/local_transport_security.cc src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc @@ -1302,14 +1317,42 @@ add_library(grpc src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc + src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c + src/core/ext/upb-generated/google/api/annotations.upb.c + src/core/ext/upb-generated/google/api/http.upb.c + src/core/ext/upb-generated/google/protobuf/any.upb.c + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c + src/core/ext/upb-generated/google/protobuf/duration.upb.c + src/core/ext/upb-generated/google/protobuf/empty.upb.c + src/core/ext/upb-generated/google/protobuf/struct.upb.c + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c + src/core/ext/upb-generated/google/rpc/status.upb.c src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c src/core/ext/filters/client_channel/lb_policy/xds/xds.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc + src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c + src/core/ext/upb-generated/envoy/api/v2/cds.upb.c + src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c + src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c + src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c + src/core/ext/upb-generated/envoy/api/v2/eds.upb.c + src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c + src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c + src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c + src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c + src/core/ext/upb-generated/envoy/type/percent.upb.c + src/core/ext/upb-generated/envoy/type/range.upb.c + src/core/ext/upb-generated/gogoproto/gogo.upb.c + src/core/ext/upb-generated/validate/validate.upb.c src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc @@ -1325,6 +1368,7 @@ add_library(grpc src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc + src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc src/core/ext/filters/census/grpc_context.cc src/core/ext/filters/client_idle/client_idle_filter.cc src/core/ext/filters/max_age/max_age_filter.cc @@ -1350,14 +1394,17 @@ endif() target_include_directories(grpc PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) # avoid dependency on libstdc++ if (_gRPC_CORE_NOSTDCXX_FLAGS) @@ -1653,10 +1700,13 @@ add_library(grpc_cronet src/core/ext/filters/client_channel/subchannel.cc src/core/ext/filters/client_channel/subchannel_pool_interface.cc src/core/ext/filters/deadline/deadline_filter.cc - src/core/ext/filters/client_channel/health/health.pb.c - third_party/nanopb/pb_common.c - third_party/nanopb/pb_decode.c - third_party/nanopb/pb_encode.c + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c + third_party/upb/upb/decode.c + third_party/upb/upb/encode.c + third_party/upb/upb/msg.c + third_party/upb/upb/port.c + third_party/upb/upb/table.c + third_party/upb/upb/upb.c src/core/lib/http/httpcli_security_connector.cc src/core/lib/security/context/security_context.cc src/core/lib/security/credentials/alts/alts_credentials.cc @@ -1717,13 +1767,11 @@ add_library(grpc_cronet src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc - src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc - src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc src/core/tsi/alts/handshaker/alts_tsi_utils.cc src/core/tsi/alts/handshaker/transport_security_common_api.cc - src/core/tsi/alts/handshaker/altscontext.pb.c - src/core/tsi/alts/handshaker/handshaker.pb.c - src/core/tsi/alts/handshaker/transport_security_common.pb.c + src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c + src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c + src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c src/core/tsi/transport_security.cc src/core/ext/transport/chttp2/client/insecure/channel_create.cc src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc @@ -1753,14 +1801,17 @@ endif() target_include_directories(grpc_cronet PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) # avoid dependency on libstdc++ if (_gRPC_CORE_NOSTDCXX_FLAGS) @@ -2042,10 +2093,13 @@ add_library(grpc_test_util src/core/ext/filters/client_channel/subchannel.cc src/core/ext/filters/client_channel/subchannel_pool_interface.cc src/core/ext/filters/deadline/deadline_filter.cc - src/core/ext/filters/client_channel/health/health.pb.c - third_party/nanopb/pb_common.c - third_party/nanopb/pb_decode.c - third_party/nanopb/pb_encode.c + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c + third_party/upb/upb/decode.c + third_party/upb/upb/encode.c + third_party/upb/upb/msg.c + third_party/upb/upb/port.c + third_party/upb/upb/table.c + third_party/upb/upb/upb.c src/core/ext/transport/chttp2/transport/bin_decoder.cc src/core/ext/transport/chttp2/transport/bin_encoder.cc src/core/ext/transport/chttp2/transport/chttp2_plugin.cc @@ -2091,14 +2145,17 @@ endif() target_include_directories(grpc_test_util PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) # avoid dependency on libstdc++ if (_gRPC_CORE_NOSTDCXX_FLAGS) @@ -2377,10 +2434,13 @@ add_library(grpc_test_util_unsecure src/core/ext/filters/client_channel/subchannel.cc src/core/ext/filters/client_channel/subchannel_pool_interface.cc src/core/ext/filters/deadline/deadline_filter.cc - src/core/ext/filters/client_channel/health/health.pb.c - third_party/nanopb/pb_common.c - third_party/nanopb/pb_decode.c - third_party/nanopb/pb_encode.c + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c + third_party/upb/upb/decode.c + third_party/upb/upb/encode.c + third_party/upb/upb/msg.c + third_party/upb/upb/port.c + third_party/upb/upb/table.c + third_party/upb/upb/upb.c src/core/ext/transport/chttp2/transport/bin_decoder.cc src/core/ext/transport/chttp2/transport/bin_encoder.cc src/core/ext/transport/chttp2/transport/chttp2_plugin.cc @@ -2426,14 +2486,17 @@ endif() target_include_directories(grpc_test_util_unsecure PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) # avoid dependency on libstdc++ if (_gRPC_CORE_NOSTDCXX_FLAGS) @@ -2723,10 +2786,13 @@ add_library(grpc_unsecure src/core/ext/filters/client_channel/subchannel.cc src/core/ext/filters/client_channel/subchannel_pool_interface.cc src/core/ext/filters/deadline/deadline_filter.cc - src/core/ext/filters/client_channel/health/health.pb.c - third_party/nanopb/pb_common.c - third_party/nanopb/pb_decode.c - third_party/nanopb/pb_encode.c + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c + third_party/upb/upb/decode.c + third_party/upb/upb/encode.c + third_party/upb/upb/msg.c + third_party/upb/upb/port.c + third_party/upb/upb/table.c + third_party/upb/upb/upb.c src/core/ext/transport/inproc/inproc_plugin.cc src/core/ext/transport/inproc/inproc_transport.cc src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc @@ -2743,18 +2809,47 @@ add_library(grpc_unsecure src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc + src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c + src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c + src/core/ext/upb-generated/google/api/annotations.upb.c + src/core/ext/upb-generated/google/api/http.upb.c + src/core/ext/upb-generated/google/protobuf/any.upb.c + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c + src/core/ext/upb-generated/google/protobuf/duration.upb.c + src/core/ext/upb-generated/google/protobuf/empty.upb.c + src/core/ext/upb-generated/google/protobuf/struct.upb.c + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c + src/core/ext/upb-generated/google/rpc/status.upb.c src/core/ext/filters/client_channel/lb_policy/xds/xds.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc + src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c + src/core/ext/upb-generated/envoy/api/v2/cds.upb.c + src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c + src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c + src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c + src/core/ext/upb-generated/envoy/api/v2/eds.upb.c + src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c + src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c + src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c + src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c + src/core/ext/upb-generated/envoy/type/percent.upb.c + src/core/ext/upb-generated/envoy/type/range.upb.c + src/core/ext/upb-generated/gogoproto/gogo.upb.c + src/core/ext/upb-generated/validate/validate.upb.c src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc src/core/ext/filters/census/grpc_context.cc @@ -2782,14 +2877,17 @@ endif() target_include_directories(grpc_unsecure PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) # avoid dependency on libstdc++ if (_gRPC_CORE_NOSTDCXX_FLAGS) @@ -2883,14 +2981,17 @@ endif() target_include_directories(reconnect_server PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) # avoid dependency on libstdc++ if (_gRPC_CORE_NOSTDCXX_FLAGS) @@ -2929,14 +3030,17 @@ endif() target_include_directories(test_tcp_server PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) # avoid dependency on libstdc++ if (_gRPC_CORE_NOSTDCXX_FLAGS) @@ -2983,14 +3087,17 @@ protobuf_generate_grpc_cpp( target_include_directories(bm_callback_test_service_impl PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -3035,14 +3142,17 @@ endif() target_include_directories(dns_test_util PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -3103,10 +3213,13 @@ add_library(grpc++ src/cpp/util/status.cc src/cpp/util/string_ref.cc src/cpp/util/time_cc.cc - src/core/ext/filters/client_channel/health/health.pb.c - third_party/nanopb/pb_common.c - third_party/nanopb/pb_decode.c - third_party/nanopb/pb_encode.c + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c + third_party/upb/upb/decode.c + third_party/upb/upb/encode.c + third_party/upb/upb/msg.c + third_party/upb/upb/port.c + third_party/upb/upb/table.c + third_party/upb/upb/upb.c src/cpp/codegen/codegen_init.cc ) @@ -3125,14 +3238,17 @@ endif() target_include_directories(grpc++ PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE ${_gRPC_PROTO_GENS_DIR} ) target_link_libraries(grpc++ @@ -3372,6 +3488,7 @@ foreach(_hdr include/grpcpp/impl/codegen/config.h include/grpcpp/impl/codegen/core_codegen_interface.h include/grpcpp/impl/codegen/create_auth_context.h + include/grpcpp/impl/codegen/delegating_channel.h include/grpcpp/impl/codegen/grpc_library.h include/grpcpp/impl/codegen/intercepted_channel.h include/grpcpp/impl/codegen/interceptor.h @@ -3451,14 +3568,17 @@ protobuf_generate_grpc_cpp( target_include_directories(grpc++_core_stats PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -3503,14 +3623,17 @@ protobuf_generate_grpc_cpp( target_include_directories(grpc++_error_details PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE ${_gRPC_PROTO_GENS_DIR} ) target_link_libraries(grpc++_error_details @@ -3573,14 +3696,17 @@ protobuf_generate_grpc_cpp( target_include_directories(grpc++_proto_reflection_desc_db PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -3637,14 +3763,17 @@ protobuf_generate_grpc_cpp( target_include_directories(grpc++_reflection PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE ${_gRPC_PROTO_GENS_DIR} ) target_link_libraries(grpc++_reflection @@ -3699,14 +3828,17 @@ endif() target_include_directories(grpc++_test_config PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -3794,14 +3926,17 @@ protobuf_generate_grpc_cpp( target_include_directories(grpc++_test_util PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -3872,6 +4007,7 @@ foreach(_hdr include/grpcpp/impl/codegen/config.h include/grpcpp/impl/codegen/core_codegen_interface.h include/grpcpp/impl/codegen/create_auth_context.h + include/grpcpp/impl/codegen/delegating_channel.h include/grpcpp/impl/codegen/grpc_library.h include/grpcpp/impl/codegen/intercepted_channel.h include/grpcpp/impl/codegen/interceptor.h @@ -4000,14 +4136,17 @@ protobuf_generate_grpc_cpp( target_include_directories(grpc++_test_util_unsecure PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -4078,6 +4217,7 @@ foreach(_hdr include/grpcpp/impl/codegen/config.h include/grpcpp/impl/codegen/core_codegen_interface.h include/grpcpp/impl/codegen/create_auth_context.h + include/grpcpp/impl/codegen/delegating_channel.h include/grpcpp/impl/codegen/grpc_library.h include/grpcpp/impl/codegen/intercepted_channel.h include/grpcpp/impl/codegen/interceptor.h @@ -4183,10 +4323,13 @@ add_library(grpc++_unsecure src/cpp/util/status.cc src/cpp/util/string_ref.cc src/cpp/util/time_cc.cc - src/core/ext/filters/client_channel/health/health.pb.c - third_party/nanopb/pb_common.c - third_party/nanopb/pb_decode.c - third_party/nanopb/pb_encode.c + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c + third_party/upb/upb/decode.c + third_party/upb/upb/encode.c + third_party/upb/upb/msg.c + third_party/upb/upb/port.c + third_party/upb/upb/table.c + third_party/upb/upb/upb.c src/cpp/codegen/codegen_init.cc ) @@ -4205,14 +4348,17 @@ endif() target_include_directories(grpc++_unsecure PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE ${_gRPC_PROTO_GENS_DIR} ) target_link_libraries(grpc++_unsecure @@ -4452,6 +4598,7 @@ foreach(_hdr include/grpcpp/impl/codegen/config.h include/grpcpp/impl/codegen/core_codegen_interface.h include/grpcpp/impl/codegen/create_auth_context.h + include/grpcpp/impl/codegen/delegating_channel.h include/grpcpp/impl/codegen/grpc_library.h include/grpcpp/impl/codegen/intercepted_channel.h include/grpcpp/impl/codegen/interceptor.h @@ -4517,14 +4664,17 @@ endif() target_include_directories(grpc_benchmark PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -4576,14 +4726,17 @@ protobuf_generate_grpc_cpp( target_include_directories(grpc_cli_libs PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -4638,14 +4791,17 @@ endif() target_include_directories(grpc_plugin_support PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE ${_gRPC_PROTO_GENS_DIR} ) target_link_libraries(grpc_plugin_support @@ -4703,14 +4859,17 @@ protobuf_generate_grpc_cpp( target_include_directories(grpcpp_channelz PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE ${_gRPC_PROTO_GENS_DIR} ) target_link_libraries(grpcpp_channelz @@ -4786,14 +4945,17 @@ protobuf_generate_grpc_cpp( target_include_directories(http2_client_main PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -4843,14 +5005,17 @@ protobuf_generate_grpc_cpp( target_include_directories(interop_client_helper PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -4915,14 +5080,17 @@ protobuf_generate_grpc_cpp( target_include_directories(interop_client_main PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -4966,14 +5134,17 @@ endif() target_include_directories(interop_server_helper PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -5036,15 +5207,18 @@ protobuf_generate_grpc_cpp( target_include_directories(interop_server_lib PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} - PRIVATE third_party/googletest/googletest/include + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include PRIVATE third_party/googletest/googlemock @@ -5087,14 +5261,17 @@ endif() target_include_directories(interop_server_main PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -5193,14 +5370,17 @@ protobuf_generate_grpc_cpp( target_include_directories(qps PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -5242,14 +5422,17 @@ endif() target_include_directories(grpc_csharp_ext PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) # avoid dependency on libstdc++ if (_gRPC_CORE_NOSTDCXX_FLAGS) @@ -5295,14 +5478,17 @@ endif() target_include_directories(bad_client_test PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -5341,14 +5527,17 @@ endif() target_include_directories(bad_ssl_test_server PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) # avoid dependency on libstdc++ if (_gRPC_CORE_NOSTDCXX_FLAGS) @@ -5465,14 +5654,17 @@ endif() target_include_directories(end2end_tests PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) # avoid dependency on libstdc++ if (_gRPC_CORE_NOSTDCXX_FLAGS) @@ -5589,14 +5781,17 @@ endif() target_include_directories(end2end_nosec_tests PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) # avoid dependency on libstdc++ if (_gRPC_CORE_NOSTDCXX_FLAGS) @@ -5624,14 +5819,17 @@ add_executable(algorithm_test target_include_directories(algorithm_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(algorithm_test @@ -5658,14 +5856,17 @@ add_executable(alloc_test target_include_directories(alloc_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(alloc_test @@ -5692,14 +5893,17 @@ add_executable(alpn_test target_include_directories(alpn_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(alpn_test @@ -5726,14 +5930,17 @@ add_executable(arena_test target_include_directories(arena_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(arena_test @@ -5760,14 +5967,17 @@ add_executable(avl_test target_include_directories(avl_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(avl_test @@ -5794,14 +6004,17 @@ add_executable(bad_server_response_test target_include_directories(bad_server_response_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(bad_server_response_test @@ -5829,14 +6042,17 @@ add_executable(bin_decoder_test target_include_directories(bin_decoder_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(bin_decoder_test @@ -5862,14 +6078,17 @@ add_executable(bin_encoder_test target_include_directories(bin_encoder_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(bin_encoder_test @@ -5896,14 +6115,17 @@ add_executable(buffer_list_test target_include_directories(buffer_list_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(buffer_list_test @@ -5931,14 +6153,17 @@ add_executable(channel_create_test target_include_directories(channel_create_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(channel_create_test @@ -5964,14 +6189,17 @@ add_executable(check_epollexclusive target_include_directories(check_epollexclusive PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(check_epollexclusive @@ -5996,14 +6224,17 @@ add_executable(chttp2_hpack_encoder_test target_include_directories(chttp2_hpack_encoder_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(chttp2_hpack_encoder_test @@ -6030,14 +6261,17 @@ add_executable(chttp2_stream_map_test target_include_directories(chttp2_stream_map_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(chttp2_stream_map_test @@ -6064,14 +6298,17 @@ add_executable(chttp2_varint_test target_include_directories(chttp2_varint_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(chttp2_varint_test @@ -6099,14 +6336,17 @@ add_executable(close_fd_test target_include_directories(close_fd_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(close_fd_test @@ -6134,14 +6374,17 @@ add_executable(cmdline_test target_include_directories(cmdline_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(cmdline_test @@ -6168,14 +6411,17 @@ add_executable(combiner_test target_include_directories(combiner_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(combiner_test @@ -6202,14 +6448,17 @@ add_executable(compression_test target_include_directories(compression_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(compression_test @@ -6236,14 +6485,17 @@ add_executable(concurrent_connectivity_test target_include_directories(concurrent_connectivity_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(concurrent_connectivity_test @@ -6270,14 +6522,17 @@ add_executable(connection_refused_test target_include_directories(connection_refused_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(connection_refused_test @@ -6304,14 +6559,17 @@ add_executable(dns_resolver_connectivity_test target_include_directories(dns_resolver_connectivity_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(dns_resolver_connectivity_test @@ -6338,14 +6596,17 @@ add_executable(dns_resolver_cooldown_using_ares_resolver_test target_include_directories(dns_resolver_cooldown_using_ares_resolver_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(dns_resolver_cooldown_using_ares_resolver_test @@ -6372,14 +6633,17 @@ add_executable(dns_resolver_cooldown_using_native_resolver_test target_include_directories(dns_resolver_cooldown_using_native_resolver_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(dns_resolver_cooldown_using_native_resolver_test @@ -6406,14 +6670,17 @@ add_executable(dns_resolver_test target_include_directories(dns_resolver_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(dns_resolver_test @@ -6441,14 +6708,17 @@ add_executable(dualstack_socket_test target_include_directories(dualstack_socket_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(dualstack_socket_test @@ -6476,14 +6746,17 @@ add_executable(endpoint_pair_test target_include_directories(endpoint_pair_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(endpoint_pair_test @@ -6510,14 +6783,17 @@ add_executable(error_test target_include_directories(error_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(error_test @@ -6545,14 +6821,17 @@ add_executable(ev_epollex_linux_test target_include_directories(ev_epollex_linux_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(ev_epollex_linux_test @@ -6580,14 +6859,17 @@ add_executable(fake_resolver_test target_include_directories(fake_resolver_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(fake_resolver_test @@ -6616,14 +6898,17 @@ add_executable(fake_transport_security_test target_include_directories(fake_transport_security_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(fake_transport_security_test @@ -6652,14 +6937,17 @@ add_executable(fd_conservation_posix_test target_include_directories(fd_conservation_posix_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(fd_conservation_posix_test @@ -6688,14 +6976,17 @@ add_executable(fd_posix_test target_include_directories(fd_posix_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(fd_posix_test @@ -6723,14 +7014,17 @@ add_executable(fling_client target_include_directories(fling_client PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(fling_client @@ -6757,14 +7051,17 @@ add_executable(fling_server target_include_directories(fling_server PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(fling_server @@ -6792,14 +7089,17 @@ add_executable(fling_stream_test target_include_directories(fling_stream_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(fling_stream_test @@ -6828,14 +7128,17 @@ add_executable(fling_test target_include_directories(fling_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(fling_test @@ -6864,14 +7167,17 @@ add_executable(fork_test target_include_directories(fork_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(fork_test @@ -6900,14 +7206,17 @@ add_executable(goaway_server_test target_include_directories(goaway_server_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(goaway_server_test @@ -6935,14 +7244,17 @@ add_executable(gpr_cpu_test target_include_directories(gpr_cpu_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(gpr_cpu_test @@ -6969,14 +7281,17 @@ add_executable(gpr_env_test target_include_directories(gpr_env_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(gpr_env_test @@ -7003,14 +7318,17 @@ add_executable(gpr_host_port_test target_include_directories(gpr_host_port_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(gpr_host_port_test @@ -7037,14 +7355,17 @@ add_executable(gpr_log_test target_include_directories(gpr_log_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(gpr_log_test @@ -7071,14 +7392,17 @@ add_executable(gpr_manual_constructor_test target_include_directories(gpr_manual_constructor_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(gpr_manual_constructor_test @@ -7105,14 +7429,17 @@ add_executable(gpr_mpscq_test target_include_directories(gpr_mpscq_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(gpr_mpscq_test @@ -7139,14 +7466,17 @@ add_executable(gpr_spinlock_test target_include_directories(gpr_spinlock_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(gpr_spinlock_test @@ -7173,14 +7503,17 @@ add_executable(gpr_string_test target_include_directories(gpr_string_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(gpr_string_test @@ -7207,14 +7540,17 @@ add_executable(gpr_sync_test target_include_directories(gpr_sync_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(gpr_sync_test @@ -7241,14 +7577,17 @@ add_executable(gpr_thd_test target_include_directories(gpr_thd_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(gpr_thd_test @@ -7275,14 +7614,17 @@ add_executable(gpr_time_test target_include_directories(gpr_time_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(gpr_time_test @@ -7309,14 +7651,17 @@ add_executable(gpr_tls_test target_include_directories(gpr_tls_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(gpr_tls_test @@ -7343,14 +7688,17 @@ add_executable(gpr_useful_test target_include_directories(gpr_useful_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(gpr_useful_test @@ -7377,14 +7725,17 @@ add_executable(grpc_auth_context_test target_include_directories(grpc_auth_context_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_auth_context_test @@ -7411,14 +7762,17 @@ add_executable(grpc_b64_test target_include_directories(grpc_b64_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_b64_test @@ -7445,14 +7799,17 @@ add_executable(grpc_byte_buffer_reader_test target_include_directories(grpc_byte_buffer_reader_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_byte_buffer_reader_test @@ -7479,14 +7836,17 @@ add_executable(grpc_channel_args_test target_include_directories(grpc_channel_args_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_channel_args_test @@ -7513,14 +7873,17 @@ add_executable(grpc_channel_stack_builder_test target_include_directories(grpc_channel_stack_builder_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_channel_stack_builder_test @@ -7547,14 +7910,17 @@ add_executable(grpc_channel_stack_test target_include_directories(grpc_channel_stack_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_channel_stack_test @@ -7581,14 +7947,17 @@ add_executable(grpc_completion_queue_test target_include_directories(grpc_completion_queue_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_completion_queue_test @@ -7615,14 +7984,17 @@ add_executable(grpc_completion_queue_threading_test target_include_directories(grpc_completion_queue_threading_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_completion_queue_threading_test @@ -7649,14 +8021,17 @@ add_executable(grpc_control_plane_credentials_test target_include_directories(grpc_control_plane_credentials_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_control_plane_credentials_test @@ -7683,14 +8058,17 @@ add_executable(grpc_create_jwt target_include_directories(grpc_create_jwt PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_create_jwt @@ -7716,14 +8094,17 @@ add_executable(grpc_credentials_test target_include_directories(grpc_credentials_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_credentials_test @@ -7750,14 +8131,17 @@ add_executable(grpc_ipv6_loopback_available_test target_include_directories(grpc_ipv6_loopback_available_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_ipv6_loopback_available_test @@ -7785,14 +8169,17 @@ add_executable(grpc_json_token_test target_include_directories(grpc_json_token_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_json_token_test @@ -7820,14 +8207,17 @@ add_executable(grpc_jwt_verifier_test target_include_directories(grpc_jwt_verifier_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_jwt_verifier_test @@ -7854,14 +8244,17 @@ add_executable(grpc_print_google_default_creds_token target_include_directories(grpc_print_google_default_creds_token PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_print_google_default_creds_token @@ -7886,14 +8279,17 @@ add_executable(grpc_security_connector_test target_include_directories(grpc_security_connector_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_security_connector_test @@ -7920,14 +8316,17 @@ add_executable(grpc_ssl_credentials_test target_include_directories(grpc_ssl_credentials_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_ssl_credentials_test @@ -7954,14 +8353,17 @@ add_executable(grpc_verify_jwt target_include_directories(grpc_verify_jwt PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(grpc_verify_jwt @@ -7987,14 +8389,17 @@ add_executable(handshake_client_ssl target_include_directories(handshake_client_ssl PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(handshake_client_ssl @@ -8025,14 +8430,17 @@ add_executable(handshake_server_ssl target_include_directories(handshake_server_ssl PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(handshake_server_ssl @@ -8063,14 +8471,17 @@ add_executable(handshake_server_with_readahead_handshaker target_include_directories(handshake_server_with_readahead_handshaker PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(handshake_server_with_readahead_handshaker @@ -8100,14 +8511,17 @@ add_executable(handshake_verify_peer_options target_include_directories(handshake_verify_peer_options PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(handshake_verify_peer_options @@ -8136,14 +8550,17 @@ add_executable(histogram_test target_include_directories(histogram_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(histogram_test @@ -8169,14 +8586,17 @@ add_executable(hpack_parser_test target_include_directories(hpack_parser_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(hpack_parser_test @@ -8203,14 +8623,17 @@ add_executable(hpack_table_test target_include_directories(hpack_table_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(hpack_table_test @@ -8237,14 +8660,17 @@ add_executable(http_parser_test target_include_directories(http_parser_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(http_parser_test @@ -8271,14 +8697,17 @@ add_executable(httpcli_format_request_test target_include_directories(httpcli_format_request_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(httpcli_format_request_test @@ -8306,14 +8735,17 @@ add_executable(httpcli_test target_include_directories(httpcli_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(httpcli_test @@ -8342,14 +8774,17 @@ add_executable(httpscli_test target_include_directories(httpscli_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(httpscli_test @@ -8377,14 +8812,17 @@ add_executable(init_test target_include_directories(init_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(init_test @@ -8411,14 +8849,17 @@ add_executable(inproc_callback_test target_include_directories(inproc_callback_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(inproc_callback_test @@ -8445,14 +8886,17 @@ add_executable(invalid_call_argument_test target_include_directories(invalid_call_argument_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(invalid_call_argument_test @@ -8479,14 +8923,17 @@ add_executable(json_rewrite target_include_directories(json_rewrite PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(json_rewrite @@ -8513,14 +8960,17 @@ add_executable(json_rewrite_test target_include_directories(json_rewrite_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(json_rewrite_test @@ -8547,14 +8997,17 @@ add_executable(json_stream_error_test target_include_directories(json_stream_error_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(json_stream_error_test @@ -8581,14 +9034,17 @@ add_executable(json_test target_include_directories(json_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(json_test @@ -8615,14 +9071,17 @@ add_executable(lame_client_test target_include_directories(lame_client_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(lame_client_test @@ -8649,14 +9108,17 @@ add_executable(load_file_test target_include_directories(load_file_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(load_file_test @@ -8683,14 +9145,17 @@ add_executable(memory_usage_client target_include_directories(memory_usage_client PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(memory_usage_client @@ -8717,14 +9182,17 @@ add_executable(memory_usage_server target_include_directories(memory_usage_server PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(memory_usage_server @@ -8752,14 +9220,17 @@ add_executable(memory_usage_test target_include_directories(memory_usage_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(memory_usage_test @@ -8787,14 +9258,17 @@ add_executable(message_compress_test target_include_directories(message_compress_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(message_compress_test @@ -8821,14 +9295,17 @@ add_executable(minimal_stack_is_minimal_test target_include_directories(minimal_stack_is_minimal_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(minimal_stack_is_minimal_test @@ -8855,14 +9332,17 @@ add_executable(mpmcqueue_test target_include_directories(mpmcqueue_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(mpmcqueue_test @@ -8889,14 +9369,17 @@ add_executable(multiple_server_queues_test target_include_directories(multiple_server_queues_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(multiple_server_queues_test @@ -8923,14 +9406,17 @@ add_executable(murmur_hash_test target_include_directories(murmur_hash_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(murmur_hash_test @@ -8957,14 +9443,17 @@ add_executable(no_server_test target_include_directories(no_server_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(no_server_test @@ -8991,14 +9480,17 @@ add_executable(num_external_connectivity_watchers_test target_include_directories(num_external_connectivity_watchers_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(num_external_connectivity_watchers_test @@ -9025,14 +9517,17 @@ add_executable(parse_address_test target_include_directories(parse_address_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(parse_address_test @@ -9060,14 +9555,17 @@ add_executable(parse_address_with_named_scope_id_test target_include_directories(parse_address_with_named_scope_id_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(parse_address_with_named_scope_id_test @@ -9095,14 +9593,17 @@ add_executable(percent_encoding_test target_include_directories(percent_encoding_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(percent_encoding_test @@ -9130,14 +9631,17 @@ add_executable(resolve_address_using_ares_resolver_posix_test target_include_directories(resolve_address_using_ares_resolver_posix_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(resolve_address_using_ares_resolver_posix_test @@ -9165,14 +9669,17 @@ add_executable(resolve_address_using_ares_resolver_test target_include_directories(resolve_address_using_ares_resolver_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(resolve_address_using_ares_resolver_test @@ -9200,14 +9707,17 @@ add_executable(resolve_address_using_native_resolver_posix_test target_include_directories(resolve_address_using_native_resolver_posix_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(resolve_address_using_native_resolver_posix_test @@ -9235,14 +9745,17 @@ add_executable(resolve_address_using_native_resolver_test target_include_directories(resolve_address_using_native_resolver_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(resolve_address_using_native_resolver_test @@ -9269,14 +9782,17 @@ add_executable(resource_quota_test target_include_directories(resource_quota_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(resource_quota_test @@ -9303,14 +9819,17 @@ add_executable(secure_channel_create_test target_include_directories(secure_channel_create_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(secure_channel_create_test @@ -9337,14 +9856,17 @@ add_executable(secure_endpoint_test target_include_directories(secure_endpoint_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(secure_endpoint_test @@ -9371,14 +9893,17 @@ add_executable(sequential_connectivity_test target_include_directories(sequential_connectivity_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(sequential_connectivity_test @@ -9405,14 +9930,17 @@ add_executable(server_chttp2_test target_include_directories(server_chttp2_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(server_chttp2_test @@ -9439,14 +9967,17 @@ add_executable(server_test target_include_directories(server_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(server_test @@ -9473,14 +10004,17 @@ add_executable(slice_buffer_test target_include_directories(slice_buffer_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(slice_buffer_test @@ -9507,14 +10041,17 @@ add_executable(slice_string_helpers_test target_include_directories(slice_string_helpers_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(slice_string_helpers_test @@ -9541,14 +10078,17 @@ add_executable(slice_test target_include_directories(slice_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(slice_test @@ -9575,14 +10115,17 @@ add_executable(sockaddr_resolver_test target_include_directories(sockaddr_resolver_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(sockaddr_resolver_test @@ -9609,14 +10152,17 @@ add_executable(sockaddr_utils_test target_include_directories(sockaddr_utils_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(sockaddr_utils_test @@ -9644,14 +10190,17 @@ add_executable(socket_utils_test target_include_directories(socket_utils_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(socket_utils_test @@ -9681,14 +10230,17 @@ add_executable(ssl_transport_security_test target_include_directories(ssl_transport_security_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(ssl_transport_security_test @@ -9716,14 +10268,17 @@ add_executable(status_conversion_test target_include_directories(status_conversion_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(status_conversion_test @@ -9750,14 +10305,17 @@ add_executable(stream_compression_test target_include_directories(stream_compression_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(stream_compression_test @@ -9784,14 +10342,17 @@ add_executable(stream_owned_slice_test target_include_directories(stream_owned_slice_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(stream_owned_slice_test @@ -9819,14 +10380,17 @@ add_executable(tcp_client_posix_test target_include_directories(tcp_client_posix_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(tcp_client_posix_test @@ -9854,14 +10418,17 @@ add_executable(tcp_client_uv_test target_include_directories(tcp_client_uv_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(tcp_client_uv_test @@ -9889,14 +10456,17 @@ add_executable(tcp_posix_test target_include_directories(tcp_posix_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(tcp_posix_test @@ -9925,14 +10495,17 @@ add_executable(tcp_server_posix_test target_include_directories(tcp_server_posix_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(tcp_server_posix_test @@ -9960,14 +10533,17 @@ add_executable(tcp_server_uv_test target_include_directories(tcp_server_uv_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(tcp_server_uv_test @@ -9994,14 +10570,17 @@ add_executable(threadpool_test target_include_directories(threadpool_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(threadpool_test @@ -10028,14 +10607,17 @@ add_executable(time_averaged_stats_test target_include_directories(time_averaged_stats_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(time_averaged_stats_test @@ -10062,14 +10644,17 @@ add_executable(timeout_encoding_test target_include_directories(timeout_encoding_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(timeout_encoding_test @@ -10096,14 +10681,17 @@ add_executable(timer_heap_test target_include_directories(timer_heap_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(timer_heap_test @@ -10130,14 +10718,17 @@ add_executable(timer_list_test target_include_directories(timer_list_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(timer_list_test @@ -10164,14 +10755,17 @@ add_executable(transport_connectivity_state_test target_include_directories(transport_connectivity_state_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(transport_connectivity_state_test @@ -10198,14 +10792,17 @@ add_executable(transport_metadata_test target_include_directories(transport_metadata_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(transport_metadata_test @@ -10233,14 +10830,17 @@ add_executable(transport_security_test target_include_directories(transport_security_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(transport_security_test @@ -10269,14 +10869,17 @@ add_executable(udp_server_test target_include_directories(udp_server_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(udp_server_test @@ -10304,14 +10907,17 @@ add_executable(uri_parser_test target_include_directories(uri_parser_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(uri_parser_test @@ -10340,14 +10946,17 @@ add_executable(alarm_test target_include_directories(alarm_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10380,14 +10989,17 @@ add_executable(alts_counter_test target_include_directories(alts_counter_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10418,14 +11030,17 @@ add_executable(alts_crypt_test target_include_directories(alts_crypt_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10457,14 +11072,17 @@ add_executable(alts_crypter_test target_include_directories(alts_crypter_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10495,14 +11113,17 @@ add_executable(alts_frame_handler_test target_include_directories(alts_frame_handler_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10534,14 +11155,17 @@ add_executable(alts_frame_protector_test target_include_directories(alts_frame_protector_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10572,14 +11196,17 @@ add_executable(alts_grpc_record_protocol_test target_include_directories(alts_grpc_record_protocol_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10610,52 +11237,17 @@ add_executable(alts_handshaker_client_test target_include_directories(alts_handshaker_client_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} - PRIVATE third_party/googletest/googletest/include - PRIVATE third_party/googletest/googletest - PRIVATE third_party/googletest/googlemock/include - PRIVATE third_party/googletest/googlemock - PRIVATE ${_gRPC_PROTO_GENS_DIR} -) - -target_link_libraries(alts_handshaker_client_test - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - alts_test_util - gpr - grpc - ${_gRPC_GFLAGS_LIBRARIES} -) - - -endif (gRPC_BUILD_TESTS) -if (gRPC_BUILD_TESTS) - -add_executable(alts_handshaker_service_api_test - test/core/tsi/alts/handshaker/alts_handshaker_service_api_test.cc - third_party/googletest/googletest/src/gtest-all.cc - third_party/googletest/googlemock/src/gmock-all.cc -) - - -target_include_directories(alts_handshaker_service_api_test - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} - PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} - PRIVATE ${_gRPC_CARES_INCLUDE_DIR} - PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10663,7 +11255,7 @@ target_include_directories(alts_handshaker_service_api_test PRIVATE ${_gRPC_PROTO_GENS_DIR} ) -target_link_libraries(alts_handshaker_service_api_test +target_link_libraries(alts_handshaker_client_test ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} alts_test_util @@ -10686,14 +11278,17 @@ add_executable(alts_iovec_record_protocol_test target_include_directories(alts_iovec_record_protocol_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10724,14 +11319,17 @@ add_executable(alts_security_connector_test target_include_directories(alts_security_connector_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10761,14 +11359,17 @@ add_executable(alts_tsi_handshaker_test target_include_directories(alts_tsi_handshaker_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10799,14 +11400,17 @@ add_executable(alts_tsi_utils_test target_include_directories(alts_tsi_utils_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10837,14 +11441,17 @@ add_executable(alts_zero_copy_grpc_protector_test target_include_directories(alts_zero_copy_grpc_protector_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10875,14 +11482,17 @@ add_executable(async_end2end_test target_include_directories(async_end2end_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10915,14 +11525,17 @@ add_executable(auth_property_iterator_test target_include_directories(auth_property_iterator_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10955,14 +11568,17 @@ add_executable(backoff_test target_include_directories(backoff_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10993,14 +11609,17 @@ add_executable(bdp_estimator_test target_include_directories(bdp_estimator_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11034,14 +11653,17 @@ add_executable(bm_alarm target_include_directories(bm_alarm PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11079,14 +11701,17 @@ add_executable(bm_arena target_include_directories(bm_arena PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11124,14 +11749,17 @@ add_executable(bm_byte_buffer target_include_directories(bm_byte_buffer PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11169,14 +11797,17 @@ add_executable(bm_call_create target_include_directories(bm_call_create PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11214,14 +11845,17 @@ add_executable(bm_callback_streaming_ping_pong target_include_directories(bm_callback_streaming_ping_pong PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11260,14 +11894,17 @@ add_executable(bm_callback_unary_ping_pong target_include_directories(bm_callback_unary_ping_pong PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11306,14 +11943,17 @@ add_executable(bm_channel target_include_directories(bm_channel PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11351,14 +11991,17 @@ add_executable(bm_chttp2_hpack target_include_directories(bm_chttp2_hpack PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11396,14 +12039,17 @@ add_executable(bm_chttp2_transport target_include_directories(bm_chttp2_transport PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11441,14 +12087,17 @@ add_executable(bm_closure target_include_directories(bm_closure PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11486,14 +12135,17 @@ add_executable(bm_cq target_include_directories(bm_cq PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11531,14 +12183,17 @@ add_executable(bm_cq_multiple_threads target_include_directories(bm_cq_multiple_threads PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11576,14 +12231,17 @@ add_executable(bm_error target_include_directories(bm_error PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11621,14 +12279,17 @@ add_executable(bm_fullstack_streaming_ping_pong target_include_directories(bm_fullstack_streaming_ping_pong PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11666,14 +12327,17 @@ add_executable(bm_fullstack_streaming_pump target_include_directories(bm_fullstack_streaming_pump PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11711,14 +12375,17 @@ add_executable(bm_fullstack_trickle target_include_directories(bm_fullstack_trickle PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11756,14 +12423,17 @@ add_executable(bm_fullstack_unary_ping_pong target_include_directories(bm_fullstack_unary_ping_pong PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11801,14 +12471,17 @@ add_executable(bm_metadata target_include_directories(bm_metadata PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11846,14 +12519,17 @@ add_executable(bm_pollset target_include_directories(bm_pollset PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11881,24 +12557,27 @@ endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) -add_executable(bm_timer - test/cpp/microbenchmarks/bm_timer.cc +add_executable(bm_threadpool + test/cpp/microbenchmarks/bm_threadpool.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc ) -target_include_directories(bm_timer +target_include_directories(bm_threadpool PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11906,7 +12585,7 @@ target_include_directories(bm_timer PRIVATE ${_gRPC_PROTO_GENS_DIR} ) -target_link_libraries(bm_timer +target_link_libraries(bm_threadpool ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} grpc_benchmark @@ -11924,25 +12603,29 @@ target_link_libraries(bm_timer endif() endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) +if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) -add_executable(byte_stream_test - test/core/transport/byte_stream_test.cc +add_executable(bm_timer + test/cpp/microbenchmarks/bm_timer.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc ) -target_include_directories(byte_stream_test +target_include_directories(bm_timer PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11950,37 +12633,46 @@ target_include_directories(byte_stream_test PRIVATE ${_gRPC_PROTO_GENS_DIR} ) -target_link_libraries(byte_stream_test +target_link_libraries(bm_timer ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} - grpc_test_util - grpc + grpc_benchmark + ${_gRPC_BENCHMARK_LIBRARIES} + grpc++_test_util_unsecure + grpc_test_util_unsecure + grpc++_unsecure + grpc_unsecure gpr + grpc++_test_config ${_gRPC_GFLAGS_LIBRARIES} ) +endif() endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) -add_executable(channel_arguments_test - test/cpp/common/channel_arguments_test.cc +add_executable(byte_stream_test + test/core/transport/byte_stream_test.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc ) -target_include_directories(channel_arguments_test +target_include_directories(byte_stream_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11988,10 +12680,10 @@ target_include_directories(channel_arguments_test PRIVATE ${_gRPC_PROTO_GENS_DIR} ) -target_link_libraries(channel_arguments_test +target_link_libraries(byte_stream_test ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} - grpc++ + grpc_test_util grpc gpr ${_gRPC_GFLAGS_LIBRARIES} @@ -12001,24 +12693,68 @@ target_link_libraries(channel_arguments_test endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) -add_executable(channel_filter_test - test/cpp/common/channel_filter_test.cc - third_party/googletest/googletest/src/gtest-all.cc +add_executable(channel_arguments_test + test/cpp/common/channel_arguments_test.cc + third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc ) -target_include_directories(channel_filter_test +target_include_directories(channel_arguments_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE third_party/googletest/googletest/include + PRIVATE third_party/googletest/googletest + PRIVATE third_party/googletest/googlemock/include + PRIVATE third_party/googletest/googlemock + PRIVATE ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(channel_arguments_test + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc++ + grpc + gpr + ${_gRPC_GFLAGS_LIBRARIES} +) + + +endif (gRPC_BUILD_TESTS) +if (gRPC_BUILD_TESTS) + +add_executable(channel_filter_test + test/cpp/common/channel_filter_test.cc + third_party/googletest/googletest/src/gtest-all.cc + third_party/googletest/googlemock/src/gmock-all.cc +) + + +target_include_directories(channel_filter_test + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12056,14 +12792,17 @@ protobuf_generate_grpc_cpp( target_include_directories(channel_trace_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12096,14 +12835,17 @@ add_executable(channelz_registry_test target_include_directories(channelz_registry_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12143,14 +12885,17 @@ protobuf_generate_grpc_cpp( target_include_directories(channelz_service_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12191,14 +12936,17 @@ protobuf_generate_grpc_cpp( target_include_directories(channelz_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12231,14 +12979,17 @@ add_executable(check_gcp_environment_linux_test target_include_directories(check_gcp_environment_linux_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12268,14 +13019,17 @@ add_executable(check_gcp_environment_windows_test target_include_directories(check_gcp_environment_windows_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12305,14 +13059,17 @@ add_executable(chttp2_settings_timeout_test target_include_directories(chttp2_settings_timeout_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12343,14 +13100,17 @@ add_executable(cli_call_test target_include_directories(cli_call_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12385,14 +13145,17 @@ add_executable(client_callback_end2end_test target_include_directories(client_callback_end2end_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12432,14 +13195,17 @@ protobuf_generate_grpc_cpp( target_include_directories(client_channel_stress_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12473,14 +13239,17 @@ add_executable(client_crash_test target_include_directories(client_crash_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12514,14 +13283,17 @@ add_executable(client_crash_test_server target_include_directories(client_crash_test_server PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12556,14 +13328,17 @@ add_executable(client_interceptors_end2end_test target_include_directories(client_interceptors_end2end_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12596,14 +13371,17 @@ add_executable(client_lb_end2end_test target_include_directories(client_lb_end2end_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12685,14 +13463,17 @@ protobuf_generate_grpc_cpp( target_include_directories(codegen_test_full PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12774,14 +13555,17 @@ protobuf_generate_grpc_cpp( target_include_directories(codegen_test_minimal PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12812,14 +13596,17 @@ add_executable(context_list_test target_include_directories(context_list_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12850,14 +13637,17 @@ add_executable(credentials_test target_include_directories(credentials_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12888,14 +13678,17 @@ add_executable(cxx_byte_buffer_test target_include_directories(cxx_byte_buffer_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12927,14 +13720,17 @@ add_executable(cxx_slice_test target_include_directories(cxx_slice_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12966,14 +13762,17 @@ add_executable(cxx_string_ref_test target_include_directories(cxx_string_ref_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -13003,14 +13802,17 @@ add_executable(cxx_time_test target_include_directories(cxx_time_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -13032,25 +13834,27 @@ target_link_libraries(cxx_time_test endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) -add_executable(end2end_test - test/cpp/end2end/end2end_test.cc - test/cpp/end2end/interceptors_util.cc +add_executable(delegating_channel_test + test/cpp/end2end/delegating_channel_test.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc ) -target_include_directories(end2end_test +target_include_directories(delegating_channel_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -13058,7 +13862,7 @@ target_include_directories(end2end_test PRIVATE ${_gRPC_PROTO_GENS_DIR} ) -target_link_libraries(end2end_test +target_link_libraries(delegating_channel_test ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} grpc++_test_util @@ -13073,32 +13877,79 @@ target_link_libraries(end2end_test endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) -add_executable(error_details_test - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.h - test/cpp/util/error_details_test.cc +add_executable(end2end_test + test/cpp/end2end/end2end_test.cc + test/cpp/end2end/interceptors_util.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc ) -protobuf_generate_grpc_cpp( - src/proto/grpc/testing/echo_messages.proto -) -target_include_directories(error_details_test +target_include_directories(end2end_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} - PRIVATE third_party/googletest/googletest/include + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE third_party/googletest/googletest/include + PRIVATE third_party/googletest/googletest + PRIVATE third_party/googletest/googlemock/include + PRIVATE third_party/googletest/googlemock + PRIVATE ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(end2end_test + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc++_test_util + grpc_test_util + grpc++ + grpc + gpr + ${_gRPC_GFLAGS_LIBRARIES} +) + + +endif (gRPC_BUILD_TESTS) +if (gRPC_BUILD_TESTS) + +add_executable(error_details_test + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.h + test/cpp/util/error_details_test.cc + third_party/googletest/googletest/src/gtest-all.cc + third_party/googletest/googlemock/src/gmock-all.cc +) + +protobuf_generate_grpc_cpp( + src/proto/grpc/testing/echo_messages.proto +) + +target_include_directories(error_details_test + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include PRIVATE third_party/googletest/googlemock @@ -13127,14 +13978,17 @@ add_executable(exception_test target_include_directories(exception_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -13167,14 +14021,17 @@ add_executable(filter_end2end_test target_include_directories(filter_end2end_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -13195,6 +14052,95 @@ target_link_libraries(filter_end2end_test endif (gRPC_BUILD_TESTS) + +add_executable(gen_hpack_tables + tools/codegen/core/gen_hpack_tables.cc +) + + +target_include_directories(gen_hpack_tables + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(gen_hpack_tables + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + gpr + grpc +) + + + +add_executable(gen_legal_metadata_characters + tools/codegen/core/gen_legal_metadata_characters.cc +) + + +target_include_directories(gen_legal_metadata_characters + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(gen_legal_metadata_characters + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} +) + + + +add_executable(gen_percent_encoding_tables + tools/codegen/core/gen_percent_encoding_tables.cc +) + + +target_include_directories(gen_percent_encoding_tables + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(gen_percent_encoding_tables + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} +) + + if (gRPC_BUILD_TESTS) add_executable(generic_end2end_test @@ -13207,14 +14153,17 @@ add_executable(generic_end2end_test target_include_directories(generic_end2end_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -13247,14 +14196,17 @@ add_executable(global_config_env_test target_include_directories(global_config_env_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -13284,14 +14236,17 @@ add_executable(global_config_test target_include_directories(global_config_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -13328,14 +14283,17 @@ protobuf_generate_grpc_cpp( target_include_directories(golden_file_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -13367,14 +14325,17 @@ add_executable(grpc_alts_credentials_options_test target_include_directories(grpc_alts_credentials_options_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -13404,14 +14365,17 @@ add_executable(grpc_cli target_include_directories(grpc_cli PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -13445,14 +14409,17 @@ add_executable(grpc_core_map_test target_include_directories(grpc_core_map_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -13482,14 +14449,17 @@ add_executable(grpc_cpp_plugin target_include_directories(grpc_cpp_plugin PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -13521,14 +14491,17 @@ add_executable(grpc_csharp_plugin target_include_directories(grpc_csharp_plugin PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -13562,14 +14535,17 @@ add_executable(grpc_fetch_oauth2 target_include_directories(grpc_fetch_oauth2 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -13601,14 +14577,17 @@ add_executable(grpc_linux_system_roots_test target_include_directories(grpc_linux_system_roots_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -13637,14 +14616,17 @@ add_executable(grpc_node_plugin target_include_directories(grpc_node_plugin PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -13676,14 +14658,17 @@ add_executable(grpc_objective_c_plugin target_include_directories(grpc_objective_c_plugin PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -13715,14 +14700,17 @@ add_executable(grpc_php_plugin target_include_directories(grpc_php_plugin PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -13754,14 +14742,17 @@ add_executable(grpc_python_plugin target_include_directories(grpc_python_plugin PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -13793,14 +14784,17 @@ add_executable(grpc_ruby_plugin target_include_directories(grpc_ruby_plugin PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -13824,6 +14818,49 @@ endif() endif (gRPC_BUILD_CODEGEN) if (gRPC_BUILD_TESTS) +add_executable(grpc_spiffe_security_connector_test + test/core/security/spiffe_security_connector_test.cc + third_party/googletest/googletest/src/gtest-all.cc + third_party/googletest/googlemock/src/gmock-all.cc +) + + +target_include_directories(grpc_spiffe_security_connector_test + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} + PRIVATE ${_gRPC_CARES_INCLUDE_DIR} + PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} + PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE third_party/googletest/googletest/include + PRIVATE third_party/googletest/googletest + PRIVATE third_party/googletest/googlemock/include + PRIVATE third_party/googletest/googlemock + PRIVATE ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(grpc_spiffe_security_connector_test + ${_gRPC_PROTOBUF_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + grpc_test_util + grpc++_test_util + grpc++ + grpc + gpr + ${_gRPC_GFLAGS_LIBRARIES} +) + + +endif (gRPC_BUILD_TESTS) +if (gRPC_BUILD_TESTS) + add_executable(grpc_tool_test ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc @@ -13848,14 +14885,17 @@ protobuf_generate_grpc_cpp( target_include_directories(grpc_tool_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -13898,14 +14938,17 @@ protobuf_generate_grpc_cpp( target_include_directories(grpclb_api_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -13944,14 +14987,17 @@ protobuf_generate_grpc_cpp( target_include_directories(grpclb_end2end_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14006,14 +15052,17 @@ protobuf_generate_grpc_cpp( target_include_directories(grpclb_fallback_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14048,14 +15097,17 @@ add_executable(h2_ssl_cert_test target_include_directories(h2_ssl_cert_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14087,14 +15139,17 @@ add_executable(h2_ssl_session_reuse_test target_include_directories(h2_ssl_session_reuse_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14126,14 +15181,17 @@ add_executable(health_service_end2end_test target_include_directories(health_service_end2end_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14166,14 +15224,17 @@ add_executable(http2_client target_include_directories(http2_client PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14208,14 +15269,17 @@ add_executable(hybrid_end2end_test target_include_directories(hybrid_end2end_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14248,14 +15312,17 @@ add_executable(inlined_vector_test target_include_directories(inlined_vector_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14288,14 +15355,17 @@ add_executable(inproc_sync_unary_ping_pong_test target_include_directories(inproc_sync_unary_ping_pong_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14332,14 +15402,17 @@ add_executable(interop_client target_include_directories(interop_client PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14376,14 +15449,17 @@ add_executable(interop_server target_include_directories(interop_server PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14422,14 +15498,17 @@ add_executable(interop_test target_include_directories(interop_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14463,14 +15542,17 @@ add_executable(json_run_localhost target_include_directories(json_run_localhost PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14505,14 +15587,17 @@ add_executable(memory_test target_include_directories(memory_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14544,14 +15629,17 @@ add_executable(message_allocator_end2end_test target_include_directories(message_allocator_end2end_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14591,14 +15679,17 @@ protobuf_generate_grpc_cpp( target_include_directories(metrics_client PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14630,14 +15721,17 @@ add_executable(mock_test target_include_directories(mock_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14670,14 +15764,17 @@ add_executable(nonblocking_test target_include_directories(nonblocking_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14710,14 +15807,17 @@ add_executable(noop-benchmark target_include_directories(noop-benchmark PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14746,14 +15846,17 @@ add_executable(optional_test target_include_directories(optional_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14785,14 +15888,17 @@ add_executable(orphanable_test target_include_directories(orphanable_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14824,14 +15930,17 @@ add_executable(port_sharing_end2end_test target_include_directories(port_sharing_end2end_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14865,14 +15974,17 @@ add_executable(proto_server_reflection_test target_include_directories(proto_server_reflection_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14907,14 +16019,17 @@ add_executable(proto_utils_test target_include_directories(proto_utils_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14945,14 +16060,17 @@ add_executable(qps_interarrival_test target_include_directories(qps_interarrival_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14988,14 +16106,17 @@ add_executable(qps_json_driver target_include_directories(qps_json_driver PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15032,14 +16153,17 @@ add_executable(qps_openloop_test target_include_directories(qps_openloop_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15076,14 +16200,17 @@ add_executable(qps_worker target_include_directories(qps_worker PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15119,14 +16246,17 @@ add_executable(raw_end2end_test target_include_directories(raw_end2end_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15180,14 +16310,17 @@ protobuf_generate_grpc_cpp( target_include_directories(reconnect_interop_client PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15242,14 +16375,17 @@ protobuf_generate_grpc_cpp( target_include_directories(reconnect_interop_server PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15285,14 +16421,17 @@ add_executable(ref_counted_ptr_test target_include_directories(ref_counted_ptr_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15324,14 +16463,17 @@ add_executable(ref_counted_test target_include_directories(ref_counted_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15363,14 +16505,17 @@ add_executable(retry_throttle_test target_include_directories(retry_throttle_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15401,14 +16546,17 @@ add_executable(secure_auth_context_test target_include_directories(secure_auth_context_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15442,14 +16590,17 @@ add_executable(secure_sync_unary_ping_pong_test target_include_directories(secure_sync_unary_ping_pong_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15486,14 +16637,17 @@ add_executable(server_builder_plugin_test target_include_directories(server_builder_plugin_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15540,14 +16694,17 @@ protobuf_generate_grpc_cpp( target_include_directories(server_builder_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15595,14 +16752,17 @@ protobuf_generate_grpc_cpp( target_include_directories(server_builder_with_socket_mutator_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15636,14 +16796,17 @@ add_executable(server_context_test_spouse_test target_include_directories(server_context_test_spouse_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15676,14 +16839,17 @@ add_executable(server_crash_test target_include_directories(server_crash_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15717,14 +16883,17 @@ add_executable(server_crash_test_client target_include_directories(server_crash_test_client PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15758,14 +16927,17 @@ add_executable(server_early_return_test target_include_directories(server_early_return_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15799,14 +16971,17 @@ add_executable(server_interceptors_end2end_test target_include_directories(server_interceptors_end2end_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15853,14 +17028,17 @@ protobuf_generate_grpc_cpp( target_include_directories(server_request_call_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15893,14 +17071,17 @@ add_executable(service_config_end2end_test target_include_directories(service_config_end2end_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15933,14 +17114,17 @@ add_executable(service_config_test target_include_directories(service_config_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -15972,14 +17156,17 @@ add_executable(shutdown_test target_include_directories(shutdown_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16012,14 +17199,17 @@ add_executable(slice_hash_table_test target_include_directories(slice_hash_table_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16050,14 +17240,17 @@ add_executable(slice_weak_hash_table_test target_include_directories(slice_weak_hash_table_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16088,14 +17281,17 @@ add_executable(stats_test target_include_directories(stats_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16127,14 +17323,17 @@ add_executable(status_metadata_test target_include_directories(status_metadata_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16163,14 +17362,17 @@ add_executable(status_util_test target_include_directories(status_util_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16200,14 +17402,17 @@ add_executable(streaming_throughput_test target_include_directories(streaming_throughput_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16272,14 +17477,17 @@ protobuf_generate_grpc_cpp( target_include_directories(stress_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16313,14 +17521,17 @@ add_executable(string_view_test target_include_directories(string_view_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16352,14 +17563,17 @@ add_executable(thread_manager_test target_include_directories(thread_manager_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16391,14 +17605,17 @@ add_executable(thread_stress_test target_include_directories(thread_stress_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16432,14 +17649,17 @@ add_executable(time_change_test target_include_directories(time_change_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16473,14 +17693,17 @@ add_executable(transport_pid_controller_test target_include_directories(transport_pid_controller_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16513,14 +17736,17 @@ add_executable(transport_security_common_api_test target_include_directories(transport_security_common_api_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16552,14 +17778,17 @@ add_executable(writes_per_rpc_test target_include_directories(writes_per_rpc_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16584,30 +17813,40 @@ endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) add_executable(xds_end2end_test - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.grpc.pb.cc - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.pb.h - ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v1/load_balancer.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/eds_for_test.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/eds_for_test.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/lrs_for_test.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/lrs_for_test.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.h test/cpp/end2end/xds_end2end_test.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc ) protobuf_generate_grpc_cpp( - src/proto/grpc/lb/v1/load_balancer.proto + src/proto/grpc/lb/v2/eds_for_test.proto +) +protobuf_generate_grpc_cpp( + src/proto/grpc/lb/v2/lrs_for_test.proto ) target_include_directories(xds_end2end_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16638,98 +17877,27 @@ add_executable(public_headers_must_be_c89 target_include_directories(public_headers_must_be_c89 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} - PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} - PRIVATE ${_gRPC_CARES_INCLUDE_DIR} - PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} -) - -target_link_libraries(public_headers_must_be_c89 - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc - gpr -) - - -endif (gRPC_BUILD_TESTS) - -add_executable(gen_hpack_tables - tools/codegen/core/gen_hpack_tables.cc -) - - -target_include_directories(gen_hpack_tables - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} -) - -target_link_libraries(gen_hpack_tables - ${_gRPC_ALLTARGETS_LIBRARIES} - gpr - grpc -) - - - -add_executable(gen_legal_metadata_characters - tools/codegen/core/gen_legal_metadata_characters.cc -) - - -target_include_directories(gen_legal_metadata_characters - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} - PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} - PRIVATE ${_gRPC_CARES_INCLUDE_DIR} - PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} -) - -target_link_libraries(gen_legal_metadata_characters - ${_gRPC_ALLTARGETS_LIBRARIES} -) - - - -add_executable(gen_percent_encoding_tables - tools/codegen/core/gen_percent_encoding_tables.cc -) - - -target_include_directories(gen_percent_encoding_tables - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} - PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} - PRIVATE ${_gRPC_CARES_INCLUDE_DIR} - PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} ) -target_link_libraries(gen_percent_encoding_tables +target_link_libraries(public_headers_must_be_c89 ${_gRPC_ALLTARGETS_LIBRARIES} + grpc + gpr ) +endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) add_executable(bad_streaming_id_bad_client_test @@ -16742,14 +17910,17 @@ add_executable(bad_streaming_id_bad_client_test target_include_directories(bad_streaming_id_bad_client_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16758,7 +17929,6 @@ target_include_directories(bad_streaming_id_bad_client_test ) target_link_libraries(bad_streaming_id_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -16782,14 +17952,17 @@ add_executable(badreq_bad_client_test target_include_directories(badreq_bad_client_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16798,7 +17971,6 @@ target_include_directories(badreq_bad_client_test ) target_link_libraries(badreq_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -16822,14 +17994,17 @@ add_executable(connection_prefix_bad_client_test target_include_directories(connection_prefix_bad_client_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16838,7 +18013,6 @@ target_include_directories(connection_prefix_bad_client_test ) target_link_libraries(connection_prefix_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -16862,14 +18036,17 @@ add_executable(duplicate_header_bad_client_test target_include_directories(duplicate_header_bad_client_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16878,7 +18055,6 @@ target_include_directories(duplicate_header_bad_client_test ) target_link_libraries(duplicate_header_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -16902,14 +18078,17 @@ add_executable(head_of_line_blocking_bad_client_test target_include_directories(head_of_line_blocking_bad_client_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16918,7 +18097,6 @@ target_include_directories(head_of_line_blocking_bad_client_test ) target_link_libraries(head_of_line_blocking_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -16942,14 +18120,17 @@ add_executable(headers_bad_client_test target_include_directories(headers_bad_client_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16958,7 +18139,6 @@ target_include_directories(headers_bad_client_test ) target_link_libraries(headers_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -16982,14 +18162,17 @@ add_executable(initial_settings_frame_bad_client_test target_include_directories(initial_settings_frame_bad_client_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -16998,7 +18181,6 @@ target_include_directories(initial_settings_frame_bad_client_test ) target_link_libraries(initial_settings_frame_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -17022,14 +18204,17 @@ add_executable(large_metadata_bad_client_test target_include_directories(large_metadata_bad_client_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -17038,7 +18223,6 @@ target_include_directories(large_metadata_bad_client_test ) target_link_libraries(large_metadata_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -17062,14 +18246,17 @@ add_executable(out_of_bounds_bad_client_test target_include_directories(out_of_bounds_bad_client_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -17078,7 +18265,6 @@ target_include_directories(out_of_bounds_bad_client_test ) target_link_libraries(out_of_bounds_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -17102,14 +18288,17 @@ add_executable(server_registered_method_bad_client_test target_include_directories(server_registered_method_bad_client_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -17118,7 +18307,6 @@ target_include_directories(server_registered_method_bad_client_test ) target_link_libraries(server_registered_method_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -17142,14 +18330,17 @@ add_executable(simple_request_bad_client_test target_include_directories(simple_request_bad_client_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -17158,7 +18349,6 @@ target_include_directories(simple_request_bad_client_test ) target_link_libraries(simple_request_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -17182,14 +18372,17 @@ add_executable(unknown_frame_bad_client_test target_include_directories(unknown_frame_bad_client_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -17198,7 +18391,6 @@ target_include_directories(unknown_frame_bad_client_test ) target_link_libraries(unknown_frame_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -17222,14 +18414,17 @@ add_executable(window_overflow_bad_client_test target_include_directories(window_overflow_bad_client_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -17238,7 +18433,6 @@ target_include_directories(window_overflow_bad_client_test ) target_link_libraries(window_overflow_bad_client_test - ${_gRPC_SSL_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} bad_client_test @@ -17261,14 +18455,17 @@ add_executable(bad_ssl_cert_server target_include_directories(bad_ssl_cert_server PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(bad_ssl_cert_server @@ -17298,14 +18495,17 @@ add_executable(bad_ssl_cert_test target_include_directories(bad_ssl_cert_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(bad_ssl_cert_test @@ -17333,14 +18533,17 @@ add_executable(h2_census_test target_include_directories(h2_census_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_census_test @@ -17368,14 +18571,17 @@ add_executable(h2_compress_test target_include_directories(h2_compress_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_compress_test @@ -17403,14 +18609,17 @@ add_executable(h2_fakesec_test target_include_directories(h2_fakesec_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_fakesec_test @@ -17439,14 +18648,17 @@ add_executable(h2_fd_test target_include_directories(h2_fd_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_fd_test @@ -17475,14 +18687,17 @@ add_executable(h2_full_test target_include_directories(h2_full_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_full_test @@ -17511,14 +18726,17 @@ add_executable(h2_full+pipe_test target_include_directories(h2_full+pipe_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_full+pipe_test @@ -17547,14 +18765,17 @@ add_executable(h2_full+trace_test target_include_directories(h2_full+trace_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_full+trace_test @@ -17582,14 +18803,17 @@ add_executable(h2_full+workarounds_test target_include_directories(h2_full+workarounds_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_full+workarounds_test @@ -17617,14 +18841,17 @@ add_executable(h2_http_proxy_test target_include_directories(h2_http_proxy_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_http_proxy_test @@ -17653,14 +18880,17 @@ add_executable(h2_local_ipv4_test target_include_directories(h2_local_ipv4_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_local_ipv4_test @@ -17690,14 +18920,17 @@ add_executable(h2_local_ipv6_test target_include_directories(h2_local_ipv6_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_local_ipv6_test @@ -17727,14 +18960,17 @@ add_executable(h2_local_uds_test target_include_directories(h2_local_uds_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_local_uds_test @@ -17763,14 +18999,17 @@ add_executable(h2_oauth2_test target_include_directories(h2_oauth2_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_oauth2_test @@ -17798,14 +19037,17 @@ add_executable(h2_proxy_test target_include_directories(h2_proxy_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_proxy_test @@ -17833,14 +19075,17 @@ add_executable(h2_sockpair_test target_include_directories(h2_sockpair_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_sockpair_test @@ -17868,14 +19113,17 @@ add_executable(h2_sockpair+trace_test target_include_directories(h2_sockpair+trace_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_sockpair+trace_test @@ -17903,14 +19151,17 @@ add_executable(h2_sockpair_1byte_test target_include_directories(h2_sockpair_1byte_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_sockpair_1byte_test @@ -17938,14 +19189,17 @@ add_executable(h2_spiffe_test target_include_directories(h2_spiffe_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_spiffe_test @@ -17973,14 +19227,17 @@ add_executable(h2_ssl_test target_include_directories(h2_ssl_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_ssl_test @@ -18008,14 +19265,17 @@ add_executable(h2_ssl_cred_reload_test target_include_directories(h2_ssl_cred_reload_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_ssl_cred_reload_test @@ -18043,14 +19303,17 @@ add_executable(h2_ssl_proxy_test target_include_directories(h2_ssl_proxy_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_ssl_proxy_test @@ -18079,14 +19342,17 @@ add_executable(h2_uds_test target_include_directories(h2_uds_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_uds_test @@ -18115,14 +19381,17 @@ add_executable(inproc_test target_include_directories(inproc_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(inproc_test @@ -18150,14 +19419,17 @@ add_executable(h2_census_nosec_test target_include_directories(h2_census_nosec_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_census_nosec_test @@ -18185,14 +19457,17 @@ add_executable(h2_compress_nosec_test target_include_directories(h2_compress_nosec_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_compress_nosec_test @@ -18221,14 +19496,17 @@ add_executable(h2_fd_nosec_test target_include_directories(h2_fd_nosec_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_fd_nosec_test @@ -18257,14 +19535,17 @@ add_executable(h2_full_nosec_test target_include_directories(h2_full_nosec_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_full_nosec_test @@ -18293,14 +19574,17 @@ add_executable(h2_full+pipe_nosec_test target_include_directories(h2_full+pipe_nosec_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_full+pipe_nosec_test @@ -18329,14 +19613,17 @@ add_executable(h2_full+trace_nosec_test target_include_directories(h2_full+trace_nosec_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_full+trace_nosec_test @@ -18364,14 +19651,17 @@ add_executable(h2_full+workarounds_nosec_test target_include_directories(h2_full+workarounds_nosec_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_full+workarounds_nosec_test @@ -18399,14 +19689,17 @@ add_executable(h2_http_proxy_nosec_test target_include_directories(h2_http_proxy_nosec_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_http_proxy_nosec_test @@ -18434,14 +19727,17 @@ add_executable(h2_proxy_nosec_test target_include_directories(h2_proxy_nosec_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_proxy_nosec_test @@ -18469,14 +19765,17 @@ add_executable(h2_sockpair_nosec_test target_include_directories(h2_sockpair_nosec_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_sockpair_nosec_test @@ -18504,14 +19803,17 @@ add_executable(h2_sockpair+trace_nosec_test target_include_directories(h2_sockpair+trace_nosec_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_sockpair+trace_nosec_test @@ -18539,14 +19841,17 @@ add_executable(h2_sockpair_1byte_nosec_test target_include_directories(h2_sockpair_1byte_nosec_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_sockpair_1byte_nosec_test @@ -18575,14 +19880,17 @@ add_executable(h2_uds_nosec_test target_include_directories(h2_uds_nosec_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(h2_uds_nosec_test @@ -18613,14 +19921,17 @@ add_executable(resolver_component_test_unsecure target_include_directories(resolver_component_test_unsecure PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -18655,14 +19966,17 @@ add_executable(resolver_component_test target_include_directories(resolver_component_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -18698,14 +20012,17 @@ add_executable(resolver_component_tests_runner_invoker_unsecure target_include_directories(resolver_component_tests_runner_invoker_unsecure PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -18741,14 +20058,17 @@ add_executable(resolver_component_tests_runner_invoker target_include_directories(resolver_component_tests_runner_invoker PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -18783,14 +20103,17 @@ add_executable(address_sorting_test_unsecure target_include_directories(address_sorting_test_unsecure PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -18824,14 +20147,17 @@ add_executable(address_sorting_test target_include_directories(address_sorting_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -18865,14 +20191,17 @@ add_executable(cancel_ares_query_test target_include_directories(cancel_ares_query_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -18906,14 +20235,17 @@ add_executable(alts_credentials_fuzzer_one_entry target_include_directories(alts_credentials_fuzzer_one_entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(alts_credentials_fuzzer_one_entry @@ -18941,14 +20273,17 @@ add_executable(api_fuzzer_one_entry target_include_directories(api_fuzzer_one_entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(api_fuzzer_one_entry @@ -18976,14 +20311,17 @@ add_executable(client_fuzzer_one_entry target_include_directories(client_fuzzer_one_entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(client_fuzzer_one_entry @@ -19011,14 +20349,17 @@ add_executable(hpack_parser_fuzzer_test_one_entry target_include_directories(hpack_parser_fuzzer_test_one_entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(hpack_parser_fuzzer_test_one_entry @@ -19046,14 +20387,17 @@ add_executable(http_request_fuzzer_test_one_entry target_include_directories(http_request_fuzzer_test_one_entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(http_request_fuzzer_test_one_entry @@ -19081,14 +20425,17 @@ add_executable(http_response_fuzzer_test_one_entry target_include_directories(http_response_fuzzer_test_one_entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(http_response_fuzzer_test_one_entry @@ -19116,14 +20463,17 @@ add_executable(json_fuzzer_test_one_entry target_include_directories(json_fuzzer_test_one_entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(json_fuzzer_test_one_entry @@ -19151,14 +20501,17 @@ add_executable(nanopb_fuzzer_response_test_one_entry target_include_directories(nanopb_fuzzer_response_test_one_entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(nanopb_fuzzer_response_test_one_entry @@ -19186,14 +20539,17 @@ add_executable(nanopb_fuzzer_serverlist_test_one_entry target_include_directories(nanopb_fuzzer_serverlist_test_one_entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(nanopb_fuzzer_serverlist_test_one_entry @@ -19221,14 +20577,17 @@ add_executable(percent_decode_fuzzer_one_entry target_include_directories(percent_decode_fuzzer_one_entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(percent_decode_fuzzer_one_entry @@ -19256,14 +20615,17 @@ add_executable(percent_encode_fuzzer_one_entry target_include_directories(percent_encode_fuzzer_one_entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(percent_encode_fuzzer_one_entry @@ -19291,14 +20653,17 @@ add_executable(server_fuzzer_one_entry target_include_directories(server_fuzzer_one_entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(server_fuzzer_one_entry @@ -19326,14 +20691,17 @@ add_executable(ssl_server_fuzzer_one_entry target_include_directories(ssl_server_fuzzer_one_entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(ssl_server_fuzzer_one_entry @@ -19361,14 +20729,17 @@ add_executable(uri_fuzzer_test_one_entry target_include_directories(uri_fuzzer_test_one_entry PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${_gRPC_SSL_INCLUDE_DIR} - PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE ${_gRPC_CARES_INCLUDE_DIR} PRIVATE ${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE ${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE ${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE ${_gRPC_SSL_INCLUDE_DIR} + PRIVATE ${_gRPC_UPB_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE ${_gRPC_UPB_INCLUDE_DIR} + PRIVATE ${_gRPC_ZLIB_INCLUDE_DIR} ) target_link_libraries(uri_fuzzer_test_one_entry diff --git a/Makefile b/Makefile index 01f5e55c41d..d4d61ca335b 100644 --- a/Makefile +++ b/Makefile @@ -306,12 +306,6 @@ ifeq ($(HAS_WORKING_NO_CXX14_COMPAT),true) W_NO_CXX14_COMPAT=-Wno-c++14-compat endif -CHECK_SHADOW_WORKS_CMD = $(CC) -std=c99 -Werror -Wshadow -o $(TMPOUT) -c test/build/shadow.c -HAS_WORKING_SHADOW = $(shell $(CHECK_SHADOW_WORKS_CMD) 2> /dev/null && echo true || echo false) -ifeq ($(HAS_WORKING_SHADOW),true) -W_SHADOW=-Wshadow -NO_W_SHADOW=-Wno-shadow -endif CHECK_EXTRA_SEMI_WORKS_CMD = $(CC) -std=c99 -Werror -Wextra-semi -o $(TMPOUT) -c test/build/extra-semi.c HAS_WORKING_EXTRA_SEMI = $(shell $(CHECK_EXTRA_SEMI_WORKS_CMD) 2> /dev/null && echo true || echo false) ifeq ($(HAS_WORKING_EXTRA_SEMI),true) @@ -347,14 +341,14 @@ HOST_CXX ?= $(CXX) HOST_LD ?= $(LD) HOST_LDXX ?= $(LDXX) -CFLAGS += -std=c99 -Wsign-conversion -Wconversion $(W_SHADOW) $(W_EXTRA_SEMI) +CFLAGS += -std=c99 $(W_EXTRA_SEMI) CXXFLAGS += -std=c++11 ifeq ($(SYSTEM),Darwin) CXXFLAGS += -stdlib=libc++ LDFLAGS += -framework CoreFoundation endif CXXFLAGS += -Wnon-virtual-dtor -CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 -Wno-deprecated-declarations -Ithird_party/nanopb -DPB_FIELD_32BIT +CPPFLAGS += -g -Wall -Wextra -Werror -Wno-unknown-warning-option -Wno-long-long -Wno-unused-parameter -Wno-deprecated-declarations -Wno-sign-conversion -Wno-shadow -Wno-conversion -Wno-implicit-fallthrough -Wno-sign-compare -Wno-missing-field-initializers -Wno-maybe-uninitialized -DPB_FIELD_32BIT -DOSATOMIC_USE_INLINED=1 -Ithird_party/nanopb -Ithird_party/upb -Isrc/core/ext/upb-generated COREFLAGS += -fno-rtti -fno-exceptions LDFLAGS += -g @@ -370,7 +364,7 @@ CPPFLAGS += -fPIC LDFLAGS += -fPIC endif -INCLUDES = . include $(GENDIR) third_party/upb third_party/upb/generated_for_cmake +INCLUDES = . include $(GENDIR) LDFLAGS += -Llibs/$(CONFIG) ifeq ($(SYSTEM),Darwin) @@ -460,9 +454,9 @@ E = @echo Q = @ endif -CORE_VERSION = 7.0.0 -CPP_VERSION = 1.23.0-dev -CSHARP_VERSION = 1.23.0-dev +CORE_VERSION = 8.0.0 +CPP_VERSION = 1.24.0-dev +CSHARP_VERSION = 2.24.0-dev CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) @@ -510,9 +504,9 @@ SHARED_EXT_CORE = dll SHARED_EXT_CPP = dll SHARED_EXT_CSHARP = dll SHARED_PREFIX = -SHARED_VERSION_CORE = -7 +SHARED_VERSION_CORE = -8 SHARED_VERSION_CPP = -1 -SHARED_VERSION_CSHARP = -1 +SHARED_VERSION_CSHARP = -2 else ifeq ($(SYSTEM),Darwin) EXECUTABLE_SUFFIX = SHARED_EXT_CORE = dylib @@ -1152,7 +1146,6 @@ alts_frame_handler_test: $(BINDIR)/$(CONFIG)/alts_frame_handler_test alts_frame_protector_test: $(BINDIR)/$(CONFIG)/alts_frame_protector_test alts_grpc_record_protocol_test: $(BINDIR)/$(CONFIG)/alts_grpc_record_protocol_test alts_handshaker_client_test: $(BINDIR)/$(CONFIG)/alts_handshaker_client_test -alts_handshaker_service_api_test: $(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test alts_iovec_record_protocol_test: $(BINDIR)/$(CONFIG)/alts_iovec_record_protocol_test alts_security_connector_test: $(BINDIR)/$(CONFIG)/alts_security_connector_test alts_tsi_handshaker_test: $(BINDIR)/$(CONFIG)/alts_tsi_handshaker_test @@ -1181,6 +1174,7 @@ bm_fullstack_trickle: $(BINDIR)/$(CONFIG)/bm_fullstack_trickle bm_fullstack_unary_ping_pong: $(BINDIR)/$(CONFIG)/bm_fullstack_unary_ping_pong bm_metadata: $(BINDIR)/$(CONFIG)/bm_metadata bm_pollset: $(BINDIR)/$(CONFIG)/bm_pollset +bm_threadpool: $(BINDIR)/$(CONFIG)/bm_threadpool bm_timer: $(BINDIR)/$(CONFIG)/bm_timer byte_stream_test: $(BINDIR)/$(CONFIG)/byte_stream_test channel_arguments_test: $(BINDIR)/$(CONFIG)/channel_arguments_test @@ -1207,10 +1201,14 @@ cxx_byte_buffer_test: $(BINDIR)/$(CONFIG)/cxx_byte_buffer_test cxx_slice_test: $(BINDIR)/$(CONFIG)/cxx_slice_test cxx_string_ref_test: $(BINDIR)/$(CONFIG)/cxx_string_ref_test cxx_time_test: $(BINDIR)/$(CONFIG)/cxx_time_test +delegating_channel_test: $(BINDIR)/$(CONFIG)/delegating_channel_test end2end_test: $(BINDIR)/$(CONFIG)/end2end_test error_details_test: $(BINDIR)/$(CONFIG)/error_details_test exception_test: $(BINDIR)/$(CONFIG)/exception_test filter_end2end_test: $(BINDIR)/$(CONFIG)/filter_end2end_test +gen_hpack_tables: $(BINDIR)/$(CONFIG)/gen_hpack_tables +gen_legal_metadata_characters: $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters +gen_percent_encoding_tables: $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables generic_end2end_test: $(BINDIR)/$(CONFIG)/generic_end2end_test global_config_env_test: $(BINDIR)/$(CONFIG)/global_config_env_test global_config_test: $(BINDIR)/$(CONFIG)/global_config_test @@ -1227,6 +1225,7 @@ grpc_objective_c_plugin: $(BINDIR)/$(CONFIG)/grpc_objective_c_plugin grpc_php_plugin: $(BINDIR)/$(CONFIG)/grpc_php_plugin grpc_python_plugin: $(BINDIR)/$(CONFIG)/grpc_python_plugin grpc_ruby_plugin: $(BINDIR)/$(CONFIG)/grpc_ruby_plugin +grpc_spiffe_security_connector_test: $(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test grpc_tool_test: $(BINDIR)/$(CONFIG)/grpc_tool_test grpclb_api_test: $(BINDIR)/$(CONFIG)/grpclb_api_test grpclb_end2end_test: $(BINDIR)/$(CONFIG)/grpclb_end2end_test @@ -1293,9 +1292,6 @@ transport_security_common_api_test: $(BINDIR)/$(CONFIG)/transport_security_commo writes_per_rpc_test: $(BINDIR)/$(CONFIG)/writes_per_rpc_test xds_end2end_test: $(BINDIR)/$(CONFIG)/xds_end2end_test public_headers_must_be_c89: $(BINDIR)/$(CONFIG)/public_headers_must_be_c89 -gen_hpack_tables: $(BINDIR)/$(CONFIG)/gen_hpack_tables -gen_legal_metadata_characters: $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters -gen_percent_encoding_tables: $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables boringssl_ssl_test: $(BINDIR)/$(CONFIG)/boringssl_ssl_test boringssl_crypto_test: $(BINDIR)/$(CONFIG)/boringssl_crypto_test bad_streaming_id_bad_client_test: $(BINDIR)/$(CONFIG)/bad_streaming_id_bad_client_test @@ -1414,7 +1410,7 @@ plugins: $(PROTOC_PLUGINS) privatelibs: privatelibs_c privatelibs_cxx -privatelibs_c: $(LIBDIR)/$(CONFIG)/libalts_test_util.a $(LIBDIR)/$(CONFIG)/libcxxabi.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libupb.a $(LIBDIR)/$(CONFIG)/libz.a $(LIBDIR)/$(CONFIG)/libares.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a +privatelibs_c: $(LIBDIR)/$(CONFIG)/libalts_test_util.a $(LIBDIR)/$(CONFIG)/libcxxabi.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libz.a $(LIBDIR)/$(CONFIG)/libares.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a pc_c: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc $(LIBDIR)/$(CONFIG)/pkgconfig/gpr.pc pc_c_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc $(LIBDIR)/$(CONFIG)/pkgconfig/gpr.pc @@ -1631,7 +1627,6 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/alts_frame_protector_test \ $(BINDIR)/$(CONFIG)/alts_grpc_record_protocol_test \ $(BINDIR)/$(CONFIG)/alts_handshaker_client_test \ - $(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test \ $(BINDIR)/$(CONFIG)/alts_iovec_record_protocol_test \ $(BINDIR)/$(CONFIG)/alts_security_connector_test \ $(BINDIR)/$(CONFIG)/alts_tsi_handshaker_test \ @@ -1660,6 +1655,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/bm_fullstack_unary_ping_pong \ $(BINDIR)/$(CONFIG)/bm_metadata \ $(BINDIR)/$(CONFIG)/bm_pollset \ + $(BINDIR)/$(CONFIG)/bm_threadpool \ $(BINDIR)/$(CONFIG)/bm_timer \ $(BINDIR)/$(CONFIG)/byte_stream_test \ $(BINDIR)/$(CONFIG)/channel_arguments_test \ @@ -1686,6 +1682,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/cxx_slice_test \ $(BINDIR)/$(CONFIG)/cxx_string_ref_test \ $(BINDIR)/$(CONFIG)/cxx_time_test \ + $(BINDIR)/$(CONFIG)/delegating_channel_test \ $(BINDIR)/$(CONFIG)/end2end_test \ $(BINDIR)/$(CONFIG)/error_details_test \ $(BINDIR)/$(CONFIG)/exception_test \ @@ -1699,6 +1696,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/grpc_core_map_test \ $(BINDIR)/$(CONFIG)/grpc_fetch_oauth2 \ $(BINDIR)/$(CONFIG)/grpc_linux_system_roots_test \ + $(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test \ $(BINDIR)/$(CONFIG)/grpc_tool_test \ $(BINDIR)/$(CONFIG)/grpclb_api_test \ $(BINDIR)/$(CONFIG)/grpclb_end2end_test \ @@ -1797,7 +1795,6 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/alts_frame_protector_test \ $(BINDIR)/$(CONFIG)/alts_grpc_record_protocol_test \ $(BINDIR)/$(CONFIG)/alts_handshaker_client_test \ - $(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test \ $(BINDIR)/$(CONFIG)/alts_iovec_record_protocol_test \ $(BINDIR)/$(CONFIG)/alts_security_connector_test \ $(BINDIR)/$(CONFIG)/alts_tsi_handshaker_test \ @@ -1826,6 +1823,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/bm_fullstack_unary_ping_pong \ $(BINDIR)/$(CONFIG)/bm_metadata \ $(BINDIR)/$(CONFIG)/bm_pollset \ + $(BINDIR)/$(CONFIG)/bm_threadpool \ $(BINDIR)/$(CONFIG)/bm_timer \ $(BINDIR)/$(CONFIG)/byte_stream_test \ $(BINDIR)/$(CONFIG)/channel_arguments_test \ @@ -1852,6 +1850,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/cxx_slice_test \ $(BINDIR)/$(CONFIG)/cxx_string_ref_test \ $(BINDIR)/$(CONFIG)/cxx_time_test \ + $(BINDIR)/$(CONFIG)/delegating_channel_test \ $(BINDIR)/$(CONFIG)/end2end_test \ $(BINDIR)/$(CONFIG)/error_details_test \ $(BINDIR)/$(CONFIG)/exception_test \ @@ -1865,6 +1864,7 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/grpc_core_map_test \ $(BINDIR)/$(CONFIG)/grpc_fetch_oauth2 \ $(BINDIR)/$(CONFIG)/grpc_linux_system_roots_test \ + $(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test \ $(BINDIR)/$(CONFIG)/grpc_tool_test \ $(BINDIR)/$(CONFIG)/grpclb_api_test \ $(BINDIR)/$(CONFIG)/grpclb_end2end_test \ @@ -2241,8 +2241,6 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/alts_grpc_record_protocol_test || ( echo test alts_grpc_record_protocol_test failed ; exit 1 ) $(E) "[RUN] Testing alts_handshaker_client_test" $(Q) $(BINDIR)/$(CONFIG)/alts_handshaker_client_test || ( echo test alts_handshaker_client_test failed ; exit 1 ) - $(E) "[RUN] Testing alts_handshaker_service_api_test" - $(Q) $(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test || ( echo test alts_handshaker_service_api_test failed ; exit 1 ) $(E) "[RUN] Testing alts_iovec_record_protocol_test" $(Q) $(BINDIR)/$(CONFIG)/alts_iovec_record_protocol_test || ( echo test alts_iovec_record_protocol_test failed ; exit 1 ) $(E) "[RUN] Testing alts_security_connector_test" @@ -2299,6 +2297,8 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/bm_metadata || ( echo test bm_metadata failed ; exit 1 ) $(E) "[RUN] Testing bm_pollset" $(Q) $(BINDIR)/$(CONFIG)/bm_pollset || ( echo test bm_pollset failed ; exit 1 ) + $(E) "[RUN] Testing bm_threadpool" + $(Q) $(BINDIR)/$(CONFIG)/bm_threadpool || ( echo test bm_threadpool failed ; exit 1 ) $(E) "[RUN] Testing bm_timer" $(Q) $(BINDIR)/$(CONFIG)/bm_timer || ( echo test bm_timer failed ; exit 1 ) $(E) "[RUN] Testing byte_stream_test" @@ -2349,6 +2349,8 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/cxx_string_ref_test || ( echo test cxx_string_ref_test failed ; exit 1 ) $(E) "[RUN] Testing cxx_time_test" $(Q) $(BINDIR)/$(CONFIG)/cxx_time_test || ( echo test cxx_time_test failed ; exit 1 ) + $(E) "[RUN] Testing delegating_channel_test" + $(Q) $(BINDIR)/$(CONFIG)/delegating_channel_test || ( echo test delegating_channel_test failed ; exit 1 ) $(E) "[RUN] Testing end2end_test" $(Q) $(BINDIR)/$(CONFIG)/end2end_test || ( echo test end2end_test failed ; exit 1 ) $(E) "[RUN] Testing error_details_test" @@ -2371,6 +2373,8 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/grpc_core_map_test || ( echo test grpc_core_map_test failed ; exit 1 ) $(E) "[RUN] Testing grpc_linux_system_roots_test" $(Q) $(BINDIR)/$(CONFIG)/grpc_linux_system_roots_test || ( echo test grpc_linux_system_roots_test failed ; exit 1 ) + $(E) "[RUN] Testing grpc_spiffe_security_connector_test" + $(Q) $(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test || ( echo test grpc_spiffe_security_connector_test failed ; exit 1 ) $(E) "[RUN] Testing grpc_tool_test" $(Q) $(BINDIR)/$(CONFIG)/grpc_tool_test || ( echo test grpc_tool_test failed ; exit 1 ) $(E) "[RUN] Testing grpclb_api_test" @@ -2526,9 +2530,9 @@ test_python: static_c tools: tools_c tools_cxx -tools_c: privatelibs_c $(BINDIR)/$(CONFIG)/check_epollexclusive $(BINDIR)/$(CONFIG)/grpc_create_jwt $(BINDIR)/$(CONFIG)/grpc_print_google_default_creds_token $(BINDIR)/$(CONFIG)/grpc_verify_jwt $(BINDIR)/$(CONFIG)/gen_hpack_tables $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables +tools_c: privatelibs_c $(BINDIR)/$(CONFIG)/check_epollexclusive $(BINDIR)/$(CONFIG)/grpc_create_jwt $(BINDIR)/$(CONFIG)/grpc_print_google_default_creds_token $(BINDIR)/$(CONFIG)/grpc_verify_jwt -tools_cxx: privatelibs_cxx +tools_cxx: privatelibs_cxx $(BINDIR)/$(CONFIG)/gen_hpack_tables $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables buildbenchmarks: privatelibs $(BINDIR)/$(CONFIG)/low_level_ping_pong_benchmark @@ -2700,6 +2704,38 @@ $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.grpc.pb.cc: src/proto/grpc/lb/v1/lo $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< endif +ifeq ($(NO_PROTOC),true) +$(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc: protoc_dep_error +$(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc: protoc_dep_error +else + +$(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc: src/proto/grpc/lb/v2/eds_for_test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) + $(E) "[PROTOC] Generating protobuf CC file from $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --cpp_out=$(GENDIR) $< + +$(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc: src/proto/grpc/lb/v2/eds_for_test.proto $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc $(PROTOBUF_DEP) $(PROTOC_PLUGINS) + $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< +endif + +ifeq ($(NO_PROTOC),true) +$(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.pb.cc: protoc_dep_error +$(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.cc: protoc_dep_error +else + +$(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.pb.cc: src/proto/grpc/lb/v2/lrs_for_test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc + $(E) "[PROTOC] Generating protobuf CC file from $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --cpp_out=$(GENDIR) $< + +$(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.cc: src/proto/grpc/lb/v2/lrs_for_test.proto $(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.pb.cc $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc + $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< +endif + ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc: protoc_dep_error @@ -3089,7 +3125,7 @@ install-shared_c: shared_c strip-shared_c install-pkg-config_c ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libaddress_sorting.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libaddress_sorting.so.7 + $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libaddress_sorting.so.8 $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libaddress_sorting.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" @@ -3098,7 +3134,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgpr.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so.7 + $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so.8 $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" @@ -3107,7 +3143,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so.7 + $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so.8 $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" @@ -3116,7 +3152,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_cronet.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so.7 + $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so.8 $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" @@ -3125,7 +3161,7 @@ endif ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_unsecure.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so.7 + $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so.8 $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so endif ifneq ($(SYSTEM),MINGW32) @@ -3195,7 +3231,7 @@ install-shared_csharp: shared_csharp strip-shared_csharp ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP)-dll.a $(prefix)/lib/libgrpc_csharp_ext.a else ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so.1 + $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so.2 $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so endif ifneq ($(SYSTEM),MINGW32) @@ -3286,8 +3322,8 @@ $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libaddress_sorting.so.7 -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so.7 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libaddress_sorting.so.8 -o $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBADDRESS_SORTING_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so.8 $(Q) ln -sf $(SHARED_PREFIX)address_sorting$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libaddress_sorting$(SHARED_VERSION_CORE).so endif endif @@ -3482,8 +3518,8 @@ $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGPR_OB ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.7 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.7 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.8 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.8 $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so endif endif @@ -3742,16 +3778,17 @@ LIBGRPC_SRC = \ src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc \ - src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc \ - src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc \ src/core/tsi/alts/handshaker/alts_tsi_utils.cc \ src/core/tsi/alts/handshaker/transport_security_common_api.cc \ - src/core/tsi/alts/handshaker/altscontext.pb.c \ - src/core/tsi/alts/handshaker/handshaker.pb.c \ - src/core/tsi/alts/handshaker/transport_security_common.pb.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c \ + third_party/upb/upb/decode.c \ + third_party/upb/upb/encode.c \ + third_party/upb/upb/msg.c \ + third_party/upb/upb/port.c \ + third_party/upb/upb/table.c \ + third_party/upb/upb/upb.c \ src/core/tsi/transport_security.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \ @@ -3784,7 +3821,7 @@ LIBGRPC_SRC = \ src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/filters/client_channel/health/health.pb.c \ + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ src/core/tsi/fake_transport_security.cc \ src/core/tsi/local_transport_security.cc \ src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc \ @@ -3803,14 +3840,42 @@ LIBGRPC_SRC = \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \ + src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \ + src/core/ext/upb-generated/google/api/annotations.upb.c \ + src/core/ext/upb-generated/google/api/http.upb.c \ + src/core/ext/upb-generated/google/protobuf/any.upb.c \ + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ + src/core/ext/upb-generated/google/protobuf/duration.upb.c \ + src/core/ext/upb-generated/google/protobuf/empty.upb.c \ + src/core/ext/upb-generated/google/protobuf/struct.upb.c \ + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ + src/core/ext/upb-generated/google/rpc/status.upb.c \ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \ src/core/ext/filters/client_channel/lb_policy/xds/xds.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc \ + src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c \ + src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c \ + src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \ + src/core/ext/upb-generated/envoy/type/percent.upb.c \ + src/core/ext/upb-generated/envoy/type/range.upb.c \ + src/core/ext/upb-generated/gogoproto/gogo.upb.c \ + src/core/ext/upb-generated/validate/validate.upb.c \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \ @@ -3826,6 +3891,7 @@ LIBGRPC_SRC = \ src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc \ src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \ src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \ + src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc \ src/core/ext/filters/census/grpc_context.cc \ src/core/ext/filters/client_idle/client_idle_filter.cc \ src/core/ext/filters/max_age/max_age_filter.cc \ @@ -3910,8 +3976,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGRPC_ ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.7 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.7 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.8 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.8 $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so endif endif @@ -4145,10 +4211,13 @@ LIBGRPC_CRONET_SRC = \ src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/filters/client_channel/health/health.pb.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ + third_party/upb/upb/decode.c \ + third_party/upb/upb/encode.c \ + third_party/upb/upb/msg.c \ + third_party/upb/upb/port.c \ + third_party/upb/upb/table.c \ + third_party/upb/upb/upb.c \ src/core/lib/http/httpcli_security_connector.cc \ src/core/lib/security/context/security_context.cc \ src/core/lib/security/credentials/alts/alts_credentials.cc \ @@ -4209,13 +4278,11 @@ LIBGRPC_CRONET_SRC = \ src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc \ - src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc \ - src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc \ src/core/tsi/alts/handshaker/alts_tsi_utils.cc \ src/core/tsi/alts/handshaker/transport_security_common_api.cc \ - src/core/tsi/alts/handshaker/altscontext.pb.c \ - src/core/tsi/alts/handshaker/handshaker.pb.c \ - src/core/tsi/alts/handshaker/transport_security_common.pb.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c \ src/core/tsi/transport_security.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \ @@ -4293,8 +4360,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(L ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_cronet.so.7 -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so.7 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_cronet.so.8 -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so.8 $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so endif endif @@ -4524,10 +4591,13 @@ LIBGRPC_TEST_UTIL_SRC = \ src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/filters/client_channel/health/health.pb.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ + third_party/upb/upb/decode.c \ + third_party/upb/upb/encode.c \ + third_party/upb/upb/msg.c \ + third_party/upb/upb/port.c \ + third_party/upb/upb/table.c \ + third_party/upb/upb/upb.c \ src/core/ext/transport/chttp2/transport/bin_decoder.cc \ src/core/ext/transport/chttp2/transport/bin_encoder.cc \ src/core/ext/transport/chttp2/transport/chttp2_plugin.cc \ @@ -4843,10 +4913,13 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \ src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/filters/client_channel/health/health.pb.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ + third_party/upb/upb/decode.c \ + third_party/upb/upb/encode.c \ + third_party/upb/upb/msg.c \ + third_party/upb/upb/port.c \ + third_party/upb/upb/table.c \ + third_party/upb/upb/upb.c \ src/core/ext/transport/chttp2/transport/bin_decoder.cc \ src/core/ext/transport/chttp2/transport/bin_encoder.cc \ src/core/ext/transport/chttp2/transport/chttp2_plugin.cc \ @@ -5160,10 +5233,13 @@ LIBGRPC_UNSECURE_SRC = \ src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/filters/client_channel/health/health.pb.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ + third_party/upb/upb/decode.c \ + third_party/upb/upb/encode.c \ + third_party/upb/upb/msg.c \ + third_party/upb/upb/port.c \ + third_party/upb/upb/table.c \ + third_party/upb/upb/upb.c \ src/core/ext/transport/inproc/inproc_plugin.cc \ src/core/ext/transport/inproc/inproc_transport.cc \ src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \ @@ -5180,18 +5256,47 @@ LIBGRPC_UNSECURE_SRC = \ src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \ src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \ + src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \ + src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \ + src/core/ext/upb-generated/google/api/annotations.upb.c \ + src/core/ext/upb-generated/google/api/http.upb.c \ + src/core/ext/upb-generated/google/protobuf/any.upb.c \ + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ + src/core/ext/upb-generated/google/protobuf/duration.upb.c \ + src/core/ext/upb-generated/google/protobuf/empty.upb.c \ + src/core/ext/upb-generated/google/protobuf/struct.upb.c \ + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ + src/core/ext/upb-generated/google/rpc/status.upb.c \ src/core/ext/filters/client_channel/lb_policy/xds/xds.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc \ + src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c \ + src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c \ + src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \ + src/core/ext/upb-generated/envoy/type/percent.upb.c \ + src/core/ext/upb-generated/envoy/type/range.upb.c \ + src/core/ext/upb-generated/gogoproto/gogo.upb.c \ + src/core/ext/upb-generated/validate/validate.upb.c \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/filters/census/grpc_context.cc \ @@ -5266,8 +5371,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $ ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.7 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.7 + $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.8 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.8 $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so endif endif @@ -5501,10 +5606,13 @@ LIBGRPC++_SRC = \ src/cpp/util/status.cc \ src/cpp/util/string_ref.cc \ src/cpp/util/time_cc.cc \ - src/core/ext/filters/client_channel/health/health.pb.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ + third_party/upb/upb/decode.c \ + third_party/upb/upb/encode.c \ + third_party/upb/upb/msg.c \ + third_party/upb/upb/port.c \ + third_party/upb/upb/table.c \ + third_party/upb/upb/upb.c \ src/cpp/codegen/codegen_init.cc \ PUBLIC_HEADERS_CXX += \ @@ -5735,6 +5843,7 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/impl/codegen/config.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ + include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ @@ -6205,6 +6314,7 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/impl/codegen/config.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ + include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ @@ -6382,6 +6492,7 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/impl/codegen/config.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ + include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ @@ -6527,10 +6638,13 @@ LIBGRPC++_UNSECURE_SRC = \ src/cpp/util/status.cc \ src/cpp/util/string_ref.cc \ src/cpp/util/time_cc.cc \ - src/core/ext/filters/client_channel/health/health.pb.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ + third_party/upb/upb/decode.c \ + third_party/upb/upb/encode.c \ + third_party/upb/upb/msg.c \ + third_party/upb/upb/port.c \ + third_party/upb/upb/table.c \ + third_party/upb/upb/upb.c \ src/cpp/codegen/codegen_init.cc \ PUBLIC_HEADERS_CXX += \ @@ -6762,6 +6876,7 @@ PUBLIC_HEADERS_CXX += \ include/grpcpp/impl/codegen/config.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ + include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ @@ -7501,8 +7616,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHA ifeq ($(SYSTEM),Darwin) $(Q) $(LD) $(LDFLAGS) $(if $(subst Linux,,$(SYSTEM)),,-Wl$(comma)-wrap$(comma)memcpy) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) else - $(Q) $(LD) $(LDFLAGS) $(if $(subst Linux,,$(SYSTEM)),,-Wl$(comma)-wrap$(comma)memcpy) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_csharp_ext.so.1 -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) - $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).so.1 + $(Q) $(LD) $(LDFLAGS) $(if $(subst Linux,,$(SYSTEM)),,-Wl$(comma)-wrap$(comma)memcpy) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_csharp_ext.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(LDLIBS) + $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).so.2 $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).so endif endif @@ -7893,41 +8008,6 @@ ifneq ($(NO_DEPS),true) endif -LIBUPB_SRC = \ - third_party/upb/generated_for_cmake/google/protobuf/descriptor.upb.c \ - third_party/upb/upb/decode.c \ - third_party/upb/upb/def.c \ - third_party/upb/upb/encode.c \ - third_party/upb/upb/handlers.c \ - third_party/upb/upb/msg.c \ - third_party/upb/upb/msgfactory.c \ - third_party/upb/upb/sink.c \ - third_party/upb/upb/table.c \ - third_party/upb/upb/upb.c \ - -PUBLIC_HEADERS_C += \ - -LIBUPB_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBUPB_SRC)))) - -$(LIBUPB_OBJS): CFLAGS += -Wno-sign-conversion -Wno-shadow -Wno-conversion -Wno-implicit-fallthrough -Wno-sign-compare -Wno-missing-field-initializers - -$(LIBDIR)/$(CONFIG)/libupb.a: $(ZLIB_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP) $(LIBUPB_OBJS) - $(E) "[AR] Creating $@" - $(Q) mkdir -p `dirname $@` - $(Q) rm -f $(LIBDIR)/$(CONFIG)/libupb.a - $(Q) $(AR) $(AROPTS) $(LIBDIR)/$(CONFIG)/libupb.a $(LIBUPB_OBJS) -ifeq ($(SYSTEM),Darwin) - $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libupb.a -endif - - - - -ifneq ($(NO_DEPS),true) --include $(LIBUPB_OBJS:.o=.dep) -endif - - LIBZ_SRC = \ third_party/zlib/adler32.c \ third_party/zlib/compress.c \ @@ -13589,49 +13669,6 @@ endif endif -ALTS_HANDSHAKER_SERVICE_API_TEST_SRC = \ - test/core/tsi/alts/handshaker/alts_handshaker_service_api_test.cc \ - -ALTS_HANDSHAKER_SERVICE_API_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(ALTS_HANDSHAKER_SERVICE_API_TEST_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test: openssl_dep_error - -else - - - - -ifeq ($(NO_PROTOBUF),true) - -# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. - -$(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test: protobuf_dep_error - -else - -$(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test: $(PROTOBUF_DEP) $(ALTS_HANDSHAKER_SERVICE_API_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libalts_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(ALTS_HANDSHAKER_SERVICE_API_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libalts_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/alts_handshaker_service_api_test - -endif - -endif - -$(OBJDIR)/$(CONFIG)/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test.o: $(LIBDIR)/$(CONFIG)/libalts_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a - -deps_alts_handshaker_service_api_test: $(ALTS_HANDSHAKER_SERVICE_API_TEST_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(ALTS_HANDSHAKER_SERVICE_API_TEST_OBJS:.o=.dep) -endif -endif - - ALTS_IOVEC_RECORD_PROTOCOL_TEST_SRC = \ test/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol_test.cc \ @@ -14855,6 +14892,50 @@ endif endif +BM_THREADPOOL_SRC = \ + test/cpp/microbenchmarks/bm_threadpool.cc \ + +BM_THREADPOOL_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(BM_THREADPOOL_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/bm_threadpool: openssl_dep_error + +else + + + + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. + +$(BINDIR)/$(CONFIG)/bm_threadpool: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/bm_threadpool: $(PROTOBUF_DEP) $(BM_THREADPOOL_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(BM_THREADPOOL_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_threadpool + +endif + +endif + +$(BM_THREADPOOL_OBJS): CPPFLAGS += -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX +$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_threadpool.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a + +deps_bm_threadpool: $(BM_THREADPOOL_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(BM_THREADPOOL_OBJS:.o=.dep) +endif +endif + + BM_TIMER_SRC = \ test/cpp/microbenchmarks/bm_timer.cc \ @@ -16044,6 +16125,49 @@ endif endif +DELEGATING_CHANNEL_TEST_SRC = \ + test/cpp/end2end/delegating_channel_test.cc \ + +DELEGATING_CHANNEL_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(DELEGATING_CHANNEL_TEST_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/delegating_channel_test: openssl_dep_error + +else + + + + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. + +$(BINDIR)/$(CONFIG)/delegating_channel_test: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/delegating_channel_test: $(PROTOBUF_DEP) $(DELEGATING_CHANNEL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(DELEGATING_CHANNEL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/delegating_channel_test + +endif + +endif + +$(OBJDIR)/$(CONFIG)/test/cpp/end2end/delegating_channel_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_delegating_channel_test: $(DELEGATING_CHANNEL_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(DELEGATING_CHANNEL_TEST_OBJS:.o=.dep) +endif +endif + + END2END_TEST_SRC = \ test/cpp/end2end/end2end_test.cc \ test/cpp/end2end/interceptors_util.cc \ @@ -16223,6 +16347,135 @@ endif endif +GEN_HPACK_TABLES_SRC = \ + tools/codegen/core/gen_hpack_tables.cc \ + +GEN_HPACK_TABLES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_HPACK_TABLES_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/gen_hpack_tables: openssl_dep_error + +else + + + + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. + +$(BINDIR)/$(CONFIG)/gen_hpack_tables: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/gen_hpack_tables: $(PROTOBUF_DEP) $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_hpack_tables + +endif + +endif + +$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_hpack_tables.o: $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a + +deps_gen_hpack_tables: $(GEN_HPACK_TABLES_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(GEN_HPACK_TABLES_OBJS:.o=.dep) +endif +endif + + +GEN_LEGAL_METADATA_CHARACTERS_SRC = \ + tools/codegen/core/gen_legal_metadata_characters.cc \ + +GEN_LEGAL_METADATA_CHARACTERS_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_LEGAL_METADATA_CHARACTERS_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/gen_legal_metadata_characters: openssl_dep_error + +else + + + + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. + +$(BINDIR)/$(CONFIG)/gen_legal_metadata_characters: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/gen_legal_metadata_characters: $(PROTOBUF_DEP) $(GEN_LEGAL_METADATA_CHARACTERS_OBJS) + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(GEN_LEGAL_METADATA_CHARACTERS_OBJS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters + +endif + +endif + +$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_legal_metadata_characters.o: + +deps_gen_legal_metadata_characters: $(GEN_LEGAL_METADATA_CHARACTERS_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(GEN_LEGAL_METADATA_CHARACTERS_OBJS:.o=.dep) +endif +endif + + +GEN_PERCENT_ENCODING_TABLES_SRC = \ + tools/codegen/core/gen_percent_encoding_tables.cc \ + +GEN_PERCENT_ENCODING_TABLES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_PERCENT_ENCODING_TABLES_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/gen_percent_encoding_tables: openssl_dep_error + +else + + + + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. + +$(BINDIR)/$(CONFIG)/gen_percent_encoding_tables: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/gen_percent_encoding_tables: $(PROTOBUF_DEP) $(GEN_PERCENT_ENCODING_TABLES_OBJS) + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(GEN_PERCENT_ENCODING_TABLES_OBJS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables + +endif + +endif + +$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_percent_encoding_tables.o: + +deps_gen_percent_encoding_tables: $(GEN_PERCENT_ENCODING_TABLES_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(GEN_PERCENT_ENCODING_TABLES_OBJS:.o=.dep) +endif +endif + + GENERIC_END2END_TEST_SRC = \ test/cpp/end2end/generic_end2end_test.cc \ @@ -16831,6 +17084,49 @@ ifneq ($(NO_DEPS),true) endif +GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_SRC = \ + test/core/security/spiffe_security_connector_test.cc \ + +GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test: openssl_dep_error + +else + + + + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.5.0+. + +$(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test: $(PROTOBUF_DEP) $(GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/grpc_spiffe_security_connector_test + +endif + +endif + +$(OBJDIR)/$(CONFIG)/test/core/security/spiffe_security_connector_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_grpc_spiffe_security_connector_test: $(GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(GRPC_SPIFFE_SECURITY_CONNECTOR_TEST_OBJS:.o=.dep) +endif +endif + + GRPC_TOOL_TEST_SRC = \ $(GENDIR)/src/proto/grpc/testing/echo.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.grpc.pb.cc \ $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc \ @@ -19647,7 +19943,8 @@ endif XDS_END2END_TEST_SRC = \ - $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.pb.cc $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.grpc.pb.cc \ + $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc \ + $(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.cc \ test/cpp/end2end/xds_end2end_test.cc \ XDS_END2END_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(XDS_END2END_TEST_SRC)))) @@ -19679,7 +19976,9 @@ endif endif -$(OBJDIR)/$(CONFIG)/src/proto/grpc/lb/v1/load_balancer.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/src/proto/grpc/lb/v2/eds_for_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + +$(OBJDIR)/$(CONFIG)/src/proto/grpc/lb/v2/lrs_for_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/end2end/xds_end2end_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a @@ -19690,7 +19989,7 @@ ifneq ($(NO_DEPS),true) -include $(XDS_END2END_TEST_OBJS:.o=.dep) endif endif -$(OBJDIR)/$(CONFIG)/test/cpp/end2end/xds_end2end_test.o: $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.pb.cc $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/end2end/xds_end2end_test.o: $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/eds_for_test.grpc.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.cc PUBLIC_HEADERS_MUST_BE_C89_SRC = \ @@ -19729,102 +20028,6 @@ endif endif -GEN_HPACK_TABLES_SRC = \ - tools/codegen/core/gen_hpack_tables.cc \ - -GEN_HPACK_TABLES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_HPACK_TABLES_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/gen_hpack_tables: openssl_dep_error - -else - - - -$(BINDIR)/$(CONFIG)/gen_hpack_tables: $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LD) $(LDFLAGS) $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_hpack_tables - -endif - -$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_hpack_tables.o: $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a - -deps_gen_hpack_tables: $(GEN_HPACK_TABLES_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(GEN_HPACK_TABLES_OBJS:.o=.dep) -endif -endif - - -GEN_LEGAL_METADATA_CHARACTERS_SRC = \ - tools/codegen/core/gen_legal_metadata_characters.cc \ - -GEN_LEGAL_METADATA_CHARACTERS_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_LEGAL_METADATA_CHARACTERS_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/gen_legal_metadata_characters: openssl_dep_error - -else - - - -$(BINDIR)/$(CONFIG)/gen_legal_metadata_characters: $(GEN_LEGAL_METADATA_CHARACTERS_OBJS) - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LD) $(LDFLAGS) $(GEN_LEGAL_METADATA_CHARACTERS_OBJS) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters - -endif - -$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_legal_metadata_characters.o: - -deps_gen_legal_metadata_characters: $(GEN_LEGAL_METADATA_CHARACTERS_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(GEN_LEGAL_METADATA_CHARACTERS_OBJS:.o=.dep) -endif -endif - - -GEN_PERCENT_ENCODING_TABLES_SRC = \ - tools/codegen/core/gen_percent_encoding_tables.cc \ - -GEN_PERCENT_ENCODING_TABLES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_PERCENT_ENCODING_TABLES_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/gen_percent_encoding_tables: openssl_dep_error - -else - - - -$(BINDIR)/$(CONFIG)/gen_percent_encoding_tables: $(GEN_PERCENT_ENCODING_TABLES_OBJS) - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LD) $(LDFLAGS) $(GEN_PERCENT_ENCODING_TABLES_OBJS) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_percent_encoding_tables - -endif - -$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_percent_encoding_tables.o: - -deps_gen_percent_encoding_tables: $(GEN_PERCENT_ENCODING_TABLES_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(GEN_PERCENT_ENCODING_TABLES_OBJS:.o=.dep) -endif -endif - - BORINGSSL_SSL_TEST_SRC = \ third_party/boringssl/crypto/test/gtest_main.cc \ third_party/boringssl/ssl/span_test.cc \ @@ -22325,6 +22528,9 @@ src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc: $(OPENSSL_ src/core/ext/transport/cronet/plugin_registry/grpc_cronet_plugin_registry.cc: $(OPENSSL_DEP) src/core/ext/transport/cronet/transport/cronet_api_dummy.cc: $(OPENSSL_DEP) src/core/ext/transport/cronet/transport/cronet_transport.cc: $(OPENSSL_DEP) +src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c: $(OPENSSL_DEP) +src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c: $(OPENSSL_DEP) +src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c: $(OPENSSL_DEP) src/core/lib/http/httpcli_security_connector.cc: $(OPENSSL_DEP) src/core/lib/security/context/security_context.cc: $(OPENSSL_DEP) src/core/lib/security/credentials/alts/alts_credentials.cc: $(OPENSSL_DEP) @@ -22379,14 +22585,9 @@ src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc: $(OPEN src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc: $(OPENSSL_DEP) src/core/tsi/alts/frame_protector/frame_handler.cc: $(OPENSSL_DEP) src/core/tsi/alts/handshaker/alts_handshaker_client.cc: $(OPENSSL_DEP) -src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc: $(OPENSSL_DEP) -src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc: $(OPENSSL_DEP) src/core/tsi/alts/handshaker/alts_shared_resource.cc: $(OPENSSL_DEP) src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc: $(OPENSSL_DEP) src/core/tsi/alts/handshaker/alts_tsi_utils.cc: $(OPENSSL_DEP) -src/core/tsi/alts/handshaker/altscontext.pb.c: $(OPENSSL_DEP) -src/core/tsi/alts/handshaker/handshaker.pb.c: $(OPENSSL_DEP) -src/core/tsi/alts/handshaker/transport_security_common.pb.c: $(OPENSSL_DEP) src/core/tsi/alts/handshaker/transport_security_common_api.cc: $(OPENSSL_DEP) src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc: $(OPENSSL_DEP) src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc: $(OPENSSL_DEP) diff --git a/PYTHON-MANIFEST.in b/PYTHON-MANIFEST.in index 544fefbc487..aa044d84074 100644 --- a/PYTHON-MANIFEST.in +++ b/PYTHON-MANIFEST.in @@ -1,4 +1,4 @@ -recursive-include src/python/grpcio/grpc *.c *.h *.py *.pyx *.pxd *.pxi *.python *.pem +recursive-include src/python/grpcio/grpc *.c *.h *.inc *.py *.pyx *.pxd *.pxi *.python *.pem recursive-exclude src/python/grpcio/grpc/_cython *.so *.pyd graft src/python/grpcio/grpcio.egg-info graft src/core @@ -8,6 +8,7 @@ graft third_party/address_sorting graft third_party/boringssl graft third_party/cares graft third_party/nanopb +graft third_party/upb graft third_party/zlib include src/python/grpcio/_parallel_compile_patch.py include src/python/grpcio/_spawn_patch.py diff --git a/WORKSPACE b/WORKSPACE index e8ec470efec..523b0153d7b 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -18,33 +18,6 @@ register_toolchains( "//third_party/toolchains/bazel_0.26.0_rbe_windows:cc-toolchain-x64_windows", ) -git_repository( - name = "io_bazel_rules_python", - commit = "fdbb17a4118a1728d19e638a5291b4c4266ea5b8", - remote = "https://github.com/bazelbuild/rules_python.git", -) - -load("@io_bazel_rules_python//python:pip.bzl", "pip_repositories", "pip_import") - -pip_import( - name = "grpc_python_dependencies", - requirements = "//:requirements.bazel.txt", -) - -http_archive( - name = "cython", - build_file = "//third_party:cython.BUILD", - sha256 = "d68138a2381afbdd0876c3cb2a22389043fa01c4badede1228ee073032b07a27", - strip_prefix = "cython-c2b80d87658a8525ce091cbe146cb7eaa29fed5c", - urls = [ - "https://github.com/cython/cython/archive/c2b80d87658a8525ce091cbe146cb7eaa29fed5c.tar.gz", - ], -) - -load("//bazel:grpc_python_deps.bzl", "grpc_python_deps") - -grpc_python_deps() - load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig") # Create toolchain configuration for remote execution. @@ -66,6 +39,17 @@ rbe_autoconfig( ), ) +load("@io_bazel_rules_python//python:pip.bzl", "pip_repositories", "pip_import") + +pip_import( + name = "grpc_python_dependencies", + requirements = "@com_github_grpc_grpc//:requirements.bazel.txt", +) + +load("@io_bazel_rules_python//python:pip.bzl", "pip_repositories") +load("@grpc_python_dependencies//:requirements.bzl", "pip_install") +pip_repositories() +pip_install() load("@upb//bazel:workspace_deps.bzl", "upb_deps") upb_deps() @@ -76,3 +60,10 @@ api_dependencies() load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains") go_rules_dependencies() go_register_toolchains() + + +load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies") +apple_rules_dependencies() + +load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies") +apple_support_dependencies() diff --git a/bazel/generate_objc.bzl b/bazel/generate_objc.bzl new file mode 100644 index 00000000000..6140015a1fa --- /dev/null +++ b/bazel/generate_objc.bzl @@ -0,0 +1,215 @@ +load( + "//bazel:protobuf.bzl", + "get_include_protoc_args", + "get_plugin_args", + "proto_path_to_generated_filename", +) +load(":grpc_util.bzl", "to_upper_camel_with_extension",) + +_GRPC_PROTO_HEADER_FMT = "{}.pbrpc.h" +_GRPC_PROTO_SRC_FMT = "{}.pbrpc.m" +_PROTO_HEADER_FMT = "{}.pbobjc.h" +_PROTO_SRC_FMT = "{}.pbobjc.m" +_GENERATED_PROTOS_DIR = "_generated_protos" + +_GENERATE_HDRS = 1 +_GENERATE_SRCS = 2 +_GENERATE_NON_ARC_SRCS = 3 + +def _generate_objc_impl(ctx): + """Implementation of the generate_objc rule.""" + protos = [ + f + for src in ctx.attr.deps + for f in src[ProtoInfo].transitive_imports.to_list() + ] + + target_package = _join_directories([ctx.label.workspace_root, ctx.label.package]) + + files_with_rpc = [_label_to_full_file_path(f, target_package) for f in ctx.attr.srcs] + + outs = [] + for proto in protos: + outs += [_get_output_file_name_from_proto(proto, _PROTO_HEADER_FMT)] + outs += [_get_output_file_name_from_proto(proto, _PROTO_SRC_FMT)] + + file_path = _get_full_path_from_file(proto) + if file_path in files_with_rpc: + outs += [_get_output_file_name_from_proto(proto, _GRPC_PROTO_HEADER_FMT)] + outs += [_get_output_file_name_from_proto(proto, _GRPC_PROTO_SRC_FMT)] + + out_files = [ctx.actions.declare_file(out) for out in outs] + dir_out = _join_directories([ + str(ctx.genfiles_dir.path), target_package, _GENERATED_PROTOS_DIR + ]) + + arguments = [] + if ctx.executable.plugin: + arguments += get_plugin_args( + ctx.executable.plugin, + [], + dir_out, + False, + ) + tools = [ctx.executable.plugin] + arguments += ["--objc_out=" + dir_out] + + arguments += ["--proto_path=."] + arguments += get_include_protoc_args(protos) + # Include the output directory so that protoc puts the generated code in the + # right directory. + arguments += ["--proto_path={}".format(dir_out)] + arguments += ["--proto_path={}".format(_get_directory_from_proto(proto)) for proto in protos] + arguments += [_get_full_path_from_file(proto) for proto in protos] + + # create a list of well known proto files if the argument is non-None + well_known_proto_files = [] + if ctx.attr.use_well_known_protos: + f = ctx.attr.well_known_protos.files.to_list()[0].dirname + # go two levels up so that #import "google/protobuf/..." is correct + arguments += ["-I{0}".format(f + "/../..")] + well_known_proto_files = ctx.attr.well_known_protos.files.to_list() + ctx.actions.run( + inputs = protos + well_known_proto_files, + tools = tools, + outputs = out_files, + executable = ctx.executable._protoc, + arguments = arguments, + ) + + return struct(files = depset(out_files)) + +def _label_to_full_file_path(src, package): + if not src.startswith("//"): + # Relative from current package + if not src.startswith(":"): + # "a.proto" -> ":a.proto" + src = ":" + src + src = "//" + package + src + # Converts //path/to/package:File.ext to path/to/package/File.ext. + src = src.replace("//", "") + src = src.replace(":", "/") + if src.startswith("/"): + # "//:a.proto" -> "/a.proto" so remove the initial slash + return src[1:] + else: + return src + +def _get_output_file_name_from_proto(proto, fmt): + return proto_path_to_generated_filename( + _GENERATED_PROTOS_DIR + "/" + + _get_directory_from_proto(proto) + _get_slash_or_null_from_proto(proto) + + to_upper_camel_with_extension(_get_file_name_from_proto(proto), "proto"), + fmt, + ) + +def _get_file_name_from_proto(proto): + return proto.path.rpartition("/")[2] + +def _get_slash_or_null_from_proto(proto): + """Potentially returns empty (if the file is in the root directory)""" + return proto.path.rpartition("/")[1] + +def _get_directory_from_proto(proto): + return proto.path.rpartition("/")[0] + +def _get_full_path_from_file(file): + gen_dir_length = 0 + # if file is generated, then prepare to remote its root + # (including CPU architecture...) + if not file.is_source: + gen_dir_length = len(file.root.path) + 1 + + return file.path[gen_dir_length:] + +def _join_directories(directories): + massaged_directories = [directory for directory in directories if len(directory) != 0] + return "/".join(massaged_directories) + + +generate_objc = rule( + attrs = { + "deps": attr.label_list( + mandatory = True, + allow_empty = False, + providers = [ProtoInfo], + ), + "plugin": attr.label( + default = "@com_github_grpc_grpc//src/compiler:grpc_objective_c_plugin", + executable = True, + providers = ["files_to_run"], + cfg = "host", + ), + "srcs": attr.string_list( + mandatory = False, + allow_empty = True + ), + "use_well_known_protos": attr.bool( + mandatory = False, + default = False + ), + "well_known_protos": attr.label( + default = "@com_google_protobuf//:well_known_protos" + ), + "_protoc": attr.label( + default = Label("//external:protocol_compiler"), + executable = True, + cfg = "host", + ), + }, + output_to_genfiles = True, + implementation = _generate_objc_impl +) + +def _group_objc_files_impl(ctx): + suffix = "" + if ctx.attr.gen_mode == _GENERATE_HDRS: + suffix = "h" + elif ctx.attr.gen_mode == _GENERATE_SRCS: + suffix = "pbrpc.m" + elif ctx.attr.gen_mode == _GENERATE_NON_ARC_SRCS: + suffix = "pbobjc.m" + else: + fail("Undefined gen_mode") + out_files = [ + file + for file in ctx.attr.src.files.to_list() + if file.basename.endswith(suffix) + ] + return struct(files = depset(out_files)) + +generate_objc_hdrs = rule( + attrs = { + "src": attr.label( + mandatory = True, + ), + "gen_mode": attr.int( + default = _GENERATE_HDRS, + ) + }, + implementation = _group_objc_files_impl +) + +generate_objc_srcs = rule( + attrs = { + "src": attr.label( + mandatory = True, + ), + "gen_mode": attr.int( + default = _GENERATE_SRCS, + ) + }, + implementation = _group_objc_files_impl +) + +generate_objc_non_arc_srcs = rule( + attrs = { + "src": attr.label( + mandatory = True, + ), + "gen_mode": attr.int( + default = _GENERATE_NON_ARC_SRCS, + ) + }, + implementation = _group_objc_files_impl +) diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl index 9fc4b1a26db..390624f3785 100644 --- a/bazel/grpc_build_system.bzl +++ b/bazel/grpc_build_system.bzl @@ -24,7 +24,10 @@ # load("//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("@build_bazel_rules_apple//apple:resources.bzl", "apple_resource_bundle") load("@upb//bazel:upb_proto_library.bzl", "upb_proto_library") +load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test") + # The set of pollers to test against if a test exercises polling POLLERS = ["epollex", "epoll1", "poll"] @@ -103,7 +106,10 @@ def grpc_cc_library( visibility = visibility, testonly = testonly, linkopts = linkopts, - includes = ["include"] + if_not_windows(["src/core/ext/upb-generated"]), + includes = [ + "include", + "src/core/ext/upb-generated", # Once upb code-gen issue is resolved, remove this. + ], alwayslink = alwayslink, data = data, tags = tags, @@ -133,6 +139,32 @@ def grpc_proto_library( use_external = use_external, generate_mocks = generate_mocks, ) +def ios_cc_test( + name, + tags = [], + **kwargs): + ios_test_adapter = "//third_party/objective_c/google_toolbox_for_mac:GTM_GoogleTestRunner_GTM_USING_XCTEST"; + + test_lib_ios = name + "_test_lib_ios" + ios_tags = tags + ["manual", "ios_cc_test"] + if not any([t for t in tags if t.startswith("no_test_ios")]): + native.objc_library( + name = test_lib_ios, + srcs = kwargs.get("srcs"), + deps = kwargs.get("deps"), + copts = kwargs.get("copts"), + tags = ios_tags, + alwayslink = 1, + testonly = 1, + ) + ios_test_deps = [ios_test_adapter, ":" + test_lib_ios] + ios_unit_test( + name = name + "_on_ios", + size = kwargs.get("size"), + tags = ios_tags, + minimum_os_version = "9.0", + 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 = []): copts = if_mac(["-DGRPC_CFSTREAM"]) @@ -179,6 +211,12 @@ def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data ) else: native.cc_test(tags = tags, **args) + ios_cc_test( + name = name, + tags = tags, + **args + ) + def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], data = [], language = "C++", testonly = False, linkshared = False, linkopts = [], tags = []): copts = [] @@ -198,6 +236,19 @@ def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], da ) def grpc_generate_one_off_targets(): + apple_resource_bundle( + # The choice of name is signicant here, since it determines the bundle name. + name = "gRPCCertificates", + resources = ["etc/roots.pem"], + ) + + # In open-source, grpc_objc* libraries depend directly on //:grpc + native.alias( + name = "grpc_objc", + actual = "//:grpc", + ) + +def grpc_objc_use_cronet_config(): pass def grpc_sh_test(name, srcs, args = [], data = []): @@ -240,6 +291,42 @@ def grpc_package(name, visibility = "private", features = []): features = features, ) +def grpc_objc_library( + name, + srcs, + hdrs = [], + textual_hdrs = [], + data = [], + deps = [], + defines = [], + includes = [], + visibility = ["//visibility:public"]): + """The grpc version of objc_library, only used for the Objective-C library compilation + + Args: + name: name of target + hdrs: public headers + srcs: all source files (.m) + textual_hdrs: private headers + data: any other bundle resources + defines: preprocessors + includes: added to search path, always [the path to objc directory] + deps: dependencies + visibility: visibility, default to public + """ + + native.objc_library( + name = name, + hdrs = hdrs, + srcs = srcs, + textual_hdrs = textual_hdrs, + data = data, + deps = deps, + defines = defines, + includes = includes, + visibility = visibility, + ) + def grpc_upb_proto_library(name, deps): upb_proto_library(name = name, deps = deps) diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl index b8df184f734..b226f15aa2a 100644 --- a/bazel/grpc_deps.bzl +++ b/bazel/grpc_deps.bzl @@ -2,6 +2,8 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@com_github_grpc_grpc//bazel:grpc_python_deps.bzl", "grpc_python_deps") + def grpc_deps(): """Loads dependencies need to compile and test the grpc library.""" @@ -189,11 +191,10 @@ def grpc_deps(): ) if "bazel_skylib" not in native.existing_rules(): - http_archive( + git_repository( name = "bazel_skylib", - sha256 = "ba5d15ca230efca96320085d8e4d58da826d1f81b444ef8afccd8b23e0799b52", - strip_prefix = "bazel-skylib-f83cb8dd6f5658bc574ccd873e25197055265d1c", - url = "https://github.com/bazelbuild/bazel-skylib/archive/f83cb8dd6f5658bc574ccd873e25197055265d1c.tar.gz", + remote = "https://github.com/bazelbuild/bazel-skylib", + tag = "0.9.0", ) if "io_opencensus_cpp" not in native.existing_rules(): @@ -206,9 +207,9 @@ def grpc_deps(): if "upb" not in native.existing_rules(): http_archive( name = "upb", - sha256 = "73deded75313f80779eba109c32f3c59a813addf5064bf6e7c213fca1e7d8e32", - strip_prefix = "upb-423ea5ca9ce8da69611e6e95559efcb3a1ba8ad8", - url = "https://github.com/protocolbuffers/upb/archive/423ea5ca9ce8da69611e6e95559efcb3a1ba8ad8.tar.gz", + sha256 = "95150db57b51b65f3422c38953956e0f786945d842d76f8ab685fbcd93ab5caa", + strip_prefix = "upb-931bbecbd3230ae7f22efa5d203639facc47f719", + url = "https://github.com/protocolbuffers/upb/archive/931bbecbd3230ae7f22efa5d203639facc47f719.tar.gz", ) if "envoy_api" not in native.existing_rules(): http_archive( @@ -224,6 +225,17 @@ def grpc_deps(): urls = ["https://github.com/bazelbuild/rules_go/releases/download/0.18.5/rules_go-0.18.5.tar.gz"], sha256 = "a82a352bffae6bee4e95f68a8d80a70e87f42c4741e6a448bec11998fcc82329", ) + + if "build_bazel_rules_apple" not in native.existing_rules(): + git_repository( + name = "build_bazel_rules_apple", + remote = "https://github.com/bazelbuild/rules_apple.git", + tag = "0.17.2", + ) + + grpc_python_deps() + + # TODO: move some dependencies from "grpc_deps" here? def grpc_test_only_deps(): """Internal, not intended for use by packages that are consuming grpc. @@ -282,3 +294,4 @@ def grpc_test_only_deps(): url = "https://github.com/twisted/constantly/archive/15.1.0.zip", build_file = "@com_github_grpc_grpc//third_party:constantly.BUILD", ) + diff --git a/bazel/grpc_python_deps.bzl b/bazel/grpc_python_deps.bzl index 91438f3927b..4e7cc1537fa 100644 --- a/bazel/grpc_python_deps.bzl +++ b/bazel/grpc_python_deps.bzl @@ -1,8 +1,67 @@ -load("//third_party/py:python_configure.bzl", "python_configure") -load("@io_bazel_rules_python//python:pip.bzl", "pip_repositories") -load("@grpc_python_dependencies//:requirements.bzl", "pip_install") +"""Load dependencies needed to compile and test the grpc python library as a 3rd-party consumer.""" + +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@com_github_grpc_grpc//third_party/py:python_configure.bzl", "python_configure") def grpc_python_deps(): + native.bind( + name = "six", + actual = "@six_archive//:six", + ) + + # protobuf binds to the name "six", so we can't use it here. + # See https://github.com/bazelbuild/bazel/issues/1952 for why bind is + # horrible. + if "six_archive" not in native.existing_rules(): + http_archive( + name = "six_archive", + strip_prefix = "six-1.12.0", + build_file = "@com_github_grpc_grpc//third_party:six.BUILD", + sha256 = "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73", + urls = ["https://files.pythonhosted.org/packages/dd/bf/4138e7bfb757de47d1f4b6994648ec67a51efe58fa907c1e11e350cddfca/six-1.12.0.tar.gz"], + ) + + if "enum34" not in native.existing_rules(): + http_archive( + name = "enum34", + build_file = "@com_github_grpc_grpc//third_party:enum34.BUILD", + strip_prefix = "enum34-1.1.6", + sha256 = "8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1", + urls = ["https://files.pythonhosted.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876/enum34-1.1.6.tar.gz"], + ) + + if "futures" not in native.existing_rules(): + http_archive( + name = "futures", + build_file = "@com_github_grpc_grpc//third_party:futures.BUILD", + strip_prefix = "futures-3.3.0", + sha256 = "7e033af76a5e35f58e56da7a91e687706faf4e7bdfb2cbc3f2cca6b9bcda9794", + urls = ["https://files.pythonhosted.org/packages/47/04/5fc6c74ad114032cd2c544c575bffc17582295e9cd6a851d6026ab4b2c00/futures-3.3.0.tar.gz"], + ) + + if "io_bazel_rules_python" not in native.existing_rules(): + git_repository( + name = "io_bazel_rules_python", + commit = "fdbb17a4118a1728d19e638a5291b4c4266ea5b8", + remote = "https://github.com/bazelbuild/rules_python.git", + ) + python_configure(name = "local_config_python") - pip_repositories() - pip_install() + + native.bind( + name = "python_headers", + actual = "@local_config_python//:python_headers", + ) + + if "cython" not in native.existing_rules(): + http_archive( + name = "cython", + build_file = "@com_github_grpc_grpc//third_party:cython.BUILD", + sha256 = "d68138a2381afbdd0876c3cb2a22389043fa01c4badede1228ee073032b07a27", + strip_prefix = "cython-c2b80d87658a8525ce091cbe146cb7eaa29fed5c", + urls = [ + "https://github.com/cython/cython/archive/c2b80d87658a8525ce091cbe146cb7eaa29fed5c.tar.gz", + ], + ) + diff --git a/bazel/grpc_util.bzl b/bazel/grpc_util.bzl new file mode 100644 index 00000000000..779747c8719 --- /dev/null +++ b/bazel/grpc_util.bzl @@ -0,0 +1,46 @@ +# Follows convention set in objectivec_helpers.cc in the protobuf ObjC compiler. +_upper_segments_list = ["url", "http", "https"] + +def strip_extension(str): + return str.rpartition(".")[0] + +def capitalize(word): + if word in _upper_segments_list: + return word.upper() + else: + return word.capitalize() + +def lower_underscore_to_upper_camel(str): + str = strip_extension(str) + camel_case_str = "" + word = "" + for c in str.elems(): # NB: assumes ASCII! + if c.isalpha(): + word += c.lower() + else: + # Last word is finished. + if len(word): + camel_case_str += capitalize(word) + word = "" + if c.isdigit(): + camel_case_str += c + + # Otherwise, drop the character. See UnderscoresToCamelCase in: + # third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc + + if len(word): + camel_case_str += capitalize(word) + return camel_case_str + +def file_to_upper_camel(src): + elements = src.rpartition("/") + upper_camel = lower_underscore_to_upper_camel(elements[-1]) + return "".join(list(elements[:-1]) + [upper_camel]) + +def file_with_extension(src, ext): + elements = src.rpartition("/") + return "".join(list(elements[:-1]) + [elements[-1], "." + ext]) + +def to_upper_camel_with_extension(src, ext): + src = file_to_upper_camel(src) + return file_with_extension(src, ext) diff --git a/bazel/objc_grpc_library.bzl b/bazel/objc_grpc_library.bzl new file mode 100644 index 00000000000..71538843589 --- /dev/null +++ b/bazel/objc_grpc_library.bzl @@ -0,0 +1,69 @@ +load( + "//bazel:generate_objc.bzl", + "generate_objc", + "generate_objc_hdrs", + "generate_objc_srcs", + "generate_objc_non_arc_srcs" +) +load("//bazel:protobuf.bzl", "well_known_proto_libs") + +def objc_grpc_library(name, deps, srcs = [], use_well_known_protos = False, **kwargs): + """Generates messages and/or service stubs for given proto_library and all transitively dependent proto files + + Args: + name: name of target + deps: a list of proto_library targets that needs to be compiled + srcs: a list of labels to proto files with service stubs to be generated, + labels specified must include service stubs; otherwise Bazel will complain about srcs being empty + use_well_known_protos: whether to use the well known protos defined in + @com_google_protobuf//src/google/protobuf, default to false + **kwargs: other arguments + """ + objc_grpc_library_name = "_" + name + "_objc_grpc_library" + + generate_objc( + name = objc_grpc_library_name, + srcs = srcs, + deps = deps, + use_well_known_protos = use_well_known_protos, + **kwargs + ) + + generate_objc_hdrs( + name = objc_grpc_library_name + "_hdrs", + src = ":" + objc_grpc_library_name, + ) + + generate_objc_non_arc_srcs( + name = objc_grpc_library_name + "_non_arc_srcs", + src = ":" + objc_grpc_library_name, + ) + + arc_srcs = None + if len(srcs) > 0: + generate_objc_srcs( + name = objc_grpc_library_name + "_srcs", + src = ":" + objc_grpc_library_name, + ) + arc_srcs = [":" + objc_grpc_library_name + "_srcs"] + + native.objc_library( + name = name, + hdrs = [":" + objc_grpc_library_name + "_hdrs"], + non_arc_srcs = [":" + objc_grpc_library_name + "_non_arc_srcs"], + srcs = arc_srcs, + defines = [ + "GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=0", + "GPB_GRPC_FORWARD_DECLARE_MESSAGE_PROTO=0", + ], + includes = [ + "_generated_protos", + "src/objective-c", + ], + deps = [ + "@com_github_grpc_grpc//src/objective-c:proto_objc_rpc", + "@com_google_protobuf//:protobuf_objc", + ], + **kwargs + ) + diff --git a/bazel/protobuf.bzl b/bazel/protobuf.bzl index f2df7bd87b2..462e6206111 100644 --- a/bazel/protobuf.bzl +++ b/bazel/protobuf.bzl @@ -59,6 +59,13 @@ def proto_path_to_generated_filename(proto_path, fmt_str): def _get_include_directory(include): directory = include.path prefix_len = 0 + + virtual_imports = "/_virtual_imports/" + if not include.is_source and virtual_imports in include.path: + root, relative = include.path.split(virtual_imports, 2) + result = root + virtual_imports + relative.split("/", 1)[0] + return result + if not include.is_source and directory.startswith(include.root.path): prefix_len = len(include.root.path) + 1 @@ -102,3 +109,63 @@ def get_plugin_args(plugin, flags, dir_out, generate_mocks): "--plugin=protoc-gen-PLUGIN=" + plugin.path, "--PLUGIN_out=" + ",".join(augmented_flags) + ":" + dir_out, ] + +def _get_staged_proto_file(context, source_file): + if source_file.dirname == context.label.package: + return source_file + else: + copied_proto = context.actions.declare_file(source_file.basename) + context.actions.run_shell( + inputs = [source_file], + outputs = [copied_proto], + command = "cp {} {}".format(source_file.path, copied_proto.path), + mnemonic = "CopySourceProto", + ) + return copied_proto + + +def protos_from_context(context): + """Copies proto files to the appropriate location. + + Args: + context: The ctx object for the rule. + + Returns: + A list of the protos. + """ + protos = [] + for src in context.attr.deps: + for file in src[ProtoInfo].direct_sources: + protos.append(_get_staged_proto_file(context, file)) + return protos + + +def includes_from_deps(deps): + """Get includes from rule dependencies.""" + return [ + file + for src in deps + for file in src[ProtoInfo].transitive_imports.to_list() + ] + +def get_proto_arguments(protos, genfiles_dir_path): + """Get the protoc arguments specifying which protos to compile.""" + arguments = [] + for proto in protos: + massaged_path = proto.path + if massaged_path.startswith(genfiles_dir_path): + massaged_path = proto.path[len(genfiles_dir_path) + 1:] + arguments.append(massaged_path) + return arguments + +def declare_out_files(protos, context, generated_file_format): + """Declares and returns the files to be generated.""" + return [ + context.actions.declare_file( + proto_path_to_generated_filename( + proto.basename, + generated_file_format, + ), + ) + for proto in protos + ] diff --git a/bazel/python_rules.bzl b/bazel/python_rules.bzl index 14550852a4a..0f00d53b6fb 100644 --- a/bazel/python_rules.bzl +++ b/bazel/python_rules.bzl @@ -1,91 +1,116 @@ """Generates and compiles Python gRPC stubs from proto_library rules.""" -load("@grpc_python_dependencies//:requirements.bzl", "requirement") load( "//bazel:protobuf.bzl", "get_include_protoc_args", "get_plugin_args", "get_proto_root", "proto_path_to_generated_filename", + "protos_from_context", + "includes_from_deps", + "get_proto_arguments", + "declare_out_files", ) _GENERATED_PROTO_FORMAT = "{}_pb2.py" _GENERATED_GRPC_PROTO_FORMAT = "{}_pb2_grpc.py" -def _get_staged_proto_file(context, source_file): - if source_file.dirname == context.label.package: - return source_file - else: - copied_proto = context.actions.declare_file(source_file.basename) - context.actions.run_shell( - inputs = [source_file], - outputs = [copied_proto], - command = "cp {} {}".format(source_file.path, copied_proto.path), - mnemonic = "CopySourceProto", - ) - return copied_proto - def _generate_py_impl(context): - protos = [] - for src in context.attr.deps: - for file in src[ProtoInfo].direct_sources: - protos.append(_get_staged_proto_file(context, file)) - includes = [ - file - for src in context.attr.deps - for file in src[ProtoInfo].transitive_imports.to_list() - ] + protos = protos_from_context(context) + includes = includes_from_deps(context.attr.deps) proto_root = get_proto_root(context.label.workspace_root) - format_str = (_GENERATED_GRPC_PROTO_FORMAT if context.executable.plugin else _GENERATED_PROTO_FORMAT) - out_files = [ - context.actions.declare_file( - proto_path_to_generated_filename( - proto.basename, - format_str, - ), - ) - for proto in protos - ] + out_files = declare_out_files(protos, context, _GENERATED_PROTO_FORMAT) - arguments = [] tools = [context.executable._protoc] - if context.executable.plugin: - arguments += get_plugin_args( - context.executable.plugin, - context.attr.flags, + arguments = ([ + "--python_out={}".format( context.genfiles_dir.path, - False, - ) - tools += [context.executable.plugin] - else: - arguments += [ - "--python_out={}:{}".format( - ",".join(context.attr.flags), - context.genfiles_dir.path, - ), - ] + ), + ] + get_include_protoc_args(includes) + [ + "--proto_path={}".format(context.genfiles_dir.path) + for proto in protos + ]) + arguments += get_proto_arguments(protos, context.genfiles_dir.path) + + context.actions.run( + inputs = protos + includes, + tools = tools, + outputs = out_files, + executable = context.executable._protoc, + arguments = arguments, + mnemonic = "ProtocInvocation", + ) + return struct(files = depset(out_files)) + +_generate_pb2_src = rule( + attrs = { + "deps": attr.label_list( + mandatory = True, + allow_empty = False, + providers = [ProtoInfo], + ), + "_protoc": attr.label( + default = Label("//external:protocol_compiler"), + providers = ["files_to_run"], + executable = True, + cfg = "host", + ), + }, + implementation = _generate_py_impl, +) + +def py_proto_library( + name, + srcs, + **kwargs): + """Generate python code for a protobuf. + + Args: + name: The name of the target. + srcs: A list of proto_library dependencies. Must contain a single element. + """ + codegen_target = "_{}_codegen".format(name) + if len(srcs) != 1: + fail("Can only compile a single proto at a time.") + + + _generate_pb2_src( + name = codegen_target, + deps = srcs, + **kwargs + ) + + native.py_library( + name = name, + srcs = [":{}".format(codegen_target)], + deps = ["@com_google_protobuf//:protobuf_python"], + **kwargs + ) + +def _generate_pb2_grpc_src_impl(context): + protos = protos_from_context(context) + includes = includes_from_deps(context.attr.deps) + proto_root = get_proto_root(context.label.workspace_root) + out_files = declare_out_files(protos, context, _GENERATED_GRPC_PROTO_FORMAT) + + arguments = [] + tools = [context.executable._protoc, context.executable._plugin] + arguments += get_plugin_args( + context.executable._plugin, + [], + context.genfiles_dir.path, + False, + ) arguments += get_include_protoc_args(includes) arguments += [ "--proto_path={}".format(context.genfiles_dir.path) for proto in protos ] - for proto in protos: - massaged_path = proto.path - if massaged_path.startswith(context.genfiles_dir.path): - massaged_path = proto.path[len(context.genfiles_dir.path) + 1:] - arguments.append(massaged_path) - - well_known_proto_files = [] - if context.attr.well_known_protos: - well_known_proto_directory = context.attr.well_known_protos.files.to_list( - )[0].dirname - - arguments += ["-I{}".format(well_known_proto_directory + "/../..")] - well_known_proto_files = context.attr.well_known_protos.files.to_list() + arguments += get_proto_arguments(protos, context.genfiles_dir.path) context.actions.run( - inputs = protos + includes + well_known_proto_files, + inputs = protos + includes, tools = tools, outputs = out_files, executable = context.executable._protoc, @@ -94,93 +119,62 @@ def _generate_py_impl(context): ) return struct(files = depset(out_files)) -__generate_py = rule( + +_generate_pb2_grpc_src = rule( attrs = { "deps": attr.label_list( mandatory = True, allow_empty = False, providers = [ProtoInfo], ), - "plugin": attr.label( + "_plugin": attr.label( executable = True, providers = ["files_to_run"], cfg = "host", + default = Label("//src/compiler:grpc_python_plugin"), ), - "flags": attr.string_list( - mandatory = False, - allow_empty = True, - ), - "well_known_protos": attr.label(mandatory = False), "_protoc": attr.label( - default = Label("//external:protocol_compiler"), executable = True, + providers = ["files_to_run"], cfg = "host", + default = Label("//external:protocol_compiler"), ), }, - output_to_genfiles = True, - implementation = _generate_py_impl, + implementation = _generate_pb2_grpc_src_impl, ) -def _generate_py(well_known_protos, **kwargs): - if well_known_protos: - __generate_py( - well_known_protos = "@com_google_protobuf//:well_known_protos", - **kwargs - ) - else: - __generate_py(**kwargs) - -def py_proto_library( - name, - deps, - well_known_protos = True, - proto_only = False, - **kwargs): - """Generate python code for a protobuf. +def py_grpc_library( + name, + srcs, + deps, + **kwargs): + """Generate python code for gRPC services defined in a protobuf. Args: name: The name of the target. - deps: A list of dependencies. Must contain a single element. - well_known_protos: A bool indicating whether or not to include well-known - protos. - proto_only: A bool indicating whether to generate vanilla protobuf code - or to also generate gRPC code. + srcs: (List of `labels`) a single proto_library target containing the + schema of the service. + deps: (List of `labels`) a single py_proto_library target for the + proto_library in `srcs`. """ - if len(deps) > 1: - fail("The supported length of 'deps' is 1.") - - codegen_target = "_{}_codegen".format(name) codegen_grpc_target = "_{}_grpc_codegen".format(name) + if len(srcs) != 1: + fail("Can only compile a single proto at a time.") - _generate_py( - name = codegen_target, - deps = deps, - well_known_protos = well_known_protos, + if len(deps) != 1: + fail("Deps must have length 1.") + + _generate_pb2_grpc_src( + name = codegen_grpc_target, + deps = srcs, **kwargs ) - if not proto_only: - _generate_py( - name = codegen_grpc_target, - deps = deps, - plugin = "//src/compiler:grpc_python_plugin", - well_known_protos = well_known_protos, - **kwargs - ) - - native.py_library( - name = name, - srcs = [ - ":{}".format(codegen_grpc_target), - ":{}".format(codegen_target), - ], - deps = [requirement("protobuf")], - **kwargs - ) - else: - native.py_library( - name = name, - srcs = [":{}".format(codegen_target), ":{}".format(codegen_target)], - deps = [requirement("protobuf")], - **kwargs - ) + native.py_library( + name = name, + srcs = [ + ":{}".format(codegen_grpc_target), + ], + deps = [Label("//src/python/grpcio/grpc:grpcio")] + deps, + **kwargs + ) diff --git a/bazel/test/python_test_repo/.gitignore b/bazel/test/python_test_repo/.gitignore new file mode 100644 index 00000000000..7146a250705 --- /dev/null +++ b/bazel/test/python_test_repo/.gitignore @@ -0,0 +1,2 @@ +bazel-* +tools/bazel-* diff --git a/bazel/test/python_test_repo/BUILD b/bazel/test/python_test_repo/BUILD new file mode 100644 index 00000000000..0df3700ec93 --- /dev/null +++ b/bazel/test/python_test_repo/BUILD @@ -0,0 +1,62 @@ +# gRPC Bazel BUILD file. +# +# Copyright 2019 The gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@com_github_grpc_grpc//bazel:python_rules.bzl", "py_proto_library", "py_grpc_library") + +package(default_testonly = 1) + +proto_library( + name = "helloworld_proto", + srcs = ["helloworld.proto"], + deps = [ + "@com_google_protobuf//:duration_proto", + "@com_google_protobuf//:timestamp_proto", + ], +) + +py_proto_library( + name = "helloworld_py_pb2", + srcs = [":helloworld_proto"], +) + +py_grpc_library( + name = "helloworld_py_pb2_grpc", + srcs = [":helloworld_proto"], + deps = [":helloworld_py_pb2"], +) + +py_proto_library( + name = "duration_py_pb2", + srcs = ["@com_google_protobuf//:duration_proto"], +) + +py_proto_library( + name = "timestamp_py_pb2", + srcs = ["@com_google_protobuf//:timestamp_proto"], +) + +py_test( + name = "import_test", + main = "helloworld.py", + srcs = ["helloworld.py"], + deps = [ + ":helloworld_py_pb2", + ":helloworld_py_pb2_grpc", + ":duration_py_pb2", + ":timestamp_py_pb2", + ], + python_version = "PY3", +) diff --git a/bazel/test/python_test_repo/README.md b/bazel/test/python_test_repo/README.md new file mode 100644 index 00000000000..d9dfd1d99b5 --- /dev/null +++ b/bazel/test/python_test_repo/README.md @@ -0,0 +1,5 @@ +## Bazel Workspace Test + +This directory houses a test ensuring that downstream projects can use +`@com_github_grpc_grpc//src/python/grpcio:grpcio`, `py_proto_library`, and +`py_grpc_library`. diff --git a/bazel/test/python_test_repo/WORKSPACE b/bazel/test/python_test_repo/WORKSPACE new file mode 100644 index 00000000000..f8a00c88283 --- /dev/null +++ b/bazel/test/python_test_repo/WORKSPACE @@ -0,0 +1,17 @@ +local_repository( + name = "com_github_grpc_grpc", + path = "../../..", +) + +load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") +grpc_deps() + +# TODO(https://github.com/grpc/grpc/issues/19835): Remove. +load("@upb//bazel:workspace_deps.bzl", "upb_deps") +upb_deps() + +load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies") +apple_rules_dependencies() + +load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies") +apple_support_dependencies() diff --git a/bazel/test/python_test_repo/helloworld.proto b/bazel/test/python_test_repo/helloworld.proto new file mode 100644 index 00000000000..b333a7409b8 --- /dev/null +++ b/bazel/test/python_test_repo/helloworld.proto @@ -0,0 +1,43 @@ +// Copyright 2019 The gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +option java_multiple_files = true; +option java_package = "io.grpc.examples.helloworld"; +option java_outer_classname = "HelloWorldProto"; +option objc_class_prefix = "HLW"; + +package helloworld; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; + +// The greeting service definition. +service Greeter { + // Sends a greeting + rpc SayHello (HelloRequest) returns (HelloReply) {} +} + +// The request message containing the user's name. +message HelloRequest { + string name = 1; + google.protobuf.Timestamp request_initiation = 2; +} + +// The response message containing the greetings +message HelloReply { + string message = 1; + google.protobuf.Duration request_duration = 2; +} diff --git a/bazel/test/python_test_repo/helloworld.py b/bazel/test/python_test_repo/helloworld.py new file mode 100644 index 00000000000..deee36a8f71 --- /dev/null +++ b/bazel/test/python_test_repo/helloworld.py @@ -0,0 +1,73 @@ +# Copyright 2019 the gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""The Python implementation of the GRPC helloworld.Greeter client.""" + +import contextlib +import datetime +import logging +import unittest + +import grpc + +import duration_pb2 +import helloworld_pb2 +import helloworld_pb2_grpc + +_HOST = 'localhost' +_SERVER_ADDRESS = '{}:0'.format(_HOST) + + +class Greeter(helloworld_pb2_grpc.GreeterServicer): + + def SayHello(self, request, context): + request_in_flight = datetime.now() - request.request_initation.ToDatetime() + request_duration = duration_pb2.Duration() + request_duration.FromTimedelta(request_in_flight) + return helloworld_pb2.HelloReply( + message='Hello, %s!' % request.name, + request_duration=request_duration, + ) + + +@contextlib.contextmanager +def _listening_server(): + server = grpc.server(futures.ThreadPoolExecutor()) + helloworld_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server) + port = server.add_insecure_port(_SERVER_ADDRESS) + server.start() + try: + yield port + finally: + server.stop(0) + + +class ImportTest(unittest.TestCase): + def run(): + with _listening_server() as port: + with grpc.insecure_channel('{}:{}'.format(_HOST, port)) as channel: + stub = helloworld_pb2_grpc.GreeterStub(channel) + request_timestamp = timestamp_pb2.Timestamp() + request_timestamp.GetCurrentTime() + response = stub.SayHello(helloworld_pb2.HelloRequest( + name='you', + request_initiation=request_timestamp, + ), + wait_for_ready=True) + self.assertEqual(response.message, "Hello, you!") + self.assertGreater(response.request_duration.microseconds, 0) + + +if __name__ == '__main__': + logging.basicConfig() + unittest.main() diff --git a/bazel/test/python_test_repo/tools/bazel b/bazel/test/python_test_repo/tools/bazel new file mode 120000 index 00000000000..ad4a1267bcd --- /dev/null +++ b/bazel/test/python_test_repo/tools/bazel @@ -0,0 +1 @@ +../../../../tools/bazel \ No newline at end of file diff --git a/build.yaml b/build.yaml index bc97b03084b..5f4dcc45734 100644 --- a/build.yaml +++ b/build.yaml @@ -12,21 +12,11 @@ settings: '#08': Use "-preN" suffixes to identify pre-release versions '#09': Per-language overrides are possible with (eg) ruby_version tag here '#10': See the expand_version.py for all the quirks here - core_version: 7.0.0 - g_stands_for: gangnam - version: 1.23.0-dev + core_version: 8.0.0 + csharp_major_version: 2 + g_stands_for: ganges + version: 1.24.0-dev filegroups: -- name: alts_proto - headers: - - src/core/tsi/alts/handshaker/altscontext.pb.h - - src/core/tsi/alts/handshaker/handshaker.pb.h - - src/core/tsi/alts/handshaker/transport_security_common.pb.h - src: - - src/core/tsi/alts/handshaker/altscontext.pb.c - - src/core/tsi/alts/handshaker/handshaker.pb.c - - src/core/tsi/alts/handshaker/transport_security_common.pb.c - uses: - - nanopb - name: alts_tsi headers: - src/core/tsi/alts/crypt/gsec.h @@ -72,21 +62,21 @@ filegroups: - grpc_shadow_boringssl - name: alts_upb headers: - - src/core/ext/upb-generated/altscontext.upb.h - - src/core/ext/upb-generated/handshaker.upb.h - - src/core/ext/upb-generated/transport_security_common.upb.h + - src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h + - src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h + - src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h src: - - src/core/ext/upb-generated/altscontext.upb.c - - src/core/ext/upb-generated/handshaker.upb.c - - src/core/ext/upb-generated/transport_security_common.upb.c + - src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c + - src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c + - src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c + uses: + - upb - name: alts_util public_headers: - include/grpc/grpc_security.h headers: - src/core/lib/security/credentials/alts/check_gcp_environment.h - src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h - - src/core/tsi/alts/handshaker/alts_handshaker_service_api.h - - src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h - src/core/tsi/alts/handshaker/alts_tsi_utils.h - src/core/tsi/alts/handshaker/transport_security_common_api.h src: @@ -97,15 +87,13 @@ filegroups: - src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc - src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc - src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc - - src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc - - src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc - src/core/tsi/alts/handshaker/alts_tsi_utils.cc - src/core/tsi/alts/handshaker/transport_security_common_api.cc uses: - - alts_proto + - alts_upb - grpc_base - tsi_interface - - nanopb + - upb - name: census public_headers: - include/grpc/census.h @@ -120,8 +108,67 @@ filegroups: - test/core/util/cmdline.cc uses: - gpr_base_headers +- name: envoy_ads_upb + headers: + - src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h + - src/core/ext/upb-generated/envoy/api/v2/cds.upb.h + - src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h + - src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h + - src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h + - src/core/ext/upb-generated/envoy/api/v2/eds.upb.h + - src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h + - src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h + - src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h + - src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h + src: + - src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c + - src/core/ext/upb-generated/envoy/api/v2/cds.upb.c + - src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c + - src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c + - src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c + - src/core/ext/upb-generated/envoy/api/v2/eds.upb.c + - src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c + - src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c + - src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c + - src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c + uses: + - envoy_core_upb + - envoy_type_upb + - google_api_upb + - proto_gen_validate_upb +- name: envoy_core_upb + headers: + - src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h + - src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h + - src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h + - src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h + - src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h + - src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h + src: + - src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c + - src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c + - src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c + - src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c + - src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c + - src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c + uses: + - envoy_type_upb + - google_api_upb + - proto_gen_validate_upb +- name: envoy_type_upb + headers: + - src/core/ext/upb-generated/envoy/type/percent.upb.h + - src/core/ext/upb-generated/envoy/type/range.upb.h + src: + - src/core/ext/upb-generated/envoy/type/percent.upb.c + - src/core/ext/upb-generated/envoy/type/range.upb.c + uses: + - google_api_upb + - proto_gen_validate_upb - name: google_api_upb headers: + - src/core/ext/upb-generated/google/api/annotations.upb.h + - src/core/ext/upb-generated/google/api/http.upb.h - src/core/ext/upb-generated/google/protobuf/any.upb.h - src/core/ext/upb-generated/google/protobuf/descriptor.upb.h - src/core/ext/upb-generated/google/protobuf/duration.upb.h @@ -129,7 +176,10 @@ filegroups: - src/core/ext/upb-generated/google/protobuf/struct.upb.h - src/core/ext/upb-generated/google/protobuf/timestamp.upb.h - src/core/ext/upb-generated/google/protobuf/wrappers.upb.h + - src/core/ext/upb-generated/google/rpc/status.upb.h src: + - src/core/ext/upb-generated/google/api/annotations.upb.c + - src/core/ext/upb-generated/google/api/http.upb.c - src/core/ext/upb-generated/google/protobuf/any.upb.c - src/core/ext/upb-generated/google/protobuf/descriptor.upb.c - src/core/ext/upb-generated/google/protobuf/duration.upb.c @@ -137,6 +187,9 @@ filegroups: - src/core/ext/upb-generated/google/protobuf/struct.upb.c - src/core/ext/upb-generated/google/protobuf/timestamp.upb.c - src/core/ext/upb-generated/google/protobuf/wrappers.upb.c + - src/core/ext/upb-generated/google/rpc/status.upb.c + uses: + - upb - name: gpr_base src: - src/core/lib/gpr/alloc.cc @@ -264,247 +317,539 @@ filegroups: uses: - grpc++_common - grpc++_codegen_base -- name: grpc_base - src: - - src/core/lib/avl/avl.cc - - src/core/lib/backoff/backoff.cc - - src/core/lib/channel/channel_args.cc - - src/core/lib/channel/channel_stack.cc - - src/core/lib/channel/channel_stack_builder.cc - - src/core/lib/channel/channel_trace.cc - - src/core/lib/channel/channelz.cc - - src/core/lib/channel/channelz_registry.cc - - src/core/lib/channel/connected_channel.cc - - src/core/lib/channel/handshaker.cc - - src/core/lib/channel/handshaker_registry.cc - - src/core/lib/channel/status_util.cc - - src/core/lib/compression/compression.cc - - src/core/lib/compression/compression_args.cc - - src/core/lib/compression/compression_internal.cc - - src/core/lib/compression/message_compress.cc - - src/core/lib/compression/stream_compression.cc - - src/core/lib/compression/stream_compression_gzip.cc - - src/core/lib/compression/stream_compression_identity.cc - - src/core/lib/debug/stats.cc - - src/core/lib/debug/stats_data.cc - - src/core/lib/http/format_request.cc - - src/core/lib/http/httpcli.cc - - src/core/lib/http/parser.cc - - src/core/lib/iomgr/buffer_list.cc - - src/core/lib/iomgr/call_combiner.cc - - src/core/lib/iomgr/cfstream_handle.cc - - src/core/lib/iomgr/combiner.cc - - src/core/lib/iomgr/endpoint.cc - - src/core/lib/iomgr/endpoint_cfstream.cc - - src/core/lib/iomgr/endpoint_pair_posix.cc - - src/core/lib/iomgr/endpoint_pair_uv.cc - - src/core/lib/iomgr/endpoint_pair_windows.cc - - src/core/lib/iomgr/error.cc - - src/core/lib/iomgr/error_cfstream.cc - - src/core/lib/iomgr/ev_epoll1_linux.cc - - src/core/lib/iomgr/ev_epollex_linux.cc - - src/core/lib/iomgr/ev_poll_posix.cc - - src/core/lib/iomgr/ev_posix.cc - - src/core/lib/iomgr/ev_windows.cc - - src/core/lib/iomgr/exec_ctx.cc - - src/core/lib/iomgr/executor.cc - - src/core/lib/iomgr/executor/mpmcqueue.cc - - src/core/lib/iomgr/executor/threadpool.cc - - src/core/lib/iomgr/fork_posix.cc - - src/core/lib/iomgr/fork_windows.cc - - src/core/lib/iomgr/gethostname_fallback.cc - - src/core/lib/iomgr/gethostname_host_name_max.cc - - src/core/lib/iomgr/gethostname_sysconf.cc - - src/core/lib/iomgr/grpc_if_nametoindex_posix.cc - - src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc - - src/core/lib/iomgr/internal_errqueue.cc - - src/core/lib/iomgr/iocp_windows.cc - - src/core/lib/iomgr/iomgr.cc - - src/core/lib/iomgr/iomgr_custom.cc - - src/core/lib/iomgr/iomgr_internal.cc - - src/core/lib/iomgr/iomgr_posix.cc - - src/core/lib/iomgr/iomgr_posix_cfstream.cc - - src/core/lib/iomgr/iomgr_uv.cc - - src/core/lib/iomgr/iomgr_windows.cc - - src/core/lib/iomgr/is_epollexclusive_available.cc - - src/core/lib/iomgr/load_file.cc - - src/core/lib/iomgr/lockfree_event.cc - - src/core/lib/iomgr/polling_entity.cc - - src/core/lib/iomgr/pollset.cc - - src/core/lib/iomgr/pollset_custom.cc - - src/core/lib/iomgr/pollset_set.cc - - src/core/lib/iomgr/pollset_set_custom.cc - - src/core/lib/iomgr/pollset_set_windows.cc - - src/core/lib/iomgr/pollset_uv.cc - - src/core/lib/iomgr/pollset_windows.cc - - src/core/lib/iomgr/resolve_address.cc - - src/core/lib/iomgr/resolve_address_custom.cc - - src/core/lib/iomgr/resolve_address_posix.cc - - src/core/lib/iomgr/resolve_address_windows.cc - - src/core/lib/iomgr/resource_quota.cc - - src/core/lib/iomgr/sockaddr_utils.cc - - src/core/lib/iomgr/socket_factory_posix.cc - - src/core/lib/iomgr/socket_mutator.cc - - src/core/lib/iomgr/socket_utils_common_posix.cc - - src/core/lib/iomgr/socket_utils_linux.cc - - src/core/lib/iomgr/socket_utils_posix.cc - - src/core/lib/iomgr/socket_utils_uv.cc - - src/core/lib/iomgr/socket_utils_windows.cc - - src/core/lib/iomgr/socket_windows.cc - - src/core/lib/iomgr/tcp_client.cc - - src/core/lib/iomgr/tcp_client_cfstream.cc - - src/core/lib/iomgr/tcp_client_custom.cc - - src/core/lib/iomgr/tcp_client_posix.cc - - src/core/lib/iomgr/tcp_client_windows.cc - - src/core/lib/iomgr/tcp_custom.cc - - src/core/lib/iomgr/tcp_posix.cc - - src/core/lib/iomgr/tcp_server.cc - - src/core/lib/iomgr/tcp_server_custom.cc - - src/core/lib/iomgr/tcp_server_posix.cc - - src/core/lib/iomgr/tcp_server_utils_posix_common.cc - - src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc - - src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc - - src/core/lib/iomgr/tcp_server_windows.cc - - src/core/lib/iomgr/tcp_uv.cc - - src/core/lib/iomgr/tcp_windows.cc - - src/core/lib/iomgr/time_averaged_stats.cc - - src/core/lib/iomgr/timer.cc - - src/core/lib/iomgr/timer_custom.cc - - src/core/lib/iomgr/timer_generic.cc - - src/core/lib/iomgr/timer_heap.cc - - src/core/lib/iomgr/timer_manager.cc - - src/core/lib/iomgr/timer_uv.cc - - src/core/lib/iomgr/udp_server.cc - - src/core/lib/iomgr/unix_sockets_posix.cc - - src/core/lib/iomgr/unix_sockets_posix_noop.cc - - src/core/lib/iomgr/wakeup_fd_eventfd.cc - - src/core/lib/iomgr/wakeup_fd_nospecial.cc - - src/core/lib/iomgr/wakeup_fd_pipe.cc - - src/core/lib/iomgr/wakeup_fd_posix.cc - - src/core/lib/json/json.cc - - src/core/lib/json/json_reader.cc - - src/core/lib/json/json_string.cc - - src/core/lib/json/json_writer.cc - - src/core/lib/slice/b64.cc - - src/core/lib/slice/percent_encoding.cc - - src/core/lib/slice/slice.cc - - src/core/lib/slice/slice_buffer.cc - - src/core/lib/slice/slice_intern.cc - - src/core/lib/slice/slice_string_helpers.cc - - src/core/lib/surface/api_trace.cc - - src/core/lib/surface/byte_buffer.cc - - src/core/lib/surface/byte_buffer_reader.cc - - src/core/lib/surface/call.cc - - src/core/lib/surface/call_details.cc - - src/core/lib/surface/call_log_batch.cc - - src/core/lib/surface/channel.cc - - src/core/lib/surface/channel_init.cc - - src/core/lib/surface/channel_ping.cc - - src/core/lib/surface/channel_stack_type.cc - - src/core/lib/surface/completion_queue.cc - - src/core/lib/surface/completion_queue_factory.cc - - src/core/lib/surface/event_string.cc - - src/core/lib/surface/lame_client.cc - - src/core/lib/surface/metadata_array.cc - - src/core/lib/surface/server.cc - - src/core/lib/surface/validate_metadata.cc - - src/core/lib/surface/version.cc - - src/core/lib/transport/bdp_estimator.cc - - src/core/lib/transport/byte_stream.cc - - src/core/lib/transport/connectivity_state.cc - - src/core/lib/transport/error_utils.cc - - src/core/lib/transport/metadata.cc - - src/core/lib/transport/metadata_batch.cc - - src/core/lib/transport/pid_controller.cc - - src/core/lib/transport/static_metadata.cc - - src/core/lib/transport/status_conversion.cc - - src/core/lib/transport/status_metadata.cc - - src/core/lib/transport/timeout_encoding.cc - - src/core/lib/transport/transport.cc - - src/core/lib/transport/transport_op_string.cc - - src/core/lib/uri/uri_parser.cc - deps: - - gpr - filegroups: - - grpc_base_headers - uses: - - grpc_codegen - - grpc_trace -- name: grpc_base_headers +- name: grpc++_codegen_base public_headers: - - include/grpc/byte_buffer.h - - include/grpc/byte_buffer_reader.h - - include/grpc/compression.h - - include/grpc/fork.h - - include/grpc/grpc.h - - include/grpc/grpc_posix.h - - include/grpc/grpc_security_constants.h - - include/grpc/load_reporting.h - - include/grpc/slice.h - - include/grpc/slice_buffer.h - - include/grpc/status.h - - include/grpc/support/workaround_list.h - headers: - - src/core/lib/avl/avl.h - - src/core/lib/backoff/backoff.h - - src/core/lib/channel/channel_args.h - - src/core/lib/channel/channel_stack.h - - src/core/lib/channel/channel_stack_builder.h - - src/core/lib/channel/channel_trace.h - - src/core/lib/channel/channelz.h - - src/core/lib/channel/channelz_registry.h - - src/core/lib/channel/connected_channel.h - - src/core/lib/channel/context.h - - src/core/lib/channel/handshaker.h - - src/core/lib/channel/handshaker_factory.h - - src/core/lib/channel/handshaker_registry.h - - src/core/lib/channel/status_util.h - - src/core/lib/compression/algorithm_metadata.h - - src/core/lib/compression/compression_args.h - - src/core/lib/compression/compression_internal.h - - src/core/lib/compression/message_compress.h - - src/core/lib/compression/stream_compression.h - - src/core/lib/compression/stream_compression_gzip.h - - src/core/lib/compression/stream_compression_identity.h - - src/core/lib/debug/stats.h - - src/core/lib/debug/stats_data.h - - src/core/lib/gprpp/debug_location.h - - src/core/lib/gprpp/inlined_vector.h - - src/core/lib/gprpp/optional.h - - src/core/lib/gprpp/orphanable.h - - src/core/lib/gprpp/ref_counted.h - - src/core/lib/gprpp/ref_counted_ptr.h - - src/core/lib/gprpp/string_view.h - - src/core/lib/http/format_request.h - - src/core/lib/http/httpcli.h - - src/core/lib/http/parser.h - - src/core/lib/iomgr/block_annotate.h - - src/core/lib/iomgr/buffer_list.h - - src/core/lib/iomgr/call_combiner.h - - src/core/lib/iomgr/cfstream_handle.h - - src/core/lib/iomgr/closure.h - - src/core/lib/iomgr/combiner.h - - src/core/lib/iomgr/dynamic_annotations.h - - src/core/lib/iomgr/endpoint.h - - src/core/lib/iomgr/endpoint_cfstream.h - - src/core/lib/iomgr/endpoint_pair.h - - src/core/lib/iomgr/error.h - - src/core/lib/iomgr/error_cfstream.h - - src/core/lib/iomgr/error_internal.h - - src/core/lib/iomgr/ev_epoll1_linux.h - - src/core/lib/iomgr/ev_epollex_linux.h - - src/core/lib/iomgr/ev_poll_posix.h - - src/core/lib/iomgr/ev_posix.h - - src/core/lib/iomgr/exec_ctx.h - - src/core/lib/iomgr/executor.h - - src/core/lib/iomgr/executor/mpmcqueue.h - - src/core/lib/iomgr/executor/threadpool.h - - src/core/lib/iomgr/gethostname.h - - src/core/lib/iomgr/grpc_if_nametoindex.h - - src/core/lib/iomgr/internal_errqueue.h - - src/core/lib/iomgr/iocp_windows.h - - src/core/lib/iomgr/iomgr.h - - src/core/lib/iomgr/iomgr_custom.h + - include/grpc++/impl/codegen/async_stream.h + - include/grpc++/impl/codegen/async_unary_call.h + - include/grpc++/impl/codegen/byte_buffer.h + - include/grpc++/impl/codegen/call.h + - include/grpc++/impl/codegen/call_hook.h + - include/grpc++/impl/codegen/channel_interface.h + - include/grpc++/impl/codegen/client_context.h + - include/grpc++/impl/codegen/client_unary_call.h + - include/grpc++/impl/codegen/completion_queue.h + - include/grpc++/impl/codegen/completion_queue_tag.h + - include/grpc++/impl/codegen/config.h + - include/grpc++/impl/codegen/core_codegen_interface.h + - include/grpc++/impl/codegen/create_auth_context.h + - include/grpc++/impl/codegen/grpc_library.h + - include/grpc++/impl/codegen/metadata_map.h + - include/grpc++/impl/codegen/method_handler_impl.h + - include/grpc++/impl/codegen/rpc_method.h + - include/grpc++/impl/codegen/rpc_service_method.h + - include/grpc++/impl/codegen/security/auth_context.h + - include/grpc++/impl/codegen/serialization_traits.h + - include/grpc++/impl/codegen/server_context.h + - include/grpc++/impl/codegen/server_interface.h + - include/grpc++/impl/codegen/service_type.h + - include/grpc++/impl/codegen/slice.h + - include/grpc++/impl/codegen/status.h + - include/grpc++/impl/codegen/status_code_enum.h + - include/grpc++/impl/codegen/string_ref.h + - include/grpc++/impl/codegen/stub_options.h + - include/grpc++/impl/codegen/sync_stream.h + - include/grpc++/impl/codegen/time.h + - include/grpcpp/impl/codegen/async_generic_service.h + - include/grpcpp/impl/codegen/async_stream.h + - include/grpcpp/impl/codegen/async_stream_impl.h + - include/grpcpp/impl/codegen/async_unary_call.h + - include/grpcpp/impl/codegen/async_unary_call_impl.h + - include/grpcpp/impl/codegen/byte_buffer.h + - include/grpcpp/impl/codegen/call.h + - include/grpcpp/impl/codegen/call_hook.h + - include/grpcpp/impl/codegen/call_op_set.h + - include/grpcpp/impl/codegen/call_op_set_interface.h + - include/grpcpp/impl/codegen/callback_common.h + - include/grpcpp/impl/codegen/channel_interface.h + - include/grpcpp/impl/codegen/client_callback.h + - include/grpcpp/impl/codegen/client_callback_impl.h + - include/grpcpp/impl/codegen/client_context.h + - include/grpcpp/impl/codegen/client_context_impl.h + - include/grpcpp/impl/codegen/client_interceptor.h + - include/grpcpp/impl/codegen/client_unary_call.h + - include/grpcpp/impl/codegen/completion_queue.h + - include/grpcpp/impl/codegen/completion_queue_impl.h + - include/grpcpp/impl/codegen/completion_queue_tag.h + - include/grpcpp/impl/codegen/config.h + - include/grpcpp/impl/codegen/core_codegen_interface.h + - include/grpcpp/impl/codegen/create_auth_context.h + - include/grpcpp/impl/codegen/delegating_channel.h + - include/grpcpp/impl/codegen/grpc_library.h + - include/grpcpp/impl/codegen/intercepted_channel.h + - include/grpcpp/impl/codegen/interceptor.h + - include/grpcpp/impl/codegen/interceptor_common.h + - include/grpcpp/impl/codegen/message_allocator.h + - include/grpcpp/impl/codegen/metadata_map.h + - include/grpcpp/impl/codegen/method_handler_impl.h + - include/grpcpp/impl/codegen/rpc_method.h + - include/grpcpp/impl/codegen/rpc_service_method.h + - include/grpcpp/impl/codegen/security/auth_context.h + - include/grpcpp/impl/codegen/serialization_traits.h + - include/grpcpp/impl/codegen/server_callback.h + - include/grpcpp/impl/codegen/server_callback_impl.h + - include/grpcpp/impl/codegen/server_context.h + - include/grpcpp/impl/codegen/server_context_impl.h + - include/grpcpp/impl/codegen/server_interceptor.h + - include/grpcpp/impl/codegen/server_interface.h + - include/grpcpp/impl/codegen/service_type.h + - include/grpcpp/impl/codegen/slice.h + - include/grpcpp/impl/codegen/status.h + - include/grpcpp/impl/codegen/status_code_enum.h + - include/grpcpp/impl/codegen/string_ref.h + - include/grpcpp/impl/codegen/stub_options.h + - include/grpcpp/impl/codegen/sync_stream.h + - include/grpcpp/impl/codegen/sync_stream_impl.h + - include/grpcpp/impl/codegen/time.h + uses: + - grpc_codegen + - grpc++_internal_hdrs_only +- name: grpc++_codegen_base_src + src: + - src/cpp/codegen/codegen_init.cc + uses: + - grpc++_codegen_base +- name: grpc++_codegen_proto + public_headers: + - include/grpc++/impl/codegen/proto_utils.h + - include/grpcpp/impl/codegen/proto_buffer_reader.h + - include/grpcpp/impl/codegen/proto_buffer_writer.h + - include/grpcpp/impl/codegen/proto_utils.h + uses: + - grpc++_codegen_base + - grpc++_config_proto +- name: grpc++_common + public_headers: + - include/grpc++/alarm.h + - include/grpc++/channel.h + - include/grpc++/client_context.h + - include/grpc++/completion_queue.h + - include/grpc++/create_channel.h + - include/grpc++/create_channel_posix.h + - include/grpc++/ext/health_check_service_server_builder_option.h + - include/grpc++/generic/async_generic_service.h + - include/grpc++/generic/generic_stub.h + - include/grpc++/grpc++.h + - include/grpc++/health_check_service_interface.h + - include/grpc++/impl/call.h + - include/grpc++/impl/channel_argument_option.h + - include/grpc++/impl/client_unary_call.h + - include/grpc++/impl/codegen/core_codegen.h + - include/grpc++/impl/grpc_library.h + - include/grpc++/impl/method_handler_impl.h + - include/grpc++/impl/rpc_method.h + - include/grpc++/impl/rpc_service_method.h + - include/grpc++/impl/serialization_traits.h + - include/grpc++/impl/server_builder_option.h + - include/grpc++/impl/server_builder_plugin.h + - include/grpc++/impl/server_initializer.h + - include/grpc++/impl/service_type.h + - include/grpc++/resource_quota.h + - include/grpc++/security/auth_context.h + - include/grpc++/security/auth_metadata_processor.h + - include/grpc++/security/credentials.h + - include/grpc++/security/server_credentials.h + - include/grpc++/server.h + - include/grpc++/server_builder.h + - include/grpc++/server_context.h + - include/grpc++/server_posix.h + - include/grpc++/support/async_stream.h + - include/grpc++/support/async_unary_call.h + - include/grpc++/support/byte_buffer.h + - include/grpc++/support/channel_arguments.h + - include/grpc++/support/config.h + - include/grpc++/support/slice.h + - include/grpc++/support/status.h + - include/grpc++/support/status_code_enum.h + - include/grpc++/support/string_ref.h + - include/grpc++/support/stub_options.h + - include/grpc++/support/sync_stream.h + - include/grpc++/support/time.h + - include/grpcpp/alarm.h + - include/grpcpp/alarm_impl.h + - include/grpcpp/channel.h + - include/grpcpp/channel_impl.h + - include/grpcpp/client_context.h + - include/grpcpp/completion_queue.h + - include/grpcpp/completion_queue_impl.h + - include/grpcpp/create_channel.h + - include/grpcpp/create_channel_impl.h + - include/grpcpp/create_channel_posix.h + - include/grpcpp/create_channel_posix_impl.h + - include/grpcpp/ext/health_check_service_server_builder_option.h + - include/grpcpp/generic/async_generic_service.h + - include/grpcpp/generic/generic_stub.h + - include/grpcpp/generic/generic_stub_impl.h + - include/grpcpp/grpcpp.h + - include/grpcpp/health_check_service_interface.h + - include/grpcpp/health_check_service_interface_impl.h + - include/grpcpp/impl/call.h + - include/grpcpp/impl/channel_argument_option.h + - include/grpcpp/impl/client_unary_call.h + - include/grpcpp/impl/codegen/core_codegen.h + - include/grpcpp/impl/grpc_library.h + - include/grpcpp/impl/method_handler_impl.h + - include/grpcpp/impl/rpc_method.h + - include/grpcpp/impl/rpc_service_method.h + - include/grpcpp/impl/serialization_traits.h + - include/grpcpp/impl/server_builder_option.h + - include/grpcpp/impl/server_builder_option_impl.h + - include/grpcpp/impl/server_builder_plugin.h + - include/grpcpp/impl/server_initializer.h + - include/grpcpp/impl/server_initializer_impl.h + - include/grpcpp/impl/service_type.h + - include/grpcpp/resource_quota.h + - include/grpcpp/resource_quota_impl.h + - include/grpcpp/security/auth_context.h + - include/grpcpp/security/auth_metadata_processor.h + - include/grpcpp/security/auth_metadata_processor_impl.h + - include/grpcpp/security/credentials.h + - include/grpcpp/security/credentials_impl.h + - include/grpcpp/security/server_credentials.h + - include/grpcpp/security/server_credentials_impl.h + - include/grpcpp/server.h + - include/grpcpp/server_builder.h + - include/grpcpp/server_builder_impl.h + - include/grpcpp/server_context.h + - include/grpcpp/server_impl.h + - include/grpcpp/server_posix.h + - include/grpcpp/server_posix_impl.h + - include/grpcpp/support/async_stream.h + - include/grpcpp/support/async_stream_impl.h + - include/grpcpp/support/async_unary_call.h + - include/grpcpp/support/async_unary_call_impl.h + - include/grpcpp/support/byte_buffer.h + - include/grpcpp/support/channel_arguments.h + - include/grpcpp/support/channel_arguments_impl.h + - include/grpcpp/support/client_callback.h + - include/grpcpp/support/client_callback_impl.h + - include/grpcpp/support/client_interceptor.h + - include/grpcpp/support/config.h + - include/grpcpp/support/interceptor.h + - include/grpcpp/support/message_allocator.h + - include/grpcpp/support/proto_buffer_reader.h + - include/grpcpp/support/proto_buffer_writer.h + - include/grpcpp/support/server_callback.h + - include/grpcpp/support/server_callback_impl.h + - include/grpcpp/support/server_interceptor.h + - include/grpcpp/support/slice.h + - include/grpcpp/support/status.h + - include/grpcpp/support/status_code_enum.h + - include/grpcpp/support/string_ref.h + - include/grpcpp/support/stub_options.h + - include/grpcpp/support/sync_stream.h + - include/grpcpp/support/sync_stream_impl.h + - include/grpcpp/support/time.h + - include/grpcpp/support/validate_service_config.h + headers: + - src/cpp/client/create_channel_internal.h + - src/cpp/common/channel_filter.h + - src/cpp/server/dynamic_thread_pool.h + - src/cpp/server/external_connection_acceptor_impl.h + - src/cpp/server/health/default_health_check_service.h + - src/cpp/server/thread_pool_interface.h + - src/cpp/thread_manager/thread_manager.h + src: + - src/cpp/client/channel_cc.cc + - src/cpp/client/client_context.cc + - src/cpp/client/client_interceptor.cc + - src/cpp/client/create_channel.cc + - src/cpp/client/create_channel_internal.cc + - src/cpp/client/create_channel_posix.cc + - src/cpp/client/credentials_cc.cc + - src/cpp/client/generic_stub.cc + - src/cpp/common/alarm.cc + - src/cpp/common/channel_arguments.cc + - src/cpp/common/channel_filter.cc + - src/cpp/common/completion_queue_cc.cc + - src/cpp/common/core_codegen.cc + - src/cpp/common/resource_quota_cc.cc + - src/cpp/common/rpc_method.cc + - src/cpp/common/validate_service_config.cc + - src/cpp/common/version_cc.cc + - src/cpp/server/async_generic_service.cc + - src/cpp/server/channel_argument_option.cc + - src/cpp/server/create_default_thread_pool.cc + - src/cpp/server/dynamic_thread_pool.cc + - src/cpp/server/external_connection_acceptor_impl.cc + - src/cpp/server/health/default_health_check_service.cc + - src/cpp/server/health/health_check_service.cc + - src/cpp/server/health/health_check_service_server_builder_option.cc + - src/cpp/server/server_builder.cc + - src/cpp/server/server_cc.cc + - src/cpp/server/server_context.cc + - src/cpp/server/server_credentials.cc + - src/cpp/server/server_posix.cc + - src/cpp/thread_manager/thread_manager.cc + - src/cpp/util/byte_buffer_cc.cc + - src/cpp/util/status.cc + - src/cpp/util/string_ref.cc + - src/cpp/util/time_cc.cc + uses: + - gpr_base_headers + - grpc_base_headers + - grpc_health_upb + - grpc_transport_inproc_headers + - grpc++_codegen_base + - grpc++_internal_hdrs_only + - nanopb_headers +- name: grpc++_config_proto + public_headers: + - include/grpc++/impl/codegen/config_protobuf.h + - include/grpcpp/impl/codegen/config_protobuf.h +- name: grpc++_internal_hdrs_only + public_headers: + - include/grpcpp/impl/codegen/sync.h +- name: grpc++_reflection_proto + src: + - src/proto/grpc/reflection/v1alpha/reflection.proto +- name: grpc++_test + public_headers: + - include/grpc++/test/mock_stream.h + - include/grpc++/test/server_context_test_spouse.h + - include/grpcpp/test/mock_stream.h + - include/grpcpp/test/server_context_test_spouse.h + deps: + - grpc++ + - grpc +- name: grpc_base + src: + - src/core/lib/avl/avl.cc + - src/core/lib/backoff/backoff.cc + - src/core/lib/channel/channel_args.cc + - src/core/lib/channel/channel_stack.cc + - src/core/lib/channel/channel_stack_builder.cc + - src/core/lib/channel/channel_trace.cc + - src/core/lib/channel/channelz.cc + - src/core/lib/channel/channelz_registry.cc + - src/core/lib/channel/connected_channel.cc + - src/core/lib/channel/handshaker.cc + - src/core/lib/channel/handshaker_registry.cc + - src/core/lib/channel/status_util.cc + - src/core/lib/compression/compression.cc + - src/core/lib/compression/compression_args.cc + - src/core/lib/compression/compression_internal.cc + - src/core/lib/compression/message_compress.cc + - src/core/lib/compression/stream_compression.cc + - src/core/lib/compression/stream_compression_gzip.cc + - src/core/lib/compression/stream_compression_identity.cc + - src/core/lib/debug/stats.cc + - src/core/lib/debug/stats_data.cc + - src/core/lib/http/format_request.cc + - src/core/lib/http/httpcli.cc + - src/core/lib/http/parser.cc + - src/core/lib/iomgr/buffer_list.cc + - src/core/lib/iomgr/call_combiner.cc + - src/core/lib/iomgr/cfstream_handle.cc + - src/core/lib/iomgr/combiner.cc + - src/core/lib/iomgr/endpoint.cc + - src/core/lib/iomgr/endpoint_cfstream.cc + - src/core/lib/iomgr/endpoint_pair_posix.cc + - src/core/lib/iomgr/endpoint_pair_uv.cc + - src/core/lib/iomgr/endpoint_pair_windows.cc + - src/core/lib/iomgr/error.cc + - src/core/lib/iomgr/error_cfstream.cc + - src/core/lib/iomgr/ev_epoll1_linux.cc + - src/core/lib/iomgr/ev_epollex_linux.cc + - src/core/lib/iomgr/ev_poll_posix.cc + - src/core/lib/iomgr/ev_posix.cc + - src/core/lib/iomgr/ev_windows.cc + - src/core/lib/iomgr/exec_ctx.cc + - src/core/lib/iomgr/executor.cc + - src/core/lib/iomgr/executor/mpmcqueue.cc + - src/core/lib/iomgr/executor/threadpool.cc + - src/core/lib/iomgr/fork_posix.cc + - src/core/lib/iomgr/fork_windows.cc + - src/core/lib/iomgr/gethostname_fallback.cc + - src/core/lib/iomgr/gethostname_host_name_max.cc + - src/core/lib/iomgr/gethostname_sysconf.cc + - src/core/lib/iomgr/grpc_if_nametoindex_posix.cc + - src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc + - src/core/lib/iomgr/internal_errqueue.cc + - src/core/lib/iomgr/iocp_windows.cc + - src/core/lib/iomgr/iomgr.cc + - src/core/lib/iomgr/iomgr_custom.cc + - src/core/lib/iomgr/iomgr_internal.cc + - src/core/lib/iomgr/iomgr_posix.cc + - src/core/lib/iomgr/iomgr_posix_cfstream.cc + - src/core/lib/iomgr/iomgr_uv.cc + - src/core/lib/iomgr/iomgr_windows.cc + - src/core/lib/iomgr/is_epollexclusive_available.cc + - src/core/lib/iomgr/load_file.cc + - src/core/lib/iomgr/lockfree_event.cc + - src/core/lib/iomgr/polling_entity.cc + - src/core/lib/iomgr/pollset.cc + - src/core/lib/iomgr/pollset_custom.cc + - src/core/lib/iomgr/pollset_set.cc + - src/core/lib/iomgr/pollset_set_custom.cc + - src/core/lib/iomgr/pollset_set_windows.cc + - src/core/lib/iomgr/pollset_uv.cc + - src/core/lib/iomgr/pollset_windows.cc + - src/core/lib/iomgr/resolve_address.cc + - src/core/lib/iomgr/resolve_address_custom.cc + - src/core/lib/iomgr/resolve_address_posix.cc + - src/core/lib/iomgr/resolve_address_windows.cc + - src/core/lib/iomgr/resource_quota.cc + - src/core/lib/iomgr/sockaddr_utils.cc + - src/core/lib/iomgr/socket_factory_posix.cc + - src/core/lib/iomgr/socket_mutator.cc + - src/core/lib/iomgr/socket_utils_common_posix.cc + - src/core/lib/iomgr/socket_utils_linux.cc + - src/core/lib/iomgr/socket_utils_posix.cc + - src/core/lib/iomgr/socket_utils_uv.cc + - src/core/lib/iomgr/socket_utils_windows.cc + - src/core/lib/iomgr/socket_windows.cc + - src/core/lib/iomgr/tcp_client.cc + - src/core/lib/iomgr/tcp_client_cfstream.cc + - src/core/lib/iomgr/tcp_client_custom.cc + - src/core/lib/iomgr/tcp_client_posix.cc + - src/core/lib/iomgr/tcp_client_windows.cc + - src/core/lib/iomgr/tcp_custom.cc + - src/core/lib/iomgr/tcp_posix.cc + - src/core/lib/iomgr/tcp_server.cc + - src/core/lib/iomgr/tcp_server_custom.cc + - src/core/lib/iomgr/tcp_server_posix.cc + - src/core/lib/iomgr/tcp_server_utils_posix_common.cc + - src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc + - src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc + - src/core/lib/iomgr/tcp_server_windows.cc + - src/core/lib/iomgr/tcp_uv.cc + - src/core/lib/iomgr/tcp_windows.cc + - src/core/lib/iomgr/time_averaged_stats.cc + - src/core/lib/iomgr/timer.cc + - src/core/lib/iomgr/timer_custom.cc + - src/core/lib/iomgr/timer_generic.cc + - src/core/lib/iomgr/timer_heap.cc + - src/core/lib/iomgr/timer_manager.cc + - src/core/lib/iomgr/timer_uv.cc + - src/core/lib/iomgr/udp_server.cc + - src/core/lib/iomgr/unix_sockets_posix.cc + - src/core/lib/iomgr/unix_sockets_posix_noop.cc + - src/core/lib/iomgr/wakeup_fd_eventfd.cc + - src/core/lib/iomgr/wakeup_fd_nospecial.cc + - src/core/lib/iomgr/wakeup_fd_pipe.cc + - src/core/lib/iomgr/wakeup_fd_posix.cc + - src/core/lib/json/json.cc + - src/core/lib/json/json_reader.cc + - src/core/lib/json/json_string.cc + - src/core/lib/json/json_writer.cc + - src/core/lib/slice/b64.cc + - src/core/lib/slice/percent_encoding.cc + - src/core/lib/slice/slice.cc + - src/core/lib/slice/slice_buffer.cc + - src/core/lib/slice/slice_intern.cc + - src/core/lib/slice/slice_string_helpers.cc + - src/core/lib/surface/api_trace.cc + - src/core/lib/surface/byte_buffer.cc + - src/core/lib/surface/byte_buffer_reader.cc + - src/core/lib/surface/call.cc + - src/core/lib/surface/call_details.cc + - src/core/lib/surface/call_log_batch.cc + - src/core/lib/surface/channel.cc + - src/core/lib/surface/channel_init.cc + - src/core/lib/surface/channel_ping.cc + - src/core/lib/surface/channel_stack_type.cc + - src/core/lib/surface/completion_queue.cc + - src/core/lib/surface/completion_queue_factory.cc + - src/core/lib/surface/event_string.cc + - src/core/lib/surface/lame_client.cc + - src/core/lib/surface/metadata_array.cc + - src/core/lib/surface/server.cc + - src/core/lib/surface/validate_metadata.cc + - src/core/lib/surface/version.cc + - src/core/lib/transport/bdp_estimator.cc + - src/core/lib/transport/byte_stream.cc + - src/core/lib/transport/connectivity_state.cc + - src/core/lib/transport/error_utils.cc + - src/core/lib/transport/metadata.cc + - src/core/lib/transport/metadata_batch.cc + - src/core/lib/transport/pid_controller.cc + - src/core/lib/transport/static_metadata.cc + - src/core/lib/transport/status_conversion.cc + - src/core/lib/transport/status_metadata.cc + - src/core/lib/transport/timeout_encoding.cc + - src/core/lib/transport/transport.cc + - src/core/lib/transport/transport_op_string.cc + - src/core/lib/uri/uri_parser.cc + deps: + - gpr + uses: + - grpc_codegen + - grpc_trace +- name: grpc_base_headers + public_headers: + - include/grpc/byte_buffer.h + - include/grpc/byte_buffer_reader.h + - include/grpc/compression.h + - include/grpc/fork.h + - include/grpc/grpc.h + - include/grpc/grpc_posix.h + - include/grpc/grpc_security_constants.h + - include/grpc/load_reporting.h + - include/grpc/slice.h + - include/grpc/slice_buffer.h + - include/grpc/status.h + - include/grpc/support/workaround_list.h + headers: + - src/core/lib/avl/avl.h + - src/core/lib/backoff/backoff.h + - src/core/lib/channel/channel_args.h + - src/core/lib/channel/channel_stack.h + - src/core/lib/channel/channel_stack_builder.h + - src/core/lib/channel/channel_trace.h + - src/core/lib/channel/channelz.h + - src/core/lib/channel/channelz_registry.h + - src/core/lib/channel/connected_channel.h + - src/core/lib/channel/context.h + - src/core/lib/channel/handshaker.h + - src/core/lib/channel/handshaker_factory.h + - src/core/lib/channel/handshaker_registry.h + - src/core/lib/channel/status_util.h + - src/core/lib/compression/algorithm_metadata.h + - src/core/lib/compression/compression_args.h + - src/core/lib/compression/compression_internal.h + - src/core/lib/compression/message_compress.h + - src/core/lib/compression/stream_compression.h + - src/core/lib/compression/stream_compression_gzip.h + - src/core/lib/compression/stream_compression_identity.h + - src/core/lib/debug/stats.h + - src/core/lib/debug/stats_data.h + - src/core/lib/gprpp/debug_location.h + - src/core/lib/gprpp/inlined_vector.h + - src/core/lib/gprpp/optional.h + - src/core/lib/gprpp/orphanable.h + - src/core/lib/gprpp/ref_counted.h + - src/core/lib/gprpp/ref_counted_ptr.h + - src/core/lib/gprpp/string_view.h + - src/core/lib/http/format_request.h + - src/core/lib/http/httpcli.h + - src/core/lib/http/parser.h + - src/core/lib/iomgr/block_annotate.h + - src/core/lib/iomgr/buffer_list.h + - src/core/lib/iomgr/call_combiner.h + - src/core/lib/iomgr/cfstream_handle.h + - src/core/lib/iomgr/closure.h + - src/core/lib/iomgr/combiner.h + - src/core/lib/iomgr/dynamic_annotations.h + - src/core/lib/iomgr/endpoint.h + - src/core/lib/iomgr/endpoint_cfstream.h + - src/core/lib/iomgr/endpoint_pair.h + - src/core/lib/iomgr/error.h + - src/core/lib/iomgr/error_cfstream.h + - src/core/lib/iomgr/error_internal.h + - src/core/lib/iomgr/ev_epoll1_linux.h + - src/core/lib/iomgr/ev_epollex_linux.h + - src/core/lib/iomgr/ev_poll_posix.h + - src/core/lib/iomgr/ev_posix.h + - src/core/lib/iomgr/exec_ctx.h + - src/core/lib/iomgr/executor.h + - src/core/lib/iomgr/executor/mpmcqueue.h + - src/core/lib/iomgr/executor/threadpool.h + - src/core/lib/iomgr/gethostname.h + - src/core/lib/iomgr/grpc_if_nametoindex.h + - src/core/lib/iomgr/internal_errqueue.h + - src/core/lib/iomgr/iocp_windows.h + - src/core/lib/iomgr/iomgr.h + - src/core/lib/iomgr/iomgr_custom.h - src/core/lib/iomgr/iomgr_internal.h - src/core/lib/iomgr/iomgr_posix.h - src/core/lib/iomgr/is_epollexclusive_available.h @@ -661,7 +1006,7 @@ filegroups: uses: - grpc_base - grpc_deadline_filter - - health_proto + - grpc_health_upb - name: grpc_client_idle_filter src: - src/core/ext/filters/client_idle/client_idle_filter.cc @@ -690,9 +1035,11 @@ filegroups: - grpc_base - name: grpc_health_upb headers: - - src/core/ext/upb-generated/grpc/health/v1/health.upb.c + - src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h src: - - src/core/ext/upb-generated/grpc/health/v1/health.upb.h + - src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c + uses: + - upb - name: grpc_http_filters headers: - src/core/ext/filters/http/client/http_client_filter.h @@ -723,9 +1070,9 @@ filegroups: uses: - grpc_base - grpc_client_channel - - nanopb + - grpc_lb_upb - grpc_resolver_fake - - grpclb_proto + - upb - name: grpc_lb_policy_grpclb_secure headers: - src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h @@ -742,11 +1089,11 @@ filegroups: plugin: grpc_lb_policy_grpclb uses: - grpc_base - - grpc_secure - grpc_client_channel - - nanopb + - grpc_lb_upb - grpc_resolver_fake - - grpclb_proto + - grpc_secure + - upb - name: grpc_lb_policy_pick_first src: - src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -776,11 +1123,10 @@ filegroups: - src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc plugin: grpc_lb_policy_xds uses: + - envoy_ads_upb - grpc_base - grpc_client_channel - - nanopb - grpc_resolver_fake - - grpclb_proto - name: grpc_lb_policy_xds_secure headers: - src/core/ext/filters/client_channel/lb_policy/xds/xds.h @@ -794,12 +1140,11 @@ filegroups: - src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc plugin: grpc_lb_policy_xds uses: + - envoy_ads_upb - grpc_base - - grpc_secure - grpc_client_channel - - nanopb - grpc_resolver_fake - - grpclb_proto + - grpc_secure - name: grpc_lb_subchannel_list headers: - src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -808,11 +1153,12 @@ filegroups: - grpc_client_channel - name: grpc_lb_upb headers: - - src/core/ext/upb-generated/grpc/lb/v1/load_balancer.upb.h + - src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h src: - - src/core/ext/upb-generated/grpc/lb/v1/load_balancer.upb.c + - src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c uses: - google_api_upb + - upb - name: grpc_max_age_filter headers: - src/core/ext/filters/max_age/max_age_filter.h @@ -880,6 +1226,13 @@ filegroups: uses: - grpc_base - grpc_client_channel +- name: grpc_resolver_xds + src: + - src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc + plugin: grpc_resolver_xds + uses: + - grpc_base + - grpc_client_channel - name: grpc_secure public_headers: - include/grpc/grpc_security.h @@ -954,7 +1307,6 @@ filegroups: - src/core/lib/security/transport/tsi_error.cc - src/core/lib/security/util/json_util.cc - src/core/lib/surface/init_secure.cc - secure: true uses: - alts_tsi - grpc_base @@ -972,7 +1324,6 @@ filegroups: headers: - src/core/tsi/grpc_shadow_boringssl.h - name: grpc_test_util_base - build: test headers: - src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h - test/core/end2end/cq_verifier.h @@ -1033,9 +1384,6 @@ filegroups: - src/core/lib/debug/trace.cc deps: - gpr - filegroups: - - grpc_trace_headers - - grpc_base_headers - name: grpc_trace_headers headers: - src/core/lib/debug/trace.h @@ -1124,455 +1472,136 @@ filegroups: src: - src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc uses: - - grpc_transport_chttp2 - - grpc_base - - grpc_client_channel - - grpc_secure - - grpc_transport_chttp2_client_connector -- name: grpc_transport_chttp2_server - headers: - - src/core/ext/transport/chttp2/server/chttp2_server.h - src: - - src/core/ext/transport/chttp2/server/chttp2_server.cc - uses: - - grpc_transport_chttp2 - - grpc_base -- name: grpc_transport_chttp2_server_insecure - src: - - src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc - - src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc - uses: - - grpc_transport_chttp2 - - grpc_base - - grpc_transport_chttp2_server -- name: grpc_transport_chttp2_server_secure - src: - - src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc - uses: - - grpc_transport_chttp2 - - grpc_base - - grpc_secure - - grpc_transport_chttp2_server -- name: grpc_transport_cronet_client_secure - public_headers: - - include/grpc/grpc_cronet.h - - include/grpc/grpc_security.h - - include/grpc/grpc_security_constants.h - headers: - - src/core/ext/transport/cronet/client/secure/cronet_channel_create.h - - src/core/ext/transport/cronet/transport/cronet_transport.h - - third_party/objective_c/Cronet/bidirectional_stream_c.h - src: - - src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc - - src/core/ext/transport/cronet/transport/cronet_api_dummy.cc - - src/core/ext/transport/cronet/transport/cronet_transport.cc - filegroups: - - grpc_base - - grpc_transport_chttp2 - - grpc_http_filters -- name: grpc_transport_inproc - src: - - src/core/ext/transport/inproc/inproc_plugin.cc - - src/core/ext/transport/inproc/inproc_transport.cc - plugin: grpc_inproc_plugin - uses: - - grpc_transport_inproc_headers - - grpc_base -- name: grpc_transport_inproc_headers - headers: - - src/core/ext/transport/inproc/inproc_transport.h - uses: - - grpc_base_headers -- name: grpc_workaround_cronet_compression_filter - headers: - - src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h - src: - - src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc - plugin: grpc_workaround_cronet_compression_filter - uses: - - grpc_base - - grpc_server_backward_compatibility -- name: grpclb_proto - headers: - - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h - - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h - - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h - src: - - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c - - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c - - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c - uses: - - nanopb -- name: health_proto - headers: - - src/core/ext/filters/client_channel/health/health.pb.h - src: - - src/core/ext/filters/client_channel/health/health.pb.c - uses: - - nanopb -- name: nanopb - src: - - third_party/nanopb/pb_common.c - - third_party/nanopb/pb_decode.c - - third_party/nanopb/pb_encode.c - uses: - - nanopb_headers -- name: nanopb_headers - headers: - - third_party/nanopb/pb.h - - third_party/nanopb/pb_common.h - - third_party/nanopb/pb_decode.h - - third_party/nanopb/pb_encode.h -- name: transport_security_test_lib - build: test - headers: - - test/core/tsi/transport_security_test_lib.h - src: - - test/core/tsi/transport_security_test_lib.cc - deps: - - grpc -- name: tsi - headers: - - src/core/tsi/fake_transport_security.h - - src/core/tsi/local_transport_security.h - - src/core/tsi/ssl/session_cache/ssl_session.h - - src/core/tsi/ssl/session_cache/ssl_session_cache.h - - src/core/tsi/ssl_transport_security.h - - src/core/tsi/ssl_types.h - - src/core/tsi/transport_security_grpc.h - src: - - src/core/tsi/fake_transport_security.cc - - src/core/tsi/local_transport_security.cc - - src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc - - src/core/tsi/ssl/session_cache/ssl_session_cache.cc - - src/core/tsi/ssl/session_cache/ssl_session_openssl.cc - - src/core/tsi/ssl_transport_security.cc - - src/core/tsi/transport_security_grpc.cc - deps: - - gpr - secure: true - uses: - - tsi_interface + - grpc_transport_chttp2 - grpc_base - - grpc_trace - - grpc_shadow_boringssl -- name: tsi_interface + - grpc_client_channel + - grpc_secure + - grpc_transport_chttp2_client_connector +- name: grpc_transport_chttp2_server headers: - - src/core/tsi/transport_security.h - - src/core/tsi/transport_security_interface.h + - src/core/ext/transport/chttp2/server/chttp2_server.h src: - - src/core/tsi/transport_security.cc - deps: - - gpr - secure: true - uses: - - grpc_trace -- name: grpc++_codegen_base - language: c++ - public_headers: - - include/grpc++/impl/codegen/async_stream.h - - include/grpc++/impl/codegen/async_unary_call.h - - include/grpc++/impl/codegen/byte_buffer.h - - include/grpc++/impl/codegen/call.h - - include/grpc++/impl/codegen/call_hook.h - - include/grpc++/impl/codegen/channel_interface.h - - include/grpc++/impl/codegen/client_context.h - - include/grpc++/impl/codegen/client_unary_call.h - - include/grpc++/impl/codegen/completion_queue.h - - include/grpc++/impl/codegen/completion_queue_tag.h - - include/grpc++/impl/codegen/config.h - - include/grpc++/impl/codegen/core_codegen_interface.h - - include/grpc++/impl/codegen/create_auth_context.h - - include/grpc++/impl/codegen/grpc_library.h - - include/grpc++/impl/codegen/metadata_map.h - - include/grpc++/impl/codegen/method_handler_impl.h - - include/grpc++/impl/codegen/rpc_method.h - - include/grpc++/impl/codegen/rpc_service_method.h - - include/grpc++/impl/codegen/security/auth_context.h - - include/grpc++/impl/codegen/serialization_traits.h - - include/grpc++/impl/codegen/server_context.h - - include/grpc++/impl/codegen/server_interface.h - - include/grpc++/impl/codegen/service_type.h - - include/grpc++/impl/codegen/slice.h - - include/grpc++/impl/codegen/status.h - - include/grpc++/impl/codegen/status_code_enum.h - - include/grpc++/impl/codegen/string_ref.h - - include/grpc++/impl/codegen/stub_options.h - - include/grpc++/impl/codegen/sync_stream.h - - include/grpc++/impl/codegen/time.h - - include/grpcpp/impl/codegen/async_generic_service.h - - include/grpcpp/impl/codegen/async_stream.h - - include/grpcpp/impl/codegen/async_stream_impl.h - - include/grpcpp/impl/codegen/async_unary_call.h - - include/grpcpp/impl/codegen/async_unary_call_impl.h - - include/grpcpp/impl/codegen/byte_buffer.h - - include/grpcpp/impl/codegen/call.h - - include/grpcpp/impl/codegen/call_hook.h - - include/grpcpp/impl/codegen/call_op_set.h - - include/grpcpp/impl/codegen/call_op_set_interface.h - - include/grpcpp/impl/codegen/callback_common.h - - include/grpcpp/impl/codegen/channel_interface.h - - include/grpcpp/impl/codegen/client_callback.h - - include/grpcpp/impl/codegen/client_callback_impl.h - - include/grpcpp/impl/codegen/client_context.h - - include/grpcpp/impl/codegen/client_context_impl.h - - include/grpcpp/impl/codegen/client_interceptor.h - - include/grpcpp/impl/codegen/client_unary_call.h - - include/grpcpp/impl/codegen/completion_queue.h - - include/grpcpp/impl/codegen/completion_queue_impl.h - - include/grpcpp/impl/codegen/completion_queue_tag.h - - include/grpcpp/impl/codegen/config.h - - include/grpcpp/impl/codegen/core_codegen_interface.h - - include/grpcpp/impl/codegen/create_auth_context.h - - include/grpcpp/impl/codegen/grpc_library.h - - include/grpcpp/impl/codegen/intercepted_channel.h - - include/grpcpp/impl/codegen/interceptor.h - - include/grpcpp/impl/codegen/interceptor_common.h - - include/grpcpp/impl/codegen/message_allocator.h - - include/grpcpp/impl/codegen/metadata_map.h - - include/grpcpp/impl/codegen/method_handler_impl.h - - include/grpcpp/impl/codegen/rpc_method.h - - include/grpcpp/impl/codegen/rpc_service_method.h - - include/grpcpp/impl/codegen/security/auth_context.h - - include/grpcpp/impl/codegen/serialization_traits.h - - include/grpcpp/impl/codegen/server_callback.h - - include/grpcpp/impl/codegen/server_callback_impl.h - - include/grpcpp/impl/codegen/server_context.h - - include/grpcpp/impl/codegen/server_context_impl.h - - include/grpcpp/impl/codegen/server_interceptor.h - - include/grpcpp/impl/codegen/server_interface.h - - include/grpcpp/impl/codegen/service_type.h - - include/grpcpp/impl/codegen/slice.h - - include/grpcpp/impl/codegen/status.h - - include/grpcpp/impl/codegen/status_code_enum.h - - include/grpcpp/impl/codegen/string_ref.h - - include/grpcpp/impl/codegen/stub_options.h - - include/grpcpp/impl/codegen/sync_stream.h - - include/grpcpp/impl/codegen/sync_stream_impl.h - - include/grpcpp/impl/codegen/time.h + - src/core/ext/transport/chttp2/server/chttp2_server.cc uses: - - grpc_codegen - - grpc++_internal_hdrs_only -- name: grpc++_codegen_base_src - language: c++ + - grpc_transport_chttp2 + - grpc_base +- name: grpc_transport_chttp2_server_insecure src: - - src/cpp/codegen/codegen_init.cc + - src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc + - src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc uses: - - grpc++_codegen_base -- name: grpc++_codegen_proto - language: c++ - public_headers: - - include/grpc++/impl/codegen/proto_utils.h - - include/grpcpp/impl/codegen/proto_buffer_reader.h - - include/grpcpp/impl/codegen/proto_buffer_writer.h - - include/grpcpp/impl/codegen/proto_utils.h + - grpc_transport_chttp2 + - grpc_base + - grpc_transport_chttp2_server +- name: grpc_transport_chttp2_server_secure + src: + - src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc uses: - - grpc++_codegen_base - - grpc++_config_proto -- name: grpc++_common - language: c++ + - grpc_transport_chttp2 + - grpc_base + - grpc_secure + - grpc_transport_chttp2_server +- name: grpc_transport_cronet_client_secure public_headers: - - include/grpc++/alarm.h - - include/grpc++/channel.h - - include/grpc++/client_context.h - - include/grpc++/completion_queue.h - - include/grpc++/create_channel.h - - include/grpc++/create_channel_posix.h - - include/grpc++/ext/health_check_service_server_builder_option.h - - include/grpc++/generic/async_generic_service.h - - include/grpc++/generic/generic_stub.h - - include/grpc++/grpc++.h - - include/grpc++/health_check_service_interface.h - - include/grpc++/impl/call.h - - include/grpc++/impl/channel_argument_option.h - - include/grpc++/impl/client_unary_call.h - - include/grpc++/impl/codegen/core_codegen.h - - include/grpc++/impl/grpc_library.h - - include/grpc++/impl/method_handler_impl.h - - include/grpc++/impl/rpc_method.h - - include/grpc++/impl/rpc_service_method.h - - include/grpc++/impl/serialization_traits.h - - include/grpc++/impl/server_builder_option.h - - include/grpc++/impl/server_builder_plugin.h - - include/grpc++/impl/server_initializer.h - - include/grpc++/impl/service_type.h - - include/grpc++/resource_quota.h - - include/grpc++/security/auth_context.h - - include/grpc++/security/auth_metadata_processor.h - - include/grpc++/security/credentials.h - - include/grpc++/security/server_credentials.h - - include/grpc++/server.h - - include/grpc++/server_builder.h - - include/grpc++/server_context.h - - include/grpc++/server_posix.h - - include/grpc++/support/async_stream.h - - include/grpc++/support/async_unary_call.h - - include/grpc++/support/byte_buffer.h - - include/grpc++/support/channel_arguments.h - - include/grpc++/support/config.h - - include/grpc++/support/slice.h - - include/grpc++/support/status.h - - include/grpc++/support/status_code_enum.h - - include/grpc++/support/string_ref.h - - include/grpc++/support/stub_options.h - - include/grpc++/support/sync_stream.h - - include/grpc++/support/time.h - - include/grpcpp/alarm.h - - include/grpcpp/alarm_impl.h - - include/grpcpp/channel.h - - include/grpcpp/channel_impl.h - - include/grpcpp/client_context.h - - include/grpcpp/completion_queue.h - - include/grpcpp/completion_queue_impl.h - - include/grpcpp/create_channel.h - - include/grpcpp/create_channel_impl.h - - include/grpcpp/create_channel_posix.h - - include/grpcpp/create_channel_posix_impl.h - - include/grpcpp/ext/health_check_service_server_builder_option.h - - include/grpcpp/generic/async_generic_service.h - - include/grpcpp/generic/generic_stub.h - - include/grpcpp/generic/generic_stub_impl.h - - include/grpcpp/grpcpp.h - - include/grpcpp/health_check_service_interface.h - - include/grpcpp/health_check_service_interface_impl.h - - include/grpcpp/impl/call.h - - include/grpcpp/impl/channel_argument_option.h - - include/grpcpp/impl/client_unary_call.h - - include/grpcpp/impl/codegen/core_codegen.h - - include/grpcpp/impl/grpc_library.h - - include/grpcpp/impl/method_handler_impl.h - - include/grpcpp/impl/rpc_method.h - - include/grpcpp/impl/rpc_service_method.h - - include/grpcpp/impl/serialization_traits.h - - include/grpcpp/impl/server_builder_option.h - - include/grpcpp/impl/server_builder_option_impl.h - - include/grpcpp/impl/server_builder_plugin.h - - include/grpcpp/impl/server_initializer.h - - include/grpcpp/impl/server_initializer_impl.h - - include/grpcpp/impl/service_type.h - - include/grpcpp/resource_quota.h - - include/grpcpp/resource_quota_impl.h - - include/grpcpp/security/auth_context.h - - include/grpcpp/security/auth_metadata_processor.h - - include/grpcpp/security/auth_metadata_processor_impl.h - - include/grpcpp/security/credentials.h - - include/grpcpp/security/credentials_impl.h - - include/grpcpp/security/server_credentials.h - - include/grpcpp/security/server_credentials_impl.h - - include/grpcpp/security/tls_credentials_options.h - - include/grpcpp/server.h - - include/grpcpp/server_builder.h - - include/grpcpp/server_builder_impl.h - - include/grpcpp/server_context.h - - include/grpcpp/server_impl.h - - include/grpcpp/server_posix.h - - include/grpcpp/server_posix_impl.h - - include/grpcpp/support/async_stream.h - - include/grpcpp/support/async_stream_impl.h - - include/grpcpp/support/async_unary_call.h - - include/grpcpp/support/async_unary_call_impl.h - - include/grpcpp/support/byte_buffer.h - - include/grpcpp/support/channel_arguments.h - - include/grpcpp/support/channel_arguments_impl.h - - include/grpcpp/support/client_callback.h - - include/grpcpp/support/client_callback_impl.h - - include/grpcpp/support/client_interceptor.h - - include/grpcpp/support/config.h - - include/grpcpp/support/interceptor.h - - include/grpcpp/support/message_allocator.h - - include/grpcpp/support/proto_buffer_reader.h - - include/grpcpp/support/proto_buffer_writer.h - - include/grpcpp/support/server_callback.h - - include/grpcpp/support/server_callback_impl.h - - include/grpcpp/support/server_interceptor.h - - include/grpcpp/support/slice.h - - include/grpcpp/support/status.h - - include/grpcpp/support/status_code_enum.h - - include/grpcpp/support/string_ref.h - - include/grpcpp/support/stub_options.h - - include/grpcpp/support/sync_stream.h - - include/grpcpp/support/sync_stream_impl.h - - include/grpcpp/support/time.h - - include/grpcpp/support/validate_service_config.h + - include/grpc/grpc_cronet.h + - include/grpc/grpc_security.h + - include/grpc/grpc_security_constants.h headers: - - src/cpp/client/create_channel_internal.h - - src/cpp/common/channel_filter.h - - src/cpp/server/dynamic_thread_pool.h - - src/cpp/server/external_connection_acceptor_impl.h - - src/cpp/server/health/default_health_check_service.h - - src/cpp/server/thread_pool_interface.h - - src/cpp/thread_manager/thread_manager.h + - src/core/ext/transport/cronet/client/secure/cronet_channel_create.h + - src/core/ext/transport/cronet/transport/cronet_transport.h + - third_party/objective_c/Cronet/bidirectional_stream_c.h src: - - src/cpp/client/channel_cc.cc - - src/cpp/client/client_context.cc - - src/cpp/client/client_interceptor.cc - - src/cpp/client/create_channel.cc - - src/cpp/client/create_channel_internal.cc - - src/cpp/client/create_channel_posix.cc - - src/cpp/client/credentials_cc.cc - - src/cpp/client/generic_stub.cc - - src/cpp/common/alarm.cc - - src/cpp/common/channel_arguments.cc - - src/cpp/common/channel_filter.cc - - src/cpp/common/completion_queue_cc.cc - - src/cpp/common/core_codegen.cc - - src/cpp/common/resource_quota_cc.cc - - src/cpp/common/rpc_method.cc - - src/cpp/common/validate_service_config.cc - - src/cpp/common/version_cc.cc - - src/cpp/server/async_generic_service.cc - - src/cpp/server/channel_argument_option.cc - - src/cpp/server/create_default_thread_pool.cc - - src/cpp/server/dynamic_thread_pool.cc - - src/cpp/server/external_connection_acceptor_impl.cc - - src/cpp/server/health/default_health_check_service.cc - - src/cpp/server/health/health_check_service.cc - - src/cpp/server/health/health_check_service_server_builder_option.cc - - src/cpp/server/server_builder.cc - - src/cpp/server/server_cc.cc - - src/cpp/server/server_context.cc - - src/cpp/server/server_credentials.cc - - src/cpp/server/server_posix.cc - - src/cpp/thread_manager/thread_manager.cc - - src/cpp/util/byte_buffer_cc.cc - - src/cpp/util/status.cc - - src/cpp/util/string_ref.cc - - src/cpp/util/time_cc.cc + - src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc + - src/core/ext/transport/cronet/transport/cronet_api_dummy.cc + - src/core/ext/transport/cronet/transport/cronet_transport.cc +- name: grpc_transport_inproc + src: + - src/core/ext/transport/inproc/inproc_plugin.cc + - src/core/ext/transport/inproc/inproc_transport.cc + plugin: grpc_inproc_plugin uses: - - gpr_base_headers - - grpc_base_headers - grpc_transport_inproc_headers - - grpc++_codegen_base - - grpc++_internal_hdrs_only + - grpc_base +- name: grpc_transport_inproc_headers + headers: + - src/core/ext/transport/inproc/inproc_transport.h + uses: + - grpc_base_headers +- name: grpc_workaround_cronet_compression_filter + headers: + - src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h + src: + - src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc + plugin: grpc_workaround_cronet_compression_filter + uses: + - grpc_base + - grpc_server_backward_compatibility +- name: grpcpp_channelz_proto + src: + - src/proto/grpc/channelz/channelz.proto +- name: nanopb + src: + - third_party/nanopb/pb_common.c + - third_party/nanopb/pb_decode.c + - third_party/nanopb/pb_encode.c + uses: - nanopb_headers - - health_proto -- name: grpc++_config_proto - language: c++ - public_headers: - - include/grpc++/impl/codegen/config_protobuf.h - - include/grpcpp/impl/codegen/config_protobuf.h -- name: grpc++_internal_hdrs_only - language: c++ - public_headers: - - include/grpcpp/impl/codegen/sync.h -- name: grpc++_reflection_proto - language: c++ +- name: nanopb_headers + headers: + - third_party/nanopb/pb.h + - third_party/nanopb/pb_common.h + - third_party/nanopb/pb_decode.h + - third_party/nanopb/pb_encode.h +- name: proto_gen_validate_upb + headers: + - src/core/ext/upb-generated/gogoproto/gogo.upb.h + - src/core/ext/upb-generated/validate/validate.upb.h src: - - src/proto/grpc/reflection/v1alpha/reflection.proto -- name: grpc++_test - language: c++ - public_headers: - - include/grpc++/test/mock_stream.h - - include/grpc++/test/server_context_test_spouse.h - - include/grpcpp/test/mock_stream.h - - include/grpcpp/test/server_context_test_spouse.h + - src/core/ext/upb-generated/gogoproto/gogo.upb.c + - src/core/ext/upb-generated/validate/validate.upb.c + uses: + - google_api_upb +- name: transport_security_test_lib + headers: + - test/core/tsi/transport_security_test_lib.h + src: + - test/core/tsi/transport_security_test_lib.cc deps: - - grpc++ - grpc -- name: grpcpp_channelz_proto - language: c++ +- name: tsi + headers: + - src/core/tsi/fake_transport_security.h + - src/core/tsi/local_transport_security.h + - src/core/tsi/ssl/session_cache/ssl_session.h + - src/core/tsi/ssl/session_cache/ssl_session_cache.h + - src/core/tsi/ssl_transport_security.h + - src/core/tsi/ssl_types.h + - src/core/tsi/transport_security_grpc.h src: - - src/proto/grpc/channelz/channelz.proto + - src/core/tsi/fake_transport_security.cc + - src/core/tsi/local_transport_security.cc + - src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc + - src/core/tsi/ssl/session_cache/ssl_session_cache.cc + - src/core/tsi/ssl/session_cache/ssl_session_openssl.cc + - src/core/tsi/ssl_transport_security.cc + - src/core/tsi/transport_security_grpc.cc + deps: + - gpr + uses: + - tsi_interface + - grpc_base + - grpc_trace + - grpc_shadow_boringssl +- name: tsi_interface + headers: + - src/core/tsi/transport_security.h + - src/core/tsi/transport_security_interface.h + src: + - src/core/tsi/transport_security.cc + deps: + - gpr + uses: + - grpc_trace libs: - name: address_sorting build: all @@ -1652,6 +1681,7 @@ libs: - grpc_resolver_dns_native - grpc_resolver_sockaddr - grpc_resolver_fake + - grpc_resolver_xds - grpc_secure - census - grpc_client_idle_filter @@ -1723,6 +1753,7 @@ libs: - grpc_resolver_dns_native - grpc_resolver_sockaddr - grpc_resolver_fake + - grpc_resolver_xds - grpc_lb_policy_grpclb - grpc_lb_policy_xds - grpc_lb_policy_pick_first @@ -3974,15 +4005,6 @@ targets: - alts_test_util - gpr - grpc -- name: alts_handshaker_service_api_test - build: test - language: c++ - src: - - test/core/tsi/alts/handshaker/alts_handshaker_service_api_test.cc - deps: - - alts_test_util - - gpr - - grpc - name: alts_iovec_record_protocol_test build: test language: c++ @@ -4488,6 +4510,27 @@ targets: - mac - linux - posix +- name: bm_threadpool + build: test + language: c++ + src: + - test/cpp/microbenchmarks/bm_threadpool.cc + deps: + - grpc_benchmark + - benchmark + - grpc++_test_util_unsecure + - grpc_test_util_unsecure + - grpc++_unsecure + - grpc_unsecure + - gpr + - grpc++_test_config + benchmark: true + defaults: benchmark + platforms: + - mac + - linux + - posix + uses_polling: false - name: bm_timer build: test language: c++ @@ -4556,8 +4599,6 @@ targets: - gpr filegroups: - grpcpp_channelz_proto - uses: - - grpc++_test - name: channelz_registry_test gtest: true build: test @@ -4570,8 +4611,6 @@ targets: - grpc++ - grpc - gpr - uses: - - grpc++_test uses_polling: false - name: channelz_service_test gtest: true @@ -4602,8 +4641,6 @@ targets: - gpr filegroups: - grpcpp_channelz_proto - uses: - - grpc++_test - name: check_gcp_environment_linux_test build: test language: c++ @@ -4839,6 +4876,18 @@ targets: - grpc - gpr uses_polling: false +- name: delegating_channel_test + gtest: true + build: test + language: c++ + src: + - test/cpp/end2end/delegating_channel_test.cc + deps: + - grpc++_test_util + - grpc_test_util + - grpc++ + - grpc + - gpr - name: end2end_test gtest: true cpu_cost: 0.5 @@ -4889,6 +4938,28 @@ targets: - grpc++ - grpc - gpr +- name: gen_hpack_tables + build: tool + language: c++ + src: + - tools/codegen/core/gen_hpack_tables.cc + deps: + - gpr + - grpc + uses_polling: false +- name: gen_legal_metadata_characters + build: tool + language: c++ + src: + - tools/codegen/core/gen_legal_metadata_characters.cc + deps: [] +- name: gen_percent_encoding_tables + build: tool + language: c++ + src: + - tools/codegen/core/gen_percent_encoding_tables.cc + deps: [] + uses_polling: false - name: generic_end2end_test gtest: true build: test @@ -4968,8 +5039,6 @@ targets: - grpc++ - grpc - gpr - uses: - - grpc++_test uses_polling: false - name: grpc_cpp_plugin build: protoc @@ -5048,6 +5117,18 @@ targets: deps: - grpc_plugin_support secure: false +- name: grpc_spiffe_security_connector_test + gtest: true + build: test + language: c++ + src: + - test/core/security/spiffe_security_connector_test.cc + deps: + - grpc_test_util + - grpc++_test_util + - grpc++ + - grpc + - gpr - name: grpc_tool_test gtest: true build: test @@ -5122,8 +5203,6 @@ targets: - grpc++ - grpc - gpr - uses: - - grpc++_test - name: h2_ssl_session_reuse_test gtest: true build: test @@ -5137,8 +5216,6 @@ targets: - grpc++ - grpc - gpr - uses: - - grpc++_test - name: health_service_end2end_test gtest: true build: test @@ -5190,8 +5267,6 @@ targets: - grpc++ - grpc - gpr - uses: - - grpc++_test - name: inproc_sync_unary_ping_pong_test build: test language: c++ @@ -5290,8 +5365,6 @@ targets: - grpc++ - grpc - gpr - uses: - - grpc++_test uses_polling: false - name: message_allocator_end2end_test gtest: true @@ -5366,8 +5439,6 @@ targets: - grpc++ - grpc - gpr - uses: - - grpc++_test - name: orphanable_test gtest: true build: test @@ -5379,8 +5450,6 @@ targets: - grpc++ - grpc - gpr - uses: - - grpc++_test - name: port_sharing_end2end_test gtest: true build: test @@ -5549,8 +5618,6 @@ targets: - grpc++ - grpc - gpr - uses: - - grpc++_test - name: ref_counted_test gtest: true build: test @@ -5562,8 +5629,6 @@ targets: - grpc++ - grpc - gpr - uses: - - grpc++_test - name: retry_throttle_test gtest: true build: test @@ -5658,8 +5723,6 @@ targets: - grpc++ - grpc - gpr - uses: - - grpc++_test - name: server_crash_test gtest: true cpu_cost: 0.1 @@ -5755,8 +5818,6 @@ targets: - grpc++ - grpc - gpr - uses: - - grpc++_test - name: shutdown_test gtest: true build: test @@ -5878,8 +5939,6 @@ targets: - grpc++ - grpc - gpr - uses: - - grpc++_test - name: thread_manager_test build: test language: c++ @@ -5961,7 +6020,8 @@ targets: build: test language: c++ src: - - src/proto/grpc/lb/v1/load_balancer.proto + - src/proto/grpc/lb/v2/eds_for_test.proto + - src/proto/grpc/lb/v2/lrs_for_test.proto - test/cpp/end2end/xds_end2end_test.cc deps: - grpc++_test_util @@ -5977,28 +6037,6 @@ targets: deps: - grpc - gpr -- name: gen_hpack_tables - build: tool - language: cc - src: - - tools/codegen/core/gen_hpack_tables.cc - deps: - - gpr - - grpc - uses_polling: false -- name: gen_legal_metadata_characters - build: tool - language: cc - src: - - tools/codegen/core/gen_legal_metadata_characters.cc - deps: [] -- name: gen_percent_encoding_tables - build: tool - language: cc - src: - - tools/codegen/core/gen_percent_encoding_tables.cc - deps: [] - uses_polling: false vspackages: - linkage: static name: grpc.dependencies.zlib @@ -6166,13 +6204,13 @@ defaults: CXXFLAGS: $(W_NO_CXX14_COMPAT) global: COREFLAGS: -fno-rtti -fno-exceptions - CPPFLAGS: -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 - -Wno-deprecated-declarations -Ithird_party/nanopb -DPB_FIELD_32BIT + CPPFLAGS: -g -Wall -Wextra -Werror -Wno-unknown-warning-option -Wno-long-long + -Wno-unused-parameter -Wno-deprecated-declarations -Wno-sign-conversion -Wno-shadow + -Wno-conversion -Wno-implicit-fallthrough -Wno-sign-compare -Wno-missing-field-initializers + -Wno-maybe-uninitialized -DPB_FIELD_32BIT -DOSATOMIC_USE_INLINED=1 -Ithird_party/nanopb + -Ithird_party/upb -Isrc/core/ext/upb-generated CXXFLAGS: -Wnon-virtual-dtor LDFLAGS: -g - upb: - CFLAGS: -Wno-sign-conversion -Wno-shadow -Wno-conversion -Wno-implicit-fallthrough - -Wno-sign-compare -Wno-missing-field-initializers zlib: CFLAGS: -Wno-sign-conversion -Wno-conversion -Wno-unused-value -Wno-implicit-function-declaration -Wno-implicit-fallthrough $(W_NO_SHIFT_NEGATIVE_VALUE) -fvisibility=hidden diff --git a/build_config.rb b/build_config.rb index ab06a137473..7bd312cd2b6 100644 --- a/build_config.rb +++ b/build_config.rb @@ -13,5 +13,5 @@ # limitations under the License. module GrpcBuildConfig - CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-7.dll' + CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-8.dll' end diff --git a/cmake/upb.cmake b/cmake/upb.cmake new file mode 100644 index 00000000000..3affa25d382 --- /dev/null +++ b/cmake/upb.cmake @@ -0,0 +1,18 @@ +# Copyright 2019 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set(UPB_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/upb) + +set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}") +set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated") diff --git a/config.m4 b/config.m4 index 6eeeafce9a5..2a074768f57 100644 --- a/config.m4 +++ b/config.m4 @@ -6,10 +6,12 @@ if test "$PHP_GRPC" != "no"; then dnl # --with-grpc -> add include path PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/include) + PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/src/core/ext/upb-generated) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/src/php/ext/grpc) - PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/boringssl/include) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/address_sorting/include) + PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/boringssl/include) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/nanopb) + PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/upb) LIBS="-lpthread $LIBS" @@ -332,16 +334,17 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc \ src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc \ - src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc \ - src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc \ src/core/tsi/alts/handshaker/alts_tsi_utils.cc \ src/core/tsi/alts/handshaker/transport_security_common_api.cc \ - src/core/tsi/alts/handshaker/altscontext.pb.c \ - src/core/tsi/alts/handshaker/handshaker.pb.c \ - src/core/tsi/alts/handshaker/transport_security_common.pb.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c \ + src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c \ + third_party/upb/upb/decode.c \ + third_party/upb/upb/encode.c \ + third_party/upb/upb/msg.c \ + third_party/upb/upb/port.c \ + third_party/upb/upb/table.c \ + third_party/upb/upb/upb.c \ src/core/tsi/transport_security.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create.cc \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \ @@ -374,7 +377,7 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/filters/client_channel/subchannel.cc \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ - src/core/ext/filters/client_channel/health/health.pb.c \ + src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ src/core/tsi/fake_transport_security.cc \ src/core/tsi/local_transport_security.cc \ src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc \ @@ -393,14 +396,42 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \ + src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \ + src/core/ext/upb-generated/google/api/annotations.upb.c \ + src/core/ext/upb-generated/google/api/http.upb.c \ + src/core/ext/upb-generated/google/protobuf/any.upb.c \ + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ + src/core/ext/upb-generated/google/protobuf/duration.upb.c \ + src/core/ext/upb-generated/google/protobuf/empty.upb.c \ + src/core/ext/upb-generated/google/protobuf/struct.upb.c \ + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ + src/core/ext/upb-generated/google/rpc/status.upb.c \ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c \ - src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \ src/core/ext/filters/client_channel/lb_policy/xds/xds.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc \ + src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c \ + src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c \ + src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \ + src/core/ext/upb-generated/envoy/type/percent.upb.c \ + src/core/ext/upb-generated/envoy/type/range.upb.c \ + src/core/ext/upb-generated/gogoproto/gogo.upb.c \ + src/core/ext/upb-generated/validate/validate.upb.c \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \ @@ -416,6 +447,7 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc \ src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \ src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \ + src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc \ src/core/ext/filters/census/grpc_context.cc \ src/core/ext/filters/client_idle/client_idle_filter.cc \ src/core/ext/filters/max_age/max_age_filter.cc \ @@ -693,8 +725,6 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/health) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/pick_first) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/round_robin) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/xds) @@ -703,6 +733,7 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/native) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/fake) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/sockaddr) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/xds) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_idle) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/deadline) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http) @@ -721,6 +752,22 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/server/secure) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/transport) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/inproc) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/api/v2) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/api/v2/auth) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/api/v2/cluster) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/api/v2/core) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/api/v2/endpoint) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/service/discovery/v2) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/service/load_stats/v2) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/type) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/gogoproto) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/google/api) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/google/protobuf) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/google/rpc) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/gcp) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/health/v1) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/lb/v1) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/validate) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/avl) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/backoff) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/channel) @@ -804,5 +851,5 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/x509v3) PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/ssl) PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/third_party/fiat) - PHP_ADD_BUILD_DIR($ext_builddir/third_party/nanopb) + PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/upb) fi diff --git a/config.w32 b/config.w32 index fd7920f72fd..065da74bfb9 100644 --- a/config.w32 +++ b/config.w32 @@ -307,16 +307,17 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\security\\credentials\\alts\\grpc_alts_credentials_client_options.cc " + "src\\core\\lib\\security\\credentials\\alts\\grpc_alts_credentials_options.cc " + "src\\core\\lib\\security\\credentials\\alts\\grpc_alts_credentials_server_options.cc " + - "src\\core\\tsi\\alts\\handshaker\\alts_handshaker_service_api.cc " + - "src\\core\\tsi\\alts\\handshaker\\alts_handshaker_service_api_util.cc " + "src\\core\\tsi\\alts\\handshaker\\alts_tsi_utils.cc " + "src\\core\\tsi\\alts\\handshaker\\transport_security_common_api.cc " + - "src\\core\\tsi\\alts\\handshaker\\altscontext.pb.c " + - "src\\core\\tsi\\alts\\handshaker\\handshaker.pb.c " + - "src\\core\\tsi\\alts\\handshaker\\transport_security_common.pb.c " + - "third_party\\nanopb\\pb_common.c " + - "third_party\\nanopb\\pb_decode.c " + - "third_party\\nanopb\\pb_encode.c " + + "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\gcp\\altscontext.upb.c " + + "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\gcp\\handshaker.upb.c " + + "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\gcp\\transport_security_common.upb.c " + + "third_party\\upb\\upb\\decode.c " + + "third_party\\upb\\upb\\encode.c " + + "third_party\\upb\\upb\\msg.c " + + "third_party\\upb\\upb\\port.c " + + "third_party\\upb\\upb\\table.c " + + "third_party\\upb\\upb\\upb.c " + "src\\core\\tsi\\transport_security.cc " + "src\\core\\ext\\transport\\chttp2\\client\\insecure\\channel_create.cc " + "src\\core\\ext\\transport\\chttp2\\client\\insecure\\channel_create_posix.cc " + @@ -349,7 +350,7 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\filters\\client_channel\\subchannel.cc " + "src\\core\\ext\\filters\\client_channel\\subchannel_pool_interface.cc " + "src\\core\\ext\\filters\\deadline\\deadline_filter.cc " + - "src\\core\\ext\\filters\\client_channel\\health\\health.pb.c " + + "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\health\\v1\\health.upb.c " + "src\\core\\tsi\\fake_transport_security.cc " + "src\\core\\tsi\\local_transport_security.cc " + "src\\core\\tsi\\ssl\\session_cache\\ssl_session_boringssl.cc " + @@ -368,14 +369,42 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\grpclb_channel_secure.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\grpclb_client_stats.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\load_balancer_api.cc " + + "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lb\\v1\\load_balancer.upb.c " + + "src\\core\\ext\\upb-generated\\google\\api\\annotations.upb.c " + + "src\\core\\ext\\upb-generated\\google\\api\\http.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\any.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\descriptor.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\duration.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\empty.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\struct.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\timestamp.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\wrappers.upb.c " + + "src\\core\\ext\\upb-generated\\google\\rpc\\status.upb.c " + "src\\core\\ext\\filters\\client_channel\\resolver\\fake\\fake_resolver.cc " + - "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\google\\protobuf\\duration.pb.c " + - "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\google\\protobuf\\timestamp.pb.c " + - "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\load_balancer.pb.c " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\xds\\xds.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\xds\\xds_channel_secure.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\xds\\xds_client_stats.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\xds\\xds_load_balancer_api.cc " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\auth\\cert.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cds.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cluster\\circuit_breaker.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cluster\\outlier_detection.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\discovery.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\eds.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\endpoint\\endpoint.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\endpoint\\load_report.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\service\\discovery\\v2\\ads.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\service\\load_stats\\v2\\lrs.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\address.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\base.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\config_source.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\grpc_service.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\health_check.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\protocol.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\type\\percent.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\type\\range.upb.c " + + "src\\core\\ext\\upb-generated\\gogoproto\\gogo.upb.c " + + "src\\core\\ext\\upb-generated\\validate\\validate.upb.c " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\pick_first\\pick_first.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\round_robin\\round_robin.cc " + "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\dns_resolver_ares.cc " + @@ -391,6 +420,7 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\dns_resolver_selection.cc " + "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\native\\dns_resolver.cc " + "src\\core\\ext\\filters\\client_channel\\resolver\\sockaddr\\sockaddr_resolver.cc " + + "src\\core\\ext\\filters\\client_channel\\resolver\\xds\\xds_resolver.cc " + "src\\core\\ext\\filters\\census\\grpc_context.cc " + "src\\core\\ext\\filters\\client_idle\\client_idle_filter.cc " + "src\\core\\ext\\filters\\max_age\\max_age_filter.cc " + @@ -679,11 +709,13 @@ if (PHP_GRPC != "no") { "/DPB_FIELD_32BIT "+ "/I"+configure_module_dirname+" "+ "/I"+configure_module_dirname+"\\include "+ + "/I"+configure_module_dirname+"\\src\\core\\ext\\upb-generated "+ "/I"+configure_module_dirname+"\\src\\php\\ext\\grpc "+ - "/I"+configure_module_dirname+"\\third_party\\boringssl\\include "+ - "/I"+configure_module_dirname+"\\third_party\\zlib "+ "/I"+configure_module_dirname+"\\third_party\\address_sorting\\include "+ - "/I"+configure_module_dirname+"\\third_party\\nanopb"); + "/I"+configure_module_dirname+"\\third_party\\boringssl\\include "+ + "/I"+configure_module_dirname+"\\third_party\\nanopb "+ + "/I"+configure_module_dirname+"\\third_party\\upb "+ + "/I"+configure_module_dirname+"\\third_party\\zlib "); base_dir = get_define('BUILD_DIR'); FSO.CreateFolder(base_dir+"\\ext"); @@ -698,12 +730,6 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\health"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\google"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\proto\\grpc\\lb\\v1\\google\\protobuf"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\pick_first"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\round_robin"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\lb_policy\\xds"); @@ -713,6 +739,7 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\dns\\native"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\fake"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\sockaddr"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_channel\\resolver\\xds"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\client_idle"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\deadline"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\http"); @@ -733,6 +760,34 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\server\\secure"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\transport"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\inproc"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api\\v2"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api\\v2\\auth"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cluster"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\api\\v2\\endpoint"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\discovery"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\discovery\\v2"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\load_stats"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\service\\load_stats\\v2"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\type"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\gogoproto"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\google"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\google\\api"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\google\\protobuf"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\google\\rpc"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\gcp"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\health"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\health\\v1"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lb"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lb\\v1"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\validate"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\avl"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\backoff"); @@ -826,7 +881,8 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\ssl"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\third_party"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl\\third_party\\fiat"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\nanopb"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\upb"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\zlib"); _build_dirs = new Array(); for (i = 0; i < build_dirs.length; i++) { diff --git a/doc/g_stands_for.md b/doc/g_stands_for.md index fe1cbc90005..413ddcb341d 100644 --- a/doc/g_stands_for.md +++ b/doc/g_stands_for.md @@ -22,4 +22,5 @@ - 1.20 'g' stands for ['godric'](https://github.com/grpc/grpc/tree/v1.20.x) - 1.21 'g' stands for ['gandalf'](https://github.com/grpc/grpc/tree/v1.21.x) - 1.22 'g' stands for ['gale'](https://github.com/grpc/grpc/tree/v1.22.x) -- 1.23 'g' stands for ['gangnam'](https://github.com/grpc/grpc/tree/master) +- 1.23 'g' stands for ['gangnam'](https://github.com/grpc/grpc/tree/v1.23.x) +- 1.24 'g' stands for ['ganges'](https://github.com/grpc/grpc/tree/master) diff --git a/doc/keepalive.md b/doc/keepalive.md index 20449fc273b..a54a4fa033c 100644 --- a/doc/keepalive.md +++ b/doc/keepalive.md @@ -18,9 +18,9 @@ The above two channel arguments should be sufficient for most users, but the fol * **GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA** * This channel argument controls the maximum number of pings that can be sent when there is no other data (data frame or header frame) to be sent. GRPC Core will not continue sending pings if we run over the limit. Setting it to 0 allows sending pings without sending data. * **GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS** - * If there is no data being sent on the transport, this channel argument controls the minimum time (in milliseconds) gRPC Core will wait between successive pings. + * If there are no data frames being received on the transport, this channel argument controls the minimum time (in milliseconds) gRPC Core will wait between successive pings. * **GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS** - * If there is no data being sent on the transport, this channel argument on the server side controls the minimum time (in milliseconds) that gRPC Core would expect between receiving successive pings. If the time between successive pings is less that than this time, then the ping will be considered a bad ping from the peer. Such a ping counts as a ‘ping strike’. + * If there are no data frames being sent on the transport, this channel argument on the server side controls the minimum time (in milliseconds) that gRPC Core would expect between receiving successive pings. If the time between successive pings is less that than this time, then the ping will be considered a bad ping from the peer. Such a ping counts as a ‘ping strike’. On the client side, this does not have any effect. * **GRPC_ARG_HTTP2_MAX_PING_STRIKES** * This arg controls the maximum number of bad pings that the server will tolerate before sending an HTTP2 GOAWAY frame and closing the transport. Setting it to 0 allows the server to accept any number of bad pings. diff --git a/doc/statuscodes.md b/doc/statuscodes.md index a5c395d0ceb..ac34da591fc 100644 --- a/doc/statuscodes.md +++ b/doc/statuscodes.md @@ -3,25 +3,25 @@ gRPC uses a set of well defined status codes as part of the RPC API. These statuses are defined as such: -| Code | Number | Description | Closest HTTP Mapping | -|------------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------| -| OK | 0 | Not an error; returned on success. | 200 OK | -| CANCELLED | 1 | The operation was cancelled, typically by the caller. | 499 Client Closed Request | -| UNKNOWN | 2 | Unknown error. For example, this error may be returned when a `Status` value received from another address space belongs to an error space that is not known in this address space. Also errors raised by APIs that do not return enough error information may be converted to this error. | 500 Internal Server Error | -| INVALID_ARGUMENT | 3 | The client specified an invalid argument. Note that this differs from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments that are problematic regardless of the state of the system (e.g., a malformed file name). | 400 Bad Request | -| DEADLINE_EXCEEDED | 4 | The deadline expired before the operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long | 504 Gateway Timeout | -| NOT_FOUND | 5 | Some requested entity (e.g., file or directory) was not found. Note to server developers: if a request is denied for an entire class of users, such as gradual feature rollout or undocumented whitelist, `NOT_FOUND` may be used. If a request is denied for some users within a class of users, such as user-based access control, `PERMISSION_DENIED` must be used. | 404 Not Found | -| ALREADY_EXISTS | 6 | The entity that a client attempted to create (e.g., file or directory) already exists. | 409 Conflict | -| PERMISSION_DENIED | 7 | The caller does not have permission to execute the specified operation. `PERMISSION_DENIED` must not be used for rejections caused by exhausting some resource (use `RESOURCE_EXHAUSTED` instead for those errors). `PERMISSION_DENIED` must not be used if the caller can not be identified (use `UNAUTHENTICATED` instead for those errors). This error code does not imply the request is valid or the requested entity exists or satisfies other pre-conditions. | 403 Forbidden | -| UNAUTHENTICATED | 16 | The request does not have valid authentication credentials for the operation. | 401 Unauthorized | -| RESOURCE_EXHAUSTED | 8 | Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. | 429 Too Many Requests | -| FAILED_PRECONDITION | 9 | The operation was rejected because the system is not in a state required for the operation's execution. For example, the directory to be deleted is non-empty, an rmdir operation is applied to a non-directory, etc. Service implementors can use the following guidelines to decide between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: (a) Use `UNAVAILABLE` if the client can retry just the failing call. (b) Use `ABORTED` if the client should retry at a higher level (e.g., when a client-specified test-and-set fails, indicating the client should restart a read-modify-write sequence). (c) Use `FAILED_PRECONDITION` if the client should not retry until the system state has been explicitly fixed. E.g., if an "rmdir" fails because the directory is non-empty, `FAILED_PRECONDITION` should be returned since the client should not retry unless the files are deleted from the directory. | 400 Bad Request | -| ABORTED | 10 | The operation was aborted, typically due to a concurrency issue such as a sequencer check failure or transaction abort. See the guidelines above for deciding between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`. | 409 Conflict | -| OUT_OF_RANGE | 11 | The operation was attempted past the valid range. E.g., seeking or reading past end-of-file. Unlike `INVALID_ARGUMENT`, this error indicates a problem that may be fixed if the system state changes. For example, a 32-bit file system will generate `INVALID_ARGUMENT` if asked to read at an offset that is not in the range [0,2^32-1], but it will generate `OUT_OF_RANGE` if asked to read from an offset past the current file size. There is a fair bit of overlap between `FAILED_PRECONDITION` and `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific error) when it applies so that callers who are iterating through a space can easily look for an `OUT_OF_RANGE` error to detect when they are done. | 400 Bad Request | -| UNIMPLEMENTED | 12 | The operation is not implemented or is not supported/enabled in this service. | 501 Not Implemented | -| INTERNAL | 13 | Internal errors. This means that some invariants expected by the underlying system have been broken. This error code is reserved for serious errors. | 500 Internal Server Error | -| UNAVAILABLE | 14 | The service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff. Note that it is not always safe to retry non-idempotent operations. | 503 Service Unavailable | -| DATA_LOSS | 15 | Unrecoverable data loss or corruption. | 500 Internal Server Error | +| Code | Number | Description | +|------------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| OK | 0 | Not an error; returned on success. | +| CANCELLED | 1 | The operation was cancelled, typically by the caller. | +| UNKNOWN | 2 | Unknown error. For example, this error may be returned when a `Status` value received from another address space belongs to an error space that is not known in this address space. Also errors raised by APIs that do not return enough error information may be converted to this error. | +| INVALID_ARGUMENT | 3 | The client specified an invalid argument. Note that this differs from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments that are problematic regardless of the state of the system (e.g., a malformed file name). | +| DEADLINE_EXCEEDED | 4 | The deadline expired before the operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long | +| NOT_FOUND | 5 | Some requested entity (e.g., file or directory) was not found. Note to server developers: if a request is denied for an entire class of users, such as gradual feature rollout or undocumented whitelist, `NOT_FOUND` may be used. If a request is denied for some users within a class of users, such as user-based access control, `PERMISSION_DENIED` must be used. | +| ALREADY_EXISTS | 6 | The entity that a client attempted to create (e.g., file or directory) already exists. | +| PERMISSION_DENIED | 7 | The caller does not have permission to execute the specified operation. `PERMISSION_DENIED` must not be used for rejections caused by exhausting some resource (use `RESOURCE_EXHAUSTED` instead for those errors). `PERMISSION_DENIED` must not be used if the caller can not be identified (use `UNAUTHENTICATED` instead for those errors). This error code does not imply the request is valid or the requested entity exists or satisfies other pre-conditions. | +| UNAUTHENTICATED | 16 | The request does not have valid authentication credentials for the operation. | +| RESOURCE_EXHAUSTED | 8 | Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. | +| FAILED_PRECONDITION | 9 | The operation was rejected because the system is not in a state required for the operation's execution. For example, the directory to be deleted is non-empty, an rmdir operation is applied to a non-directory, etc. Service implementors can use the following guidelines to decide between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: (a) Use `UNAVAILABLE` if the client can retry just the failing call. (b) Use `ABORTED` if the client should retry at a higher level (e.g., when a client-specified test-and-set fails, indicating the client should restart a read-modify-write sequence). (c) Use `FAILED_PRECONDITION` if the client should not retry until the system state has been explicitly fixed. E.g., if an "rmdir" fails because the directory is non-empty, `FAILED_PRECONDITION` should be returned since the client should not retry unless the files are deleted from the directory. | +| ABORTED | 10 | The operation was aborted, typically due to a concurrency issue such as a sequencer check failure or transaction abort. See the guidelines above for deciding between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`. | +| OUT_OF_RANGE | 11 | The operation was attempted past the valid range. E.g., seeking or reading past end-of-file. Unlike `INVALID_ARGUMENT`, this error indicates a problem that may be fixed if the system state changes. For example, a 32-bit file system will generate `INVALID_ARGUMENT` if asked to read at an offset that is not in the range [0,2^32-1], but it will generate `OUT_OF_RANGE` if asked to read from an offset past the current file size. There is a fair bit of overlap between `FAILED_PRECONDITION` and `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific error) when it applies so that callers who are iterating through a space can easily look for an `OUT_OF_RANGE` error to detect when they are done. | +| UNIMPLEMENTED | 12 | The operation is not implemented or is not supported/enabled in this service. | +| INTERNAL | 13 | Internal errors. This means that some invariants expected by the underlying system have been broken. This error code is reserved for serious errors. | +| UNAVAILABLE | 14 | The service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff. Note that it is not always safe to retry non-idempotent operations. | +| DATA_LOSS | 15 | Unrecoverable data loss or corruption. | All RPCs started at a client return a `status` object composed of an integer `code` and a string `message`. The server-side can choose the status it diff --git a/examples/BUILD b/examples/BUILD index a9dd94902a4..6f801963c6e 100644 --- a/examples/BUILD +++ b/examples/BUILD @@ -18,7 +18,8 @@ package(default_visibility = ["//visibility:public"]) load("//bazel:grpc_build_system.bzl", "grpc_proto_library") load("//bazel:cc_grpc_library.bzl", "cc_grpc_library") -load("//bazel:python_rules.bzl", "py_proto_library") +load("//bazel:python_rules.bzl", "py_proto_library", "py_grpc_library") +load("@grpc_python_dependencies//:requirements.bzl", "requirement") grpc_proto_library( name = "auth_sample", @@ -60,13 +61,19 @@ grpc_proto_library( ) proto_library( - name = "helloworld_proto_descriptor", + name = "protos/helloworld_proto", srcs = ["protos/helloworld.proto"], ) py_proto_library( - name = "py_helloworld", - deps = [":helloworld_proto_descriptor"], + name = "helloworld_py_pb2", + srcs = [":protos/helloworld_proto"], +) + +py_grpc_library( + name = "helloworld_py_pb2_grpc", + srcs = [":protos/helloworld_proto"], + deps = [":helloworld_py_pb2"], ) cc_binary( @@ -231,3 +238,8 @@ cc_binary( "//:grpc++", ], ) + +proto_library( + name = "route_guide_proto", + srcs = ["protos/route_guide.proto"], +) diff --git a/examples/objective-c/BUILD b/examples/objective-c/BUILD new file mode 100644 index 00000000000..4a5eafdf3fb --- /dev/null +++ b/examples/objective-c/BUILD @@ -0,0 +1,119 @@ +# Copyright 2019 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # 3-clause BSD + +package(default_visibility = ["//visibility:public"]) + +load("@com_github_grpc_grpc//bazel:objc_grpc_library.bzl", "objc_grpc_library") +load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application") +load("@build_bazel_rules_apple//apple:macos.bzl", "macos_application") + +objc_grpc_library( + name = "HelloWorld_grpc_proto", + srcs = ["//examples:protos/helloworld.proto"], + deps = ["//examples:helloworld_proto"], + tags = ["manual"], +) + +# This one works with import "external/com_github_grpc_grpc/examples/protos/Helloworld.pbrpc.h" +objc_grpc_library( + name = "HelloWorld_grpc_proto_external", + srcs = ["//external/com_github_grpc_grpc/examples:protos/helloworld.proto"], + deps = ["@com_github_grpc_grpc//examples:helloworld_proto"], + tags = ["manual"], +) + +objc_library( + name = "HelloWorld-lib", + srcs = glob(["helloworld/**/*.m",]), + hdrs = glob(["helloworld/**/*.h"]), + data = glob([ + "helloworld/HelloWorld/Base.lproj/**", + "helloworld/HelloWorld/Images.xcassets/**", + ]), + includes = ["helloworld/HelloWorld"], + deps = [":HelloWorld_grpc_proto"], + tags = ["manual"], +) + +ios_application( + name = "HelloWorld", + bundle_id = "Google.HelloWorld", + families = [ + "iphone", + "ipad", + ], + minimum_os_version = "8.0", + infoplists = ["helloworld/HelloWorld/Info.plist"], + deps = [":HelloWorld-lib"], + tags = ["manual"], +) + +objc_library( + name = "HelloWorldMacos-lib", + srcs = glob(["helloworld_macos/**/*.m",]), + hdrs = glob(["helloworld_macos/**/*.h"]), + data = glob([ + "helloworld_macos/HelloWorld/Base.lproj/**", + "helloworld_macos/HelloWorld/Images.xcassets/**", + ]), + includes = ["helloworld_macos/HelloWorld"], + deps = [":HelloWorld_grpc_proto"], + tags = ["manual"], +) + +macos_application( + name = "HelloWorldMacos", + bundle_id = "io.grpc.HelloWorld", + minimum_os_version = "10.13", + entitlements = "helloworld_macos/HelloWorld/Helloworld.entitlements", + infoplists = ["helloworld_macos/HelloWorld/Info.plist"], + deps = [":HelloWorldMacos-lib"], + tags = ["manual"], +) + +objc_grpc_library( + name = "RouteGuide", + srcs = ["//examples:protos/route_guide.proto"], + deps = ["//examples:route_guide_proto"], + tags = ["manual"], +) + +objc_library( + name = "RouteGuideClient-lib", + srcs = glob(["route_guide/**/*.m"]), + hdrs = glob(["route_guide/**/*.h"]), + data = glob([ + "route_guide/Misc/Base.lproj/**", + "route_guide/Misc/Images.xcassets/**", + "route_guide/route_guide_db.json", + ]), + includes = ["route_guide/Misc"], + deps = [":RouteGuide"], + tags = ["manual"], +) + +ios_application( + name = "RouteGuideClient", + bundle_id = "gRPC.RouteGuideClient", + families = [ + "iphone", + "ipad", + ], + minimum_os_version = "8.0", + infoplists = ["route_guide/Misc/Info.plist"], + deps = [":RouteGuideClient-lib"], + tags = ["manual"], +) diff --git a/examples/objective-c/helloworld/main.m b/examples/objective-c/helloworld/main.m index 649e65bb5b2..d193af862ba 100644 --- a/examples/objective-c/helloworld/main.m +++ b/examples/objective-c/helloworld/main.m @@ -21,7 +21,11 @@ #import #import +#if COCOAPODS #import +#else +#import "examples/protos/Helloworld.pbrpc.h" +#endif static NSString * const kHostAddress = @"localhost:50051"; diff --git a/examples/objective-c/helloworld_macos/HelloWorld/Info.plist b/examples/objective-c/helloworld_macos/HelloWorld/Info.plist index f7bfdac9d6f..c76261baef0 100644 --- a/examples/objective-c/helloworld_macos/HelloWorld/Info.plist +++ b/examples/objective-c/helloworld_macos/HelloWorld/Info.plist @@ -3,7 +3,7 @@ CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) + en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIconFile diff --git a/examples/objective-c/helloworld_macos/main.m b/examples/objective-c/helloworld_macos/main.m index ce24a9b1466..c0e7ef3c9ab 100644 --- a/examples/objective-c/helloworld_macos/main.m +++ b/examples/objective-c/helloworld_macos/main.m @@ -20,7 +20,11 @@ #import #import +#if COCOAPODS #import +#else +#import "examples/protos/Helloworld.pbrpc.h" +#endif static NSString * const kHostAddress = @"localhost:50051"; diff --git a/examples/objective-c/route_guide/ViewControllers.m b/examples/objective-c/route_guide/ViewControllers.m index 43d2082f585..f36bfe607b5 100644 --- a/examples/objective-c/route_guide/ViewControllers.m +++ b/examples/objective-c/route_guide/ViewControllers.m @@ -17,7 +17,11 @@ */ #import +#if COCOAPODS #import +#else +#import "examples/protos/RouteGuide.pbrpc.h" +#endif static NSString * const kHostAddress = @"localhost:50051"; diff --git a/examples/python/auth/BUILD.bazel b/examples/python/auth/BUILD.bazel index 7bb4203f93f..cc454fdfdfe 100644 --- a/examples/python/auth/BUILD.bazel +++ b/examples/python/auth/BUILD.bazel @@ -36,7 +36,8 @@ py_binary( deps = [ ":_credentials", "//src/python/grpcio/grpc:grpcio", - "//examples:py_helloworld", + "//examples:helloworld_py_pb2", + "//examples:helloworld_py_pb2_grpc", ], ) @@ -47,8 +48,8 @@ py_binary( deps = [ ":_credentials", "//src/python/grpcio/grpc:grpcio", - "//examples:py_helloworld", - + "//examples:helloworld_py_pb2", + "//examples:helloworld_py_pb2_grpc", ], ) @@ -57,7 +58,7 @@ py_test( srcs = ["test/_auth_example_test.py"], deps = [ "//src/python/grpcio/grpc:grpcio", - "//examples:py_helloworld", + "//examples:helloworld_py_pb2", ":customized_auth_client", ":customized_auth_server", ":_credentials", diff --git a/examples/python/auth/customized_auth_client.py b/examples/python/auth/customized_auth_client.py index 0236c07adb1..9bcf1b5085f 100644 --- a/examples/python/auth/customized_auth_client.py +++ b/examples/python/auth/customized_auth_client.py @@ -29,8 +29,6 @@ from examples.python.auth import _credentials _LOGGER = logging.getLogger(__name__) _LOGGER.setLevel(logging.INFO) -_ONE_DAY_IN_SECONDS = 60 * 60 * 24 - _SERVER_ADDR_TEMPLATE = 'localhost:%d' _SIGNATURE_HEADER_KEY = 'x-signature' diff --git a/examples/python/auth/customized_auth_server.py b/examples/python/auth/customized_auth_server.py index 1debc6c3c5f..4bb74d6a871 100644 --- a/examples/python/auth/customized_auth_server.py +++ b/examples/python/auth/customized_auth_server.py @@ -20,7 +20,6 @@ from __future__ import print_function import argparse import contextlib import logging -import time from concurrent import futures import grpc @@ -31,8 +30,6 @@ from examples.python.auth import _credentials _LOGGER = logging.getLogger(__name__) _LOGGER.setLevel(logging.INFO) -_ONE_DAY_IN_SECONDS = 60 * 60 * 24 - _LISTEN_ADDRESS_TEMPLATE = 'localhost:%d' _SIGNATURE_HEADER_KEY = 'x-signature' @@ -85,7 +82,7 @@ def run_server(port): server.start() try: - yield port + yield server, port finally: server.stop(0) @@ -96,13 +93,9 @@ def main(): '--port', nargs='?', type=int, default=50051, help='the listening port') args = parser.parse_args() - with run_server(args.port) as port: + with run_server(args.port) as (server, port): logging.info('Server is listening at port :%d', port) - try: - while True: - time.sleep(_ONE_DAY_IN_SECONDS) - except KeyboardInterrupt: - pass + server.wait_for_termination() if __name__ == '__main__': diff --git a/examples/python/auth/test/_auth_example_test.py b/examples/python/auth/test/_auth_example_test.py index e2214267212..8e1a3b2b359 100644 --- a/examples/python/auth/test/_auth_example_test.py +++ b/examples/python/auth/test/_auth_example_test.py @@ -30,20 +30,20 @@ _SERVER_ADDR_TEMPLATE = 'localhost:%d' class AuthExampleTest(unittest.TestCase): def test_successful_call(self): - with customized_auth_server.run_server(0) as port: + with customized_auth_server.run_server(0) as (_, port): with customized_auth_client.create_client_channel( _SERVER_ADDR_TEMPLATE % port) as channel: customized_auth_client.send_rpc(channel) # No unhandled exception raised, test passed! def test_no_channel_credential(self): - with customized_auth_server.run_server(0) as port: + with customized_auth_server.run_server(0) as (_, port): with grpc.insecure_channel(_SERVER_ADDR_TEMPLATE % port) as channel: resp = customized_auth_client.send_rpc(channel) self.assertEqual(resp.code(), grpc.StatusCode.UNAVAILABLE) def test_no_call_credential(self): - with customized_auth_server.run_server(0) as port: + with customized_auth_server.run_server(0) as (_, port): channel_credential = grpc.ssl_channel_credentials( _credentials.ROOT_CERTIFICATE) with grpc.secure_channel(_SERVER_ADDR_TEMPLATE % port, diff --git a/examples/python/cancellation/BUILD.bazel b/examples/python/cancellation/BUILD.bazel new file mode 100644 index 00000000000..41b394a07a2 --- /dev/null +++ b/examples/python/cancellation/BUILD.bazel @@ -0,0 +1,81 @@ +# gRPC Bazel BUILD file. +# +# Copyright 2019 The gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("//bazel:python_rules.bzl", "py_proto_library", "py_grpc_library") + +package(default_testonly = 1) + +proto_library( + name = "hash_name_proto", + srcs = ["hash_name.proto"], +) + +py_proto_library( + name = "hash_name_py_pb2", + srcs = [":hash_name_proto"], +) + +py_grpc_library( + name = "hash_name_py_pb2_grpc", + srcs = [":hash_name_proto"], + deps = [":hash_name_py_pb2"], +) + +py_binary( + name = "client", + srcs = ["client.py"], + deps = [ + "//src/python/grpcio/grpc:grpcio", + ":hash_name_py_pb2", + ":hash_name_py_pb2_grpc", + "//external:six" + ], + srcs_version = "PY2AND3", +) + +py_library( + name = "search", + srcs = ["search.py"], + srcs_version = "PY2AND3", + deps = [ + ":hash_name_py_pb2", + ], +) + +py_binary( + name = "server", + srcs = ["server.py"], + deps = [ + "//src/python/grpcio/grpc:grpcio", + ":hash_name_py_pb2", + ":search", + ] + select({ + "//conditions:default": ["@futures//:futures"], + "//:python3": [], + }), + srcs_version = "PY2AND3", +) + +py_test( + name = "test/_cancellation_example_test", + srcs = ["test/_cancellation_example_test.py"], + data = [ + ":client", + ":server" + ], + size = "small", +) diff --git a/examples/python/cancellation/README.md b/examples/python/cancellation/README.md new file mode 100644 index 00000000000..26ef61c329f --- /dev/null +++ b/examples/python/cancellation/README.md @@ -0,0 +1,127 @@ +### Cancellation + +In the example, we implement a silly algorithm. We search for bytestrings whose +hashes are similar to a given search string. For example, say we're looking for +the string "doctor". Our algorithm may return `JrqhZVkTDoctYrUlXDbL6pfYQHU=` or +`RC9/7mlM3ldy4TdoctOc6WzYbO4=`. This is a brute force algorithm, so the server +performing the search must be conscious of the resources it allows to each client +and each client must be conscientious of the resources it demands of the server. + +In particular, we ensure that client processes cancel the stream explicitly +before terminating and we ensure that server processes cancel RPCs that have gone on longer +than a certain number of iterations. + +#### Cancellation on the Client Side + +A client may cancel an RPC for several reasons. Perhaps the data it requested +has been made irrelevant. Perhaps you, as the client, want to be a good citizen +of the server and are conserving compute resources. + +##### Cancelling a Server-Side Unary RPC from the Client + +The default RPC methods on a stub will simply return the result of an RPC. + +```python +>>> stub = hash_name_pb2_grpc.HashFinderStub(channel) +>>> stub.Find(hash_name_pb2.HashNameRequest(desired_name=name)) + +``` + +But you may use the `future()` method to receive an instance of `grpc.Future`. +This interface allows you to wait on a response with a timeout, add a callback +to be executed when the RPC completes, or to cancel the RPC before it has +completed. + +In the example, we use this interface to cancel our in-progress RPC when the +user interrupts the process with ctrl-c. + +```python +stub = hash_name_pb2_grpc.HashFinderStub(channel) +future = stub.Find.future(hash_name_pb2.HashNameRequest(desired_name=name)) +def cancel_request(unused_signum, unused_frame): + future.cancel() + sys.exit(0) +signal.signal(signal.SIGINT, cancel_request) + +result = future.result() +print(result) +``` + +We also call `sys.exit(0)` to terminate the process. If we do not do this, then +`future.result()` with throw an `RpcError`. Alternatively, you may catch this +exception. + + +##### Cancelling a Server-Side Streaming RPC from the Client + +Cancelling a Server-side streaming RPC is even simpler from the perspective of +the gRPC API. The default stub method is already an instance of `grpc.Future`, +so the methods outlined above still apply. It is also a generator, so we may +iterate over it to yield the results of our RPC. + +```python +stub = hash_name_pb2_grpc.HashFinderStub(channel) +result_generator = stub.FindRange(hash_name_pb2.HashNameRequest(desired_name=name)) +def cancel_request(unused_signum, unused_frame): + result_generator.cancel() + sys.exit(0) +signal.signal(signal.SIGINT, cancel_request) +for result in result_generator: + print(result) +``` + +We also call `sys.exit(0)` here to terminate the process. Alternatively, you may +catch the `RpcError` raised by the for loop upon cancellation. + + +#### Cancellation on the Server Side + +A server is reponsible for cancellation in two ways. It must respond in some way +when a client initiates a cancellation, otherwise long-running computations +could continue indefinitely. + +It may also decide to cancel the RPC for its own reasons. In our example, the +server can be configured to cancel an RPC after a certain number of hashes has +been computed in order to conserve compute resources. + +##### Responding to Cancellations from a Servicer Thread + +It's important to remember that a gRPC Python server is backed by a thread pool +with a fixed size. When an RPC is cancelled, the library does *not* terminate +your servicer thread. It is your responsibility as the application author to +ensure that your servicer thread terminates soon after the RPC has been +cancelled. + +In this example, we use the `ServicerContext.add_callback` method to set a +`threading.Event` object when the RPC is terminated. We pass this `Event` object +down through our hashing algorithm and ensure to check that the RPC is still +ongoing before each iteration. + +```python +stop_event = threading.Event() +def on_rpc_done(): + # Regain servicer thread. + stop_event.set() +context.add_callback(on_rpc_done) +secret = _find_secret(stop_event) +``` + +##### Initiating a Cancellation on the Server Side + +Initiating a cancellation from the server side is simpler. Just call +`ServicerContext.cancel()`. + +In our example, we ensure that no single client is monopolizing the server by +cancelling after a configurable number of hashes have been checked. + +```python +try: + for candidate in secret_generator: + yield candidate +except ResourceLimitExceededError: + print("Cancelling RPC due to exhausted resources.") + context.cancel() +``` + +In this type of situation, you may also consider returning a more specific error +using the [`grpcio-status`](https://pypi.org/project/grpcio-status/) package. diff --git a/examples/python/cancellation/client.py b/examples/python/cancellation/client.py new file mode 100644 index 00000000000..f80f9668849 --- /dev/null +++ b/examples/python/cancellation/client.py @@ -0,0 +1,104 @@ +# Copyright 2019 the gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""An example of cancelling requests in gRPC.""" + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import argparse +import logging +import signal +import sys + +import grpc + +from examples.python.cancellation import hash_name_pb2 +from examples.python.cancellation import hash_name_pb2_grpc + +_DESCRIPTION = "A client for finding hashes similar to names." +_LOGGER = logging.getLogger(__name__) + + +def run_unary_client(server_target, name, ideal_distance): + with grpc.insecure_channel(server_target) as channel: + stub = hash_name_pb2_grpc.HashFinderStub(channel) + future = stub.Find.future( + hash_name_pb2.HashNameRequest( + desired_name=name, ideal_hamming_distance=ideal_distance), + wait_for_ready=True) + + def cancel_request(unused_signum, unused_frame): + future.cancel() + sys.exit(0) + + signal.signal(signal.SIGINT, cancel_request) + result = future.result() + print(result) + + +def run_streaming_client(server_target, name, ideal_distance, + interesting_distance): + with grpc.insecure_channel(server_target) as channel: + stub = hash_name_pb2_grpc.HashFinderStub(channel) + result_generator = stub.FindRange( + hash_name_pb2.HashNameRequest( + desired_name=name, + ideal_hamming_distance=ideal_distance, + interesting_hamming_distance=interesting_distance), + wait_for_ready=True) + + def cancel_request(unused_signum, unused_frame): + result_generator.cancel() + sys.exit(0) + + signal.signal(signal.SIGINT, cancel_request) + for result in result_generator: + print(result) + + +def main(): + parser = argparse.ArgumentParser(description=_DESCRIPTION) + parser.add_argument("name", type=str, help='The desired name.') + parser.add_argument( + "--ideal-distance", + default=0, + nargs='?', + type=int, + help="The desired Hamming distance.") + parser.add_argument( + '--server', + default='localhost:50051', + type=str, + nargs='?', + help='The host-port pair at which to reach the server.') + parser.add_argument( + '--show-inferior', + default=None, + type=int, + nargs='?', + help='Also show candidates with a Hamming distance less than this value.' + ) + + args = parser.parse_args() + if args.show_inferior is not None: + run_streaming_client(args.server, args.name, args.ideal_distance, + args.show_inferior) + else: + run_unary_client(args.server, args.name, args.ideal_distance) + + +if __name__ == "__main__": + logging.basicConfig() + main() diff --git a/examples/python/cancellation/hash_name.proto b/examples/python/cancellation/hash_name.proto new file mode 100644 index 00000000000..7b4e47e056f --- /dev/null +++ b/examples/python/cancellation/hash_name.proto @@ -0,0 +1,56 @@ +// Copyright 2019 the gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package hash_name; + +// A request for a single secret whose hash is similar to a desired name. +message HashNameRequest { + // The string that is desired in the secret's hash. + string desired_name = 1; + + // The ideal Hamming distance betwen desired_name and the secret that will + // be searched for. + int32 ideal_hamming_distance = 2; + + // A Hamming distance greater than the ideal Hamming distance. Search results + // with a Hamming distance less than this value but greater than the ideal + // distance will be returned back to the client but will not terminate the + // search. + int32 interesting_hamming_distance = 3; +} + +message HashNameResponse { + // The search result. + string secret = 1; + + // The hash of the search result. A substring of this is of + // ideal_hamming_distance Hamming distance or less from desired_name. + string hashed_name = 2; + + // The Hamming distance between hashed_name and desired_name. + int32 hamming_distance = 3; +} + +service HashFinder { + + // Search for a single string whose hash is similar to the specified + // desired_name. interesting_hamming_distance is ignored. + rpc Find (HashNameRequest) returns (HashNameResponse) {} + + // Search for a string whose hash is similar to the specified desired_name, + // but also stream back less-than-ideal candidates. + rpc FindRange (HashNameRequest) returns (stream HashNameResponse) {} +} diff --git a/examples/python/cancellation/search.py b/examples/python/cancellation/search.py new file mode 100644 index 00000000000..9d2331af1bb --- /dev/null +++ b/examples/python/cancellation/search.py @@ -0,0 +1,148 @@ +# Copyright 2019 the gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""A search algorithm over the space of all bytestrings.""" + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import base64 +import hashlib +import itertools +import logging +import struct + +from examples.python.cancellation import hash_name_pb2 + +_LOGGER = logging.getLogger(__name__) +_BYTE_MAX = 255 + + +def _get_hamming_distance(a, b): + """Calculates hamming distance between strings of equal length.""" + distance = 0 + for char_a, char_b in zip(a, b): + if char_a != char_b: + distance += 1 + return distance + + +def _get_substring_hamming_distance(candidate, target): + """Calculates the minimum hamming distance between between the target + and any substring of the candidate. + + Args: + candidate: The string whose substrings will be tested. + target: The target string. + + Returns: + The minimum Hamming distance between candidate and target. + """ + min_distance = None + if len(target) > len(candidate): + raise ValueError("Candidate must be at least as long as target.") + for i in range(len(candidate) - len(target) + 1): + distance = _get_hamming_distance(candidate[i:i + len(target)].lower(), + target.lower()) + if min_distance is None or distance < min_distance: + min_distance = distance + return min_distance + + +def _get_hash(secret): + hasher = hashlib.sha1() + hasher.update(secret) + return base64.b64encode(hasher.digest()).decode('ascii') + + +class ResourceLimitExceededError(Exception): + """Signifies the request has exceeded configured limits.""" + + +def _bytestrings_of_length(length): + """Generates a stream containing all bytestrings of a given length. + + Args: + length: A positive integer length. + + Yields: + All bytestrings of length `length`. + """ + for digits in itertools.product(range(_BYTE_MAX), repeat=length): + yield b''.join(struct.pack('B', i) for i in digits) + + +def _all_bytestrings(): + """Generates a stream containing all possible bytestrings. + + This generator does not terminate. + + Yields: + All bytestrings in ascending order of length. + """ + for bytestring in itertools.chain.from_iterable( + _bytestrings_of_length(length) for length in itertools.count()): + yield bytestring + + +def search(target, + ideal_distance, + stop_event, + maximum_hashes, + interesting_hamming_distance=None): + """Find candidate strings. + + Search through the space of all bytestrings, in order of increasing length, + indefinitely, until a hash with a Hamming distance of `maximum_distance` or + less has been found. + + Args: + target: The search string. + ideal_distance: The desired Hamming distance. + stop_event: An event indicating whether the RPC should terminate. + maximum_hashes: The maximum number of hashes to check before stopping. + interesting_hamming_distance: If specified, strings with a Hamming + distance from the target below this value will be yielded. + + Yields: + Instances of HashNameResponse. The final entry in the stream will be of + `maximum_distance` Hamming distance or less from the target string, + while all others will be of less than `interesting_hamming_distance`. + + Raises: + ResourceLimitExceededError: If the computation exceeds `maximum_hashes` + iterations. + """ + hashes_computed = 0 + for secret in _all_bytestrings(): + if stop_event.is_set(): + raise StopIteration() # pylint: disable=stop-iteration-return + candidate_hash = _get_hash(secret) + distance = _get_substring_hamming_distance(candidate_hash, target) + if interesting_hamming_distance is not None and distance <= interesting_hamming_distance: + # Surface interesting candidates, but don't stop. + yield hash_name_pb2.HashNameResponse( + secret=base64.b64encode(secret), + hashed_name=candidate_hash, + hamming_distance=distance) + elif distance <= ideal_distance: + # Yield ideal candidate and end the stream. + yield hash_name_pb2.HashNameResponse( + secret=base64.b64encode(secret), + hashed_name=candidate_hash, + hamming_distance=distance) + raise StopIteration() # pylint: disable=stop-iteration-return + hashes_computed += 1 + if hashes_computed == maximum_hashes: + raise ResourceLimitExceededError() diff --git a/examples/python/cancellation/server.py b/examples/python/cancellation/server.py new file mode 100644 index 00000000000..f27825d68ed --- /dev/null +++ b/examples/python/cancellation/server.py @@ -0,0 +1,124 @@ +# Copyright 2019 the gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""An example of cancelling requests in gRPC.""" + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +from concurrent import futures +import argparse +import logging +import threading + +import grpc +import search + +from examples.python.cancellation import hash_name_pb2 +from examples.python.cancellation import hash_name_pb2_grpc + +_LOGGER = logging.getLogger(__name__) +_SERVER_HOST = 'localhost' + +_DESCRIPTION = "A server for finding hashes similar to names." + + +class HashFinder(hash_name_pb2_grpc.HashFinderServicer): + + def __init__(self, maximum_hashes): + super(HashFinder, self).__init__() + self._maximum_hashes = maximum_hashes + + def Find(self, request, context): + stop_event = threading.Event() + + def on_rpc_done(): + _LOGGER.debug("Attempting to regain servicer thread.") + stop_event.set() + + context.add_callback(on_rpc_done) + candidates = [] + try: + candidates = list( + search.search(request.desired_name, + request.ideal_hamming_distance, stop_event, + self._maximum_hashes)) + except search.ResourceLimitExceededError: + _LOGGER.info("Cancelling RPC due to exhausted resources.") + context.cancel() + _LOGGER.debug("Servicer thread returning.") + if not candidates: + return hash_name_pb2.HashNameResponse() + return candidates[-1] + + def FindRange(self, request, context): + stop_event = threading.Event() + + def on_rpc_done(): + _LOGGER.debug("Attempting to regain servicer thread.") + stop_event.set() + + context.add_callback(on_rpc_done) + secret_generator = search.search( + request.desired_name, + request.ideal_hamming_distance, + stop_event, + self._maximum_hashes, + interesting_hamming_distance=request.interesting_hamming_distance) + try: + for candidate in secret_generator: + yield candidate + except search.ResourceLimitExceededError: + _LOGGER.info("Cancelling RPC due to exhausted resources.") + context.cancel() + _LOGGER.debug("Regained servicer thread.") + + +def _running_server(port, maximum_hashes): + # We use only a single servicer thread here to demonstrate that, if managed + # carefully, cancelled RPCs can need not continue occupying servicers + # threads. + server = grpc.server( + futures.ThreadPoolExecutor(max_workers=1), maximum_concurrent_rpcs=1) + hash_name_pb2_grpc.add_HashFinderServicer_to_server( + HashFinder(maximum_hashes), server) + address = '{}:{}'.format(_SERVER_HOST, port) + actual_port = server.add_insecure_port(address) + server.start() + print("Server listening at '{}'".format(address)) + return server + + +def main(): + parser = argparse.ArgumentParser(description=_DESCRIPTION) + parser.add_argument( + '--port', + type=int, + default=50051, + nargs='?', + help='The port on which the server will listen.') + parser.add_argument( + '--maximum-hashes', + type=int, + default=1000000, + nargs='?', + help='The maximum number of hashes to search before cancelling.') + args = parser.parse_args() + server = _running_server(args.port, args.maximum_hashes) + server.wait_for_termination() + + +if __name__ == "__main__": + logging.basicConfig() + main() diff --git a/examples/python/cancellation/test/_cancellation_example_test.py b/examples/python/cancellation/test/_cancellation_example_test.py new file mode 100644 index 00000000000..2301cc63c67 --- /dev/null +++ b/examples/python/cancellation/test/_cancellation_example_test.py @@ -0,0 +1,87 @@ +# Copyright 2019 the gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Test for cancellation example.""" + +import contextlib +import os +import signal +import socket +import subprocess +import unittest + +_BINARY_DIR = os.path.realpath( + os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')) +_SERVER_PATH = os.path.join(_BINARY_DIR, 'server') +_CLIENT_PATH = os.path.join(_BINARY_DIR, 'client') + + +@contextlib.contextmanager +def _get_port(): + sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) + sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1) + if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 0: + raise RuntimeError("Failed to set SO_REUSEPORT.") + sock.bind(('', 0)) + try: + yield sock.getsockname()[1] + finally: + sock.close() + + +def _start_client(server_port, + desired_string, + ideal_distance, + interesting_distance=None): + interesting_distance_args = () if interesting_distance is None else ( + '--show-inferior', interesting_distance) + return subprocess.Popen((_CLIENT_PATH, desired_string, '--server', + 'localhost:{}'.format(server_port), + '--ideal-distance', + str(ideal_distance)) + interesting_distance_args) + + +class CancellationExampleTest(unittest.TestCase): + + def test_successful_run(self): + with _get_port() as test_port: + server_process = subprocess.Popen((_SERVER_PATH, '--port', + str(test_port))) + try: + client_process = _start_client(test_port, 'aa', 0) + client_return_code = client_process.wait() + self.assertEqual(0, client_return_code) + self.assertIsNone(server_process.poll()) + finally: + server_process.kill() + server_process.wait() + + def test_graceful_sigint(self): + with _get_port() as test_port: + server_process = subprocess.Popen((_SERVER_PATH, '--port', + str(test_port))) + try: + client_process1 = _start_client(test_port, 'aaaaaaaaaa', 0) + client_process1.send_signal(signal.SIGINT) + client_process1.wait() + client_process2 = _start_client(test_port, 'aa', 0) + client_return_code = client_process2.wait() + self.assertEqual(0, client_return_code) + self.assertIsNone(server_process.poll()) + finally: + server_process.kill() + server_process.wait() + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/examples/python/compression/BUILD.bazel b/examples/python/compression/BUILD.bazel index b95d7cccc77..9d5f6bb83ed 100644 --- a/examples/python/compression/BUILD.bazel +++ b/examples/python/compression/BUILD.bazel @@ -17,7 +17,8 @@ py_binary( srcs = ["server.py"], deps = [ "//src/python/grpcio/grpc:grpcio", - "//examples:py_helloworld", + "//examples:helloworld_py_pb2", + "//examples:helloworld_py_pb2_grpc", ], srcs_version = "PY2AND3", ) @@ -27,7 +28,8 @@ py_binary( srcs = ["client.py"], deps = [ "//src/python/grpcio/grpc:grpcio", - "//examples:py_helloworld", + "//examples:helloworld_py_pb2", + "//examples:helloworld_py_pb2_grpc", ], srcs_version = "PY2AND3", ) diff --git a/examples/python/compression/server.py b/examples/python/compression/server.py index bc13e60cb5b..69411f10eb0 100644 --- a/examples/python/compression/server.py +++ b/examples/python/compression/server.py @@ -21,7 +21,6 @@ from concurrent import futures import argparse import logging import threading -import time import grpc from examples import helloworld_pb2 @@ -36,7 +35,6 @@ _COMPRESSION_OPTIONS = { _LOGGER = logging.getLogger(__name__) _SERVER_HOST = 'localhost' -_ONE_DAY_IN_SECONDS = 60 * 60 * 24 class Greeter(helloworld_pb2_grpc.GreeterServicer): @@ -72,11 +70,7 @@ def run_server(server_compression, no_compress_every_n, port): server.add_insecure_port(address) server.start() print("Server listening at '{}'".format(address)) - try: - while True: - time.sleep(_ONE_DAY_IN_SECONDS) - except KeyboardInterrupt: - server.stop(None) + server.wait_for_termination() def main(): diff --git a/examples/python/debug/BUILD.bazel b/examples/python/debug/BUILD.bazel index 0134d8675ed..657ae860ae3 100644 --- a/examples/python/debug/BUILD.bazel +++ b/examples/python/debug/BUILD.bazel @@ -21,7 +21,8 @@ py_binary( deps = [ "//src/python/grpcio/grpc:grpcio", "//src/python/grpcio_channelz/grpc_channelz/v1:grpc_channelz", - "//examples:py_helloworld", + "//examples:helloworld_py_pb2", + "//examples:helloworld_py_pb2_grpc", ], ) @@ -31,7 +32,8 @@ py_binary( srcs = ["send_message.py"], deps = [ "//src/python/grpcio/grpc:grpcio", - "//examples:py_helloworld", + "//examples:helloworld_py_pb2", + "//examples:helloworld_py_pb2_grpc", ], ) @@ -51,9 +53,10 @@ py_test( deps = [ "//src/python/grpcio/grpc:grpcio", "//src/python/grpcio_channelz/grpc_channelz/v1:grpc_channelz", - "//examples:py_helloworld", + "//examples:helloworld_py_pb2", + "//examples:helloworld_py_pb2_grpc", ":debug_server", ":send_message", ":get_stats", ], -) \ No newline at end of file +) diff --git a/examples/python/debug/debug_server.py b/examples/python/debug/debug_server.py index 64926b53457..3bc52f7c3f4 100644 --- a/examples/python/debug/debug_server.py +++ b/examples/python/debug/debug_server.py @@ -19,7 +19,6 @@ from __future__ import print_function import argparse import logging -import time from concurrent import futures import random @@ -32,7 +31,6 @@ from examples import helloworld_pb2_grpc _LOGGER = logging.getLogger(__name__) _LOGGER.setLevel(logging.INFO) -_ONE_DAY_IN_SECONDS = 60 * 60 * 24 _RANDOM_FAILURE_RATE = 0.3 @@ -78,11 +76,7 @@ def main(): server = create_server(addr=args.addr, failure_rate=args.failure_rate) server.start() - try: - while True: - time.sleep(_ONE_DAY_IN_SECONDS) - except KeyboardInterrupt: - server.stop(0) + server.wait_for_termination() if __name__ == '__main__': diff --git a/examples/python/debug/get_stats.py b/examples/python/debug/get_stats.py index d0b7061c54f..2da51d0efcf 100644 --- a/examples/python/debug/get_stats.py +++ b/examples/python/debug/get_stats.py @@ -20,8 +20,14 @@ from __future__ import print_function import logging import argparse import grpc -from grpc_channelz.v1 import channelz_pb2 -from grpc_channelz.v1 import channelz_pb2_grpc + +# TODO(https://github.com/grpc/grpc/issues/19863): Remove. +try: + from src.python.grpcio_channelz.grpc_channelz.v1 import channelz_pb2 + from src.python.grpcio_channelz.grpc_channelz.v1 import channelz_pb2_grpc +except ImportError: + from grpc_channelz.v1 import channelz_pb2 + from grpc_channelz.v1 import channelz_pb2_grpc def run(addr): diff --git a/examples/python/errors/BUILD.bazel b/examples/python/errors/BUILD.bazel index b07dd12ebd3..4b779ddfcf1 100644 --- a/examples/python/errors/BUILD.bazel +++ b/examples/python/errors/BUILD.bazel @@ -21,7 +21,8 @@ py_library( deps = [ "//src/python/grpcio/grpc:grpcio", "//src/python/grpcio_status/grpc_status:grpc_status", - "//examples:py_helloworld", + "//examples:helloworld_py_pb2", + "//examples:helloworld_py_pb2_grpc", requirement('googleapis-common-protos'), ], ) @@ -33,7 +34,8 @@ py_library( deps = [ "//src/python/grpcio/grpc:grpcio", "//src/python/grpcio_status/grpc_status:grpc_status", - "//examples:py_helloworld", + "//examples:helloworld_py_pb2", + "//examples:helloworld_py_pb2_grpc", ] + select({ "//conditions:default": [requirement("futures")], "//:python3": [], diff --git a/examples/python/errors/server.py b/examples/python/errors/server.py index 50d4a2ac671..a4a70e1e201 100644 --- a/examples/python/errors/server.py +++ b/examples/python/errors/server.py @@ -14,7 +14,6 @@ """This example sends out rich error status from server-side.""" from concurrent import futures -import time import logging import threading @@ -27,8 +26,6 @@ from google.rpc import code_pb2, status_pb2, error_details_pb2 from examples import helloworld_pb2 from examples import helloworld_pb2_grpc -_ONE_DAY_IN_SECONDS = 60 * 60 * 24 - def create_greet_limit_exceed_error_status(name): detail = any_pb2.Any() @@ -73,11 +70,7 @@ def create_server(server_address): def serve(server): server.start() - try: - while True: - time.sleep(_ONE_DAY_IN_SECONDS) - except KeyboardInterrupt: - server.stop(None) + server.wait_for_termination() def main(): diff --git a/examples/python/helloworld/greeter_server.py b/examples/python/helloworld/greeter_server.py index e3b4f2c1ff9..7bc3f2f725c 100644 --- a/examples/python/helloworld/greeter_server.py +++ b/examples/python/helloworld/greeter_server.py @@ -14,7 +14,6 @@ """The Python implementation of the GRPC helloworld.Greeter server.""" from concurrent import futures -import time import logging import grpc @@ -22,8 +21,6 @@ import grpc import helloworld_pb2 import helloworld_pb2_grpc -_ONE_DAY_IN_SECONDS = 60 * 60 * 24 - class Greeter(helloworld_pb2_grpc.GreeterServicer): @@ -36,11 +33,7 @@ def serve(): helloworld_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server) server.add_insecure_port('[::]:50051') server.start() - try: - while True: - time.sleep(_ONE_DAY_IN_SECONDS) - except KeyboardInterrupt: - server.stop(0) + server.wait_for_termination() if __name__ == '__main__': diff --git a/examples/python/helloworld/greeter_server_with_reflection.py b/examples/python/helloworld/greeter_server_with_reflection.py index 5acedbcb71f..7c73a42eb66 100644 --- a/examples/python/helloworld/greeter_server_with_reflection.py +++ b/examples/python/helloworld/greeter_server_with_reflection.py @@ -14,7 +14,6 @@ """The reflection-enabled version of gRPC helloworld.Greeter server.""" from concurrent import futures -import time import logging import grpc @@ -23,8 +22,6 @@ from grpc_reflection.v1alpha import reflection import helloworld_pb2 import helloworld_pb2_grpc -_ONE_DAY_IN_SECONDS = 60 * 60 * 24 - class Greeter(helloworld_pb2_grpc.GreeterServicer): @@ -42,11 +39,7 @@ def serve(): reflection.enable_server_reflection(SERVICE_NAMES, server) server.add_insecure_port('[::]:50051') server.start() - try: - while True: - time.sleep(_ONE_DAY_IN_SECONDS) - except KeyboardInterrupt: - server.stop(0) + server.wait_for_termination() if __name__ == '__main__': diff --git a/examples/python/interceptors/headers/greeter_server.py b/examples/python/interceptors/headers/greeter_server.py index 6b0f4058bcd..32706ae7094 100644 --- a/examples/python/interceptors/headers/greeter_server.py +++ b/examples/python/interceptors/headers/greeter_server.py @@ -14,7 +14,6 @@ """The Python implementation of the GRPC helloworld.Greeter server.""" from concurrent import futures -import time import logging import grpc @@ -23,8 +22,6 @@ import helloworld_pb2 import helloworld_pb2_grpc from request_header_validator_interceptor import RequestHeaderValidatorInterceptor -_ONE_DAY_IN_SECONDS = 60 * 60 * 24 - class Greeter(helloworld_pb2_grpc.GreeterServicer): @@ -42,11 +39,7 @@ def serve(): helloworld_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server) server.add_insecure_port('[::]:50051') server.start() - try: - while True: - time.sleep(_ONE_DAY_IN_SECONDS) - except KeyboardInterrupt: - server.stop(0) + server.wait_for_termination() if __name__ == '__main__': diff --git a/examples/python/metadata/metadata_server.py b/examples/python/metadata/metadata_server.py index a4329df79aa..79eb380092e 100644 --- a/examples/python/metadata/metadata_server.py +++ b/examples/python/metadata/metadata_server.py @@ -15,7 +15,6 @@ from __future__ import print_function from concurrent import futures -import time import logging import grpc @@ -23,8 +22,6 @@ import grpc import helloworld_pb2 import helloworld_pb2_grpc -_ONE_DAY_IN_SECONDS = 60 * 60 * 24 - class Greeter(helloworld_pb2_grpc.GreeterServicer): @@ -44,11 +41,7 @@ def serve(): helloworld_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server) server.add_insecure_port('[::]:50051') server.start() - try: - while True: - time.sleep(_ONE_DAY_IN_SECONDS) - except KeyboardInterrupt: - server.stop(0) + server.wait_for_termination() if __name__ == '__main__': diff --git a/examples/python/multiplex/multiplex_server.py b/examples/python/multiplex/multiplex_server.py index c01824b3a97..f168fe7f1b3 100644 --- a/examples/python/multiplex/multiplex_server.py +++ b/examples/python/multiplex/multiplex_server.py @@ -26,8 +26,6 @@ import route_guide_pb2 import route_guide_pb2_grpc import route_guide_resources -_ONE_DAY_IN_SECONDS = 60 * 60 * 24 - def _get_feature(feature_db, point): """Returns Feature at given location or None.""" @@ -129,11 +127,7 @@ def serve(): _RouteGuideServicer(), server) server.add_insecure_port('[::]:50051') server.start() - try: - while True: - time.sleep(_ONE_DAY_IN_SECONDS) - except KeyboardInterrupt: - server.stop(0) + server.wait_for_termination() if __name__ == '__main__': diff --git a/examples/python/multiprocessing/BUILD b/examples/python/multiprocessing/BUILD index f9fa6598068..257523f14bb 100644 --- a/examples/python/multiprocessing/BUILD +++ b/examples/python/multiprocessing/BUILD @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@grpc_python_dependencies//:requirements.bzl", "requirement") -load("//bazel:python_rules.bzl", "py_proto_library") +load("//bazel:python_rules.bzl", "py_proto_library", "py_grpc_library") proto_library( name = "prime_proto", @@ -24,8 +23,13 @@ proto_library( py_proto_library( name = "prime_proto_pb2", - deps = [":prime_proto"], - well_known_protos = False, + srcs = [":prime_proto"], +) + +py_grpc_library( + name = "prime_proto_pb2_grpc", + srcs = [":prime_proto"], + deps = [":prime_proto_pb2"], ) py_binary( @@ -35,6 +39,7 @@ py_binary( deps = [ "//src/python/grpcio/grpc:grpcio", ":prime_proto_pb2", + ":prime_proto_pb2_grpc", ], srcs_version = "PY3", ) @@ -45,9 +50,10 @@ py_binary( srcs = ["server.py"], deps = [ "//src/python/grpcio/grpc:grpcio", - ":prime_proto_pb2" + ":prime_proto_pb2", + ":prime_proto_pb2_grpc", ] + select({ - "//conditions:default": [requirement("futures")], + "//conditions:default": ["@futures//:futures"], "//:python3": [], }), srcs_version = "PY3", diff --git a/examples/python/route_guide/route_guide_server.py b/examples/python/route_guide/route_guide_server.py index e00cb699084..4ab33e68f28 100644 --- a/examples/python/route_guide/route_guide_server.py +++ b/examples/python/route_guide/route_guide_server.py @@ -24,8 +24,6 @@ import route_guide_pb2 import route_guide_pb2_grpc import route_guide_resources -_ONE_DAY_IN_SECONDS = 60 * 60 * 24 - def get_feature(feature_db, point): """Returns Feature at given location or None.""" @@ -119,11 +117,7 @@ def serve(): RouteGuideServicer(), server) server.add_insecure_port('[::]:50051') server.start() - try: - while True: - time.sleep(_ONE_DAY_IN_SECONDS) - except KeyboardInterrupt: - server.stop(0) + server.wait_for_termination() if __name__ == '__main__': diff --git a/examples/python/wait_for_ready/BUILD.bazel b/examples/python/wait_for_ready/BUILD.bazel index 70daf83d334..f074ae7bb7f 100644 --- a/examples/python/wait_for_ready/BUILD.bazel +++ b/examples/python/wait_for_ready/BUILD.bazel @@ -20,7 +20,8 @@ py_library( srcs = ["wait_for_ready_example.py"], deps = [ "//src/python/grpcio/grpc:grpcio", - "//examples:py_helloworld", + "//examples:helloworld_py_pb2", + "//examples:helloworld_py_pb2_grpc", ], ) diff --git a/examples/python/wait_for_ready/wait_for_ready_example.py b/examples/python/wait_for_ready/wait_for_ready_example.py index a0f076e894a..8dd770d6a0e 100644 --- a/examples/python/wait_for_ready/wait_for_ready_example.py +++ b/examples/python/wait_for_ready/wait_for_ready_example.py @@ -28,8 +28,6 @@ from examples import helloworld_pb2_grpc _LOGGER = logging.getLogger(__name__) _LOGGER.setLevel(logging.INFO) -_ONE_DAY_IN_SECONDS = 60 * 60 * 24 - @contextmanager def get_free_loopback_tcp_port(): diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 7ff51fa08c9..02af80f53c2 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-C++' # TODO (mxyan): use version that match gRPC version when pod is stabilized - # version = '1.23.0-dev' + # version = '1.24.0-dev' version = '0.0.9-dev' s.version = version s.summary = 'gRPC C++ library' @@ -31,7 +31,7 @@ Pod::Spec.new do |s| s.license = 'Apache License, Version 2.0' s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' } - grpc_version = '1.23.0-dev' + grpc_version = '1.24.0-dev' s.source = { :git => 'https://github.com/grpc/grpc.git', @@ -180,6 +180,7 @@ Pod::Spec.new do |s| 'include/grpcpp/impl/codegen/config.h', 'include/grpcpp/impl/codegen/core_codegen_interface.h', 'include/grpcpp/impl/codegen/create_auth_context.h', + 'include/grpcpp/impl/codegen/delegating_channel.h', 'include/grpcpp/impl/codegen/grpc_library.h', 'include/grpcpp/impl/codegen/intercepted_channel.h', 'include/grpcpp/impl/codegen/interceptor.h', @@ -228,6 +229,10 @@ Pod::Spec.new do |s| 'src/cpp/server/health/default_health_check_service.h', 'src/cpp/server/thread_pool_interface.h', 'src/cpp/thread_manager/thread_manager.h', + 'third_party/nanopb/pb.h', + 'third_party/nanopb/pb_common.h', + 'third_party/nanopb/pb_decode.h', + 'third_party/nanopb/pb_encode.h', 'src/cpp/client/insecure_credentials.cc', 'src/cpp/client/secure_credentials.cc', 'src/cpp/common/auth_property_iterator.cc', @@ -381,13 +386,19 @@ Pod::Spec.new do |s| 'src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h', 'src/core/lib/security/credentials/alts/check_gcp_environment.h', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h', - 'src/core/tsi/alts/handshaker/alts_handshaker_service_api.h', - 'src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h', 'src/core/tsi/alts/handshaker/alts_tsi_utils.h', 'src/core/tsi/alts/handshaker/transport_security_common_api.h', - 'src/core/tsi/alts/handshaker/altscontext.pb.h', - 'src/core/tsi/alts/handshaker/handshaker.pb.h', - 'src/core/tsi/alts/handshaker/transport_security_common.pb.h', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h', + 'third_party/upb/upb/decode.h', + 'third_party/upb/upb/encode.h', + 'third_party/upb/upb/generated_util.h', + 'third_party/upb/upb/msg.h', + 'third_party/upb/upb/port_def.inc', + 'third_party/upb/upb/port_undef.inc', + 'third_party/upb/upb/table.int.h', + 'third_party/upb/upb/upb.h', 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_interface.h', 'src/core/ext/transport/chttp2/client/authority.h', @@ -420,7 +431,7 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/subchannel_interface.h', 'src/core/ext/filters/client_channel/subchannel_pool_interface.h', 'src/core/ext/filters/deadline/deadline_filter.h', - 'src/core/ext/filters/client_channel/health/health.pb.h', + 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h', 'src/core/tsi/fake_transport_security.h', 'src/core/tsi/local_transport_security.h', 'src/core/tsi/ssl/session_cache/ssl_session.h', @@ -579,13 +590,41 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h', + 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h', + 'src/core/ext/upb-generated/google/api/annotations.upb.h', + 'src/core/ext/upb-generated/google/api/http.upb.h', + 'src/core/ext/upb-generated/google/protobuf/any.upb.h', + 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h', + 'src/core/ext/upb-generated/google/protobuf/duration.upb.h', + 'src/core/ext/upb-generated/google/protobuf/empty.upb.h', + 'src/core/ext/upb-generated/google/protobuf/struct.upb.h', + 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h', + 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h', + 'src/core/ext/upb-generated/google/rpc/status.upb.h', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h', + 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h', + 'src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h', + 'src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h', + 'src/core/ext/upb-generated/envoy/type/percent.upb.h', + 'src/core/ext/upb-generated/envoy/type/range.upb.h', + 'src/core/ext/upb-generated/gogoproto/gogo.upb.h', + 'src/core/ext/upb-generated/validate/validate.upb.h', 'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h', @@ -782,8 +821,16 @@ Pod::Spec.new do |s| 'src/core/lib/transport/transport_impl.h', 'src/core/lib/uri/uri_parser.h', 'src/core/lib/debug/trace.h', - 'src/core/ext/transport/inproc/inproc_transport.h', - 'src/core/ext/filters/client_channel/health/health.pb.h' + 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h', + 'third_party/upb/upb/decode.h', + 'third_party/upb/upb/encode.h', + 'third_party/upb/upb/generated_util.h', + 'third_party/upb/upb/msg.h', + 'third_party/upb/upb/port_def.inc', + 'third_party/upb/upb/port_undef.inc', + 'third_party/upb/upb/table.int.h', + 'third_party/upb/upb/upb.h', + 'src/core/ext/transport/inproc/inproc_transport.h' end s.subspec 'Protobuf' do |ss| @@ -798,9 +845,11 @@ Pod::Spec.new do |s| end s.prepare_command = <<-END_OF_COMMAND - find src/cpp/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include ;g' - find src/cpp/ -type f -path '*.grpc_back' -print0 | xargs -0 rm - find src/core/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include ;g' - find src/core/ -type f -path '*.grpc_back' -print0 | xargs -0 rm + sed -E -i '' 's;#include "(pb(_.*)?\\.h)";#if COCOAPODS==1\\\n #include \\\n#else\\\n #include "\\1"\\\n#endif;g' $(find src/core -type f -print | xargs grep -H -c '#include \\\n#else\\\n #include "\\1"\\\n#endif;g' $(find src/cpp -type f -print | xargs grep -H -c '#include \\\n#else\\\n #include "\\1"\\\n#endif;g' $(find src/core -type f -print | xargs grep -H -c '#include ;#if COCOAPODS==1\\\n #include \\\n#else\\\n #include \\\n#endif;g' $(find src/core -type f \\( -path '*.h' -or -path '*.cc' \\) -print | xargs grep -H -c '#include #endif /* _MSC_VER */ +/* Type of cycle clock implementation */ +#ifdef GPR_LINUX +/* Disable cycle clock by default. + TODO(soheil): enable when we support fallback for unstable cycle clocks. +#if defined(__i386__) +#define GPR_CYCLE_COUNTER_RDTSC_32 1 +#elif defined(__x86_64__) || defined(__amd64__) +#define GPR_CYCLE_COUNTER_RDTSC_64 1 +#else +#define GPR_CYCLE_COUNTER_FALLBACK 1 +#endif +*/ +#define GPR_CYCLE_COUNTER_FALLBACK 1 +#else +#define GPR_CYCLE_COUNTER_FALLBACK 1 +#endif /* GPR_LINUX */ + /* Cache line alignment */ #ifndef GPR_CACHELINE_SIZE_LOG #if defined(__i386__) || defined(__x86_64__) diff --git a/include/grpcpp/impl/codegen/channel_interface.h b/include/grpcpp/impl/codegen/channel_interface.h index dd2fe8d687a..828d5c783e0 100644 --- a/include/grpcpp/impl/codegen/channel_interface.h +++ b/include/grpcpp/impl/codegen/channel_interface.h @@ -57,6 +57,10 @@ class ClientCallbackUnaryFactory; namespace grpc { class ChannelInterface; +namespace experimental { +class DelegatingChannel; +} + namespace internal { class Call; class CallOpSetInterface; @@ -128,6 +132,7 @@ class ChannelInterface { template friend class ::grpc_impl::internal::CallbackUnaryCallImpl; friend class ::grpc::internal::RpcMethod; + friend class ::grpc::experimental::DelegatingChannel; friend class ::grpc::internal::InterceptedChannel; virtual internal::Call CreateCall(const internal::RpcMethod& method, ::grpc_impl::ClientContext* context, diff --git a/include/grpcpp/impl/codegen/client_context_impl.h b/include/grpcpp/impl/codegen/client_context_impl.h index 638ea641bed..7a543055b4b 100644 --- a/include/grpcpp/impl/codegen/client_context_impl.h +++ b/include/grpcpp/impl/codegen/client_context_impl.h @@ -85,6 +85,7 @@ class ClientCallbackReaderImpl; template class ClientCallbackWriterImpl; class ClientCallbackUnaryImpl; +class ClientContextAccessor; } // namespace internal class CallCredentials; @@ -424,6 +425,7 @@ class ClientContext { template friend class ::grpc_impl::internal::ClientCallbackWriterImpl; friend class ::grpc_impl::internal::ClientCallbackUnaryImpl; + friend class ::grpc_impl::internal::ClientContextAccessor; // Used by friend class CallOpClientRecvStatus void set_debug_error_string(const grpc::string& debug_error_string) { diff --git a/include/grpcpp/impl/codegen/delegating_channel.h b/include/grpcpp/impl/codegen/delegating_channel.h new file mode 100644 index 00000000000..a18622235f9 --- /dev/null +++ b/include/grpcpp/impl/codegen/delegating_channel.h @@ -0,0 +1,87 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef GRPCPP_IMPL_CODEGEN_DELEGATING_CHANNEL_H +#define GRPCPP_IMPL_CODEGEN_DELEGATING_CHANNEL_H + +namespace grpc { +namespace experimental { + +class DelegatingChannel : public ::grpc::ChannelInterface { + public: + virtual ~DelegatingChannel() {} + + DelegatingChannel(std::shared_ptr<::grpc::ChannelInterface> delegate_channel) + : delegate_channel_(delegate_channel) {} + + grpc_connectivity_state GetState(bool try_to_connect) override { + return delegate_channel()->GetState(try_to_connect); + } + + std::shared_ptr<::grpc::ChannelInterface> delegate_channel() { + return delegate_channel_; + } + + private: + internal::Call CreateCall(const internal::RpcMethod& method, + ClientContext* context, + ::grpc_impl::CompletionQueue* cq) final { + return delegate_channel()->CreateCall(method, context, cq); + } + + void PerformOpsOnCall(internal::CallOpSetInterface* ops, + internal::Call* call) final { + delegate_channel()->PerformOpsOnCall(ops, call); + } + + void* RegisterMethod(const char* method) final { + return delegate_channel()->RegisterMethod(method); + } + + void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed, + gpr_timespec deadline, + ::grpc_impl::CompletionQueue* cq, + void* tag) override { + delegate_channel()->NotifyOnStateChangeImpl(last_observed, deadline, cq, + tag); + } + + bool WaitForStateChangeImpl(grpc_connectivity_state last_observed, + gpr_timespec deadline) override { + return delegate_channel()->WaitForStateChangeImpl(last_observed, deadline); + } + + internal::Call CreateCallInternal(const internal::RpcMethod& method, + ClientContext* context, + ::grpc_impl::CompletionQueue* cq, + size_t interceptor_pos) final { + return delegate_channel()->CreateCallInternal(method, context, cq, + interceptor_pos); + } + + ::grpc_impl::CompletionQueue* CallbackCQ() final { + return delegate_channel()->CallbackCQ(); + } + + std::shared_ptr<::grpc::ChannelInterface> delegate_channel_; +}; + +} // namespace experimental +} // namespace grpc + +#endif // GRPCPP_IMPL_CODEGEN_DELEGATING_CHANNEL_H diff --git a/include/grpcpp/impl/codegen/proto_utils.h b/include/grpcpp/impl/codegen/proto_utils.h index f9a7d3c0b34..2cf4cdcc9b5 100644 --- a/include/grpcpp/impl/codegen/proto_utils.h +++ b/include/grpcpp/impl/codegen/proto_utils.h @@ -83,14 +83,9 @@ Status GenericDeserialize(ByteBuffer* buffer, if (!reader.status().ok()) { return reader.status(); } - ::grpc::protobuf::io::CodedInputStream decoder(&reader); - decoder.SetTotalBytesLimit(INT_MAX, INT_MAX); - if (!msg->ParseFromCodedStream(&decoder)) { + if (!msg->ParseFromZeroCopyStream(&reader)) { result = Status(StatusCode::INTERNAL, msg->InitializationErrorString()); } - if (!decoder.ConsumedEntireMessage()) { - result = Status(StatusCode::INTERNAL, "Did not read entire message"); - } } buffer->Clear(); return result; diff --git a/package.xml b/package.xml index cb221ff932d..196c6a6d7db 100644 --- a/package.xml +++ b/package.xml @@ -13,8 +13,8 @@ 2018-01-19 - 1.23.0dev - 1.23.0dev + 1.24.0dev + 1.24.0dev beta @@ -270,17 +270,19 @@ - - - - - - - - - + + + + + + + + + + + @@ -313,7 +315,7 @@ - + @@ -472,13 +474,41 @@ + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + @@ -736,16 +766,17 @@ - - - - - - - - + + + + + + + + + @@ -778,7 +809,7 @@ - + @@ -797,14 +828,42 @@ + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + @@ -820,6 +879,7 @@ + diff --git a/setup.py b/setup.py index 1e205bdf91d..4f787c05cf7 100644 --- a/setup.py +++ b/setup.py @@ -35,9 +35,7 @@ egg_info.manifest_maker.template = 'PYTHON-MANIFEST.in' PY3 = sys.version_info.major == 3 PYTHON_STEM = os.path.join('src', 'python', 'grpcio') CORE_INCLUDE = ('include', '.',) -SSL_INCLUDE = (os.path.join('third_party', 'boringssl', 'include'),) -ZLIB_INCLUDE = (os.path.join('third_party', 'zlib'),) -NANOPB_INCLUDE = (os.path.join('third_party', 'nanopb'),) +ADDRESS_SORTING_INCLUDE = (os.path.join('third_party', 'address_sorting', 'include'),) CARES_INCLUDE = ( os.path.join('third_party', 'cares'), os.path.join('third_party', 'cares', 'cares'),) @@ -49,7 +47,11 @@ if 'linux' in sys.platform: CARES_INCLUDE += (os.path.join('third_party', 'cares', 'config_linux'),) if 'openbsd' in sys.platform: CARES_INCLUDE += (os.path.join('third_party', 'cares', 'config_openbsd'),) -ADDRESS_SORTING_INCLUDE = (os.path.join('third_party', 'address_sorting', 'include'),) +NANOPB_INCLUDE = (os.path.join('third_party', 'nanopb'),) +SSL_INCLUDE = (os.path.join('third_party', 'boringssl', 'include'),) +UPB_INCLUDE = (os.path.join('third_party', 'upb'),) +UPB_GRPC_GENERATED_INCLUDE = (os.path.join('src', 'core', 'ext', 'upb-generated'),) +ZLIB_INCLUDE = (os.path.join('third_party', 'zlib'),) README = os.path.join(PYTHON_STEM, 'README.rst') # Ensure we're in the proper directory whether or not we're being used by pip. @@ -203,8 +205,15 @@ if BUILD_WITH_SYSTEM_CARES: CARES_INCLUDE = (os.path.join('/usr', 'include'),) EXTENSION_INCLUDE_DIRECTORIES = ( - (PYTHON_STEM,) + CORE_INCLUDE + SSL_INCLUDE + ZLIB_INCLUDE + - NANOPB_INCLUDE + CARES_INCLUDE + ADDRESS_SORTING_INCLUDE) + (PYTHON_STEM,) + + CORE_INCLUDE + + ADDRESS_SORTING_INCLUDE + + CARES_INCLUDE + + NANOPB_INCLUDE + + SSL_INCLUDE + + UPB_INCLUDE + + UPB_GRPC_GENERATED_INCLUDE + + ZLIB_INCLUDE) EXTENSION_LIBRARIES = () if "linux" in sys.platform: diff --git a/src/benchmark/gen_build_yaml.py b/src/benchmark/gen_build_yaml.py index 4d9391a91f5..35c9244e6fa 100755 --- a/src/benchmark/gen_build_yaml.py +++ b/src/benchmark/gen_build_yaml.py @@ -14,6 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +from __future__ import print_function import os import sys import glob @@ -27,7 +28,7 @@ out['libs'] = [{ 'name': 'benchmark', 'build': 'private', 'language': 'c++', - 'secure': 'no', + 'secure': False, 'defaults': 'benchmark', 'src': sorted(glob.glob('third_party/benchmark/src/*.cc')), 'headers': sorted( @@ -35,4 +36,4 @@ out['libs'] = [{ glob.glob('third_party/benchmark/include/benchmark/*.h')), }] -print yaml.dump(out) +print(yaml.dump(out)) diff --git a/src/boringssl/gen_build_yaml.py b/src/boringssl/gen_build_yaml.py index c25a4ed3c94..3b259c32c5d 100755 --- a/src/boringssl/gen_build_yaml.py +++ b/src/boringssl/gen_build_yaml.py @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +from __future__ import print_function import shutil import sys import os @@ -28,7 +29,7 @@ sys.path.append(os.path.join(boring_ssl_root, 'util')) try: import generate_build_files except ImportError: - print yaml.dump({}) + print(yaml.dump({})) sys.exit() def map_dir(filename): @@ -61,7 +62,7 @@ class Grpc(object): 'name': 'boringssl', 'build': 'private', 'language': 'c', - 'secure': 'no', + 'secure': False, 'src': sorted( map_dir(f) for f in files['ssl'] + files['crypto'] @@ -79,7 +80,7 @@ class Grpc(object): 'name': 'boringssl_test_util', 'build': 'private', 'language': 'c++', - 'secure': 'no', + 'secure': False, 'boringssl': True, 'defaults': 'boringssl', 'src': [ @@ -93,7 +94,7 @@ class Grpc(object): 'name': 'boringssl_%s' % test, 'build': 'test', 'run': False, - 'secure': 'no', + 'secure': False, 'language': 'c++', 'src': sorted(map_dir(f) for f in files[test]), 'vs_proj_dir': 'test/boringssl', @@ -135,7 +136,7 @@ try: g = Grpc() generate_build_files.main([g]) - print yaml.dump(g.yaml) + print(yaml.dump(g.yaml)) finally: shutil.rmtree('src') diff --git a/src/c-ares/gen_build_yaml.py b/src/c-ares/gen_build_yaml.py index 6e832edcea3..fe2ecb462c3 100755 --- a/src/c-ares/gen_build_yaml.py +++ b/src/c-ares/gen_build_yaml.py @@ -53,7 +53,7 @@ try: 'defaults': 'ares', 'build': 'private', 'language': 'c', - 'secure': 'no', + 'secure': False, 'src': [ "third_party/cares/cares/ares__close_sockets.c", "third_party/cares/cares/ares__get_hostent.c", diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc index a45408a4cb8..d7ba4f2636a 100644 --- a/src/compiler/csharp_generator.cc +++ b/src/compiler/csharp_generator.cc @@ -437,8 +437,8 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service, "/// The channel to use to make remote " "calls.\n", "servicename", GetServiceClassName(service)); - out->Print("public $name$(grpc::Channel channel) : base(channel)\n", "name", - GetClientClassName(service)); + out->Print("public $name$(grpc::ChannelBase channel) : base(channel)\n", + "name", GetClientClassName(service)); out->Print("{\n"); out->Print("}\n"); } diff --git a/src/compiler/objective_c_generator_helpers.h b/src/compiler/objective_c_generator_helpers.h index a284da97f4b..0ed27738c2e 100644 --- a/src/compiler/objective_c_generator_helpers.h +++ b/src/compiler/objective_c_generator_helpers.h @@ -45,6 +45,16 @@ inline ::grpc::string LocalImport(const ::grpc::string& import) { return ::grpc::string("#import \"" + import + "\"\n"); } +inline ::grpc::string FrameworkImport(const ::grpc::string& import, + const ::grpc::string& framework) { + // Flattens the directory structure: grab the file name only + std::size_t pos = import.rfind("/"); + // If pos is npos, pos + 1 is 0, which gives us the entire string, + // so there's no need to check that + ::grpc::string filename = import.substr(pos + 1, import.size() - (pos + 1)); + return ::grpc::string("#import <" + framework + "/" + filename + ">\n"); +} + inline ::grpc::string SystemImport(const ::grpc::string& import) { return ::grpc::string("#import <" + import + ">\n"); } diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index 87977095d05..f398033f6db 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -29,6 +29,7 @@ using ::google::protobuf::compiler::objectivec:: IsProtobufLibraryBundledProtoFile; using ::google::protobuf::compiler::objectivec::ProtobufLibraryFrameworkName; +using ::grpc_objective_c_generator::FrameworkImport; using ::grpc_objective_c_generator::LocalImport; using ::grpc_objective_c_generator::PreprocIfElse; using ::grpc_objective_c_generator::PreprocIfNot; @@ -37,11 +38,16 @@ using ::grpc_objective_c_generator::SystemImport; namespace { inline ::grpc::string ImportProtoHeaders( - const grpc::protobuf::FileDescriptor* dep, const char* indent) { + const grpc::protobuf::FileDescriptor* dep, const char* indent, + const ::grpc::string& framework) { ::grpc::string header = grpc_objective_c_generator::MessageHeaderName(dep); if (!IsProtobufLibraryBundledProtoFile(dep)) { - return indent + LocalImport(header); + if (framework.empty()) { + return indent + LocalImport(header); + } else { + return indent + FrameworkImport(header, framework); + } } ::grpc::string base_name = header; @@ -74,6 +80,28 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { return true; } + ::grpc::string framework; + std::vector<::grpc::string> params_list = + grpc_generator::tokenize(parameter, ","); + for (auto param_str = params_list.begin(); param_str != params_list.end(); + ++param_str) { + std::vector<::grpc::string> param = + grpc_generator::tokenize(*param_str, "="); + if (param[0] == "generate_for_named_framework") { + if (param.size() != 2) { + *error = + grpc::string("Format: generate_for_named_framework="); + return false; + } else if (param[1].empty()) { + *error = grpc::string( + "Name of framework cannot be empty for parameter: ") + + param[0]; + return false; + } + framework = param[1]; + } + } + static const ::grpc::string kNonNullBegin = "NS_ASSUME_NONNULL_BEGIN\n"; static const ::grpc::string kNonNullEnd = "NS_ASSUME_NONNULL_END\n"; static const ::grpc::string kProtocolOnly = "GPB_GRPC_PROTOCOL_ONLY"; @@ -86,7 +114,12 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { { // Generate .pbrpc.h - ::grpc::string imports = LocalImport(file_name + ".pbobjc.h"); + ::grpc::string imports; + if (framework.empty()) { + imports = LocalImport(file_name + ".pbobjc.h"); + } else { + imports = FrameworkImport(file_name + ".pbobjc.h", framework); + } ::grpc::string system_imports = SystemImport("ProtoRPC/ProtoService.h") + SystemImport("ProtoRPC/ProtoRPC.h") + @@ -106,7 +139,8 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { ::grpc::string class_imports; for (int i = 0; i < file->dependency_count(); i++) { - class_imports += ImportProtoHeaders(file->dependency(i), " "); + class_imports += + ImportProtoHeaders(file->dependency(i), " ", framework); } ::grpc::string ng_protocols; @@ -141,14 +175,22 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { { // Generate .pbrpc.m - ::grpc::string imports = LocalImport(file_name + ".pbrpc.h") + - LocalImport(file_name + ".pbobjc.h") + - SystemImport("ProtoRPC/ProtoRPC.h") + - SystemImport("RxLibrary/GRXWriter+Immediate.h"); + ::grpc::string imports; + if (framework.empty()) { + imports = LocalImport(file_name + ".pbrpc.h") + + LocalImport(file_name + ".pbobjc.h") + + SystemImport("ProtoRPC/ProtoRPC.h") + + SystemImport("RxLibrary/GRXWriter+Immediate.h"); + } else { + imports = FrameworkImport(file_name + ".pbrpc.h", framework) + + FrameworkImport(file_name + ".pbobjc.h", framework) + + SystemImport("ProtoRPC/ProtoRPC.h") + + SystemImport("RxLibrary/GRXWriter+Immediate.h"); + } ::grpc::string class_imports; for (int i = 0; i < file->dependency_count(); i++) { - class_imports += ImportProtoHeaders(file->dependency(i), ""); + class_imports += ImportProtoHeaders(file->dependency(i), "", framework); } ::grpc::string definitions; diff --git a/src/compiler/ruby_generator.cc b/src/compiler/ruby_generator.cc index e39d8be5d41..2a71aae32bb 100644 --- a/src/compiler/ruby_generator.cc +++ b/src/compiler/ruby_generator.cc @@ -40,13 +40,11 @@ namespace { // Prints out the method using the ruby gRPC DSL. void PrintMethod(const MethodDescriptor* method, const grpc::string& package, Printer* out) { - grpc::string input_type = - RubyTypeOf(method->input_type()->full_name(), package); + grpc::string input_type = RubyTypeOf(method->input_type(), package); if (method->client_streaming()) { input_type = "stream(" + input_type + ")"; } - grpc::string output_type = - RubyTypeOf(method->output_type()->full_name(), package); + grpc::string output_type = RubyTypeOf(method->output_type(), package); if (method->server_streaming()) { output_type = "stream(" + output_type + ")"; } @@ -160,13 +158,7 @@ grpc::string GetServices(const FileDescriptor* file) { return output; } - std::string package_name; - - if (file->options().has_ruby_package()) { - package_name = file->options().ruby_package(); - } else { - package_name = file->package(); - } + std::string package_name = RubyPackage(file); // Write out a file header. std::map header_comment_vars = ListToDict({ diff --git a/src/compiler/ruby_generator_string-inl.h b/src/compiler/ruby_generator_string-inl.h index ecfe796e7a2..7d6b50a516d 100644 --- a/src/compiler/ruby_generator_string-inl.h +++ b/src/compiler/ruby_generator_string-inl.h @@ -100,10 +100,29 @@ inline grpc::string Modularize(grpc::string s) { return new_string; } +// RubyPackage gets the ruby package in either proto or ruby_package format +inline grpc::string RubyPackage(const grpc::protobuf::FileDescriptor* file) { + grpc::string package_name = file->package(); + if (file->options().has_ruby_package()) { + package_name = file->options().ruby_package(); + + // If :: is in the package convert the Ruby formated name + // -> A::B::C + // to use the dot seperator notation + // -> A.B.C + package_name = ReplaceAll(package_name, "::", "."); + } + return package_name; +} + // RubyTypeOf updates a proto type to the required ruby equivalent. -inline grpc::string RubyTypeOf(const grpc::string& a_type, +inline grpc::string RubyTypeOf(const grpc::protobuf::Descriptor* descriptor, const grpc::string& package) { - grpc::string res(a_type); + std::string proto_type = descriptor->full_name(); + if (descriptor->file()->options().has_ruby_package()) { + proto_type = RubyPackage(descriptor->file()) + "." + descriptor->name(); + } + grpc::string res(proto_type); ReplacePrefix(&res, package, ""); // remove the leading package if present ReplacePrefix(&res, ".", ""); // remove the leading . (no package) if (res.find('.') == grpc::string::npos) { diff --git a/src/core/ext/filters/client_channel/channel_connectivity.cc b/src/core/ext/filters/client_channel/channel_connectivity.cc index 232183d61ff..58170e66f96 100644 --- a/src/core/ext/filters/client_channel/channel_connectivity.cc +++ b/src/core/ext/filters/client_channel/channel_connectivity.cc @@ -111,6 +111,12 @@ static void finished_completion(void* pw, grpc_cq_completion* ignored) { static void partly_done(state_watcher* w, bool due_to_completion, grpc_error* error) { + bool end_op = false; + void* end_op_tag = nullptr; + grpc_error* end_op_error = nullptr; + grpc_completion_queue* end_op_cq = nullptr; + grpc_cq_completion* end_op_completion_storage = nullptr; + if (due_to_completion) { grpc_timer_cancel(&w->alarm); } else { @@ -152,8 +158,11 @@ static void partly_done(state_watcher* w, bool due_to_completion, w->error = error; } w->phase = CALLING_BACK_AND_FINISHED; - grpc_cq_end_op(w->cq, w->tag, w->error, finished_completion, w, - &w->completion_storage); + end_op = true; + end_op_cq = w->cq; + end_op_tag = w->tag; + end_op_error = w->error; + end_op_completion_storage = &w->completion_storage; break; case CALLING_BACK_AND_FINISHED: GPR_UNREACHABLE_CODE(return ); @@ -161,6 +170,11 @@ static void partly_done(state_watcher* w, bool due_to_completion, } gpr_mu_unlock(&w->mu); + if (end_op) { + grpc_cq_end_op(end_op_cq, end_op_tag, end_op_error, finished_completion, w, + end_op_completion_storage); + } + GRPC_ERROR_UNREF(error); } diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index c06e995f5a5..63bd737e931 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -320,6 +320,54 @@ class CallData { private: class QueuedPickCanceller; + class Metadata : public LoadBalancingPolicy::MetadataInterface { + public: + Metadata(CallData* calld, grpc_metadata_batch* batch) + : calld_(calld), batch_(batch) {} + + void Add(StringView key, StringView value) override { + grpc_linked_mdelem* linked_mdelem = static_cast( + calld_->arena_->Alloc(sizeof(grpc_linked_mdelem))); + linked_mdelem->md = grpc_mdelem_from_slices( + grpc_core::ExternallyManagedSlice(key.data(), key.size()), + grpc_core::ExternallyManagedSlice(value.data(), value.size())); + GPR_ASSERT(grpc_metadata_batch_link_tail(batch_, linked_mdelem) == + GRPC_ERROR_NONE); + } + + Iterator Begin() const override { + static_assert(sizeof(grpc_linked_mdelem*) <= sizeof(Iterator), + "iterator size too large"); + return reinterpret_cast(batch_->list.head); + } + bool IsEnd(Iterator it) const override { + return reinterpret_cast(it) == nullptr; + } + void Next(Iterator* it) const override { + *it = reinterpret_cast( + reinterpret_cast(*it)->next); + } + StringView Key(Iterator it) const override { + return StringView( + GRPC_MDKEY(reinterpret_cast(it)->md)); + } + StringView Value(Iterator it) const override { + return StringView( + GRPC_MDVALUE(reinterpret_cast(it)->md)); + } + + void Erase(Iterator* it) override { + grpc_linked_mdelem* linked_mdelem = + reinterpret_cast(*it); + *it = reinterpret_cast(linked_mdelem->next); + grpc_metadata_batch_remove(batch_, linked_mdelem); + } + + private: + CallData* calld_; + grpc_metadata_batch* batch_; + }; + class LbCallState : public LoadBalancingPolicy::CallState { public: explicit LbCallState(CallData* calld) : calld_(calld) {} @@ -660,7 +708,8 @@ class CallData { LbCallState lb_call_state_; RefCountedPtr connected_subchannel_; void (*lb_recv_trailing_metadata_ready_)( - void* user_data, grpc_metadata_batch* recv_trailing_metadata, + void* user_data, grpc_error* error, + LoadBalancingPolicy::MetadataInterface* recv_trailing_metadata, LoadBalancingPolicy::CallState* call_state) = nullptr; void* lb_recv_trailing_metadata_ready_user_data_ = nullptr; grpc_closure pick_closure_; @@ -1461,7 +1510,7 @@ void ChannelData::CreateResolvingLoadBalancingPolicyLocked() { UniquePtr( New(this)); lb_args.args = channel_args_; - UniquePtr target_uri(strdup(target_uri_.get())); + UniquePtr target_uri(gpr_strdup(target_uri_.get())); resolving_lb_policy_.reset(New( std::move(lb_args), &grpc_client_channel_routing_trace, std::move(target_uri), ProcessResolverResultLocked, this)); @@ -2109,9 +2158,10 @@ void CallData::RecvTrailingMetadataReadyForLoadBalancingPolicy( void* arg, grpc_error* error) { CallData* calld = static_cast(arg); // Invoke callback to LB policy. + Metadata trailing_metadata(calld, calld->recv_trailing_metadata_); calld->lb_recv_trailing_metadata_ready_( - calld->lb_recv_trailing_metadata_ready_user_data_, - calld->recv_trailing_metadata_, &calld->lb_call_state_); + calld->lb_recv_trailing_metadata_ready_user_data_, error, + &trailing_metadata, &calld->lb_call_state_); // Chain to original callback. GRPC_CLOSURE_RUN(calld->original_recv_trailing_metadata_ready_, GRPC_ERROR_REF(error)); @@ -3136,8 +3186,7 @@ void CallData::AddRetriableSendInitialMetadataOp( if (GPR_UNLIKELY(retry_state->send_initial_metadata.idx.named .grpc_previous_rpc_attempts != nullptr)) { grpc_metadata_batch_remove(&retry_state->send_initial_metadata, - retry_state->send_initial_metadata.idx.named - .grpc_previous_rpc_attempts); + GRPC_BATCH_GRPC_PREVIOUS_RPC_ATTEMPTS); } if (GPR_UNLIKELY(num_attempts_completed_ > 0)) { grpc_mdelem retry_md = grpc_mdelem_create( @@ -3147,7 +3196,7 @@ void CallData::AddRetriableSendInitialMetadataOp( &retry_state->send_initial_metadata, &retry_state ->send_initial_metadata_storage[send_initial_metadata_.list.count], - retry_md); + retry_md, GRPC_BATCH_GRPC_PREVIOUS_RPC_ATTEMPTS); if (GPR_UNLIKELY(error != GRPC_ERROR_NONE)) { gpr_log(GPR_ERROR, "error adding retry metadata: %s", grpc_error_string(error)); @@ -3716,11 +3765,13 @@ void CallData::StartPickLocked(void* arg, grpc_error* error) { // attempt) to the LB policy instead the one from the parent channel. LoadBalancingPolicy::PickArgs pick_args; pick_args.call_state = &calld->lb_call_state_; - pick_args.initial_metadata = + Metadata initial_metadata( + calld, calld->seen_send_initial_metadata_ ? &calld->send_initial_metadata_ : calld->pending_batches_[0] - .batch->payload->send_initial_metadata.send_initial_metadata; + .batch->payload->send_initial_metadata.send_initial_metadata); + pick_args.initial_metadata = &initial_metadata; // Grab initial metadata flags so that we can check later if the call has // wait_for_ready enabled. const uint32_t send_initial_metadata_flags = diff --git a/src/core/ext/filters/client_channel/client_channel_channelz.cc b/src/core/ext/filters/client_channel/client_channel_channelz.cc index a489685df40..87a76601f02 100644 --- a/src/core/ext/filters/client_channel/client_channel_channelz.cc +++ b/src/core/ext/filters/client_channel/client_channel_channelz.cc @@ -32,7 +32,8 @@ namespace channelz { SubchannelNode::SubchannelNode(const char* target_address, size_t channel_tracer_max_nodes) - : BaseNode(EntityType::kSubchannel), + : BaseNode(EntityType::kSubchannel, + UniquePtr(gpr_strdup(target_address))), target_(UniquePtr(gpr_strdup(target_address))), trace_(channel_tracer_max_nodes) {} @@ -42,8 +43,9 @@ void SubchannelNode::UpdateConnectivityState(grpc_connectivity_state state) { connectivity_state_.Store(state, MemoryOrder::RELAXED); } -void SubchannelNode::SetChildSocketUuid(intptr_t uuid) { - child_socket_uuid_.Store(uuid, MemoryOrder::RELAXED); +void SubchannelNode::SetChildSocket(RefCountedPtr socket) { + MutexLock lock(&socket_mu_); + child_socket_ = std::move(socket); } void SubchannelNode::PopulateConnectivityState(grpc_json* json) { @@ -88,14 +90,20 @@ grpc_json* SubchannelNode::RenderJson() { call_counter_.PopulateCallCounts(json); json = top_level_json; // populate the child socket. - intptr_t socket_uuid = child_socket_uuid_.Load(MemoryOrder::RELAXED); - if (socket_uuid != 0) { + RefCountedPtr child_socket; + { + MutexLock lock(&socket_mu_); + child_socket = child_socket_; + } + if (child_socket != nullptr && child_socket->uuid() != 0) { grpc_json* array_parent = grpc_json_create_child( nullptr, json, "socketRef", nullptr, GRPC_JSON_ARRAY, false); json_iterator = grpc_json_create_child(json_iterator, array_parent, nullptr, nullptr, GRPC_JSON_OBJECT, false); - grpc_json_add_number_string_child(json_iterator, nullptr, "socketId", - socket_uuid); + grpc_json* sibling_iterator = grpc_json_add_number_string_child( + json_iterator, nullptr, "socketId", child_socket->uuid()); + grpc_json_create_child(sibling_iterator, json_iterator, "name", + child_socket->name(), GRPC_JSON_STRING, false); } return top_level_json; } diff --git a/src/core/ext/filters/client_channel/client_channel_channelz.h b/src/core/ext/filters/client_channel/client_channel_channelz.h index 80a6fd230c8..5a1a1adcd1b 100644 --- a/src/core/ext/filters/client_channel/client_channel_channelz.h +++ b/src/core/ext/filters/client_channel/client_channel_channelz.h @@ -40,11 +40,10 @@ class SubchannelNode : public BaseNode { // Sets the subchannel's connectivity state without health checking. void UpdateConnectivityState(grpc_connectivity_state state); - // Used when the subchannel's child socket uuid changes. This should be set - // when the subchannel's transport is created and set to 0 when the subchannel - // unrefs the transport. A uuid of 0 indicates that the child socket is no - // longer associated with this subchannel. - void SetChildSocketUuid(intptr_t uuid); + // Used when the subchannel's child socket changes. This should be set when + // the subchannel's transport is created and set to nullptr when the + // subchannel unrefs the transport. + void SetChildSocket(RefCountedPtr socket); grpc_json* RenderJson() override; @@ -66,7 +65,8 @@ class SubchannelNode : public BaseNode { void PopulateConnectivityState(grpc_json* json); Atomic connectivity_state_{GRPC_CHANNEL_IDLE}; - Atomic child_socket_uuid_{0}; + Mutex socket_mu_; + RefCountedPtr child_socket_; UniquePtr target_; CallCountingHelper call_counter_; ChannelTrace trace_; diff --git a/src/core/ext/filters/client_channel/connector.h b/src/core/ext/filters/client_channel/connector.h index ea34dcdab57..2bd5ff26e3e 100644 --- a/src/core/ext/filters/client_channel/connector.h +++ b/src/core/ext/filters/client_channel/connector.h @@ -22,6 +22,7 @@ #include #include "src/core/lib/channel/channel_stack.h" +#include "src/core/lib/channel/channelz.h" #include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/transport/transport.h" @@ -48,8 +49,15 @@ typedef struct { /** channel arguments (to be passed to the filters) */ grpc_channel_args* channel_args; - /** socket uuid of the connected transport. 0 if not available */ - intptr_t socket_uuid; + /** channelz socket node of the connected transport. nullptr if not available + */ + grpc_core::RefCountedPtr socket; + + void reset() { + transport = nullptr; + channel_args = nullptr; + socket = nullptr; + } } grpc_connect_out_args; struct grpc_connector_vtable { diff --git a/src/core/ext/filters/client_channel/health/health.pb.c b/src/core/ext/filters/client_channel/health/health.pb.c deleted file mode 100644 index 5499c549cc6..00000000000 --- a/src/core/ext/filters/client_channel/health/health.pb.c +++ /dev/null @@ -1,23 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.7-dev */ - -#include "src/core/ext/filters/client_channel/health/health.pb.h" -/* @@protoc_insertion_point(includes) */ -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - - - -const pb_field_t grpc_health_v1_HealthCheckRequest_fields[2] = { - PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_health_v1_HealthCheckRequest, service, service, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_health_v1_HealthCheckResponse_fields[2] = { - PB_FIELD( 1, UENUM , OPTIONAL, STATIC , FIRST, grpc_health_v1_HealthCheckResponse, status, status, 0), - PB_LAST_FIELD -}; - - -/* @@protoc_insertion_point(eof) */ diff --git a/src/core/ext/filters/client_channel/health/health.pb.h b/src/core/ext/filters/client_channel/health/health.pb.h deleted file mode 100644 index 9d54ccd6182..00000000000 --- a/src/core/ext/filters/client_channel/health/health.pb.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.7-dev */ - -#ifndef PB_GRPC_HEALTH_V1_HEALTH_PB_H_INCLUDED -#define PB_GRPC_HEALTH_V1_HEALTH_PB_H_INCLUDED -#include "pb.h" -/* @@protoc_insertion_point(includes) */ -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Enum definitions */ -typedef enum _grpc_health_v1_HealthCheckResponse_ServingStatus { - grpc_health_v1_HealthCheckResponse_ServingStatus_UNKNOWN = 0, - grpc_health_v1_HealthCheckResponse_ServingStatus_SERVING = 1, - grpc_health_v1_HealthCheckResponse_ServingStatus_NOT_SERVING = 2, - grpc_health_v1_HealthCheckResponse_ServingStatus_SERVICE_UNKNOWN = 3 -} grpc_health_v1_HealthCheckResponse_ServingStatus; -#define _grpc_health_v1_HealthCheckResponse_ServingStatus_MIN grpc_health_v1_HealthCheckResponse_ServingStatus_UNKNOWN -#define _grpc_health_v1_HealthCheckResponse_ServingStatus_MAX grpc_health_v1_HealthCheckResponse_ServingStatus_SERVICE_UNKNOWN -#define _grpc_health_v1_HealthCheckResponse_ServingStatus_ARRAYSIZE ((grpc_health_v1_HealthCheckResponse_ServingStatus)(grpc_health_v1_HealthCheckResponse_ServingStatus_SERVICE_UNKNOWN+1)) - -/* Struct definitions */ -typedef struct _grpc_health_v1_HealthCheckRequest { - bool has_service; - char service[200]; -/* @@protoc_insertion_point(struct:grpc_health_v1_HealthCheckRequest) */ -} grpc_health_v1_HealthCheckRequest; - -typedef struct _grpc_health_v1_HealthCheckResponse { - bool has_status; - grpc_health_v1_HealthCheckResponse_ServingStatus status; -/* @@protoc_insertion_point(struct:grpc_health_v1_HealthCheckResponse) */ -} grpc_health_v1_HealthCheckResponse; - -/* Default values for struct fields */ - -/* Initializer values for message structs */ -#define grpc_health_v1_HealthCheckRequest_init_default {false, ""} -#define grpc_health_v1_HealthCheckResponse_init_default {false, (grpc_health_v1_HealthCheckResponse_ServingStatus)0} -#define grpc_health_v1_HealthCheckRequest_init_zero {false, ""} -#define grpc_health_v1_HealthCheckResponse_init_zero {false, (grpc_health_v1_HealthCheckResponse_ServingStatus)0} - -/* Field tags (for use in manual encoding/decoding) */ -#define grpc_health_v1_HealthCheckRequest_service_tag 1 -#define grpc_health_v1_HealthCheckResponse_status_tag 1 - -/* Struct field encoding specification for nanopb */ -extern const pb_field_t grpc_health_v1_HealthCheckRequest_fields[2]; -extern const pb_field_t grpc_health_v1_HealthCheckResponse_fields[2]; - -/* Maximum encoded size of messages (where known) */ -#define grpc_health_v1_HealthCheckRequest_size 203 -#define grpc_health_v1_HealthCheckResponse_size 2 - -/* Message IDs (where set with "msgid" option) */ -#ifdef PB_MSGID - -#define HEALTH_MESSAGES \ - - -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif -/* @@protoc_insertion_point(eof) */ - -#endif diff --git a/src/core/ext/filters/client_channel/health/health_check_client.cc b/src/core/ext/filters/client_channel/health/health_check_client.cc index a6b910b5dad..026831645c0 100644 --- a/src/core/ext/filters/client_channel/health/health_check_client.cc +++ b/src/core/ext/filters/client_channel/health/health_check_client.cc @@ -23,14 +23,12 @@ #include "src/core/ext/filters/client_channel/health/health_check_client.h" -#include "pb_decode.h" -#include "pb_encode.h" -#include "src/core/ext/filters/client_channel/health/health.pb.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/transport/error_utils.h" #include "src/core/lib/transport/status_metadata.h" +#include "src/proto/grpc/health/v1/health.upb.h" #define HEALTH_CHECK_INITIAL_CONNECT_BACKOFF_SECONDS 1 #define HEALTH_CHECK_RECONNECT_BACKOFF_MULTIPLIER 1.6 @@ -202,19 +200,16 @@ namespace { void EncodeRequest(const char* service_name, ManualConstructor* send_message) { - grpc_health_v1_HealthCheckRequest request_struct; - request_struct.has_service = true; - snprintf(request_struct.service, sizeof(request_struct.service), "%s", - service_name); - pb_ostream_t ostream; - memset(&ostream, 0, sizeof(ostream)); - pb_encode(&ostream, grpc_health_v1_HealthCheckRequest_fields, - &request_struct); - grpc_slice request_slice = GRPC_SLICE_MALLOC(ostream.bytes_written); - ostream = pb_ostream_from_buffer(GRPC_SLICE_START_PTR(request_slice), - GRPC_SLICE_LENGTH(request_slice)); - GPR_ASSERT(pb_encode(&ostream, grpc_health_v1_HealthCheckRequest_fields, - &request_struct) != 0); + upb::Arena arena; + grpc_health_v1_HealthCheckRequest* request_struct = + grpc_health_v1_HealthCheckRequest_new(arena.ptr()); + grpc_health_v1_HealthCheckRequest_set_service( + request_struct, upb_strview_makez(service_name)); + size_t buf_length; + char* buf = grpc_health_v1_HealthCheckRequest_serialize( + request_struct, arena.ptr(), &buf_length); + grpc_slice request_slice = GRPC_SLICE_MALLOC(buf_length); + memcpy(GRPC_SLICE_START_PTR(request_slice), buf, buf_length); grpc_slice_buffer slice_buffer; grpc_slice_buffer_init(&slice_buffer); grpc_slice_buffer_add(&slice_buffer, request_slice); @@ -248,24 +243,19 @@ bool DecodeResponse(grpc_slice_buffer* slice_buffer, grpc_error** error) { } } // Deserialize message. - grpc_health_v1_HealthCheckResponse response_struct; - pb_istream_t istream = - pb_istream_from_buffer(recv_message, slice_buffer->length); - if (!pb_decode(&istream, grpc_health_v1_HealthCheckResponse_fields, - &response_struct)) { + upb::Arena arena; + grpc_health_v1_HealthCheckResponse* response_struct = + grpc_health_v1_HealthCheckResponse_parse( + reinterpret_cast(recv_message), slice_buffer->length, + arena.ptr()); + if (response_struct == nullptr) { // Can't parse message; assume unhealthy. *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING( "cannot parse health check response"); return false; } - if (!response_struct.has_status) { - // Field not present; assume unhealthy. - *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING( - "status field not present in health check response"); - return false; - } - return response_struct.status == - grpc_health_v1_HealthCheckResponse_ServingStatus_SERVING; + int32_t status = grpc_health_v1_HealthCheckResponse_status(response_struct); + return status == grpc_health_v1_HealthCheckResponse_SERVING; } } // namespace @@ -356,7 +346,8 @@ void HealthCheckClient::CallState::StartCall() { &send_initial_metadata_, &path_metadata_storage_, grpc_mdelem_from_slices( GRPC_MDSTR_PATH, - GRPC_MDSTR_SLASH_GRPC_DOT_HEALTH_DOT_V1_DOT_HEALTH_SLASH_WATCH)); + GRPC_MDSTR_SLASH_GRPC_DOT_HEALTH_DOT_V1_DOT_HEALTH_SLASH_WATCH), + GRPC_BATCH_PATH); GPR_ASSERT(error == GRPC_ERROR_NONE); payload_.send_initial_metadata.send_initial_metadata = &send_initial_metadata_; diff --git a/src/core/ext/filters/client_channel/lb_policy.h b/src/core/ext/filters/client_channel/lb_policy.h index ecc235bb71b..ea4962cdb77 100644 --- a/src/core/ext/filters/client_channel/lb_policy.h +++ b/src/core/ext/filters/client_channel/lb_policy.h @@ -27,10 +27,10 @@ #include "src/core/lib/gprpp/abstract.h" #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" +#include "src/core/lib/gprpp/string_view.h" #include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/iomgr/polling_entity.h" #include "src/core/lib/transport/connectivity_state.h" -#include "src/core/lib/transport/metadata_batch.h" namespace grpc_core { @@ -92,14 +92,44 @@ class LoadBalancingPolicy : public InternallyRefCounted { GRPC_ABSTRACT_BASE_CLASS }; + /// Interface for accessing metadata. + class MetadataInterface { + public: + // Implementations whose iterators fit in intptr_t may internally + // cast this directly to their iterator type. Otherwise, they may + // dynamically allocate their iterators and store the address here. + typedef intptr_t Iterator; + + virtual ~MetadataInterface() = default; + + /// Adds a key/value pair. + /// Does NOT take ownership of \a key or \a value. + /// Implementations must ensure that the key and value remain alive + /// until the call ends. If desired, they may be allocated via + /// CallState::Alloc(). + virtual void Add(StringView key, StringView value) GRPC_ABSTRACT; + + /// Iteration interface. + virtual Iterator Begin() const GRPC_ABSTRACT; + virtual bool IsEnd(Iterator it) const GRPC_ABSTRACT; + virtual void Next(Iterator* it) const GRPC_ABSTRACT; + virtual StringView Key(Iterator it) const GRPC_ABSTRACT; + virtual StringView Value(Iterator it) const GRPC_ABSTRACT; + + /// Removes the element pointed to by \a it, which is modified to + /// point to the next element. + virtual void Erase(Iterator* it) GRPC_ABSTRACT; + + GRPC_ABSTRACT_BASE_CLASS + }; + /// Arguments used when picking a subchannel for an RPC. struct PickArgs { /// Initial metadata associated with the picking call. /// The LB policy may use the existing metadata to influence its routing /// decision, and it may add new metadata elements to be sent with the /// call to the chosen backend. - // TODO(roth): Provide a more generic metadata API here. - grpc_metadata_batch* initial_metadata = nullptr; + MetadataInterface* initial_metadata; /// An interface for accessing call state. Can be used to allocate /// data associated with the call in an efficient way. CallState* call_state; @@ -144,8 +174,11 @@ class LoadBalancingPolicy : public InternallyRefCounted { /// modified by the callback. The callback does not take ownership, /// however, so any data that needs to be used after returning must /// be copied. + // TODO(roth): Replace grpc_error with something better before we allow + // people outside of gRPC team to use this API. void (*recv_trailing_metadata_ready)( - void* user_data, grpc_metadata_batch* recv_trailing_metadata, + void* user_data, grpc_error* error, + MetadataInterface* recv_trailing_metadata, CallState* call_state) = nullptr; void* recv_trailing_metadata_ready_user_data = nullptr; }; diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc index 3bb31fe3b08..3057b26d315 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc @@ -20,9 +20,12 @@ #include "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h" +#include + #include #include +#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h" #include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/profiling/timers.h" @@ -95,22 +98,33 @@ static void start_transport_stream_op_batch( GPR_TIMER_SCOPE("clr_start_transport_stream_op_batch", 0); // Handle send_initial_metadata. if (batch->send_initial_metadata) { - // Grab client stats object from user_data for LB token metadata. - grpc_linked_mdelem* lb_token = - batch->payload->send_initial_metadata.send_initial_metadata->idx.named - .lb_token; - if (lb_token != nullptr) { + // Grab client stats object from metadata. + grpc_linked_mdelem* client_stats_md = + batch->payload->send_initial_metadata.send_initial_metadata->list.head; + for (; client_stats_md != nullptr; + client_stats_md = client_stats_md->next) { + if (GRPC_SLICE_START_PTR(GRPC_MDKEY(client_stats_md->md)) == + static_cast(grpc_core::kGrpcLbClientStatsMetadataKey)) { + break; + } + } + if (client_stats_md != nullptr) { grpc_core::GrpcLbClientStats* client_stats = - static_cast(grpc_mdelem_get_user_data( - lb_token->md, grpc_core::GrpcLbClientStats::Destroy)); + const_cast( + reinterpret_cast( + GRPC_SLICE_START_PTR(GRPC_MDVALUE(client_stats_md->md)))); if (client_stats != nullptr) { - calld->client_stats = client_stats->Ref(); + calld->client_stats.reset(client_stats); // Intercept completion. calld->original_on_complete_for_send = batch->on_complete; GRPC_CLOSURE_INIT(&calld->on_complete_for_send, on_complete_for_send, calld, grpc_schedule_on_exec_ctx); batch->on_complete = &calld->on_complete_for_send; } + // Remove metadata so it doesn't go out on the wire. + grpc_metadata_batch_remove( + batch->payload->send_initial_metadata.send_initial_metadata, + client_stats_md); } } // Intercept completion of recv_initial_metadata. diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc index 2eb1d9d4237..6a565e057b9 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc @@ -108,11 +108,15 @@ #define GRPC_GRPCLB_DEFAULT_FALLBACK_TIMEOUT_MS 10000 #define GRPC_ARG_GRPCLB_ADDRESS_LB_TOKEN "grpc.grpclb_address_lb_token" +#define GRPC_ARG_GRPCLB_ADDRESS_CLIENT_STATS "grpc.grpclb_address_client_stats" namespace grpc_core { TraceFlag grpc_lb_glb_trace(false, "glb"); +const char kGrpcLbClientStatsMetadataKey[] = "grpclb_client_stats"; +const char kGrpcLbLbTokenMetadataKey[] = "lb-token"; + namespace { constexpr char kGrpclb[] = "grpclb"; @@ -405,18 +409,18 @@ void ParseServer(const grpc_grpclb_server* server, const uint16_t netorder_port = grpc_htons((uint16_t)server->port); /* the addresses are given in binary format (a in(6)_addr struct) in * server->ip_address.bytes. */ - const grpc_grpclb_ip_address* ip = &server->ip_address; - if (ip->size == 4) { + const grpc_grpclb_server_ip_address& ip = server->ip_address; + if (ip.size == 4) { addr->len = static_cast(sizeof(grpc_sockaddr_in)); grpc_sockaddr_in* addr4 = reinterpret_cast(&addr->addr); addr4->sin_family = GRPC_AF_INET; - memcpy(&addr4->sin_addr, ip->bytes, ip->size); + memcpy(&addr4->sin_addr, ip.data, ip.size); addr4->sin_port = netorder_port; - } else if (ip->size == 16) { + } else if (ip.size == 16) { addr->len = static_cast(sizeof(grpc_sockaddr_in6)); grpc_sockaddr_in6* addr6 = (grpc_sockaddr_in6*)&addr->addr; addr6->sin6_family = GRPC_AF_INET6; - memcpy(&addr6->sin6_addr, ip->bytes, ip->size); + memcpy(&addr6->sin6_addr, ip.data, ip.size); addr6->sin6_port = netorder_port; } } @@ -445,28 +449,48 @@ UniquePtr GrpcLb::Serverlist::AsText() const { return result; } -// vtable for LB token channel arg. +// vtables for channel args for LB token and client stats. void* lb_token_copy(void* token) { - return token == nullptr - ? nullptr - : (void*)GRPC_MDELEM_REF(grpc_mdelem{(uintptr_t)token}).payload; + return gpr_strdup(static_cast(token)); } -void lb_token_destroy(void* token) { - if (token != nullptr) { - GRPC_MDELEM_UNREF(grpc_mdelem{(uintptr_t)token}); - } +void lb_token_destroy(void* token) { gpr_free(token); } +void* client_stats_copy(void* p) { + GrpcLbClientStats* client_stats = static_cast(p); + client_stats->Ref().release(); + return p; +} +void client_stats_destroy(void* p) { + GrpcLbClientStats* client_stats = static_cast(p); + client_stats->Unref(); } -int lb_token_cmp(void* token1, void* token2) { +int equal_cmp(void* p1, void* p2) { // Always indicate a match, since we don't want this channel arg to // affect the subchannel's key in the index. + // TODO(roth): Is this right? This does prevent us from needlessly + // recreating the subchannel whenever the LB token or client stats + // changes (i.e., when the balancer call is terminated and reestablished). + // However, it means that we don't actually recreate the subchannel, + // which means that we won't ever switch over to using the new LB + // token or client stats. A better approach might be to find somewhere + // other than the subchannel args to store the LB token and client + // stats. They could be stored in a map and then looked up for each + // call (although we'd need to make sure our Map<> implementation is + // performant enough). Or we could do something more complicated whereby + // we create our own subchannel wrapper to store them, although that would + // involve a lot of refcounting overhead. + // Given that we're trying to move from grpclb to xds at this point, + // and that no one has actually reported any problems with this, we + // probably won't bother fixing this at this point. return 0; } const grpc_arg_pointer_vtable lb_token_arg_vtable = { - lb_token_copy, lb_token_destroy, lb_token_cmp}; + lb_token_copy, lb_token_destroy, equal_cmp}; +const grpc_arg_pointer_vtable client_stats_arg_vtable = { + client_stats_copy, client_stats_destroy, equal_cmp}; bool IsServerValid(const grpc_grpclb_server* server, size_t idx, bool log) { if (server->drop) return false; - const grpc_grpclb_ip_address* ip = &server->ip_address; + const grpc_grpclb_server_ip_address& ip = server->ip_address; if (GPR_UNLIKELY(server->port >> 16 != 0)) { if (log) { gpr_log(GPR_ERROR, @@ -475,12 +499,12 @@ bool IsServerValid(const grpc_grpclb_server* server, size_t idx, bool log) { } return false; } - if (GPR_UNLIKELY(ip->size != 4 && ip->size != 16)) { + if (GPR_UNLIKELY(ip.size != 4 && ip.size != 16)) { if (log) { gpr_log(GPR_ERROR, "Expected IP to be 4 or 16 bytes, got %d at index %lu of " "serverlist. Ignoring", - ip->size, (unsigned long)idx); + ip.size, (unsigned long)idx); } return false; } @@ -498,20 +522,14 @@ ServerAddressList GrpcLb::Serverlist::GetServerAddressList( grpc_resolved_address addr; ParseServer(server, &addr); // LB token processing. - grpc_mdelem lb_token; - if (server->has_load_balance_token) { + char lb_token[GPR_ARRAY_SIZE(server->load_balance_token) + 1]; + if (server->load_balance_token[0] != 0) { const size_t lb_token_max_length = GPR_ARRAY_SIZE(server->load_balance_token); const size_t lb_token_length = strnlen(server->load_balance_token, lb_token_max_length); - grpc_slice lb_token_mdstr = grpc_slice_from_copied_buffer( - server->load_balance_token, lb_token_length); - lb_token = grpc_mdelem_from_slices(GRPC_MDSTR_LB_TOKEN, lb_token_mdstr); - if (client_stats != nullptr) { - GPR_ASSERT(grpc_mdelem_set_user_data( - lb_token, GrpcLbClientStats::Destroy, - client_stats->Ref().release()) == client_stats); - } + memcpy(lb_token, server->load_balance_token, lb_token_length); + lb_token[lb_token_length] = '\0'; } else { char* uri = grpc_sockaddr_to_uri(&addr); gpr_log(GPR_INFO, @@ -519,16 +537,21 @@ ServerAddressList GrpcLb::Serverlist::GetServerAddressList( "be used instead", uri); gpr_free(uri); - lb_token = GRPC_MDELEM_LB_TOKEN_EMPTY; + lb_token[0] = '\0'; } // Add address. - grpc_arg arg = grpc_channel_arg_pointer_create( - const_cast(GRPC_ARG_GRPCLB_ADDRESS_LB_TOKEN), - (void*)lb_token.payload, &lb_token_arg_vtable); - grpc_channel_args* args = grpc_channel_args_copy_and_add(nullptr, &arg, 1); + InlinedVector args_to_add; + args_to_add.emplace_back(grpc_channel_arg_pointer_create( + const_cast(GRPC_ARG_GRPCLB_ADDRESS_LB_TOKEN), lb_token, + &lb_token_arg_vtable)); + if (client_stats != nullptr) { + args_to_add.emplace_back(grpc_channel_arg_pointer_create( + const_cast(GRPC_ARG_GRPCLB_ADDRESS_CLIENT_STATS), client_stats, + &client_stats_arg_vtable)); + } + grpc_channel_args* args = grpc_channel_args_copy_and_add( + nullptr, args_to_add.data(), args_to_add.size()); addresses.emplace_back(addr, args); - // Clean up. - GRPC_MDELEM_UNREF(lb_token); } return addresses; } @@ -573,25 +596,35 @@ GrpcLb::PickResult GrpcLb::Picker::Pick(PickArgs args) { // If pick succeeded, add LB token to initial metadata. if (result.type == PickResult::PICK_COMPLETE && result.subchannel != nullptr) { - const grpc_arg* arg = grpc_channel_args_find( - result.subchannel->channel_args(), GRPC_ARG_GRPCLB_ADDRESS_LB_TOKEN); + // Encode client stats object into metadata for use by + // client_load_reporting filter. + const grpc_arg* arg = + grpc_channel_args_find(result.subchannel->channel_args(), + GRPC_ARG_GRPCLB_ADDRESS_CLIENT_STATS); + if (arg != nullptr && arg->type == GRPC_ARG_POINTER && + arg->value.pointer.p != nullptr) { + GrpcLbClientStats* client_stats = + static_cast(arg->value.pointer.p); + client_stats->Ref().release(); // Ref passed via metadata. + // The metadata value is a hack: we pretend the pointer points to + // a string and rely on the client_load_reporting filter to know + // how to interpret it. + args.initial_metadata->Add( + kGrpcLbClientStatsMetadataKey, + StringView(reinterpret_cast(client_stats), 0)); + // Update calls-started. + client_stats->AddCallStarted(); + } + // Encode the LB token in metadata. + arg = grpc_channel_args_find(result.subchannel->channel_args(), + GRPC_ARG_GRPCLB_ADDRESS_LB_TOKEN); if (arg == nullptr) { gpr_log(GPR_ERROR, "[grpclb %p picker %p] No LB token for subchannel %p", parent_, this, result.subchannel.get()); abort(); } - grpc_mdelem lb_token = {reinterpret_cast(arg->value.pointer.p)}; - GPR_ASSERT(!GRPC_MDISNULL(lb_token)); - grpc_linked_mdelem* mdelem_storage = static_cast( - args.call_state->Alloc(sizeof(grpc_linked_mdelem))); - GPR_ASSERT(grpc_metadata_batch_add_tail( - args.initial_metadata, mdelem_storage, - GRPC_MDELEM_REF(lb_token)) == GRPC_ERROR_NONE); - GrpcLbClientStats* client_stats = static_cast( - grpc_mdelem_get_user_data(lb_token, GrpcLbClientStats::Destroy)); - if (client_stats != nullptr) { - client_stats->AddCallStarted(); - } + args.initial_metadata->Add(kGrpcLbLbTokenMetadataKey, + static_cast(arg->value.pointer.p)); } return result; } @@ -757,13 +790,14 @@ GrpcLb::BalancerCallState::BalancerCallState( GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD, nullptr, deadline, nullptr); // Init the LB call request payload. + upb::Arena arena; grpc_grpclb_request* request = - grpc_grpclb_request_create(grpclb_policy()->server_name_); - grpc_slice request_payload_slice = grpc_grpclb_request_encode(request); + grpc_grpclb_request_create(grpclb_policy()->server_name_, arena.ptr()); + grpc_slice request_payload_slice = + grpc_grpclb_request_encode(request, arena.ptr()); send_message_payload_ = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_slice_unref_internal(request_payload_slice); - grpc_grpclb_request_destroy(request); // Init other data associated with the LB call. grpc_metadata_array_init(&lb_initial_metadata_recv_); grpc_metadata_array_init(&lb_trailing_metadata_recv_); @@ -907,27 +941,32 @@ void GrpcLb::BalancerCallState::MaybeSendClientLoadReportLocked( bool GrpcLb::BalancerCallState::LoadReportCountersAreZero( grpc_grpclb_request* request) { - GrpcLbClientStats::DroppedCallCounts* drop_entries = - static_cast( - request->client_stats.calls_finished_with_drop.arg); - return request->client_stats.num_calls_started == 0 && - request->client_stats.num_calls_finished == 0 && - request->client_stats.num_calls_finished_with_client_failed_to_send == + const grpc_lb_v1_ClientStats* cstats = + grpc_lb_v1_LoadBalanceRequest_client_stats(request); + if (cstats == nullptr) { + return true; + } + size_t drop_count; + grpc_lb_v1_ClientStats_calls_finished_with_drop(cstats, &drop_count); + return grpc_lb_v1_ClientStats_num_calls_started(cstats) == 0 && + grpc_lb_v1_ClientStats_num_calls_finished(cstats) == 0 && + grpc_lb_v1_ClientStats_num_calls_finished_with_client_failed_to_send( + cstats) == 0 && + grpc_lb_v1_ClientStats_num_calls_finished_known_received(cstats) == 0 && - request->client_stats.num_calls_finished_known_received == 0 && - (drop_entries == nullptr || drop_entries->size() == 0); + drop_count == 0; } void GrpcLb::BalancerCallState::SendClientLoadReportLocked() { // Construct message payload. GPR_ASSERT(send_message_payload_ == nullptr); + upb::Arena arena; grpc_grpclb_request* request = - grpc_grpclb_load_report_request_create(client_stats_.get()); + grpc_grpclb_load_report_request_create(client_stats_.get(), arena.ptr()); // Skip client load report if the counters were all zero in the last // report and they are still zero in this one. if (LoadReportCountersAreZero(request)) { if (last_client_load_report_counters_were_zero_) { - grpc_grpclb_request_destroy(request); ScheduleNextClientLoadReportLocked(); return; } @@ -935,11 +974,11 @@ void GrpcLb::BalancerCallState::SendClientLoadReportLocked() { } else { last_client_load_report_counters_were_zero_ = false; } - grpc_slice request_payload_slice = grpc_grpclb_request_encode(request); + grpc_slice request_payload_slice = + grpc_grpclb_request_encode(request, arena.ptr()); send_message_payload_ = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_slice_unref_internal(request_payload_slice); - grpc_grpclb_request_destroy(request); // Send the report. grpc_op op; memset(&op, 0, sizeof(op)); @@ -1001,16 +1040,20 @@ void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked( grpc_byte_buffer_reader_destroy(&bbr); grpc_byte_buffer_destroy(lb_calld->recv_message_payload_); lb_calld->recv_message_payload_ = nullptr; - grpc_grpclb_initial_response* initial_response; + const grpc_grpclb_initial_response* initial_response; grpc_grpclb_serverlist* serverlist; + upb::Arena arena; if (!lb_calld->seen_initial_response_ && - (initial_response = grpc_grpclb_initial_response_parse(response_slice)) != - nullptr) { + (initial_response = grpc_grpclb_initial_response_parse( + response_slice, arena.ptr())) != nullptr) { // Have NOT seen initial response, look for initial response. - if (initial_response->has_client_stats_report_interval) { - lb_calld->client_stats_report_interval_ = GPR_MAX( - GPR_MS_PER_SEC, grpc_grpclb_duration_to_millis( - &initial_response->client_stats_report_interval)); + const google_protobuf_Duration* client_stats_report_interval = + grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval( + initial_response); + if (client_stats_report_interval != nullptr) { + lb_calld->client_stats_report_interval_ = + GPR_MAX(GPR_MS_PER_SEC, + grpc_grpclb_duration_to_millis(client_stats_report_interval)); if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { gpr_log(GPR_INFO, "[grpclb %p] lb_calld=%p: Received initial LB response " @@ -1025,7 +1068,6 @@ void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked( "client load reporting NOT enabled", grpclb_policy, lb_calld); } - grpc_grpclb_initial_response_destroy(initial_response); lb_calld->seen_initial_response_ = true; } else if ((serverlist = grpc_grpclb_response_parse_serverlist( response_slice)) != nullptr) { @@ -1411,10 +1453,10 @@ void GrpcLb::UpdateLocked(UpdateArgs args) { // Returns the backend addresses extracted from the given addresses. ServerAddressList ExtractBackendAddresses(const ServerAddressList& addresses) { - void* lb_token = (void*)GRPC_MDELEM_LB_TOKEN_EMPTY.payload; + static const char* lb_token = ""; grpc_arg arg = grpc_channel_arg_pointer_create( - const_cast(GRPC_ARG_GRPCLB_ADDRESS_LB_TOKEN), lb_token, - &lb_token_arg_vtable); + const_cast(GRPC_ARG_GRPCLB_ADDRESS_LB_TOKEN), + const_cast(lb_token), &lb_token_arg_vtable); ServerAddressList backend_addresses; for (size_t i = 0; i < addresses.size(); ++i) { if (!addresses[i].IsBalancer()) { @@ -1826,7 +1868,12 @@ bool maybe_add_client_load_reporting_filter(grpc_channel_stack_builder* builder, grpc_channel_args_find(args, GRPC_ARG_LB_POLICY_NAME); if (channel_arg != nullptr && channel_arg->type == GRPC_ARG_STRING && strcmp(channel_arg->value.string, "grpclb") == 0) { - return grpc_channel_stack_builder_append_filter( + // TODO(roth): When we get around to re-attempting + // https://github.com/grpc/grpc/pull/16214, we should try to keep + // this filter at the very top of the subchannel stack, since that + // will minimize the number of metadata elements that the filter + // needs to iterate through to find the ClientStats object. + return grpc_channel_stack_builder_prepend_filter( builder, (const grpc_channel_filter*)arg, nullptr, nullptr); } return true; diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h index 4d39c4d504b..a032b5dbf1d 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h @@ -32,5 +32,12 @@ #define GRPC_ARG_ADDRESS_IS_BACKEND_FROM_GRPCLB_LOAD_BALANCER \ "grpc.address_is_backend_from_grpclb_load_balancer" +namespace grpc_core { + +extern const char kGrpcLbClientStatsMetadataKey[]; +extern const char kGrpcLbLbTokenMetadataKey[]; + +} // namespace grpc_core + #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H \ */ diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc index 22cefc937b0..68097e14a4e 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc @@ -18,213 +18,154 @@ #include -#include "pb_decode.h" -#include "pb_encode.h" #include "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h" +#include "src/core/lib/gpr/useful.h" -#include - -/* invoked once for every Server in ServerList */ -static bool count_serverlist(pb_istream_t* stream, const pb_field_t* field, - void** arg) { - grpc_grpclb_serverlist* sl = static_cast(*arg); - grpc_grpclb_server server; - if (GPR_UNLIKELY(!pb_decode(stream, grpc_lb_v1_Server_fields, &server))) { - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(stream)); - return false; - } - ++sl->num_servers; - return true; -} - -typedef struct decode_serverlist_arg { - /* The decoding callback is invoked once per server in serverlist. Remember - * which index of the serverlist are we currently decoding */ - size_t decoding_idx; - /* The decoded serverlist */ - grpc_grpclb_serverlist* serverlist; -} decode_serverlist_arg; +#include "google/protobuf/duration.upb.h" +#include "google/protobuf/timestamp.upb.h" -/* invoked once for every Server in ServerList */ -static bool decode_serverlist(pb_istream_t* stream, const pb_field_t* field, - void** arg) { - decode_serverlist_arg* dec_arg = static_cast(*arg); - GPR_ASSERT(dec_arg->serverlist->num_servers >= dec_arg->decoding_idx); - grpc_grpclb_server* server = - static_cast(gpr_zalloc(sizeof(grpc_grpclb_server))); - if (GPR_UNLIKELY(!pb_decode(stream, grpc_lb_v1_Server_fields, server))) { - gpr_free(server); - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(stream)); - return false; - } - dec_arg->serverlist->servers[dec_arg->decoding_idx++] = server; - return true; -} +#include -grpc_grpclb_request* grpc_grpclb_request_create(const char* lb_service_name) { - grpc_grpclb_request* req = static_cast( - gpr_malloc(sizeof(grpc_grpclb_request))); - req->has_client_stats = false; - req->has_initial_request = true; - req->initial_request.has_name = true; - // GCC warns (-Wstringop-truncation) because the destination - // buffer size is identical to max-size, leading to a potential - // char[] with no null terminator. nanopb can handle it fine, - // and parantheses around strncpy silence that compiler warning. - (strncpy(req->initial_request.name, lb_service_name, - GRPC_GRPCLB_SERVICE_NAME_MAX_LENGTH)); +namespace grpc_core { + +grpc_grpclb_request* grpc_grpclb_request_create(const char* lb_service_name, + upb_arena* arena) { + grpc_grpclb_request* req = grpc_lb_v1_LoadBalanceRequest_new(arena); + grpc_lb_v1_InitialLoadBalanceRequest* initial_request = + grpc_lb_v1_LoadBalanceRequest_mutable_initial_request(req, arena); + size_t name_len = + GPR_MIN(strlen(lb_service_name), GRPC_GRPCLB_SERVICE_NAME_MAX_LENGTH); + grpc_lb_v1_InitialLoadBalanceRequest_set_name( + initial_request, upb_strview_make(lb_service_name, name_len)); return req; } -static void populate_timestamp(gpr_timespec timestamp, - grpc_grpclb_timestamp* timestamp_pb) { - timestamp_pb->has_seconds = true; - timestamp_pb->seconds = timestamp.tv_sec; - timestamp_pb->has_nanos = true; - timestamp_pb->nanos = timestamp.tv_nsec; -} +namespace { -static bool encode_string(pb_ostream_t* stream, const pb_field_t* field, - void* const* arg) { - char* str = static_cast(*arg); - if (!pb_encode_tag_for_field(stream, field)) return false; - return pb_encode_string(stream, reinterpret_cast(str), strlen(str)); +void google_protobuf_Timestamp_assign(google_protobuf_Timestamp* timestamp, + const gpr_timespec& value) { + google_protobuf_Timestamp_set_seconds(timestamp, value.tv_sec); + google_protobuf_Timestamp_set_nanos(timestamp, value.tv_nsec); } -static bool encode_drops(pb_ostream_t* stream, const pb_field_t* field, - void* const* arg) { - grpc_core::GrpcLbClientStats::DroppedCallCounts* drop_entries = - static_cast(*arg); - if (drop_entries == nullptr) return true; - for (size_t i = 0; i < drop_entries->size(); ++i) { - if (!pb_encode_tag_for_field(stream, field)) return false; - grpc_lb_v1_ClientStatsPerToken drop_message; - drop_message.load_balance_token.funcs.encode = encode_string; - drop_message.load_balance_token.arg = (*drop_entries)[i].token.get(); - drop_message.has_num_calls = true; - drop_message.num_calls = (*drop_entries)[i].count; - if (!pb_encode_submessage(stream, grpc_lb_v1_ClientStatsPerToken_fields, - &drop_message)) { - return false; - } - } - return true; -} +} // namespace grpc_grpclb_request* grpc_grpclb_load_report_request_create( - grpc_core::GrpcLbClientStats* client_stats) { - grpc_grpclb_request* req = static_cast( - gpr_zalloc(sizeof(grpc_grpclb_request))); - req->has_client_stats = true; - req->client_stats.has_timestamp = true; - populate_timestamp(gpr_now(GPR_CLOCK_REALTIME), &req->client_stats.timestamp); - req->client_stats.has_num_calls_started = true; - req->client_stats.has_num_calls_finished = true; - req->client_stats.has_num_calls_finished_with_client_failed_to_send = true; - req->client_stats.has_num_calls_finished_with_client_failed_to_send = true; - req->client_stats.has_num_calls_finished_known_received = true; - req->client_stats.calls_finished_with_drop.funcs.encode = encode_drops; - grpc_core::UniquePtr - drop_counts; - client_stats->Get( - &req->client_stats.num_calls_started, - &req->client_stats.num_calls_finished, - &req->client_stats.num_calls_finished_with_client_failed_to_send, - &req->client_stats.num_calls_finished_known_received, &drop_counts); - // Will be deleted in grpc_grpclb_request_destroy(). - req->client_stats.calls_finished_with_drop.arg = drop_counts.release(); + GrpcLbClientStats* client_stats, upb_arena* arena) { + grpc_grpclb_request* req = grpc_lb_v1_LoadBalanceRequest_new(arena); + grpc_lb_v1_ClientStats* req_stats = + grpc_lb_v1_LoadBalanceRequest_mutable_client_stats(req, arena); + google_protobuf_Timestamp_assign( + grpc_lb_v1_ClientStats_mutable_timestamp(req_stats, arena), + gpr_now(GPR_CLOCK_REALTIME)); + + int64_t num_calls_started; + int64_t num_calls_finished; + int64_t num_calls_finished_with_client_failed_to_send; + int64_t num_calls_finished_known_received; + UniquePtr drop_token_counts; + client_stats->Get(&num_calls_started, &num_calls_finished, + &num_calls_finished_with_client_failed_to_send, + &num_calls_finished_known_received, &drop_token_counts); + grpc_lb_v1_ClientStats_set_num_calls_started(req_stats, num_calls_started); + grpc_lb_v1_ClientStats_set_num_calls_finished(req_stats, num_calls_finished); + grpc_lb_v1_ClientStats_set_num_calls_finished_with_client_failed_to_send( + req_stats, num_calls_finished_with_client_failed_to_send); + grpc_lb_v1_ClientStats_set_num_calls_finished_known_received( + req_stats, num_calls_finished_known_received); + if (drop_token_counts != nullptr) { + for (size_t i = 0; i < drop_token_counts->size(); ++i) { + GrpcLbClientStats::DropTokenCount& cur = (*drop_token_counts)[i]; + grpc_lb_v1_ClientStatsPerToken* cur_msg = + grpc_lb_v1_ClientStats_add_calls_finished_with_drop(req_stats, arena); + + const size_t token_len = strlen(cur.token.get()); + char* token = reinterpret_cast(upb_arena_malloc(arena, token_len)); + memcpy(token, cur.token.get(), token_len); + + grpc_lb_v1_ClientStatsPerToken_set_load_balance_token( + cur_msg, upb_strview_make(token, token_len)); + grpc_lb_v1_ClientStatsPerToken_set_num_calls(cur_msg, cur.count); + } + } return req; } -grpc_slice grpc_grpclb_request_encode(const grpc_grpclb_request* request) { - size_t encoded_length; - pb_ostream_t sizestream; - pb_ostream_t outputstream; - grpc_slice slice; - memset(&sizestream, 0, sizeof(pb_ostream_t)); - pb_encode(&sizestream, grpc_lb_v1_LoadBalanceRequest_fields, request); - encoded_length = sizestream.bytes_written; - - slice = GRPC_SLICE_MALLOC(encoded_length); - outputstream = - pb_ostream_from_buffer(GRPC_SLICE_START_PTR(slice), encoded_length); - GPR_ASSERT(pb_encode(&outputstream, grpc_lb_v1_LoadBalanceRequest_fields, - request) != 0); - return slice; -} - -void grpc_grpclb_request_destroy(grpc_grpclb_request* request) { - if (request->has_client_stats) { - grpc_core::GrpcLbClientStats::DroppedCallCounts* drop_entries = - static_cast( - request->client_stats.calls_finished_with_drop.arg); - grpc_core::Delete(drop_entries); - } - gpr_free(request); +grpc_slice grpc_grpclb_request_encode(const grpc_grpclb_request* request, + upb_arena* arena) { + size_t buf_length; + char* buf = + grpc_lb_v1_LoadBalanceRequest_serialize(request, arena, &buf_length); + return grpc_slice_from_copied_buffer(buf, buf_length); } -typedef grpc_lb_v1_LoadBalanceResponse grpc_grpclb_response; -grpc_grpclb_initial_response* grpc_grpclb_initial_response_parse( - const grpc_slice& encoded_grpc_grpclb_response) { - pb_istream_t stream = pb_istream_from_buffer( - const_cast(GRPC_SLICE_START_PTR(encoded_grpc_grpclb_response)), - GRPC_SLICE_LENGTH(encoded_grpc_grpclb_response)); - grpc_grpclb_response res; - memset(&res, 0, sizeof(grpc_grpclb_response)); - if (GPR_UNLIKELY( - !pb_decode(&stream, grpc_lb_v1_LoadBalanceResponse_fields, &res))) { - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&stream)); +const grpc_grpclb_initial_response* grpc_grpclb_initial_response_parse( + const grpc_slice& encoded_grpc_grpclb_response, upb_arena* arena) { + grpc_lb_v1_LoadBalanceResponse* response = + grpc_lb_v1_LoadBalanceResponse_parse( + reinterpret_cast( + GRPC_SLICE_START_PTR(encoded_grpc_grpclb_response)), + GRPC_SLICE_LENGTH(encoded_grpc_grpclb_response), arena); + if (response == nullptr) { + gpr_log(GPR_ERROR, "grpc_lb_v1_LoadBalanceResponse parse error"); return nullptr; } - - if (!res.has_initial_response) return nullptr; - - grpc_grpclb_initial_response* initial_res = - static_cast( - gpr_malloc(sizeof(grpc_grpclb_initial_response))); - memcpy(initial_res, &res.initial_response, - sizeof(grpc_grpclb_initial_response)); - - return initial_res; + return grpc_lb_v1_LoadBalanceResponse_initial_response(response); } grpc_grpclb_serverlist* grpc_grpclb_response_parse_serverlist( const grpc_slice& encoded_grpc_grpclb_response) { - pb_istream_t stream = pb_istream_from_buffer( - const_cast(GRPC_SLICE_START_PTR(encoded_grpc_grpclb_response)), - GRPC_SLICE_LENGTH(encoded_grpc_grpclb_response)); - pb_istream_t stream_at_start = stream; - grpc_grpclb_serverlist* sl = static_cast( + upb::Arena arena; + grpc_lb_v1_LoadBalanceResponse* response = + grpc_lb_v1_LoadBalanceResponse_parse( + reinterpret_cast( + GRPC_SLICE_START_PTR(encoded_grpc_grpclb_response)), + GRPC_SLICE_LENGTH(encoded_grpc_grpclb_response), arena.ptr()); + if (response == nullptr) { + gpr_log(GPR_ERROR, "grpc_lb_v1_LoadBalanceResponse parse error"); + return nullptr; + } + grpc_grpclb_serverlist* server_list = static_cast( gpr_zalloc(sizeof(grpc_grpclb_serverlist))); - grpc_grpclb_response res; - memset(&res, 0, sizeof(grpc_grpclb_response)); // First pass: count number of servers. - res.server_list.servers.funcs.decode = count_serverlist; - res.server_list.servers.arg = sl; - bool status = pb_decode(&stream, grpc_lb_v1_LoadBalanceResponse_fields, &res); - if (GPR_UNLIKELY(!status)) { - gpr_free(sl); - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&stream)); - return nullptr; + const grpc_lb_v1_ServerList* server_list_msg = + grpc_lb_v1_LoadBalanceResponse_server_list(response); + size_t server_count = 0; + const grpc_lb_v1_Server* const* servers = nullptr; + if (server_list_msg != nullptr) { + servers = grpc_lb_v1_ServerList_servers(server_list_msg, &server_count); } // Second pass: populate servers. - if (sl->num_servers > 0) { - sl->servers = static_cast( - gpr_zalloc(sizeof(grpc_grpclb_server*) * sl->num_servers)); - decode_serverlist_arg decode_arg; - memset(&decode_arg, 0, sizeof(decode_arg)); - decode_arg.serverlist = sl; - res.server_list.servers.funcs.decode = decode_serverlist; - res.server_list.servers.arg = &decode_arg; - status = pb_decode(&stream_at_start, grpc_lb_v1_LoadBalanceResponse_fields, - &res); - if (GPR_UNLIKELY(!status)) { - grpc_grpclb_destroy_serverlist(sl); - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&stream)); - return nullptr; + if (server_count > 0) { + server_list->servers = static_cast( + gpr_zalloc(sizeof(grpc_grpclb_server*) * server_count)); + server_list->num_servers = server_count; + for (size_t i = 0; i < server_count; ++i) { + grpc_grpclb_server* cur = server_list->servers[i] = + static_cast( + gpr_zalloc(sizeof(grpc_grpclb_server))); + upb_strview address = grpc_lb_v1_Server_ip_address(servers[i]); + if (address.size == 0) { + ; // Nothing to do because cur->ip_address is an empty string. + } else if (address.size <= GRPC_GRPCLB_SERVER_IP_ADDRESS_MAX_SIZE) { + cur->ip_address.size = static_cast(address.size); + memcpy(cur->ip_address.data, address.data, address.size); + } + cur->port = grpc_lb_v1_Server_port(servers[i]); + upb_strview token = grpc_lb_v1_Server_load_balance_token(servers[i]); + if (token.size == 0) { + ; // Nothing to do because cur->load_balance_token is an empty string. + } else if (token.size <= GRPC_GRPCLB_SERVER_LOAD_BALANCE_TOKEN_MAX_SIZE) { + memcpy(cur->load_balance_token, token.data, token.size); + } else { + gpr_log(GPR_ERROR, + "grpc_lb_v1_LoadBalanceResponse has too long token. len=%zu", + token.size); + } + cur->drop = grpc_lb_v1_Server_drop(servers[i]); } } - return sl; + return server_list; } void grpc_grpclb_destroy_serverlist(grpc_grpclb_serverlist* serverlist) { @@ -239,16 +180,17 @@ void grpc_grpclb_destroy_serverlist(grpc_grpclb_serverlist* serverlist) { } grpc_grpclb_serverlist* grpc_grpclb_serverlist_copy( - const grpc_grpclb_serverlist* sl) { + const grpc_grpclb_serverlist* server_list) { grpc_grpclb_serverlist* copy = static_cast( gpr_zalloc(sizeof(grpc_grpclb_serverlist))); - copy->num_servers = sl->num_servers; + copy->num_servers = server_list->num_servers; copy->servers = static_cast( - gpr_malloc(sizeof(grpc_grpclb_server*) * sl->num_servers)); - for (size_t i = 0; i < sl->num_servers; i++) { + gpr_malloc(sizeof(grpc_grpclb_server*) * server_list->num_servers)); + for (size_t i = 0; i < server_list->num_servers; i++) { copy->servers[i] = static_cast( gpr_malloc(sizeof(grpc_grpclb_server))); - memcpy(copy->servers[i], sl->servers[i], sizeof(grpc_grpclb_server)); + memcpy(copy->servers[i], server_list->servers[i], + sizeof(grpc_grpclb_server)); } return copy; } @@ -274,38 +216,11 @@ bool grpc_grpclb_server_equals(const grpc_grpclb_server* lhs, return memcmp(lhs, rhs, sizeof(grpc_grpclb_server)) == 0; } -int grpc_grpclb_duration_compare(const grpc_grpclb_duration* lhs, - const grpc_grpclb_duration* rhs) { - GPR_ASSERT(lhs && rhs); - if (lhs->has_seconds && rhs->has_seconds) { - if (lhs->seconds < rhs->seconds) return -1; - if (lhs->seconds > rhs->seconds) return 1; - } else if (lhs->has_seconds) { - return 1; - } else if (rhs->has_seconds) { - return -1; - } - - GPR_ASSERT(lhs->seconds == rhs->seconds); - if (lhs->has_nanos && rhs->has_nanos) { - if (lhs->nanos < rhs->nanos) return -1; - if (lhs->nanos > rhs->nanos) return 1; - } else if (lhs->has_nanos) { - return 1; - } else if (rhs->has_nanos) { - return -1; - } - - return 0; -} - -grpc_millis grpc_grpclb_duration_to_millis(grpc_grpclb_duration* duration_pb) { +grpc_millis grpc_grpclb_duration_to_millis( + const grpc_grpclb_duration* duration_pb) { return static_cast( - (duration_pb->has_seconds ? duration_pb->seconds : 0) * GPR_MS_PER_SEC + - (duration_pb->has_nanos ? duration_pb->nanos : 0) / GPR_NS_PER_MS); + google_protobuf_Duration_seconds(duration_pb) * GPR_MS_PER_SEC + + google_protobuf_Duration_nanos(duration_pb) / GPR_NS_PER_MS); } -void grpc_grpclb_initial_response_destroy( - grpc_grpclb_initial_response* response) { - gpr_free(response); -} +} // namespace grpc_core diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h index 8005f6fe301..3062e9526ae 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h @@ -24,38 +24,57 @@ #include #include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h" -#include "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h" #include "src/core/lib/iomgr/exec_ctx.h" +#include "src/proto/grpc/lb/v1/load_balancer.upb.h" #define GRPC_GRPCLB_SERVICE_NAME_MAX_LENGTH 128 +#define GRPC_GRPCLB_SERVER_IP_ADDRESS_MAX_SIZE 16 +#define GRPC_GRPCLB_SERVER_LOAD_BALANCE_TOKEN_MAX_SIZE 50 + +namespace grpc_core { -typedef grpc_lb_v1_Server_ip_address_t grpc_grpclb_ip_address; typedef grpc_lb_v1_LoadBalanceRequest grpc_grpclb_request; +typedef grpc_lb_v1_LoadBalanceResponse grpc_grpclb_response; typedef grpc_lb_v1_InitialLoadBalanceResponse grpc_grpclb_initial_response; -typedef grpc_lb_v1_Server grpc_grpclb_server; typedef google_protobuf_Duration grpc_grpclb_duration; typedef google_protobuf_Timestamp grpc_grpclb_timestamp; +typedef struct { + int32_t size; + char data[GRPC_GRPCLB_SERVER_IP_ADDRESS_MAX_SIZE]; +} grpc_grpclb_server_ip_address; + +// Contains server information. When the drop field is not true, use the other +// fields. +typedef struct { + grpc_grpclb_server_ip_address ip_address; + int32_t port; + char load_balance_token[GRPC_GRPCLB_SERVER_LOAD_BALANCE_TOKEN_MAX_SIZE]; + bool drop; +} grpc_grpclb_server; + typedef struct { grpc_grpclb_server** servers; size_t num_servers; } grpc_grpclb_serverlist; -/** Create a request for a gRPC LB service under \a lb_service_name */ -grpc_grpclb_request* grpc_grpclb_request_create(const char* lb_service_name); +/** + * Create a request for a gRPC LB service under \a lb_service_name. + * \a lb_service_name should be alive when returned request is being used. + */ +grpc_grpclb_request* grpc_grpclb_request_create(const char* lb_service_name, + upb_arena* arena); grpc_grpclb_request* grpc_grpclb_load_report_request_create( - grpc_core::GrpcLbClientStats* client_stats); + grpc_core::GrpcLbClientStats* client_stats, upb_arena* arena); /** Protocol Buffers v3-encode \a request */ -grpc_slice grpc_grpclb_request_encode(const grpc_grpclb_request* request); - -/** Destroy \a request */ -void grpc_grpclb_request_destroy(grpc_grpclb_request* request); +grpc_slice grpc_grpclb_request_encode(const grpc_grpclb_request* request, + upb_arena* arena); /** Parse (ie, decode) the bytes in \a encoded_grpc_grpclb_response as a \a * grpc_grpclb_initial_response */ -grpc_grpclb_initial_response* grpc_grpclb_initial_response_parse( - const grpc_slice& encoded_grpc_grpclb_response); +const grpc_grpclb_initial_response* grpc_grpclb_initial_response_parse( + const grpc_slice& encoded_grpc_grpclb_response, upb_arena* arena); /** Parse the list of servers from an encoded \a grpc_grpclb_response */ grpc_grpclb_serverlist* grpc_grpclb_response_parse_serverlist( @@ -75,16 +94,10 @@ bool grpc_grpclb_server_equals(const grpc_grpclb_server* lhs, /** Destroy \a serverlist */ void grpc_grpclb_destroy_serverlist(grpc_grpclb_serverlist* serverlist); -/** Compare \a lhs against \a rhs and return 0 if \a lhs and \a rhs are equal, - * < 0 if \a lhs represents a duration shorter than \a rhs and > 0 otherwise */ -int grpc_grpclb_duration_compare(const grpc_grpclb_duration* lhs, - const grpc_grpclb_duration* rhs); - -grpc_millis grpc_grpclb_duration_to_millis(grpc_grpclb_duration* duration_pb); +grpc_millis grpc_grpclb_duration_to_millis( + const grpc_grpclb_duration* duration_pb); -/** Destroy \a initial_response */ -void grpc_grpclb_initial_response_destroy( - grpc_grpclb_initial_response* response); +} // namespace grpc_core #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_LOAD_BALANCER_API_H \ */ diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c deleted file mode 100644 index 131d9b7cae0..00000000000 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c +++ /dev/null @@ -1,19 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.7-dev */ - -#include "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h" -/* @@protoc_insertion_point(includes) */ -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - - - -const pb_field_t google_protobuf_Duration_fields[3] = { - PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, google_protobuf_Duration, seconds, seconds, 0), - PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, google_protobuf_Duration, nanos, seconds, 0), - PB_LAST_FIELD -}; - - -/* @@protoc_insertion_point(eof) */ diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h deleted file mode 100644 index 93070c65b83..00000000000 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.7-dev */ - -#ifndef PB_GOOGLE_PROTOBUF_DURATION_PB_H_INCLUDED -#define PB_GOOGLE_PROTOBUF_DURATION_PB_H_INCLUDED -#include "pb.h" -/* @@protoc_insertion_point(includes) */ -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Struct definitions */ -typedef struct _google_protobuf_Duration { - bool has_seconds; - int64_t seconds; - bool has_nanos; - int32_t nanos; -/* @@protoc_insertion_point(struct:google_protobuf_Duration) */ -} google_protobuf_Duration; - -/* Default values for struct fields */ - -/* Initializer values for message structs */ -#define google_protobuf_Duration_init_default {false, 0, false, 0} -#define google_protobuf_Duration_init_zero {false, 0, false, 0} - -/* Field tags (for use in manual encoding/decoding) */ -#define google_protobuf_Duration_seconds_tag 1 -#define google_protobuf_Duration_nanos_tag 2 - -/* Struct field encoding specification for nanopb */ -extern const pb_field_t google_protobuf_Duration_fields[3]; - -/* Maximum encoded size of messages (where known) */ -#define google_protobuf_Duration_size 22 - -/* Message IDs (where set with "msgid" option) */ -#ifdef PB_MSGID - -#define DURATION_MESSAGES \ - - -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif -/* @@protoc_insertion_point(eof) */ - -#endif diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c deleted file mode 100644 index b6f8ffc5592..00000000000 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c +++ /dev/null @@ -1,19 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.7-dev */ - -#include "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h" -/* @@protoc_insertion_point(includes) */ -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - - - -const pb_field_t google_protobuf_Timestamp_fields[3] = { - PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, google_protobuf_Timestamp, seconds, seconds, 0), - PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, google_protobuf_Timestamp, nanos, seconds, 0), - PB_LAST_FIELD -}; - - -/* @@protoc_insertion_point(eof) */ diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h deleted file mode 100644 index 7f484815244..00000000000 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.7-dev */ - -#ifndef PB_GOOGLE_PROTOBUF_TIMESTAMP_PB_H_INCLUDED -#define PB_GOOGLE_PROTOBUF_TIMESTAMP_PB_H_INCLUDED -#include "pb.h" -/* @@protoc_insertion_point(includes) */ -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Struct definitions */ -typedef struct _google_protobuf_Timestamp { - bool has_seconds; - int64_t seconds; - bool has_nanos; - int32_t nanos; -/* @@protoc_insertion_point(struct:google_protobuf_Timestamp) */ -} google_protobuf_Timestamp; - -/* Default values for struct fields */ - -/* Initializer values for message structs */ -#define google_protobuf_Timestamp_init_default {false, 0, false, 0} -#define google_protobuf_Timestamp_init_zero {false, 0, false, 0} - -/* Field tags (for use in manual encoding/decoding) */ -#define google_protobuf_Timestamp_seconds_tag 1 -#define google_protobuf_Timestamp_nanos_tag 2 - -/* Struct field encoding specification for nanopb */ -extern const pb_field_t google_protobuf_Timestamp_fields[3]; - -/* Maximum encoded size of messages (where known) */ -#define google_protobuf_Timestamp_size 22 - -/* Message IDs (where set with "msgid" option) */ -#ifdef PB_MSGID - -#define TIMESTAMP_MESSAGES \ - - -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif -/* @@protoc_insertion_point(eof) */ - -#endif diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c deleted file mode 100644 index f6538e1349f..00000000000 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c +++ /dev/null @@ -1,89 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.7-dev */ - -#include "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h" -/* @@protoc_insertion_point(includes) */ -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - - - -const pb_field_t grpc_lb_v1_LoadBalanceRequest_fields[3] = { - PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v1_LoadBalanceRequest, initial_request, initial_request, &grpc_lb_v1_InitialLoadBalanceRequest_fields), - PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v1_LoadBalanceRequest, client_stats, initial_request, &grpc_lb_v1_ClientStats_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v1_InitialLoadBalanceRequest_fields[2] = { - PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v1_InitialLoadBalanceRequest, name, name, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v1_ClientStatsPerToken_fields[3] = { - PB_FIELD( 1, STRING , OPTIONAL, CALLBACK, FIRST, grpc_lb_v1_ClientStatsPerToken, load_balance_token, load_balance_token, 0), - PB_FIELD( 2, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStatsPerToken, num_calls, load_balance_token, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v1_ClientStats_fields[7] = { - PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v1_ClientStats, timestamp, timestamp, &google_protobuf_Timestamp_fields), - PB_FIELD( 2, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, num_calls_started, timestamp, 0), - PB_FIELD( 3, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, num_calls_finished, num_calls_started, 0), - PB_FIELD( 6, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, num_calls_finished_with_client_failed_to_send, num_calls_finished, 0), - PB_FIELD( 7, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, num_calls_finished_known_received, num_calls_finished_with_client_failed_to_send, 0), - PB_FIELD( 8, MESSAGE , REPEATED, CALLBACK, OTHER, grpc_lb_v1_ClientStats, calls_finished_with_drop, num_calls_finished_known_received, &grpc_lb_v1_ClientStatsPerToken_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v1_LoadBalanceResponse_fields[3] = { - PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v1_LoadBalanceResponse, initial_response, initial_response, &grpc_lb_v1_InitialLoadBalanceResponse_fields), - PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v1_LoadBalanceResponse, server_list, initial_response, &grpc_lb_v1_ServerList_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v1_InitialLoadBalanceResponse_fields[3] = { - PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v1_InitialLoadBalanceResponse, load_balancer_delegate, load_balancer_delegate, 0), - PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v1_InitialLoadBalanceResponse, client_stats_report_interval, load_balancer_delegate, &google_protobuf_Duration_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v1_ServerList_fields[2] = { - PB_FIELD( 1, MESSAGE , REPEATED, CALLBACK, FIRST, grpc_lb_v1_ServerList, servers, servers, &grpc_lb_v1_Server_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v1_Server_fields[5] = { - PB_FIELD( 1, BYTES , OPTIONAL, STATIC , FIRST, grpc_lb_v1_Server, ip_address, ip_address, 0), - PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Server, port, ip_address, 0), - PB_FIELD( 3, STRING , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Server, load_balance_token, port, 0), - PB_FIELD( 4, BOOL , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Server, drop, load_balance_token, 0), - PB_LAST_FIELD -}; - - -/* Check that field information fits in pb_field_t */ -#if !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_32BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in 8 or 16 bit - * field descriptors. - */ -PB_STATIC_ASSERT((pb_membersize(grpc_lb_v1_LoadBalanceRequest, initial_request) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceRequest, client_stats) < 65536 && pb_membersize(grpc_lb_v1_ClientStats, timestamp) < 65536 && pb_membersize(grpc_lb_v1_ClientStats, calls_finished_with_drop) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, initial_response) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, server_list) < 65536 && pb_membersize(grpc_lb_v1_InitialLoadBalanceResponse, client_stats_report_interval) < 65536 && pb_membersize(grpc_lb_v1_ServerList, servers) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_lb_v1_LoadBalanceRequest_grpc_lb_v1_InitialLoadBalanceRequest_grpc_lb_v1_ClientStatsPerToken_grpc_lb_v1_ClientStats_grpc_lb_v1_LoadBalanceResponse_grpc_lb_v1_InitialLoadBalanceResponse_grpc_lb_v1_ServerList_grpc_lb_v1_Server) -#endif - -#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_16BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in the default - * 8 bit descriptors. - */ -PB_STATIC_ASSERT((pb_membersize(grpc_lb_v1_LoadBalanceRequest, initial_request) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceRequest, client_stats) < 256 && pb_membersize(grpc_lb_v1_ClientStats, timestamp) < 256 && pb_membersize(grpc_lb_v1_ClientStats, calls_finished_with_drop) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, initial_response) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, server_list) < 256 && pb_membersize(grpc_lb_v1_InitialLoadBalanceResponse, client_stats_report_interval) < 256 && pb_membersize(grpc_lb_v1_ServerList, servers) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_lb_v1_LoadBalanceRequest_grpc_lb_v1_InitialLoadBalanceRequest_grpc_lb_v1_ClientStatsPerToken_grpc_lb_v1_ClientStats_grpc_lb_v1_LoadBalanceResponse_grpc_lb_v1_InitialLoadBalanceResponse_grpc_lb_v1_ServerList_grpc_lb_v1_Server) -#endif - - -/* @@protoc_insertion_point(eof) */ diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h deleted file mode 100644 index a4ff516d8e1..00000000000 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h +++ /dev/null @@ -1,164 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.7-dev */ - -#ifndef PB_GRPC_LB_V1_LOAD_BALANCER_PB_H_INCLUDED -#define PB_GRPC_LB_V1_LOAD_BALANCER_PB_H_INCLUDED -#include "pb.h" -#include "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h" -#include "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h" -/* @@protoc_insertion_point(includes) */ -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Struct definitions */ -typedef struct _grpc_lb_v1_ServerList { - pb_callback_t servers; -/* @@protoc_insertion_point(struct:grpc_lb_v1_ServerList) */ -} grpc_lb_v1_ServerList; - -typedef struct _grpc_lb_v1_ClientStats { - bool has_timestamp; - google_protobuf_Timestamp timestamp; - bool has_num_calls_started; - int64_t num_calls_started; - bool has_num_calls_finished; - int64_t num_calls_finished; - bool has_num_calls_finished_with_client_failed_to_send; - int64_t num_calls_finished_with_client_failed_to_send; - bool has_num_calls_finished_known_received; - int64_t num_calls_finished_known_received; - pb_callback_t calls_finished_with_drop; -/* @@protoc_insertion_point(struct:grpc_lb_v1_ClientStats) */ -} grpc_lb_v1_ClientStats; - -typedef struct _grpc_lb_v1_ClientStatsPerToken { - pb_callback_t load_balance_token; - bool has_num_calls; - int64_t num_calls; -/* @@protoc_insertion_point(struct:grpc_lb_v1_ClientStatsPerToken) */ -} grpc_lb_v1_ClientStatsPerToken; - -typedef struct _grpc_lb_v1_InitialLoadBalanceRequest { - bool has_name; - char name[128]; -/* @@protoc_insertion_point(struct:grpc_lb_v1_InitialLoadBalanceRequest) */ -} grpc_lb_v1_InitialLoadBalanceRequest; - -typedef struct _grpc_lb_v1_InitialLoadBalanceResponse { - bool has_load_balancer_delegate; - char load_balancer_delegate[64]; - bool has_client_stats_report_interval; - google_protobuf_Duration client_stats_report_interval; -/* @@protoc_insertion_point(struct:grpc_lb_v1_InitialLoadBalanceResponse) */ -} grpc_lb_v1_InitialLoadBalanceResponse; - -typedef PB_BYTES_ARRAY_T(16) grpc_lb_v1_Server_ip_address_t; -typedef struct _grpc_lb_v1_Server { - bool has_ip_address; - grpc_lb_v1_Server_ip_address_t ip_address; - bool has_port; - int32_t port; - bool has_load_balance_token; - char load_balance_token[50]; - bool has_drop; - bool drop; -/* @@protoc_insertion_point(struct:grpc_lb_v1_Server) */ -} grpc_lb_v1_Server; - -typedef struct _grpc_lb_v1_LoadBalanceRequest { - bool has_initial_request; - grpc_lb_v1_InitialLoadBalanceRequest initial_request; - bool has_client_stats; - grpc_lb_v1_ClientStats client_stats; -/* @@protoc_insertion_point(struct:grpc_lb_v1_LoadBalanceRequest) */ -} grpc_lb_v1_LoadBalanceRequest; - -typedef struct _grpc_lb_v1_LoadBalanceResponse { - bool has_initial_response; - grpc_lb_v1_InitialLoadBalanceResponse initial_response; - bool has_server_list; - grpc_lb_v1_ServerList server_list; -/* @@protoc_insertion_point(struct:grpc_lb_v1_LoadBalanceResponse) */ -} grpc_lb_v1_LoadBalanceResponse; - -/* Default values for struct fields */ - -/* Initializer values for message structs */ -#define grpc_lb_v1_LoadBalanceRequest_init_default {false, grpc_lb_v1_InitialLoadBalanceRequest_init_default, false, grpc_lb_v1_ClientStats_init_default} -#define grpc_lb_v1_InitialLoadBalanceRequest_init_default {false, ""} -#define grpc_lb_v1_ClientStatsPerToken_init_default {{{NULL}, NULL}, false, 0} -#define grpc_lb_v1_ClientStats_init_default {false, google_protobuf_Timestamp_init_default, false, 0, false, 0, false, 0, false, 0, {{NULL}, NULL}} -#define grpc_lb_v1_LoadBalanceResponse_init_default {false, grpc_lb_v1_InitialLoadBalanceResponse_init_default, false, grpc_lb_v1_ServerList_init_default} -#define grpc_lb_v1_InitialLoadBalanceResponse_init_default {false, "", false, google_protobuf_Duration_init_default} -#define grpc_lb_v1_ServerList_init_default {{{NULL}, NULL}} -#define grpc_lb_v1_Server_init_default {false, {0, {0}}, false, 0, false, "", false, 0} -#define grpc_lb_v1_LoadBalanceRequest_init_zero {false, grpc_lb_v1_InitialLoadBalanceRequest_init_zero, false, grpc_lb_v1_ClientStats_init_zero} -#define grpc_lb_v1_InitialLoadBalanceRequest_init_zero {false, ""} -#define grpc_lb_v1_ClientStatsPerToken_init_zero {{{NULL}, NULL}, false, 0} -#define grpc_lb_v1_ClientStats_init_zero {false, google_protobuf_Timestamp_init_zero, false, 0, false, 0, false, 0, false, 0, {{NULL}, NULL}} -#define grpc_lb_v1_LoadBalanceResponse_init_zero {false, grpc_lb_v1_InitialLoadBalanceResponse_init_zero, false, grpc_lb_v1_ServerList_init_zero} -#define grpc_lb_v1_InitialLoadBalanceResponse_init_zero {false, "", false, google_protobuf_Duration_init_zero} -#define grpc_lb_v1_ServerList_init_zero {{{NULL}, NULL}} -#define grpc_lb_v1_Server_init_zero {false, {0, {0}}, false, 0, false, "", false, 0} - -/* Field tags (for use in manual encoding/decoding) */ -#define grpc_lb_v1_ServerList_servers_tag 1 -#define grpc_lb_v1_ClientStats_timestamp_tag 1 -#define grpc_lb_v1_ClientStats_num_calls_started_tag 2 -#define grpc_lb_v1_ClientStats_num_calls_finished_tag 3 -#define grpc_lb_v1_ClientStats_num_calls_finished_with_client_failed_to_send_tag 6 -#define grpc_lb_v1_ClientStats_num_calls_finished_known_received_tag 7 -#define grpc_lb_v1_ClientStats_calls_finished_with_drop_tag 8 -#define grpc_lb_v1_ClientStatsPerToken_load_balance_token_tag 1 -#define grpc_lb_v1_ClientStatsPerToken_num_calls_tag 2 -#define grpc_lb_v1_InitialLoadBalanceRequest_name_tag 1 -#define grpc_lb_v1_InitialLoadBalanceResponse_load_balancer_delegate_tag 1 -#define grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval_tag 2 -#define grpc_lb_v1_Server_ip_address_tag 1 -#define grpc_lb_v1_Server_port_tag 2 -#define grpc_lb_v1_Server_load_balance_token_tag 3 -#define grpc_lb_v1_Server_drop_tag 4 -#define grpc_lb_v1_LoadBalanceRequest_initial_request_tag 1 -#define grpc_lb_v1_LoadBalanceRequest_client_stats_tag 2 -#define grpc_lb_v1_LoadBalanceResponse_initial_response_tag 1 -#define grpc_lb_v1_LoadBalanceResponse_server_list_tag 2 - -/* Struct field encoding specification for nanopb */ -extern const pb_field_t grpc_lb_v1_LoadBalanceRequest_fields[3]; -extern const pb_field_t grpc_lb_v1_InitialLoadBalanceRequest_fields[2]; -extern const pb_field_t grpc_lb_v1_ClientStatsPerToken_fields[3]; -extern const pb_field_t grpc_lb_v1_ClientStats_fields[7]; -extern const pb_field_t grpc_lb_v1_LoadBalanceResponse_fields[3]; -extern const pb_field_t grpc_lb_v1_InitialLoadBalanceResponse_fields[3]; -extern const pb_field_t grpc_lb_v1_ServerList_fields[2]; -extern const pb_field_t grpc_lb_v1_Server_fields[5]; - -/* Maximum encoded size of messages (where known) */ -#define grpc_lb_v1_LoadBalanceRequest_size (140 + grpc_lb_v1_ClientStats_size) -#define grpc_lb_v1_InitialLoadBalanceRequest_size 131 -/* grpc_lb_v1_ClientStatsPerToken_size depends on runtime parameters */ -/* grpc_lb_v1_ClientStats_size depends on runtime parameters */ -#define grpc_lb_v1_LoadBalanceResponse_size (98 + grpc_lb_v1_ServerList_size) -#define grpc_lb_v1_InitialLoadBalanceResponse_size 90 -/* grpc_lb_v1_ServerList_size depends on runtime parameters */ -#define grpc_lb_v1_Server_size 83 - -/* Message IDs (where set with "msgid" option) */ -#ifdef PB_MSGID - -#define LOAD_BALANCER_MESSAGES \ - - -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif -/* @@protoc_insertion_point(eof) */ - -#endif diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc b/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc index 9721972511a..75fa544c80a 100644 --- a/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc +++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc @@ -108,6 +108,8 @@ #define GRPC_XDS_RECONNECT_MAX_BACKOFF_SECONDS 120 #define GRPC_XDS_RECONNECT_JITTER 0.2 #define GRPC_XDS_DEFAULT_FALLBACK_TIMEOUT_MS 10000 +#define GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS 1000 +#define GRPC_XDS_DEFAULT_LOCALITY_RETENTION_INTERVAL_MS (15 * 60 * 1000) namespace grpc_core { @@ -116,10 +118,6 @@ TraceFlag grpc_lb_xds_trace(false, "xds"); namespace { constexpr char kXds[] = "xds_experimental"; -constexpr char kDefaultLocalityRegion[] = "xds_default_locality_region"; -constexpr char kDefaultLocalityZone[] = "xds_default_locality_zone"; -constexpr char kDefaultLocalitySubzone[] = "xds_default_locality_subzone"; -constexpr uint32_t kDefaultLocalityWeight = 3; class ParsedXdsConfig : public LoadBalancingPolicy::Config { public: @@ -158,98 +156,192 @@ class XdsLb : public LoadBalancingPolicy { void ResetBackoffLocked() override; private: - struct LocalityServerlistEntry; - using LocalityList = InlinedVector, 1>; - - /// Contains a channel to the LB server and all the data related to the - /// channel. - class BalancerChannelState - : public InternallyRefCounted { + // Contains a channel to the LB server and all the data related to the + // channel. Holds a ref to the xds policy. + class LbChannelState : public InternallyRefCounted { public: - /// Contains a call to the LB server and all the data related to the call. - class BalancerCallState : public InternallyRefCounted { + // An LB call wrapper that can restart a call upon failure. Holds a ref to + // the LB channel. The template parameter is the kind of wrapped LB call. + template + class RetryableLbCall : public InternallyRefCounted> { public: - explicit BalancerCallState(RefCountedPtr lb_chand); + explicit RetryableLbCall(RefCountedPtr lb_chand); - // It's the caller's responsibility to ensure that Orphan() is called from - // inside the combiner. void Orphan() override; - void StartQuery(); + void OnCallFinishedLocked(); - RefCountedPtr client_stats() const { - return client_stats_; - } + T* lb_calld() const { return lb_calld_.get(); } + LbChannelState* lb_chand() const { return lb_chand_.get(); } + + private: + void StartNewCallLocked(); + void StartRetryTimerLocked(); + static void OnRetryTimerLocked(void* arg, grpc_error* error); + + // The wrapped LB call that talks to the LB server. It's instantiated + // every time we start a new call. It's null during call retry backoff. + OrphanablePtr lb_calld_; + // The owing LB channel. + RefCountedPtr lb_chand_; + + // Retry state. + BackOff backoff_; + grpc_timer retry_timer_; + grpc_closure on_retry_timer_; + bool retry_timer_callback_pending_ = false; + + bool shutting_down_ = false; + }; + + // Contains an EDS call to the LB server. + class EdsCallState : public InternallyRefCounted { + public: + // The ctor and dtor should not be used directly. + explicit EdsCallState( + RefCountedPtr> parent); + ~EdsCallState() override; + + void Orphan() override; - bool seen_initial_response() const { return seen_initial_response_; } + RetryableLbCall* parent() const { return parent_.get(); } + LbChannelState* lb_chand() const { return parent_->lb_chand(); } + XdsLb* xdslb_policy() const { return lb_chand()->xdslb_policy(); } + bool seen_response() const { return seen_response_; } private: - GRPC_ALLOW_CLASS_TO_USE_NON_PUBLIC_DELETE + static void OnResponseReceivedLocked(void* arg, grpc_error* error); + static void OnStatusReceivedLocked(void* arg, grpc_error* error); - ~BalancerCallState(); + bool IsCurrentCallOnChannel() const; - XdsLb* xdslb_policy() const { return lb_chand_->xdslb_policy_.get(); } + // The owning RetryableLbCall<>. + RefCountedPtr> parent_; + bool seen_response_ = false; - bool IsCurrentCallOnChannel() const { - return this == lb_chand_->lb_calld_.get(); - } + // Always non-NULL. + grpc_call* lb_call_; + + // recv_initial_metadata + grpc_metadata_array initial_metadata_recv_; + + // send_message + grpc_byte_buffer* send_message_payload_ = nullptr; + + // recv_message + grpc_byte_buffer* recv_message_payload_ = nullptr; + grpc_closure on_response_received_; + + // recv_trailing_metadata + grpc_metadata_array trailing_metadata_recv_; + grpc_status_code status_code_; + grpc_slice status_details_; + grpc_closure on_status_received_; + }; + + // Contains an LRS call to the LB server. + class LrsCallState : public InternallyRefCounted { + public: + // The ctor and dtor should not be used directly. + explicit LrsCallState( + RefCountedPtr> parent); + ~LrsCallState() override; + + void Orphan() override; + + void MaybeStartReportingLocked(); + + RetryableLbCall* parent() { return parent_.get(); } + LbChannelState* lb_chand() const { return parent_->lb_chand(); } + XdsLb* xdslb_policy() const { return lb_chand()->xdslb_policy(); } + bool seen_response() const { return seen_response_; } + + private: + // Reports client-side load stats according to a fixed interval. + class Reporter : public InternallyRefCounted { + public: + Reporter(RefCountedPtr parent, + grpc_millis report_interval) + : parent_(std::move(parent)), report_interval_(report_interval) { + GRPC_CLOSURE_INIT( + &on_next_report_timer_, OnNextReportTimerLocked, this, + grpc_combiner_scheduler(xdslb_policy()->combiner())); + GRPC_CLOSURE_INIT( + &on_report_done_, OnReportDoneLocked, this, + grpc_combiner_scheduler(xdslb_policy()->combiner())); + ScheduleNextReportLocked(); + } - void ScheduleNextClientLoadReportLocked(); - void SendClientLoadReportLocked(); + void Orphan() override; - static bool LoadReportCountersAreZero(xds_grpclb_request* request); + private: + void ScheduleNextReportLocked(); + static void OnNextReportTimerLocked(void* arg, grpc_error* error); + void SendReportLocked(); + static void OnReportDoneLocked(void* arg, grpc_error* error); + + bool IsCurrentReporterOnCall() const { + return this == parent_->reporter_.get(); + } + XdsLb* xdslb_policy() const { return parent_->xdslb_policy(); } + + // The owning LRS call. + RefCountedPtr parent_; + + // The load reporting state. + const grpc_millis report_interval_; + bool last_report_counters_were_zero_ = false; + bool next_report_timer_callback_pending_ = false; + grpc_timer next_report_timer_; + grpc_closure on_next_report_timer_; + grpc_closure on_report_done_; + }; - static void MaybeSendClientLoadReportLocked(void* arg, grpc_error* error); static void OnInitialRequestSentLocked(void* arg, grpc_error* error); - static void OnBalancerMessageReceivedLocked(void* arg, grpc_error* error); - static void OnBalancerStatusReceivedLocked(void* arg, grpc_error* error); + static void OnResponseReceivedLocked(void* arg, grpc_error* error); + static void OnStatusReceivedLocked(void* arg, grpc_error* error); + + bool IsCurrentCallOnChannel() const; - // The owning LB channel. - RefCountedPtr lb_chand_; + // The owning RetryableLbCall<>. + RefCountedPtr> parent_; + bool seen_response_ = false; - // The streaming call to the LB server. Always non-NULL. - grpc_call* lb_call_ = nullptr; + // Always non-NULL. + grpc_call* lb_call_; // recv_initial_metadata - grpc_metadata_array lb_initial_metadata_recv_; + grpc_metadata_array initial_metadata_recv_; // send_message grpc_byte_buffer* send_message_payload_ = nullptr; - grpc_closure lb_on_initial_request_sent_; + grpc_closure on_initial_request_sent_; // recv_message grpc_byte_buffer* recv_message_payload_ = nullptr; - grpc_closure lb_on_balancer_message_received_; - bool seen_initial_response_ = false; + grpc_closure on_response_received_; // recv_trailing_metadata - grpc_closure lb_on_balancer_status_received_; - grpc_metadata_array lb_trailing_metadata_recv_; - grpc_status_code lb_call_status_; - grpc_slice lb_call_status_details_; - - // The stats for client-side load reporting associated with this LB call. - // Created after the first serverlist is received. - RefCountedPtr client_stats_; - grpc_millis client_stats_report_interval_ = 0; - grpc_timer client_load_report_timer_; - bool client_load_report_timer_callback_pending_ = false; - bool last_client_load_report_counters_were_zero_ = false; - bool client_load_report_is_due_ = false; - // The closure used for either the load report timer or the callback for - // completion of sending the load report. - grpc_closure client_load_report_closure_; + grpc_metadata_array trailing_metadata_recv_; + grpc_status_code status_code_; + grpc_slice status_details_; + grpc_closure on_status_received_; + + // Load reporting state. + grpc_millis load_reporting_interval_ = 0; + OrphanablePtr reporter_; }; - BalancerChannelState(const char* balancer_name, - const grpc_channel_args& args, - RefCountedPtr parent_xdslb_policy); - ~BalancerChannelState(); + LbChannelState(RefCountedPtr xdslb_policy, const char* balancer_name, + const grpc_channel_args& args); + ~LbChannelState(); void Orphan() override; grpc_channel* channel() const { return channel_; } - BalancerCallState* lb_calld() const { return lb_calld_.get(); } + XdsLb* xdslb_policy() const { return xdslb_policy_.get(); } + EdsCallState* eds_calld() const { return eds_calld_->lb_calld(); } + LrsCallState* lrs_calld() const { return lrs_calld_->lb_calld(); } bool IsCurrentChannel() const { return this == xdslb_policy_->lb_chand_.get(); @@ -257,11 +349,7 @@ class XdsLb : public LoadBalancingPolicy { bool IsPendingChannel() const { return this == xdslb_policy_->pending_lb_chand_.get(); } - bool HasActiveCall() const { return lb_calld_ != nullptr; } - - void StartCallRetryTimerLocked(); - static void OnCallRetryTimerLocked(void* arg, grpc_error* error); - void StartCallLocked(); + bool HasActiveEdsCall() const { return eds_calld_->lb_calld() != nullptr; } void StartConnectivityWatchLocked(); void CancelConnectivityWatchLocked(); @@ -277,29 +365,35 @@ class XdsLb : public LoadBalancingPolicy { grpc_connectivity_state connectivity_ = GRPC_CHANNEL_IDLE; grpc_closure on_connectivity_changed_; - // The data associated with the current LB call. It holds a ref to this LB - // channel. It's instantiated every time we query for backends. It's reset - // whenever the current LB call is no longer needed (e.g., the LB policy is - // shutting down, or the LB call has ended). A non-NULL lb_calld_ always - // contains a non-NULL lb_call_. - OrphanablePtr lb_calld_; - BackOff lb_call_backoff_; - grpc_timer lb_call_retry_timer_; - grpc_closure lb_on_call_retry_; - bool retry_timer_callback_pending_ = false; + // The retryable XDS calls to the LB server. + OrphanablePtr> eds_calld_; + OrphanablePtr> lrs_calld_; }; - // Since pickers are UniquePtrs we use this RefCounted wrapper - // to control references to it by the xds picker and the locality - // entry - class PickerRef : public RefCounted { + // We need this wrapper for the following reasons: + // 1. To process per-locality load reporting. + // 2. Since pickers are UniquePtrs we use this RefCounted wrapper to control + // references to it by the xds picker and the locality entry. + class PickerWrapper : public RefCounted { public: - explicit PickerRef(UniquePtr picker) - : picker_(std::move(picker)) {} - PickResult Pick(PickArgs args) { return picker_->Pick(args); } + PickerWrapper(UniquePtr picker, + RefCountedPtr locality_stats) + : picker_(std::move(picker)), + locality_stats_(std::move(locality_stats)) { + locality_stats_->RefByPicker(); + } + ~PickerWrapper() { locality_stats_->UnrefByPicker(); } + + PickResult Pick(PickArgs args); private: + static void RecordCallCompletion( + void* arg, grpc_error* error, + LoadBalancingPolicy::MetadataInterface* recv_trailing_metadata, + LoadBalancingPolicy::CallState* call_state); + UniquePtr picker_; + RefCountedPtr locality_stats_; }; // The picker will use a stateless weighting algorithm to pick the locality to @@ -311,18 +405,21 @@ class XdsLb : public LoadBalancingPolicy { // proportional to the locality's weight. The start of the range is the // previous value in the vector and is 0 for the first element. using PickerList = - InlinedVector>, 1>; - Picker(RefCountedPtr client_stats, PickerList pickers) - : client_stats_(std::move(client_stats)), - pickers_(std::move(pickers)) {} + InlinedVector>, 1>; + Picker(RefCountedPtr xds_policy, PickerList pickers) + : xds_policy_(std::move(xds_policy)), + pickers_(std::move(pickers)), + drop_config_(xds_policy_->drop_config_) {} PickResult Pick(PickArgs args) override; private: - // Calls the picker of the locality that the key falls within + // Calls the picker of the locality that the key falls within. PickResult PickFromLocality(const uint32_t key, PickArgs args); - RefCountedPtr client_stats_; + + RefCountedPtr xds_policy_; PickerList pickers_; + RefCountedPtr drop_config_; }; class FallbackHelper : public ChannelControlHelper { @@ -351,63 +448,30 @@ class XdsLb : public LoadBalancingPolicy { LoadBalancingPolicy* child_ = nullptr; }; - class LocalityName : public RefCounted { - public: - struct Less { - bool operator()(const RefCountedPtr& lhs, - const RefCountedPtr& rhs) { - int cmp_result = strcmp(lhs->region_.get(), rhs->region_.get()); - if (cmp_result != 0) return cmp_result < 0; - cmp_result = strcmp(lhs->zone_.get(), rhs->zone_.get()); - if (cmp_result != 0) return cmp_result < 0; - return strcmp(lhs->subzone_.get(), rhs->subzone_.get()) < 0; - } - }; - - LocalityName(UniquePtr region, UniquePtr zone, - UniquePtr subzone) - : region_(std::move(region)), - zone_(std::move(zone)), - subzone_(std::move(subzone)) {} - - bool operator==(const LocalityName& other) const { - return strcmp(region_.get(), other.region_.get()) == 0 && - strcmp(zone_.get(), other.zone_.get()) == 0 && - strcmp(subzone_.get(), other.subzone_.get()) == 0; - } - - const char* AsHumanReadableString() { - if (human_readable_string_ == nullptr) { - char* tmp; - gpr_asprintf(&tmp, "{region=\"%s\", zone=\"%s\", subzone=\"%s\"}", - region_.get(), zone_.get(), subzone_.get()); - human_readable_string_.reset(tmp); - } - return human_readable_string_.get(); - } - - private: - UniquePtr region_; - UniquePtr zone_; - UniquePtr subzone_; - UniquePtr human_readable_string_; - }; - class LocalityMap { public: class LocalityEntry : public InternallyRefCounted { public: LocalityEntry(RefCountedPtr parent, - RefCountedPtr name, uint32_t locality_weight); + RefCountedPtr name); ~LocalityEntry(); - void UpdateLocked(xds_grpclb_serverlist* serverlist, + void UpdateLocked(uint32_t locality_weight, ServerAddressList serverlist, LoadBalancingPolicy::Config* child_policy_config, const grpc_channel_args* args); void ShutdownLocked(); void ResetBackoffLocked(); + void DeactivateLocked(); void Orphan() override; + grpc_connectivity_state connectivity_state() const { + return connectivity_state_; + } + uint32_t locality_weight() const { return locality_weight_; } + RefCountedPtr picker_wrapper() const { + return picker_wrapper_; + } + private: class Helper : public ChannelControlHelper { public: @@ -434,50 +498,50 @@ class XdsLb : public LoadBalancingPolicy { RefCountedPtr entry_; LoadBalancingPolicy* child_ = nullptr; }; + // Methods for dealing with the child policy. OrphanablePtr CreateChildPolicyLocked( const char* name, const grpc_channel_args* args); grpc_channel_args* CreateChildPolicyArgsLocked( const grpc_channel_args* args); + static void OnDelayedRemovalTimerLocked(void* arg, grpc_error* error); + RefCountedPtr parent_; - RefCountedPtr name_; + RefCountedPtr name_; OrphanablePtr child_policy_; OrphanablePtr pending_child_policy_; - RefCountedPtr picker_ref_; - grpc_connectivity_state connectivity_state_; + RefCountedPtr picker_wrapper_; + grpc_connectivity_state connectivity_state_ = GRPC_CHANNEL_IDLE; uint32_t locality_weight_; + grpc_closure on_delayed_removal_timer_; + grpc_timer delayed_removal_timer_; + bool delayed_removal_timer_callback_pending_ = false; }; - void UpdateLocked(const LocalityList& locality_list, + explicit LocalityMap(XdsLb* xds_policy) : xds_policy_(xds_policy) {} + + void UpdateLocked(const XdsLocalityList& locality_list, LoadBalancingPolicy::Config* child_policy_config, - const grpc_channel_args* args, XdsLb* parent); + const grpc_channel_args* args, XdsLb* parent, + bool is_initial_update = false); + void UpdateXdsPickerLocked(); void ShutdownLocked(); void ResetBackoffLocked(); private: - void PruneLocalities(const LocalityList& locality_list); - Map, OrphanablePtr, - LocalityName::Less> + XdsLb* xds_policy_; + Map, OrphanablePtr, + XdsLocalityName::Less> map_; }; - struct LocalityServerlistEntry { - ~LocalityServerlistEntry() { xds_grpclb_destroy_serverlist(serverlist); } - - RefCountedPtr locality_name; - uint32_t locality_weight; - // The deserialized response from the balancer. May be nullptr until one - // such response has arrived. - xds_grpclb_serverlist* serverlist; - }; - ~XdsLb(); void ShutdownLocked() override; // Helper function used in UpdateLocked(). - void ProcessAddressesAndChannelArgsLocked(const ServerAddressList& addresses, + void ProcessAddressesAndChannelArgsLocked(ServerAddressList addresses, const grpc_channel_args& args); // Parses the xds config given the JSON node of the first child of XdsConfig. @@ -486,7 +550,7 @@ class XdsLb : public LoadBalancingPolicy { // found. Does nothing upon failure. void ParseLbConfig(const ParsedXdsConfig* xds_config); - BalancerChannelState* LatestLbChannel() const { + LbChannelState* LatestLbChannel() const { return pending_lb_chand_ != nullptr ? pending_lb_chand_.get() : lb_chand_.get(); } @@ -499,7 +563,7 @@ class XdsLb : public LoadBalancingPolicy { const char* name, const grpc_channel_args* args); void MaybeExitFallbackMode(); - // Who the client is trying to communicate with. + // Name of the backend server to connect to. const char* server_name_ = nullptr; // Name of the balancer to connect to. @@ -512,11 +576,11 @@ class XdsLb : public LoadBalancingPolicy { bool shutting_down_ = false; // The channel for communicating with the LB server. - OrphanablePtr lb_chand_; - OrphanablePtr pending_lb_chand_; + OrphanablePtr lb_chand_; + OrphanablePtr pending_lb_chand_; // Timeout in milliseconds for the LB call. 0 means no deadline. - int lb_call_timeout_ms_ = 0; + const grpc_millis lb_call_timeout_ms_; // Whether the checks for fallback at startup are ALL pending. There are // several cases where this can be reset: @@ -528,7 +592,7 @@ class XdsLb : public LoadBalancingPolicy { bool fallback_at_startup_checks_pending_ = false; // Timeout in milliseconds for before using fallback backend addresses. // 0 means not using fallback. - int lb_fallback_timeout_ms_ = 0; + const grpc_millis lb_fallback_timeout_ms_; // The backend addresses from the resolver. ServerAddressList fallback_backend_addresses_; // Fallback timer. @@ -543,34 +607,75 @@ class XdsLb : public LoadBalancingPolicy { // The policy to use for the backends. RefCountedPtr child_policy_config_; + const grpc_millis locality_retention_interval_ms_; // Map of policies to use in the backend LocalityMap locality_map_; // TODO(mhaidry) : Add support for multiple maps of localities // with different priorities - LocalityList locality_serverlist_; + XdsLocalityList locality_list_; // TODO(mhaidry) : Add a pending locality map that may be swapped with the // the current one when new localities in the pending map are ready // to accept connections + + // The config for dropping calls. + RefCountedPtr drop_config_; + + // The stats for client-side load reporting. + XdsClientStats client_stats_; }; +// +// XdsLb::PickerWrapper::Pick +// + +LoadBalancingPolicy::PickResult XdsLb::PickerWrapper::Pick( + LoadBalancingPolicy::PickArgs args) { + // Forward the pick to the picker returned from the child policy. + PickResult result = picker_->Pick(args); + if (result.type != PickResult::PICK_COMPLETE || + result.subchannel == nullptr || locality_stats_ == nullptr) { + return result; + } + // Record a call started. + locality_stats_->AddCallStarted(); + // Intercept the recv_trailing_metadata op to record call completion. + result.recv_trailing_metadata_ready = RecordCallCompletion; + result.recv_trailing_metadata_ready_user_data = + locality_stats_->Ref(DEBUG_LOCATION, "LocalityStats+call").release(); + return result; +} + +// Note that the following callback does not run in either the control plane +// combiner or the data plane combiner. +void XdsLb::PickerWrapper::RecordCallCompletion( + void* arg, grpc_error* error, + LoadBalancingPolicy::MetadataInterface* recv_trailing_metadata, + LoadBalancingPolicy::CallState* call_state) { + XdsClientStats::LocalityStats* locality_stats = + static_cast(arg); + const bool call_failed = error != GRPC_ERROR_NONE; + locality_stats->AddCallFinished(call_failed); + locality_stats->Unref(DEBUG_LOCATION, "LocalityStats+call"); +} + // // XdsLb::Picker // XdsLb::PickResult XdsLb::Picker::Pick(PickArgs args) { - // TODO(roth): Add support for drop handling. - // Generate a random number between 0 and the total weight - const uint32_t key = - (rand() * pickers_[pickers_.size() - 1].first) / RAND_MAX; + // Handle drop. + const UniquePtr* drop_category; + if (drop_config_->ShouldDrop(&drop_category)) { + xds_policy_->client_stats_.AddCallDropped(*drop_category); + PickResult result; + result.type = PickResult::PICK_COMPLETE; + return result; + } + // Generate a random number in [0, total weight). + const uint32_t key = rand() % pickers_[pickers_.size() - 1].first; // Forward pick to whichever locality maps to the range in which the // random number falls in. - PickResult result = PickFromLocality(key, args); - // If pick succeeded, add client stats. - if (result.type == PickResult::PICK_COMPLETE && - result.subchannel != nullptr && client_stats_ != nullptr) { - // TODO(roth): Add support for client stats. - } - return result; + return PickFromLocality(key, args); } XdsLb::PickResult XdsLb::Picker::PickFromLocality(const uint32_t key, @@ -678,172 +783,46 @@ void XdsLb::FallbackHelper::AddTraceEvent(TraceSeverity severity, } // -// serverlist parsing code +// XdsLb::LbChannelState // -// Returns the backend addresses extracted from the given addresses. -ServerAddressList ExtractBackendAddresses(const ServerAddressList& addresses) { - ServerAddressList backend_addresses; - for (size_t i = 0; i < addresses.size(); ++i) { - if (!addresses[i].IsBalancer()) { - backend_addresses.emplace_back(addresses[i]); - } - } - return backend_addresses; -} - -bool IsServerValid(const xds_grpclb_server* server, size_t idx, bool log) { - if (server->drop) return false; - const xds_grpclb_ip_address* ip = &server->ip_address; - if (GPR_UNLIKELY(server->port >> 16 != 0)) { - if (log) { - gpr_log(GPR_ERROR, - "Invalid port '%d' at index %lu of serverlist. Ignoring.", - server->port, (unsigned long)idx); - } - return false; - } - if (GPR_UNLIKELY(ip->size != 4 && ip->size != 16)) { - if (log) { - gpr_log(GPR_ERROR, - "Expected IP to be 4 or 16 bytes, got %d at index %lu of " - "serverlist. Ignoring", - ip->size, (unsigned long)idx); - } - return false; - } - return true; -} - -void ParseServer(const xds_grpclb_server* server, grpc_resolved_address* addr) { - memset(addr, 0, sizeof(*addr)); - if (server->drop) return; - const uint16_t netorder_port = grpc_htons((uint16_t)server->port); - /* the addresses are given in binary format (a in(6)_addr struct) in - * server->ip_address.bytes. */ - const xds_grpclb_ip_address* ip = &server->ip_address; - if (ip->size == 4) { - addr->len = static_cast(sizeof(grpc_sockaddr_in)); - grpc_sockaddr_in* addr4 = reinterpret_cast(&addr->addr); - addr4->sin_family = GRPC_AF_INET; - memcpy(&addr4->sin_addr, ip->bytes, ip->size); - addr4->sin_port = netorder_port; - } else if (ip->size == 16) { - addr->len = static_cast(sizeof(grpc_sockaddr_in6)); - grpc_sockaddr_in6* addr6 = (grpc_sockaddr_in6*)&addr->addr; - addr6->sin6_family = GRPC_AF_INET6; - memcpy(&addr6->sin6_addr, ip->bytes, ip->size); - addr6->sin6_port = netorder_port; - } -} - -// Returns addresses extracted from \a serverlist. -ServerAddressList ProcessServerlist(const xds_grpclb_serverlist* serverlist) { - ServerAddressList addresses; - for (size_t i = 0; i < serverlist->num_servers; ++i) { - const xds_grpclb_server* server = serverlist->servers[i]; - if (!IsServerValid(serverlist->servers[i], i, false)) continue; - grpc_resolved_address addr; - ParseServer(server, &addr); - addresses.emplace_back(addr, nullptr); - } - return addresses; -} - -// -// XdsLb::BalancerChannelState -// - -XdsLb::BalancerChannelState::BalancerChannelState( - const char* balancer_name, const grpc_channel_args& args, - RefCountedPtr parent_xdslb_policy) - : InternallyRefCounted(&grpc_lb_xds_trace), - xdslb_policy_(std::move(parent_xdslb_policy)), - lb_call_backoff_( - BackOff::Options() - .set_initial_backoff(GRPC_XDS_INITIAL_CONNECT_BACKOFF_SECONDS * - 1000) - .set_multiplier(GRPC_XDS_RECONNECT_BACKOFF_MULTIPLIER) - .set_jitter(GRPC_XDS_RECONNECT_JITTER) - .set_max_backoff(GRPC_XDS_RECONNECT_MAX_BACKOFF_SECONDS * 1000)) { - GRPC_CLOSURE_INIT(&on_connectivity_changed_, - &XdsLb::BalancerChannelState::OnConnectivityChangedLocked, +XdsLb::LbChannelState::LbChannelState(RefCountedPtr xdslb_policy, + const char* balancer_name, + const grpc_channel_args& args) + : InternallyRefCounted(&grpc_lb_xds_trace), + xdslb_policy_(std::move(xdslb_policy)) { + GRPC_CLOSURE_INIT(&on_connectivity_changed_, OnConnectivityChangedLocked, this, grpc_combiner_scheduler(xdslb_policy_->combiner())); channel_ = xdslb_policy_->channel_control_helper()->CreateChannel( balancer_name, args); GPR_ASSERT(channel_ != nullptr); - StartCallLocked(); -} - -XdsLb::BalancerChannelState::~BalancerChannelState() { - xdslb_policy_.reset(DEBUG_LOCATION, "BalancerChannelState"); - grpc_channel_destroy(channel_); -} - -void XdsLb::BalancerChannelState::Orphan() { - shutting_down_ = true; - lb_calld_.reset(); - if (retry_timer_callback_pending_) grpc_timer_cancel(&lb_call_retry_timer_); - Unref(DEBUG_LOCATION, "lb_channel_orphaned"); + eds_calld_.reset(New>( + Ref(DEBUG_LOCATION, "LbChannelState+eds"))); + lrs_calld_.reset(New>( + Ref(DEBUG_LOCATION, "LbChannelState+lrs"))); } -void XdsLb::BalancerChannelState::StartCallRetryTimerLocked() { - grpc_millis next_try = lb_call_backoff_.NextAttemptTime(); +XdsLb::LbChannelState::~LbChannelState() { if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { - gpr_log(GPR_INFO, - "[xdslb %p] Failed to connect to LB server (lb_chand: %p)...", - xdslb_policy_.get(), this); - grpc_millis timeout = next_try - ExecCtx::Get()->Now(); - if (timeout > 0) { - gpr_log(GPR_INFO, "[xdslb %p] ... retry_timer_active in %" PRId64 "ms.", - xdslb_policy_.get(), timeout); - } else { - gpr_log(GPR_INFO, "[xdslb %p] ... retry_timer_active immediately.", - xdslb_policy_.get()); - } + gpr_log(GPR_INFO, "[xdslb %p] Destroying LB channel %p", xdslb_policy(), + this); } - Ref(DEBUG_LOCATION, "on_balancer_call_retry_timer").release(); - GRPC_CLOSURE_INIT(&lb_on_call_retry_, &OnCallRetryTimerLocked, this, - grpc_combiner_scheduler(xdslb_policy_->combiner())); - grpc_timer_init(&lb_call_retry_timer_, next_try, &lb_on_call_retry_); - retry_timer_callback_pending_ = true; -} - -void XdsLb::BalancerChannelState::OnCallRetryTimerLocked(void* arg, - grpc_error* error) { - BalancerChannelState* lb_chand = static_cast(arg); - lb_chand->retry_timer_callback_pending_ = false; - if (!lb_chand->shutting_down_ && error == GRPC_ERROR_NONE && - lb_chand->lb_calld_ == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { - gpr_log(GPR_INFO, - "[xdslb %p] Restarting call to LB server (lb_chand: %p)", - lb_chand->xdslb_policy_.get(), lb_chand); - } - lb_chand->StartCallLocked(); - } - lb_chand->Unref(DEBUG_LOCATION, "on_balancer_call_retry_timer"); + grpc_channel_destroy(channel_); } -void XdsLb::BalancerChannelState::StartCallLocked() { - if (shutting_down_) return; - GPR_ASSERT(channel_ != nullptr); - GPR_ASSERT(lb_calld_ == nullptr); - lb_calld_ = MakeOrphanable(Ref()); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { - gpr_log(GPR_INFO, - "[xdslb %p] Query for backends (lb_chand: %p, lb_calld: %p)", - xdslb_policy_.get(), this, lb_calld_.get()); - } - lb_calld_->StartQuery(); +void XdsLb::LbChannelState::Orphan() { + shutting_down_ = true; + eds_calld_.reset(); + lrs_calld_.reset(); + Unref(DEBUG_LOCATION, "LbChannelState+orphaned"); } -void XdsLb::BalancerChannelState::StartConnectivityWatchLocked() { +void XdsLb::LbChannelState::StartConnectivityWatchLocked() { grpc_channel_element* client_channel_elem = grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel_)); GPR_ASSERT(client_channel_elem->filter == &grpc_client_channel_filter); // Ref held by callback. - Ref(DEBUG_LOCATION, "watch_lb_channel_connectivity").release(); + Ref(DEBUG_LOCATION, "LbChannelState+start_watch").release(); grpc_client_channel_watch_connectivity_state( client_channel_elem, grpc_polling_entity_create_from_pollset_set( @@ -851,7 +830,7 @@ void XdsLb::BalancerChannelState::StartConnectivityWatchLocked() { &connectivity_, &on_connectivity_changed_, nullptr); } -void XdsLb::BalancerChannelState::CancelConnectivityWatchLocked() { +void XdsLb::LbChannelState::CancelConnectivityWatchLocked() { grpc_channel_element* client_channel_elem = grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel_)); GPR_ASSERT(client_channel_elem->filter == &grpc_client_channel_filter); @@ -862,9 +841,9 @@ void XdsLb::BalancerChannelState::CancelConnectivityWatchLocked() { nullptr, &on_connectivity_changed_, nullptr); } -void XdsLb::BalancerChannelState::OnConnectivityChangedLocked( - void* arg, grpc_error* error) { - BalancerChannelState* self = static_cast(arg); +void XdsLb::LbChannelState::OnConnectivityChangedLocked(void* arg, + grpc_error* error) { + LbChannelState* self = static_cast(arg); if (!self->shutting_down_ && self->xdslb_policy_->fallback_at_startup_checks_pending_) { if (self->connectivity_ != GRPC_CHANNEL_TRANSIENT_FAILURE) { @@ -891,84 +870,145 @@ void XdsLb::BalancerChannelState::OnConnectivityChangedLocked( self->xdslb_policy_->UpdateFallbackPolicyLocked(); } // Done watching connectivity state, so drop ref. - self->Unref(DEBUG_LOCATION, "watch_lb_channel_connectivity"); + self->Unref(DEBUG_LOCATION, "LbChannelState+watch_done"); } // -// XdsLb::BalancerChannelState::BalancerCallState +// XdsLb::LbChannelState::RetryableLbCall<> // -XdsLb::BalancerChannelState::BalancerCallState::BalancerCallState( - RefCountedPtr lb_chand) - : InternallyRefCounted(&grpc_lb_xds_trace), - lb_chand_(std::move(lb_chand)) { - GPR_ASSERT(xdslb_policy() != nullptr); - GPR_ASSERT(!xdslb_policy()->shutting_down_); +template +XdsLb::LbChannelState::RetryableLbCall::RetryableLbCall( + RefCountedPtr lb_chand) + : lb_chand_(std::move(lb_chand)), + backoff_( + BackOff::Options() + .set_initial_backoff(GRPC_XDS_INITIAL_CONNECT_BACKOFF_SECONDS * + 1000) + .set_multiplier(GRPC_XDS_RECONNECT_BACKOFF_MULTIPLIER) + .set_jitter(GRPC_XDS_RECONNECT_JITTER) + .set_max_backoff(GRPC_XDS_RECONNECT_MAX_BACKOFF_SECONDS * 1000)) { + GRPC_CLOSURE_INIT( + &on_retry_timer_, OnRetryTimerLocked, this, + grpc_combiner_scheduler(lb_chand_->xdslb_policy()->combiner())); + StartNewCallLocked(); +} + +template +void XdsLb::LbChannelState::RetryableLbCall::Orphan() { + shutting_down_ = true; + lb_calld_.reset(); + if (retry_timer_callback_pending_) grpc_timer_cancel(&retry_timer_); + this->Unref(DEBUG_LOCATION, "RetryableLbCall+orphaned"); +} + +template +void XdsLb::LbChannelState::RetryableLbCall::OnCallFinishedLocked() { + const bool seen_response = lb_calld_->seen_response(); + lb_calld_.reset(); + if (seen_response) { + // If we lost connection to the LB server, reset backoff and restart the LB + // call immediately. + backoff_.Reset(); + StartNewCallLocked(); + } else { + // If we failed to connect to the LB server, retry later. + StartRetryTimerLocked(); + } +} + +template +void XdsLb::LbChannelState::RetryableLbCall::StartNewCallLocked() { + if (shutting_down_) return; + GPR_ASSERT(lb_chand_->channel_ != nullptr); + GPR_ASSERT(lb_calld_ == nullptr); + if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { + gpr_log(GPR_INFO, + "[xdslb %p] Start new call from retryable call (lb_chand: %p, " + "retryable call: %p)", + lb_chand()->xdslb_policy(), lb_chand(), this); + } + lb_calld_ = MakeOrphanable( + this->Ref(DEBUG_LOCATION, "RetryableLbCall+start_new_call")); +} + +template +void XdsLb::LbChannelState::RetryableLbCall::StartRetryTimerLocked() { + if (shutting_down_) return; + const grpc_millis next_attempt_time = backoff_.NextAttemptTime(); + if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { + grpc_millis timeout = GPR_MAX(next_attempt_time - ExecCtx::Get()->Now(), 0); + gpr_log(GPR_INFO, + "[xdslb %p] Failed to connect to LB server (lb_chand: %p) " + "retry timer will fire in %" PRId64 "ms.", + lb_chand()->xdslb_policy(), lb_chand(), timeout); + } + this->Ref(DEBUG_LOCATION, "RetryableLbCall+retry_timer_start").release(); + grpc_timer_init(&retry_timer_, next_attempt_time, &on_retry_timer_); + retry_timer_callback_pending_ = true; +} + +template +void XdsLb::LbChannelState::RetryableLbCall::OnRetryTimerLocked( + void* arg, grpc_error* error) { + RetryableLbCall* lb_calld = static_cast(arg); + lb_calld->retry_timer_callback_pending_ = false; + if (!lb_calld->shutting_down_ && error == GRPC_ERROR_NONE) { + if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { + gpr_log(GPR_INFO, + "[xdslb %p] Retry timer fires (lb_chand: %p, retryable call: %p)", + lb_calld->lb_chand()->xdslb_policy(), lb_calld->lb_chand(), + lb_calld); + } + lb_calld->StartNewCallLocked(); + } + lb_calld->Unref(DEBUG_LOCATION, "RetryableLbCall+retry_timer_done"); +} + +// +// XdsLb::LbChannelState::EdsCallState +// + +XdsLb::LbChannelState::EdsCallState::EdsCallState( + RefCountedPtr> parent) + : InternallyRefCounted(&grpc_lb_xds_trace), + parent_(std::move(parent)) { // Init the LB call. Note that the LB call will progress every time there's - // activity in xdslb_policy_->interested_parties(), which is comprised of + // activity in xdslb_policy()->interested_parties(), which is comprised of // the polling entities from client_channel. + GPR_ASSERT(xdslb_policy() != nullptr); GPR_ASSERT(xdslb_policy()->server_name_ != nullptr); GPR_ASSERT(xdslb_policy()->server_name_[0] != '\0'); const grpc_millis deadline = xdslb_policy()->lb_call_timeout_ms_ == 0 ? GRPC_MILLIS_INF_FUTURE : ExecCtx::Get()->Now() + xdslb_policy()->lb_call_timeout_ms_; + // Create an LB call with the specified method name. lb_call_ = grpc_channel_create_pollset_set_call( - lb_chand_->channel_, nullptr, GRPC_PROPAGATE_DEFAULTS, + lb_chand()->channel_, nullptr, GRPC_PROPAGATE_DEFAULTS, xdslb_policy()->interested_parties(), - GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD, + GRPC_MDSTR_SLASH_ENVOY_DOT_API_DOT_V2_DOT_ENDPOINTDISCOVERYSERVICE_SLASH_STREAMENDPOINTS, nullptr, deadline, nullptr); + GPR_ASSERT(lb_call_ != nullptr); // Init the LB call request payload. - xds_grpclb_request* request = - xds_grpclb_request_create(xdslb_policy()->server_name_); - grpc_slice request_payload_slice = xds_grpclb_request_encode(request); + grpc_slice request_payload_slice = + XdsEdsRequestCreateAndEncode(xdslb_policy()->server_name_); send_message_payload_ = grpc_raw_byte_buffer_create(&request_payload_slice, 1); grpc_slice_unref_internal(request_payload_slice); - xds_grpclb_request_destroy(request); // Init other data associated with the LB call. - grpc_metadata_array_init(&lb_initial_metadata_recv_); - grpc_metadata_array_init(&lb_trailing_metadata_recv_); - GRPC_CLOSURE_INIT(&lb_on_initial_request_sent_, OnInitialRequestSentLocked, - this, grpc_combiner_scheduler(xdslb_policy()->combiner())); - GRPC_CLOSURE_INIT(&lb_on_balancer_message_received_, - OnBalancerMessageReceivedLocked, this, + grpc_metadata_array_init(&initial_metadata_recv_); + grpc_metadata_array_init(&trailing_metadata_recv_); + GRPC_CLOSURE_INIT(&on_response_received_, OnResponseReceivedLocked, this, grpc_combiner_scheduler(xdslb_policy()->combiner())); - GRPC_CLOSURE_INIT(&lb_on_balancer_status_received_, - OnBalancerStatusReceivedLocked, this, + GRPC_CLOSURE_INIT(&on_status_received_, OnStatusReceivedLocked, this, grpc_combiner_scheduler(xdslb_policy()->combiner())); -} - -XdsLb::BalancerChannelState::BalancerCallState::~BalancerCallState() { - GPR_ASSERT(lb_call_ != nullptr); - grpc_call_unref(lb_call_); - grpc_metadata_array_destroy(&lb_initial_metadata_recv_); - grpc_metadata_array_destroy(&lb_trailing_metadata_recv_); - grpc_byte_buffer_destroy(send_message_payload_); - grpc_byte_buffer_destroy(recv_message_payload_); - grpc_slice_unref_internal(lb_call_status_details_); -} - -void XdsLb::BalancerChannelState::BalancerCallState::Orphan() { - GPR_ASSERT(lb_call_ != nullptr); - // If we are here because xdslb_policy wants to cancel the call, - // lb_on_balancer_status_received_ will complete the cancellation and clean - // up. Otherwise, we are here because xdslb_policy has to orphan a failed - // call, then the following cancellation will be a no-op. - grpc_call_cancel(lb_call_, nullptr); - if (client_load_report_timer_callback_pending_) { - grpc_timer_cancel(&client_load_report_timer_); - } - // Note that the initial ref is hold by lb_on_balancer_status_received_ - // instead of the caller of this function. So the corresponding unref happens - // in lb_on_balancer_status_received_ instead of here. -} - -void XdsLb::BalancerChannelState::BalancerCallState::StartQuery() { - GPR_ASSERT(lb_call_ != nullptr); + // Start the call. if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { - gpr_log(GPR_INFO, "[xdslb %p] Starting LB call (lb_calld: %p, lb_call: %p)", - xdslb_policy(), this, lb_call_); + gpr_log(GPR_INFO, + "[xdslb %p] Starting EDS call (lb_chand: %p, lb_calld: %p, " + "lb_call: %p)", + xdslb_policy(), lb_chand(), this, lb_call_); } // Create the ops. grpc_call_error call_error; @@ -988,19 +1028,14 @@ void XdsLb::BalancerChannelState::BalancerCallState::StartQuery() { op->flags = 0; op->reserved = nullptr; op++; - // TODO(roth): We currently track this ref manually. Once the - // ClosureRef API is ready, we should pass the RefCountedPtr<> along - // with the callback. - auto self = Ref(DEBUG_LOCATION, "on_initial_request_sent"); - self.release(); - call_error = grpc_call_start_batch_and_execute( - lb_call_, ops, (size_t)(op - ops), &lb_on_initial_request_sent_); + call_error = grpc_call_start_batch_and_execute(lb_call_, ops, + (size_t)(op - ops), nullptr); GPR_ASSERT(GRPC_CALL_OK == call_error); // Op: recv initial metadata. op = ops; op->op = GRPC_OP_RECV_INITIAL_METADATA; op->data.recv_initial_metadata.recv_initial_metadata = - &lb_initial_metadata_recv_; + &initial_metadata_recv_; op->flags = 0; op->reserved = nullptr; op++; @@ -1010,21 +1045,16 @@ void XdsLb::BalancerChannelState::BalancerCallState::StartQuery() { op->flags = 0; op->reserved = nullptr; op++; - // TODO(roth): We currently track this ref manually. Once the - // ClosureRef API is ready, we should pass the RefCountedPtr<> along - // with the callback. - self = Ref(DEBUG_LOCATION, "on_message_received"); - self.release(); + Ref(DEBUG_LOCATION, "EDS+OnResponseReceivedLocked").release(); call_error = grpc_call_start_batch_and_execute( - lb_call_, ops, (size_t)(op - ops), &lb_on_balancer_message_received_); + lb_call_, ops, (size_t)(op - ops), &on_response_received_); GPR_ASSERT(GRPC_CALL_OK == call_error); // Op: recv server status. op = ops; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; - op->data.recv_status_on_client.trailing_metadata = - &lb_trailing_metadata_recv_; - op->data.recv_status_on_client.status = &lb_call_status_; - op->data.recv_status_on_client.status_details = &lb_call_status_details_; + op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv_; + op->data.recv_status_on_client.status = &status_code_; + op->data.recv_status_on_client.status_details = &status_details_; op->flags = 0; op->reserved = nullptr; op++; @@ -1032,276 +1062,203 @@ void XdsLb::BalancerChannelState::BalancerCallState::StartQuery() { // ref instead of a new ref. When it's invoked, it's the initial ref that is // unreffed. call_error = grpc_call_start_batch_and_execute( - lb_call_, ops, (size_t)(op - ops), &lb_on_balancer_status_received_); + lb_call_, ops, (size_t)(op - ops), &on_status_received_); GPR_ASSERT(GRPC_CALL_OK == call_error); } -void XdsLb::BalancerChannelState::BalancerCallState:: - ScheduleNextClientLoadReportLocked() { - const grpc_millis next_client_load_report_time = - ExecCtx::Get()->Now() + client_stats_report_interval_; - GRPC_CLOSURE_INIT(&client_load_report_closure_, - MaybeSendClientLoadReportLocked, this, - grpc_combiner_scheduler(xdslb_policy()->combiner())); - grpc_timer_init(&client_load_report_timer_, next_client_load_report_time, - &client_load_report_closure_); - client_load_report_timer_callback_pending_ = true; +XdsLb::LbChannelState::EdsCallState::~EdsCallState() { + grpc_metadata_array_destroy(&initial_metadata_recv_); + grpc_metadata_array_destroy(&trailing_metadata_recv_); + grpc_byte_buffer_destroy(send_message_payload_); + grpc_byte_buffer_destroy(recv_message_payload_); + grpc_slice_unref_internal(status_details_); + GPR_ASSERT(lb_call_ != nullptr); + grpc_call_unref(lb_call_); } -void XdsLb::BalancerChannelState::BalancerCallState:: - MaybeSendClientLoadReportLocked(void* arg, grpc_error* error) { - BalancerCallState* lb_calld = static_cast(arg); - lb_calld->client_load_report_timer_callback_pending_ = false; - if (error != GRPC_ERROR_NONE || !lb_calld->IsCurrentCallOnChannel()) { - lb_calld->Unref(DEBUG_LOCATION, "client_load_report"); - return; - } - // If we've already sent the initial request, then we can go ahead and send - // the load report. Otherwise, we need to wait until the initial request has - // been sent to send this (see OnInitialRequestSentLocked()). - if (lb_calld->send_message_payload_ == nullptr) { - lb_calld->SendClientLoadReportLocked(); - } else { - lb_calld->client_load_report_is_due_ = true; - } -} - -bool XdsLb::BalancerChannelState::BalancerCallState::LoadReportCountersAreZero( - xds_grpclb_request* request) { - XdsLbClientStats::DroppedCallCounts* drop_entries = - static_cast( - request->client_stats.calls_finished_with_drop.arg); - return request->client_stats.num_calls_started == 0 && - request->client_stats.num_calls_finished == 0 && - request->client_stats.num_calls_finished_with_client_failed_to_send == - 0 && - request->client_stats.num_calls_finished_known_received == 0 && - (drop_entries == nullptr || drop_entries->empty()); -} - -// TODO(vpowar): Use LRS to send the client Load Report. -void XdsLb::BalancerChannelState::BalancerCallState:: - SendClientLoadReportLocked() { - // Construct message payload. - GPR_ASSERT(send_message_payload_ == nullptr); - xds_grpclb_request* request = - xds_grpclb_load_report_request_create_locked(client_stats_.get()); - // Skip client load report if the counters were all zero in the last - // report and they are still zero in this one. - if (LoadReportCountersAreZero(request)) { - if (last_client_load_report_counters_were_zero_) { - xds_grpclb_request_destroy(request); - ScheduleNextClientLoadReportLocked(); - return; - } - last_client_load_report_counters_were_zero_ = true; - } else { - last_client_load_report_counters_were_zero_ = false; - } - // TODO(vpowar): Send the report on LRS stream. - xds_grpclb_request_destroy(request); +void XdsLb::LbChannelState::EdsCallState::Orphan() { + GPR_ASSERT(lb_call_ != nullptr); + // If we are here because xdslb_policy wants to cancel the call, + // on_status_received_ will complete the cancellation and clean up. Otherwise, + // we are here because xdslb_policy has to orphan a failed call, then the + // following cancellation will be a no-op. + grpc_call_cancel(lb_call_, nullptr); + // Note that the initial ref is hold by on_status_received_. So the + // corresponding unref happens in on_status_received_ instead of here. } -void XdsLb::BalancerChannelState::BalancerCallState::OnInitialRequestSentLocked( +void XdsLb::LbChannelState::EdsCallState::OnResponseReceivedLocked( void* arg, grpc_error* error) { - BalancerCallState* lb_calld = static_cast(arg); - grpc_byte_buffer_destroy(lb_calld->send_message_payload_); - lb_calld->send_message_payload_ = nullptr; - // If we attempted to send a client load report before the initial request was - // sent (and this lb_calld is still in use), send the load report now. - if (lb_calld->client_load_report_is_due_ && - lb_calld->IsCurrentCallOnChannel()) { - lb_calld->SendClientLoadReportLocked(); - lb_calld->client_load_report_is_due_ = false; - } - lb_calld->Unref(DEBUG_LOCATION, "on_initial_request_sent"); -} - -void XdsLb::BalancerChannelState::BalancerCallState:: - OnBalancerMessageReceivedLocked(void* arg, grpc_error* error) { - BalancerCallState* lb_calld = static_cast(arg); - XdsLb* xdslb_policy = lb_calld->xdslb_policy(); + EdsCallState* eds_calld = static_cast(arg); + LbChannelState* lb_chand = eds_calld->lb_chand(); + XdsLb* xdslb_policy = eds_calld->xdslb_policy(); // Empty payload means the LB call was cancelled. - if (!lb_calld->IsCurrentCallOnChannel() || - lb_calld->recv_message_payload_ == nullptr) { - lb_calld->Unref(DEBUG_LOCATION, "on_message_received"); + if (!eds_calld->IsCurrentCallOnChannel() || + eds_calld->recv_message_payload_ == nullptr) { + eds_calld->Unref(DEBUG_LOCATION, "EDS+OnResponseReceivedLocked"); return; } + // Read the response. grpc_byte_buffer_reader bbr; - grpc_byte_buffer_reader_init(&bbr, lb_calld->recv_message_payload_); + grpc_byte_buffer_reader_init(&bbr, eds_calld->recv_message_payload_); grpc_slice response_slice = grpc_byte_buffer_reader_readall(&bbr); grpc_byte_buffer_reader_destroy(&bbr); - grpc_byte_buffer_destroy(lb_calld->recv_message_payload_); - lb_calld->recv_message_payload_ = nullptr; - xds_grpclb_initial_response* initial_response; - xds_grpclb_serverlist* serverlist; - if (!lb_calld->seen_initial_response_ && - (initial_response = xds_grpclb_initial_response_parse(response_slice)) != - nullptr) { - // Have NOT seen initial response, look for initial response. - // TODO(juanlishen): When we convert this to use the xds protocol, the - // balancer will send us a fallback timeout such that we should go into - // fallback mode if we have lost contact with the balancer after a certain - // period of time. We will need to save the timeout value here, and then - // when the balancer call ends, we will need to start a timer for the - // specified period of time, and if the timer fires, we go into fallback - // mode. We will also need to cancel the timer when we receive a serverlist - // from the balancer. - if (initial_response->has_client_stats_report_interval) { - const grpc_millis interval = xds_grpclb_duration_to_millis( - &initial_response->client_stats_report_interval); - if (interval > 0) { - lb_calld->client_stats_report_interval_ = - GPR_MAX(GPR_MS_PER_SEC, interval); - } + grpc_byte_buffer_destroy(eds_calld->recv_message_payload_); + eds_calld->recv_message_payload_ = nullptr; + // TODO(juanlishen): When we convert this to use the xds protocol, the + // balancer will send us a fallback timeout such that we should go into + // fallback mode if we have lost contact with the balancer after a certain + // period of time. We will need to save the timeout value here, and then + // when the balancer call ends, we will need to start a timer for the + // specified period of time, and if the timer fires, we go into fallback + // mode. We will also need to cancel the timer when we receive a serverlist + // from the balancer. + // This anonymous lambda is a hack to avoid the usage of goto. + [&]() { + // Parse the response. + XdsUpdate update; + grpc_error* parse_error = + XdsEdsResponseDecodeAndParse(response_slice, &update); + if (parse_error != GRPC_ERROR_NONE) { + gpr_log(GPR_ERROR, "[xdslb %p] EDS response parsing failed. error=%s", + xdslb_policy, grpc_error_string(parse_error)); + GRPC_ERROR_UNREF(parse_error); + return; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { - if (lb_calld->client_stats_report_interval_ != 0) { - gpr_log(GPR_INFO, - "[xdslb %p] Received initial LB response message; " - "client load reporting interval = %" PRId64 " milliseconds", - xdslb_policy, lb_calld->client_stats_report_interval_); - } else { - gpr_log(GPR_INFO, - "[xdslb %p] Received initial LB response message; client load " - "reporting NOT enabled", - xdslb_policy); - } + if (update.locality_list.empty() && !update.drop_all) { + char* response_slice_str = + grpc_dump_slice(response_slice, GPR_DUMP_ASCII | GPR_DUMP_HEX); + gpr_log(GPR_ERROR, + "[xdslb %p] EDS response '%s' doesn't contain any valid locality " + "but doesn't require to drop all calls. Ignoring.", + xdslb_policy, response_slice_str); + gpr_free(response_slice_str); + return; } - xds_grpclb_initial_response_destroy(initial_response); - lb_calld->seen_initial_response_ = true; - } else if ((serverlist = xds_grpclb_response_parse_serverlist( - response_slice)) != nullptr) { - // Have seen initial response, look for serverlist. - GPR_ASSERT(lb_calld->lb_call_ != nullptr); + eds_calld->seen_response_ = true; if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { gpr_log(GPR_INFO, - "[xdslb %p] Serverlist with %" PRIuPTR " servers received", - xdslb_policy, serverlist->num_servers); - for (size_t i = 0; i < serverlist->num_servers; ++i) { - grpc_resolved_address addr; - ParseServer(serverlist->servers[i], &addr); - char* ipport; - grpc_sockaddr_to_string(&ipport, &addr, false); - gpr_log(GPR_INFO, "[xdslb %p] Serverlist[%" PRIuPTR "]: %s", - xdslb_policy, i, ipport); - gpr_free(ipport); + "[xdslb %p] EDS response with %" PRIuPTR + " localities and %" PRIuPTR + " drop categories received (drop_all=%d)", + xdslb_policy, update.locality_list.size(), + update.drop_config->drop_category_list().size(), update.drop_all); + for (size_t i = 0; i < update.locality_list.size(); ++i) { + const XdsLocalityInfo& locality = update.locality_list[i]; + gpr_log(GPR_INFO, + "[xdslb %p] Locality %" PRIuPTR " %s contains %" PRIuPTR + " server addresses", + xdslb_policy, i, + locality.locality_name->AsHumanReadableString(), + locality.serverlist.size()); + for (size_t j = 0; j < locality.serverlist.size(); ++j) { + char* ipport; + grpc_sockaddr_to_string(&ipport, &locality.serverlist[j].address(), + false); + gpr_log(GPR_INFO, + "[xdslb %p] Locality %" PRIuPTR + " %s, server address %" PRIuPTR ": %s", + xdslb_policy, i, + locality.locality_name->AsHumanReadableString(), j, ipport); + gpr_free(ipport); + } + } + for (size_t i = 0; i < update.drop_config->drop_category_list().size(); + ++i) { + const XdsDropConfig::DropCategory& drop_category = + update.drop_config->drop_category_list()[i]; + gpr_log(GPR_INFO, + "[xdslb %p] Drop category %s has drop rate %d per million", + xdslb_policy, drop_category.name.get(), + drop_category.parts_per_million); } } - // Pending LB channel receives a serverlist; promote it. + // Pending LB channel receives a response; promote it. // Note that this call can't be on a discarded pending channel, because // such channels don't have any current call but we have checked this call // is a current call. - if (!lb_calld->lb_chand_->IsCurrentChannel()) { + if (!lb_chand->IsCurrentChannel()) { if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { gpr_log(GPR_INFO, - "[xdslb %p] Promoting pending LB channel %p to replace " - "current LB channel %p", - xdslb_policy, lb_calld->lb_chand_.get(), - lb_calld->xdslb_policy()->lb_chand_.get()); + "[xdslb %p] Pending LB channel %p receives EDS response; " + "promoting it to replace current LB channel %p", + xdslb_policy, lb_chand, xdslb_policy->lb_chand_.get()); } - lb_calld->xdslb_policy()->lb_chand_ = - std::move(lb_calld->xdslb_policy()->pending_lb_chand_); - } - // Start sending client load report only after we start using the - // serverlist returned from the current LB call. - if (lb_calld->client_stats_report_interval_ > 0 && - lb_calld->client_stats_ == nullptr) { - lb_calld->client_stats_ = MakeRefCounted(); - lb_calld->Ref(DEBUG_LOCATION, "client_load_report").release(); - lb_calld->ScheduleNextClientLoadReportLocked(); + // TODO(juanlishen): Maybe promote the pending LB channel when the + // response results a READY locality map. + xdslb_policy->lb_chand_ = std::move(xdslb_policy->pending_lb_chand_); } - if (!xdslb_policy->locality_serverlist_.empty() && - xds_grpclb_serverlist_equals( - xdslb_policy->locality_serverlist_[0]->serverlist, serverlist)) { + // At this point, lb_chand must be the current LB channel, so try to start + // load reporting. + LrsCallState* lrs_calld = lb_chand->lrs_calld_->lb_calld(); + if (lrs_calld != nullptr) lrs_calld->MaybeStartReportingLocked(); + // If the balancer tells us to drop all the calls, we should exit fallback + // mode immediately. + if (update.drop_all) xdslb_policy->MaybeExitFallbackMode(); + // Update the drop config. + const bool drop_config_changed = + xdslb_policy->drop_config_ == nullptr || + *xdslb_policy->drop_config_ != *update.drop_config; + xdslb_policy->drop_config_ = std::move(update.drop_config); + // Ignore identical locality update. + if (xdslb_policy->locality_list_ == update.locality_list) { if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { gpr_log(GPR_INFO, - "[xdslb %p] Incoming server list identical to current, " - "ignoring.", - xdslb_policy); + "[xdslb %p] Incoming locality list identical to current, " + "ignoring. (drop_config_changed=%d)", + xdslb_policy, drop_config_changed); } - xds_grpclb_destroy_serverlist(serverlist); - } else { // New serverlist. - // If the balancer tells us to drop all the calls, we should exit fallback - // mode immediately. - // TODO(juanlishen): When we add EDS drop, we should change to check - // drop_percentage. - if (serverlist->num_servers == 0) xdslb_policy->MaybeExitFallbackMode(); - if (!xdslb_policy->locality_serverlist_.empty()) { - xds_grpclb_destroy_serverlist( - xdslb_policy->locality_serverlist_[0]->serverlist); - } else { - // Initialize locality serverlist, currently the list only handles - // one child. - xdslb_policy->locality_serverlist_.emplace_back( - MakeUnique()); - xdslb_policy->locality_serverlist_[0]->locality_name = - MakeRefCounted( - UniquePtr(gpr_strdup(kDefaultLocalityRegion)), - UniquePtr(gpr_strdup(kDefaultLocalityZone)), - UniquePtr(gpr_strdup(kDefaultLocalitySubzone))); - xdslb_policy->locality_serverlist_[0]->locality_weight = - kDefaultLocalityWeight; + if (drop_config_changed) { + xdslb_policy->locality_map_.UpdateXdsPickerLocked(); } - // Update the serverlist in the XdsLb instance. This serverlist - // instance will be destroyed either upon the next update or when the - // XdsLb instance is destroyed. - xdslb_policy->locality_serverlist_[0]->serverlist = serverlist; - xdslb_policy->locality_map_.UpdateLocked( - xdslb_policy->locality_serverlist_, - xdslb_policy->child_policy_config_.get(), xdslb_policy->args_, - xdslb_policy); + return; } - } else { - // No valid initial response or serverlist found. - char* response_slice_str = - grpc_dump_slice(response_slice, GPR_DUMP_ASCII | GPR_DUMP_HEX); - gpr_log(GPR_ERROR, - "[xdslb %p] Invalid LB response received: '%s'. Ignoring.", - xdslb_policy, response_slice_str); - gpr_free(response_slice_str); - } + // Update the locality list. + xdslb_policy->locality_list_ = std::move(update.locality_list); + // Update the locality map. + xdslb_policy->locality_map_.UpdateLocked( + xdslb_policy->locality_list_, xdslb_policy->child_policy_config_.get(), + xdslb_policy->args_, xdslb_policy); + }(); grpc_slice_unref_internal(response_slice); - if (!xdslb_policy->shutting_down_) { - // Keep listening for serverlist updates. - grpc_op op; - memset(&op, 0, sizeof(op)); - op.op = GRPC_OP_RECV_MESSAGE; - op.data.recv_message.recv_message = &lb_calld->recv_message_payload_; - op.flags = 0; - op.reserved = nullptr; - // Reuse the "OnBalancerMessageReceivedLocked" ref taken in StartQuery(). - const grpc_call_error call_error = grpc_call_start_batch_and_execute( - lb_calld->lb_call_, &op, 1, - &lb_calld->lb_on_balancer_message_received_); - GPR_ASSERT(GRPC_CALL_OK == call_error); - } else { - lb_calld->Unref(DEBUG_LOCATION, "on_message_received+xds_shutdown"); + if (xdslb_policy->shutting_down_) { + eds_calld->Unref(DEBUG_LOCATION, + "EDS+OnResponseReceivedLocked+xds_shutdown"); + return; } + // Keep listening for serverlist updates. + grpc_op op; + memset(&op, 0, sizeof(op)); + op.op = GRPC_OP_RECV_MESSAGE; + op.data.recv_message.recv_message = &eds_calld->recv_message_payload_; + op.flags = 0; + op.reserved = nullptr; + GPR_ASSERT(eds_calld->lb_call_ != nullptr); + // Reuse the "EDS+OnResponseReceivedLocked" ref taken in ctor. + const grpc_call_error call_error = grpc_call_start_batch_and_execute( + eds_calld->lb_call_, &op, 1, &eds_calld->on_response_received_); + GPR_ASSERT(GRPC_CALL_OK == call_error); } -void XdsLb::BalancerChannelState::BalancerCallState:: - OnBalancerStatusReceivedLocked(void* arg, grpc_error* error) { - BalancerCallState* lb_calld = static_cast(arg); - XdsLb* xdslb_policy = lb_calld->xdslb_policy(); - BalancerChannelState* lb_chand = lb_calld->lb_chand_.get(); - GPR_ASSERT(lb_calld->lb_call_ != nullptr); +void XdsLb::LbChannelState::EdsCallState::OnStatusReceivedLocked( + void* arg, grpc_error* error) { + EdsCallState* eds_calld = static_cast(arg); + LbChannelState* lb_chand = eds_calld->lb_chand(); + XdsLb* xdslb_policy = eds_calld->xdslb_policy(); if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { - char* status_details = - grpc_slice_to_c_string(lb_calld->lb_call_status_details_); + char* status_details = grpc_slice_to_c_string(eds_calld->status_details_); gpr_log(GPR_INFO, - "[xdslb %p] Status from LB server received. Status = %d, details " - "= '%s', (lb_chand: %p, lb_calld: %p, lb_call: %p), error '%s'", - xdslb_policy, lb_calld->lb_call_status_, status_details, lb_chand, - lb_calld, lb_calld->lb_call_, grpc_error_string(error)); + "[xdslb %p] EDS call status received. Status = %d, details " + "= '%s', (lb_chand: %p, eds_calld: %p, lb_call: %p), error '%s'", + xdslb_policy, eds_calld->status_code_, status_details, lb_chand, + eds_calld, eds_calld->lb_call_, grpc_error_string(error)); gpr_free(status_details); } // Ignore status from a stale call. - if (lb_calld->IsCurrentCallOnChannel()) { + if (eds_calld->IsCurrentCallOnChannel()) { // Because this call is the current one on the channel, the channel can't // have been swapped out; otherwise, the call should have been reset. GPR_ASSERT(lb_chand->IsCurrentChannel() || lb_chand->IsPendingChannel()); - GPR_ASSERT(!xdslb_policy->shutting_down_); if (lb_chand != xdslb_policy->LatestLbChannel()) { // This channel must be the current one and there is a pending one. Swap // in the pending one and we are done. @@ -1309,23 +1266,13 @@ void XdsLb::BalancerChannelState::BalancerCallState:: gpr_log(GPR_INFO, "[xdslb %p] Promoting pending LB channel %p to replace " "current LB channel %p", - xdslb_policy, lb_calld->lb_chand_.get(), - lb_calld->xdslb_policy()->lb_chand_.get()); + xdslb_policy, lb_chand, xdslb_policy->lb_chand_.get()); } xdslb_policy->lb_chand_ = std::move(xdslb_policy->pending_lb_chand_); } else { // This channel is the most recently created one. Try to restart the call // and reresolve. - lb_chand->lb_calld_.reset(); - if (lb_calld->seen_initial_response_) { - // If we lost connection to the LB server, reset the backoff and restart - // the LB call immediately. - lb_chand->lb_call_backoff_.Reset(); - lb_chand->StartCallLocked(); - } else { - // If we failed to connect to the LB server, retry later. - lb_chand->StartCallRetryTimerLocked(); - } + eds_calld->parent_->OnCallFinishedLocked(); xdslb_policy->channel_control_helper()->RequestReresolution(); // If the fallback-at-startup checks are pending, go into fallback mode // immediately. This short-circuits the timeout for the @@ -1341,7 +1288,369 @@ void XdsLb::BalancerChannelState::BalancerCallState:: } } } - lb_calld->Unref(DEBUG_LOCATION, "lb_call_ended"); + eds_calld->Unref(DEBUG_LOCATION, "EDS+OnStatusReceivedLocked"); +} + +bool XdsLb::LbChannelState::EdsCallState::IsCurrentCallOnChannel() const { + // If the retryable EDS call is null (which only happens when the LB channel + // is shutting down), all the EDS calls are stale. + if (lb_chand()->eds_calld_ == nullptr) return false; + return this == lb_chand()->eds_calld_->lb_calld(); +} + +// +// XdsLb::LbChannelState::LrsCallState::Reporter +// + +void XdsLb::LbChannelState::LrsCallState::Reporter::Orphan() { + if (next_report_timer_callback_pending_) { + grpc_timer_cancel(&next_report_timer_); + } +} + +void XdsLb::LbChannelState::LrsCallState::Reporter::ScheduleNextReportLocked() { + const grpc_millis next_report_time = ExecCtx::Get()->Now() + report_interval_; + grpc_timer_init(&next_report_timer_, next_report_time, + &on_next_report_timer_); + next_report_timer_callback_pending_ = true; +} + +void XdsLb::LbChannelState::LrsCallState::Reporter::OnNextReportTimerLocked( + void* arg, grpc_error* error) { + Reporter* self = static_cast(arg); + self->next_report_timer_callback_pending_ = false; + if (error != GRPC_ERROR_NONE || !self->IsCurrentReporterOnCall()) { + self->Unref(DEBUG_LOCATION, "Reporter+timer"); + return; + } + self->SendReportLocked(); +} + +void XdsLb::LbChannelState::LrsCallState::Reporter::SendReportLocked() { + // Create a request that contains the load report. + grpc_slice request_payload_slice = XdsLrsRequestCreateAndEncode( + xdslb_policy()->server_name_, &xdslb_policy()->client_stats_); + // Skip client load report if the counters were all zero in the last + // report and they are still zero in this one. + const bool old_val = last_report_counters_were_zero_; + last_report_counters_were_zero_ = static_cast( + grpc_slice_eq(request_payload_slice, grpc_empty_slice())); + if (old_val && last_report_counters_were_zero_) { + ScheduleNextReportLocked(); + return; + } + parent_->send_message_payload_ = + grpc_raw_byte_buffer_create(&request_payload_slice, 1); + grpc_slice_unref_internal(request_payload_slice); + // Send the report. + grpc_op op; + memset(&op, 0, sizeof(op)); + op.op = GRPC_OP_SEND_MESSAGE; + op.data.send_message.send_message = parent_->send_message_payload_; + grpc_call_error call_error = grpc_call_start_batch_and_execute( + parent_->lb_call_, &op, 1, &on_report_done_); + if (GPR_UNLIKELY(call_error != GRPC_CALL_OK)) { + gpr_log(GPR_ERROR, + "[xdslb %p] lb_calld=%p call_error=%d sending client load report", + xdslb_policy(), this, call_error); + GPR_ASSERT(GRPC_CALL_OK == call_error); + } +} + +void XdsLb::LbChannelState::LrsCallState::Reporter::OnReportDoneLocked( + void* arg, grpc_error* error) { + Reporter* self = static_cast(arg); + grpc_byte_buffer_destroy(self->parent_->send_message_payload_); + self->parent_->send_message_payload_ = nullptr; + if (error != GRPC_ERROR_NONE || !self->IsCurrentReporterOnCall()) { + // If this reporter is no longer the current one on the call, the reason + // might be that it was orphaned for a new one due to config update. + if (!self->IsCurrentReporterOnCall()) { + self->parent_->MaybeStartReportingLocked(); + } + self->Unref(DEBUG_LOCATION, "Reporter+report_done"); + return; + } + self->ScheduleNextReportLocked(); +} + +// +// XdsLb::LbChannelState::LrsCallState +// + +XdsLb::LbChannelState::LrsCallState::LrsCallState( + RefCountedPtr> parent) + : InternallyRefCounted(&grpc_lb_xds_trace), + parent_(std::move(parent)) { + // Init the LB call. Note that the LB call will progress every time there's + // activity in xdslb_policy()->interested_parties(), which is comprised of + // the polling entities from client_channel. + GPR_ASSERT(xdslb_policy() != nullptr); + GPR_ASSERT(xdslb_policy()->server_name_ != nullptr); + GPR_ASSERT(xdslb_policy()->server_name_[0] != '\0'); + const grpc_millis deadline = + xdslb_policy()->lb_call_timeout_ms_ == 0 + ? GRPC_MILLIS_INF_FUTURE + : ExecCtx::Get()->Now() + xdslb_policy()->lb_call_timeout_ms_; + lb_call_ = grpc_channel_create_pollset_set_call( + lb_chand()->channel_, nullptr, GRPC_PROPAGATE_DEFAULTS, + xdslb_policy()->interested_parties(), + GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V2_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS, + nullptr, deadline, nullptr); + GPR_ASSERT(lb_call_ != nullptr); + // Init the LB call request payload. + grpc_slice request_payload_slice = + XdsLrsRequestCreateAndEncode(xdslb_policy()->server_name_); + send_message_payload_ = + grpc_raw_byte_buffer_create(&request_payload_slice, 1); + grpc_slice_unref_internal(request_payload_slice); + // Init other data associated with the LRS call. + grpc_metadata_array_init(&initial_metadata_recv_); + grpc_metadata_array_init(&trailing_metadata_recv_); + GRPC_CLOSURE_INIT(&on_initial_request_sent_, OnInitialRequestSentLocked, this, + grpc_combiner_scheduler(xdslb_policy()->combiner())); + GRPC_CLOSURE_INIT(&on_response_received_, OnResponseReceivedLocked, this, + grpc_combiner_scheduler(xdslb_policy()->combiner())); + GRPC_CLOSURE_INIT(&on_status_received_, OnStatusReceivedLocked, this, + grpc_combiner_scheduler(xdslb_policy()->combiner())); + // Start the call. + if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { + gpr_log(GPR_INFO, + "[xdslb %p] Starting LRS call (lb_chand: %p, lb_calld: %p, " + "lb_call: %p)", + xdslb_policy(), lb_chand(), this, lb_call_); + } + // Create the ops. + grpc_call_error call_error; + grpc_op ops[3]; + memset(ops, 0, sizeof(ops)); + // Op: send initial metadata. + grpc_op* op = ops; + op->op = GRPC_OP_SEND_INITIAL_METADATA; + op->data.send_initial_metadata.count = 0; + op->flags = 0; + op->reserved = nullptr; + op++; + // Op: send request message. + GPR_ASSERT(send_message_payload_ != nullptr); + op->op = GRPC_OP_SEND_MESSAGE; + op->data.send_message.send_message = send_message_payload_; + op->flags = 0; + op->reserved = nullptr; + op++; + Ref(DEBUG_LOCATION, "LRS+OnInitialRequestSentLocked").release(); + call_error = grpc_call_start_batch_and_execute( + lb_call_, ops, (size_t)(op - ops), &on_initial_request_sent_); + GPR_ASSERT(GRPC_CALL_OK == call_error); + // Op: recv initial metadata. + op = ops; + op->op = GRPC_OP_RECV_INITIAL_METADATA; + op->data.recv_initial_metadata.recv_initial_metadata = + &initial_metadata_recv_; + op->flags = 0; + op->reserved = nullptr; + op++; + // Op: recv response. + op->op = GRPC_OP_RECV_MESSAGE; + op->data.recv_message.recv_message = &recv_message_payload_; + op->flags = 0; + op->reserved = nullptr; + op++; + Ref(DEBUG_LOCATION, "LRS+OnResponseReceivedLocked").release(); + call_error = grpc_call_start_batch_and_execute( + lb_call_, ops, (size_t)(op - ops), &on_response_received_); + GPR_ASSERT(GRPC_CALL_OK == call_error); + // Op: recv server status. + op = ops; + op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; + op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv_; + op->data.recv_status_on_client.status = &status_code_; + op->data.recv_status_on_client.status_details = &status_details_; + op->flags = 0; + op->reserved = nullptr; + op++; + // This callback signals the end of the LB call, so it relies on the initial + // ref instead of a new ref. When it's invoked, it's the initial ref that is + // unreffed. + call_error = grpc_call_start_batch_and_execute( + lb_call_, ops, (size_t)(op - ops), &on_status_received_); + GPR_ASSERT(GRPC_CALL_OK == call_error); +} + +XdsLb::LbChannelState::LrsCallState::~LrsCallState() { + grpc_metadata_array_destroy(&initial_metadata_recv_); + grpc_metadata_array_destroy(&trailing_metadata_recv_); + grpc_byte_buffer_destroy(send_message_payload_); + grpc_byte_buffer_destroy(recv_message_payload_); + grpc_slice_unref_internal(status_details_); + GPR_ASSERT(lb_call_ != nullptr); + grpc_call_unref(lb_call_); +} + +void XdsLb::LbChannelState::LrsCallState::Orphan() { + reporter_.reset(); + GPR_ASSERT(lb_call_ != nullptr); + // If we are here because xdslb_policy wants to cancel the call, + // on_status_received_ will complete the cancellation and clean up. Otherwise, + // we are here because xdslb_policy has to orphan a failed call, then the + // following cancellation will be a no-op. + grpc_call_cancel(lb_call_, nullptr); + // Note that the initial ref is hold by on_status_received_. So the + // corresponding unref happens in on_status_received_ instead of here. +} + +void XdsLb::LbChannelState::LrsCallState::MaybeStartReportingLocked() { + // Don't start if this is not the current call on the current channel. + if (!IsCurrentCallOnChannel() || !lb_chand()->IsCurrentChannel()) return; + // Don't start again if already started. + if (reporter_ != nullptr) return; + // Don't start if the previous send_message op (of the initial request or the + // last report of the previous reporter) hasn't completed. + if (send_message_payload_ != nullptr) return; + // Don't start if no LRS response has arrived. + if (!seen_response()) return; + // Don't start if the EDS call hasn't received any valid response. Note that + // this must be the first channel because it is the current channel but its + // EDS call hasn't seen any response. + EdsCallState* eds_calld = lb_chand()->eds_calld_->lb_calld(); + if (eds_calld == nullptr || !eds_calld->seen_response()) return; + // Start reporting. + lb_chand()->xdslb_policy_->client_stats_.MaybeInitLastReportTime(); + reporter_ = MakeOrphanable( + Ref(DEBUG_LOCATION, "LRS+load_report+start"), load_reporting_interval_); +} + +void XdsLb::LbChannelState::LrsCallState::OnInitialRequestSentLocked( + void* arg, grpc_error* error) { + LrsCallState* lrs_calld = static_cast(arg); + // Clear the send_message_payload_. + grpc_byte_buffer_destroy(lrs_calld->send_message_payload_); + lrs_calld->send_message_payload_ = nullptr; + lrs_calld->MaybeStartReportingLocked(); + lrs_calld->Unref(DEBUG_LOCATION, "LRS+OnInitialRequestSentLocked"); +} + +void XdsLb::LbChannelState::LrsCallState::OnResponseReceivedLocked( + void* arg, grpc_error* error) { + LrsCallState* lrs_calld = static_cast(arg); + XdsLb* xdslb_policy = lrs_calld->xdslb_policy(); + // Empty payload means the LB call was cancelled. + if (!lrs_calld->IsCurrentCallOnChannel() || + lrs_calld->recv_message_payload_ == nullptr) { + lrs_calld->Unref(DEBUG_LOCATION, "LRS+OnResponseReceivedLocked"); + return; + } + // Read the response. + grpc_byte_buffer_reader bbr; + grpc_byte_buffer_reader_init(&bbr, lrs_calld->recv_message_payload_); + grpc_slice response_slice = grpc_byte_buffer_reader_readall(&bbr); + grpc_byte_buffer_reader_destroy(&bbr); + grpc_byte_buffer_destroy(lrs_calld->recv_message_payload_); + lrs_calld->recv_message_payload_ = nullptr; + // This anonymous lambda is a hack to avoid the usage of goto. + [&]() { + // Parse the response. + grpc_millis new_load_reporting_interval; + grpc_error* parse_error = XdsLrsResponseDecodeAndParse( + response_slice, &new_load_reporting_interval, + xdslb_policy->server_name_); + if (parse_error != GRPC_ERROR_NONE) { + gpr_log(GPR_ERROR, "[xdslb %p] LRS response parsing failed. error=%s", + xdslb_policy, grpc_error_string(parse_error)); + GRPC_ERROR_UNREF(parse_error); + return; + } + lrs_calld->seen_response_ = true; + if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { + gpr_log(GPR_INFO, + "[xdslb %p] LRS response received, load_report_interval=%" PRId64 + "ms", + xdslb_policy, new_load_reporting_interval); + } + if (new_load_reporting_interval < + GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS) { + new_load_reporting_interval = + GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS; + if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { + gpr_log( + GPR_INFO, + "[xdslb %p] Increased load_report_interval to minimum value %dms", + xdslb_policy, GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS); + } + } + // Ignore identical update. + if (lrs_calld->load_reporting_interval_ == new_load_reporting_interval) { + if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { + gpr_log(GPR_INFO, + "[xdslb %p] Incoming LRS response identical to current, " + "ignoring.", + xdslb_policy); + } + return; + } + // Stop current load reporting (if any) to adopt the new reporting interval. + lrs_calld->reporter_.reset(); + // Record the new config. + lrs_calld->load_reporting_interval_ = new_load_reporting_interval; + // Try starting sending load report. + lrs_calld->MaybeStartReportingLocked(); + }(); + grpc_slice_unref_internal(response_slice); + if (xdslb_policy->shutting_down_) { + lrs_calld->Unref(DEBUG_LOCATION, + "LRS+OnResponseReceivedLocked+xds_shutdown"); + return; + } + // Keep listening for LRS config updates. + grpc_op op; + memset(&op, 0, sizeof(op)); + op.op = GRPC_OP_RECV_MESSAGE; + op.data.recv_message.recv_message = &lrs_calld->recv_message_payload_; + op.flags = 0; + op.reserved = nullptr; + GPR_ASSERT(lrs_calld->lb_call_ != nullptr); + // Reuse the "OnResponseReceivedLocked" ref taken in ctor. + const grpc_call_error call_error = grpc_call_start_batch_and_execute( + lrs_calld->lb_call_, &op, 1, &lrs_calld->on_response_received_); + GPR_ASSERT(GRPC_CALL_OK == call_error); +} + +void XdsLb::LbChannelState::LrsCallState::OnStatusReceivedLocked( + void* arg, grpc_error* error) { + LrsCallState* lrs_calld = static_cast(arg); + XdsLb* xdslb_policy = lrs_calld->xdslb_policy(); + LbChannelState* lb_chand = lrs_calld->lb_chand(); + GPR_ASSERT(lrs_calld->lb_call_ != nullptr); + if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { + char* status_details = grpc_slice_to_c_string(lrs_calld->status_details_); + gpr_log(GPR_INFO, + "[xdslb %p] LRS call status received. Status = %d, details " + "= '%s', (lb_chand: %p, lb_calld: %p, lb_call: %p), error '%s'", + xdslb_policy, lrs_calld->status_code_, status_details, lb_chand, + lrs_calld, lrs_calld->lb_call_, grpc_error_string(error)); + gpr_free(status_details); + } + // Ignore status from a stale call. + if (lrs_calld->IsCurrentCallOnChannel()) { + // Because this call is the current one on the channel, the channel can't + // have been swapped out; otherwise, the call should have been reset. + GPR_ASSERT(lb_chand->IsCurrentChannel() || lb_chand->IsPendingChannel()); + GPR_ASSERT(!xdslb_policy->shutting_down_); + if (lb_chand == xdslb_policy->LatestLbChannel()) { + // This channel is the most recently created one. Try to restart the call + // and reresolve. + lrs_calld->parent_->OnCallFinishedLocked(); + xdslb_policy->channel_control_helper()->RequestReresolution(); + } + } + lrs_calld->Unref(DEBUG_LOCATION, "LRS+OnStatusReceivedLocked"); +} + +bool XdsLb::LbChannelState::LrsCallState::IsCurrentCallOnChannel() const { + // If the retryable LRS call is null (which only happens when the LB channel + // is shutting down), all the LRS calls are stale. + if (lb_chand()->lrs_calld_ == nullptr) return false; + return this == lb_chand()->lrs_calld_->lb_calld(); } // @@ -1403,8 +1712,15 @@ grpc_channel_args* BuildBalancerChannelArgs(const grpc_channel_args* args) { XdsLb::XdsLb(Args args) : LoadBalancingPolicy(std::move(args)), - locality_map_(), - locality_serverlist_() { + lb_call_timeout_ms_(grpc_channel_args_find_integer( + args.args, GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS, {0, 0, INT_MAX})), + lb_fallback_timeout_ms_(grpc_channel_args_find_integer( + args.args, GRPC_ARG_XDS_FALLBACK_TIMEOUT_MS, + {GRPC_XDS_DEFAULT_FALLBACK_TIMEOUT_MS, 0, INT_MAX})), + locality_retention_interval_ms_(grpc_channel_args_find_integer( + args.args, GRPC_ARG_LOCALITY_RETENTION_INTERVAL_MS, + {GRPC_XDS_DEFAULT_LOCALITY_RETENTION_INTERVAL_MS, 0, INT_MAX})), + locality_map_(this) { // Record server name. const grpc_arg* arg = grpc_channel_args_find(args.args, GRPC_ARG_SERVER_URI); const char* server_uri = grpc_channel_arg_get_string(arg); @@ -1418,13 +1734,6 @@ XdsLb::XdsLb(Args args) server_name_); } grpc_uri_destroy(uri); - // Record LB call timeout. - arg = grpc_channel_args_find(args.args, GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS); - lb_call_timeout_ms_ = grpc_channel_arg_get_integer(arg, {0, 0, INT_MAX}); - // Record fallback timeout. - arg = grpc_channel_args_find(args.args, GRPC_ARG_XDS_FALLBACK_TIMEOUT_MS); - lb_fallback_timeout_ms_ = grpc_channel_arg_get_integer( - arg, {GRPC_XDS_DEFAULT_FALLBACK_TIMEOUT_MS, 0, INT_MAX}); } XdsLb::~XdsLb() { @@ -1433,7 +1742,7 @@ XdsLb::~XdsLb() { } gpr_free((void*)server_name_); grpc_channel_args_destroy(args_); - locality_serverlist_.clear(); + locality_list_.clear(); } void XdsLb::ShutdownLocked() { @@ -1482,9 +1791,9 @@ void XdsLb::ResetBackoffLocked() { } void XdsLb::ProcessAddressesAndChannelArgsLocked( - const ServerAddressList& addresses, const grpc_channel_args& args) { + ServerAddressList addresses, const grpc_channel_args& args) { // Update fallback address list. - fallback_backend_addresses_ = ExtractBackendAddresses(addresses); + fallback_backend_addresses_ = std::move(addresses); // Make sure that GRPC_ARG_LB_POLICY_NAME is set in channel args, // since we use this to trigger the client_load_reporting filter. static const char* args_to_remove[] = {GRPC_ARG_LB_POLICY_NAME}; @@ -1505,11 +1814,10 @@ void XdsLb::ProcessAddressesAndChannelArgsLocked( strcmp(last_balancer_name.get(), balancer_name_.get()) != 0; } if (create_lb_channel) { - OrphanablePtr lb_chand = - MakeOrphanable( - balancer_name_.get(), *lb_channel_args, - Ref(DEBUG_LOCATION, "BalancerChannelState")); - if (lb_chand_ == nullptr || !lb_chand_->HasActiveCall()) { + OrphanablePtr lb_chand = MakeOrphanable( + Ref(DEBUG_LOCATION, "XdsLb+LbChannelState"), balancer_name_.get(), + *lb_channel_args); + if (lb_chand_ == nullptr || !lb_chand_->HasActiveEdsCall()) { GPR_ASSERT(pending_lb_chand_ == nullptr); // If we do not have a working LB channel yet, use the newly created one. lb_chand_ = std::move(lb_chand); @@ -1524,6 +1832,7 @@ void XdsLb::ProcessAddressesAndChannelArgsLocked( void XdsLb::ParseLbConfig(const ParsedXdsConfig* xds_config) { if (xds_config == nullptr || xds_config->balancer_name() == nullptr) return; // TODO(yashykt) : does this need to be a gpr_strdup + // TODO(juanlishen): Read balancer name from bootstrap file. balancer_name_ = UniquePtr(gpr_strdup(xds_config->balancer_name())); child_policy_config_ = xds_config->child_policy(); fallback_policy_config_ = xds_config->fallback_policy(); @@ -1536,9 +1845,9 @@ void XdsLb::UpdateLocked(UpdateArgs args) { gpr_log(GPR_ERROR, "[xdslb %p] LB config parsing fails.", this); return; } - ProcessAddressesAndChannelArgsLocked(args.addresses, *args.args); - locality_map_.UpdateLocked(locality_serverlist_, child_policy_config_.get(), - args_, this); + ProcessAddressesAndChannelArgsLocked(std::move(args.addresses), *args.args); + locality_map_.UpdateLocked(locality_list_, child_policy_config_.get(), args_, + this, is_initial_update); // Update the existing fallback policy. The fallback policy config and/or the // fallback addresses may be new. if (fallback_policy_ != nullptr) UpdateFallbackPolicyLocked(); @@ -1736,44 +2045,111 @@ void XdsLb::MaybeExitFallbackMode() { // XdsLb::LocalityMap // -void XdsLb::LocalityMap::PruneLocalities(const LocalityList& locality_list) { - for (auto iter = map_.begin(); iter != map_.end();) { - bool found = false; - for (size_t i = 0; i < locality_list.size(); i++) { - if (*locality_list[i]->locality_name == *iter->first) { - found = true; +void XdsLb::LocalityMap::UpdateLocked( + const XdsLocalityList& locality_list, + LoadBalancingPolicy::Config* child_policy_config, + const grpc_channel_args* args, XdsLb* parent, bool is_initial_update) { + if (parent->shutting_down_) return; + // Add or update the localities in locality_list. + for (size_t i = 0; i < locality_list.size(); i++) { + auto& locality_name = locality_list[i].locality_name; + auto iter = map_.find(locality_name); + // Add a new entry in the locality map if a new locality is received in the + // locality list. + if (iter == map_.end()) { + OrphanablePtr new_entry = MakeOrphanable( + parent->Ref(DEBUG_LOCATION, "LocalityEntry"), locality_name); + iter = map_.emplace(locality_name, std::move(new_entry)).first; + } + // Keep a copy of serverlist in locality_list_ so that we can compare it + // with the future ones. + iter->second->UpdateLocked(locality_list[i].lb_weight, + locality_list[i].serverlist, child_policy_config, + args); + } + // Remove (later) the localities not in locality_list. + for (auto& p : map_) { + const XdsLocalityName* locality_name = p.first.get(); + LocalityEntry* locality_entry = p.second.get(); + bool in_locality_list = false; + for (size_t i = 0; i < locality_list.size(); ++i) { + if (*locality_list[i].locality_name == *locality_name) { + in_locality_list = true; break; } } - if (!found) { // Remove entries not present in the locality list - iter = map_.erase(iter); - } else - iter++; + if (!in_locality_list) locality_entry->DeactivateLocked(); } + // Generate a new xds picker immediately. + if (!is_initial_update) UpdateXdsPickerLocked(); } -void XdsLb::LocalityMap::UpdateLocked( - const LocalityList& locality_serverlist, - LoadBalancingPolicy::Config* child_policy_config, - const grpc_channel_args* args, XdsLb* parent) { - if (parent->shutting_down_) return; - for (size_t i = 0; i < locality_serverlist.size(); i++) { - auto iter = map_.find(locality_serverlist[i]->locality_name); - if (iter == map_.end()) { - OrphanablePtr new_entry = MakeOrphanable( - parent->Ref(DEBUG_LOCATION, "LocalityEntry"), - locality_serverlist[i]->locality_name, - locality_serverlist[i]->locality_weight); - iter = map_.emplace(locality_serverlist[i]->locality_name, - std::move(new_entry)) - .first; +void XdsLb::LocalityMap::UpdateXdsPickerLocked() { + // If we are in fallback mode, don't generate an xds picker from localities. + if (xds_policy_->fallback_policy_ != nullptr) return; + // Construct a new xds picker which maintains a map of all locality pickers + // that are ready. Each locality is represented by a portion of the range + // proportional to its weight, such that the total range is the sum of the + // weights of all localities. + uint32_t end = 0; + size_t num_connecting = 0; + size_t num_idle = 0; + size_t num_transient_failures = 0; + Picker::PickerList pickers; + for (auto& p : map_) { + const LocalityEntry* entry = p.second.get(); + if (entry->locality_weight() == 0) continue; + switch (entry->connectivity_state()) { + case GRPC_CHANNEL_READY: { + end += entry->locality_weight(); + pickers.push_back(MakePair(end, entry->picker_wrapper())); + break; + } + case GRPC_CHANNEL_CONNECTING: { + num_connecting++; + break; + } + case GRPC_CHANNEL_IDLE: { + num_idle++; + break; + } + case GRPC_CHANNEL_TRANSIENT_FAILURE: { + num_transient_failures++; + break; + } + default: + GPR_UNREACHABLE_CODE(return ); } - // Don't create new child policies if not directed to - xds_grpclb_serverlist* serverlist = - parent->locality_serverlist_[i]->serverlist; - iter->second->UpdateLocked(serverlist, child_policy_config, args); } - PruneLocalities(locality_serverlist); + // Pass on the constructed xds picker if it has any ready pickers in their map + // otherwise pass a QueuePicker if any of the locality pickers are in a + // connecting or idle state, finally return a transient failure picker if all + // locality pickers are in transient failure. + if (!pickers.empty()) { + xds_policy_->channel_control_helper()->UpdateState( + GRPC_CHANNEL_READY, + UniquePtr( + New(xds_policy_->Ref(DEBUG_LOCATION, "XdsLb+Picker"), + std::move(pickers)))); + } else if (num_connecting > 0) { + xds_policy_->channel_control_helper()->UpdateState( + GRPC_CHANNEL_CONNECTING, + UniquePtr( + New(xds_policy_->Ref(DEBUG_LOCATION, "QueuePicker")))); + } else if (num_idle > 0) { + xds_policy_->channel_control_helper()->UpdateState( + GRPC_CHANNEL_IDLE, + UniquePtr( + New(xds_policy_->Ref(DEBUG_LOCATION, "QueuePicker")))); + } else { + grpc_error* error = + grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING( + "connections to all active localities failing"), + GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE); + xds_policy_->channel_control_helper()->UpdateState( + GRPC_CHANNEL_TRANSIENT_FAILURE, + UniquePtr(New(error))); + } } void XdsLb::LocalityMap::ShutdownLocked() { map_.clear(); } @@ -1789,15 +2165,14 @@ void XdsLb::LocalityMap::ResetBackoffLocked() { // XdsLb::LocalityMap::LocalityEntry::LocalityEntry( - RefCountedPtr parent, RefCountedPtr name, - uint32_t locality_weight) - : parent_(std::move(parent)), - name_(std::move(name)), - locality_weight_(locality_weight) { + RefCountedPtr parent, RefCountedPtr name) + : parent_(std::move(parent)), name_(std::move(name)) { if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_trace)) { gpr_log(GPR_INFO, "[xdslb %p] created LocalityEntry %p for %s", parent_.get(), this, name_->AsHumanReadableString()); } + GRPC_CLOSURE_INIT(&on_delayed_removal_timer_, OnDelayedRemovalTimerLocked, + this, grpc_combiner_scheduler(parent_->combiner())); } XdsLb::LocalityMap::LocalityEntry::~LocalityEntry() { @@ -1861,13 +2236,18 @@ XdsLb::LocalityMap::LocalityEntry::CreateChildPolicyLocked( } void XdsLb::LocalityMap::LocalityEntry::UpdateLocked( - xds_grpclb_serverlist* serverlist, + uint32_t locality_weight, ServerAddressList serverlist, LoadBalancingPolicy::Config* child_policy_config, const grpc_channel_args* args_in) { if (parent_->shutting_down_) return; + // Update locality weight. + locality_weight_ = locality_weight; + if (delayed_removal_timer_callback_pending_) { + grpc_timer_cancel(&delayed_removal_timer_); + } // Construct update args. UpdateArgs update_args; - update_args.addresses = ProcessServerlist(serverlist); + update_args.addresses = std::move(serverlist); update_args.config = child_policy_config == nullptr ? nullptr : child_policy_config->Ref(); update_args.args = CreateChildPolicyArgsLocked(args_in); @@ -1988,7 +2368,10 @@ void XdsLb::LocalityMap::LocalityEntry::ShutdownLocked() { } // Drop our ref to the child's picker, in case it's holding a ref to // the child. - picker_ref_.reset(); + picker_wrapper_.reset(); + if (delayed_removal_timer_callback_pending_) { + grpc_timer_cancel(&delayed_removal_timer_); + } } void XdsLb::LocalityMap::LocalityEntry::ResetBackoffLocked() { @@ -2003,6 +2386,36 @@ void XdsLb::LocalityMap::LocalityEntry::Orphan() { Unref(); } +void XdsLb::LocalityMap::LocalityEntry::DeactivateLocked() { + // If locality retaining is disabled, delete the locality immediately. + if (parent_->locality_retention_interval_ms_ == 0) { + parent_->locality_map_.map_.erase(name_); + return; + } + // If already deactivated, don't do that again. + if (locality_weight_ == 0) return; + // Set the locality weight to 0 so that future xds picker won't contain this + // locality. + locality_weight_ = 0; + // Start a timer to delete the locality. + Ref(DEBUG_LOCATION, "LocalityEntry+timer").release(); + grpc_timer_init( + &delayed_removal_timer_, + ExecCtx::Get()->Now() + parent_->locality_retention_interval_ms_, + &on_delayed_removal_timer_); + delayed_removal_timer_callback_pending_ = true; +} + +void XdsLb::LocalityMap::LocalityEntry::OnDelayedRemovalTimerLocked( + void* arg, grpc_error* error) { + LocalityEntry* self = static_cast(arg); + self->delayed_removal_timer_callback_pending_ = false; + if (error == GRPC_ERROR_NONE && self->locality_weight_ == 0) { + self->parent_->locality_map_.map_.erase(self->name_); + } + self->Unref(DEBUG_LOCATION, "LocalityEntry+timer"); +} + // // XdsLb::LocalityEntry::Helper // @@ -2062,81 +2475,14 @@ void XdsLb::LocalityMap::LocalityEntry::Helper::UpdateState( entry_->parent_->MaybeCancelFallbackAtStartupChecks(); entry_->parent_->MaybeExitFallbackMode(); } - // If we are in fallback mode, ignore update request from the child policy. - if (entry_->parent_->fallback_policy_ != nullptr) return; GPR_ASSERT(entry_->parent_->lb_chand_ != nullptr); - RefCountedPtr client_stats = - entry_->parent_->lb_chand_->lb_calld() == nullptr - ? nullptr - : entry_->parent_->lb_chand_->lb_calld()->client_stats(); - // Cache the picker and its state in the entry - entry_->picker_ref_ = MakeRefCounted(std::move(picker)); + // Cache the picker and its state in the entry. + entry_->picker_wrapper_ = MakeRefCounted( + std::move(picker), + entry_->parent_->client_stats_.FindLocalityStats(entry_->name_)); entry_->connectivity_state_ = state; - // Construct a new xds picker which maintains a map of all locality pickers - // that are ready. Each locality is represented by a portion of the range - // proportional to its weight, such that the total range is the sum of the - // weights of all localities - uint32_t end = 0; - size_t num_connecting = 0; - size_t num_idle = 0; - size_t num_transient_failures = 0; - auto& locality_map = this->entry_->parent_->locality_map_.map_; - Picker::PickerList pickers; - for (auto& p : locality_map) { - const LocalityEntry* entry = p.second.get(); - grpc_connectivity_state connectivity_state = entry->connectivity_state_; - switch (connectivity_state) { - case GRPC_CHANNEL_READY: { - end += entry->locality_weight_; - pickers.push_back(MakePair(end, entry->picker_ref_)); - break; - } - case GRPC_CHANNEL_CONNECTING: { - num_connecting++; - break; - } - case GRPC_CHANNEL_IDLE: { - num_idle++; - break; - } - case GRPC_CHANNEL_TRANSIENT_FAILURE: { - num_transient_failures++; - break; - } - default: { - gpr_log(GPR_ERROR, "Invalid locality connectivity state - %d", - connectivity_state); - } - } - } - // Pass on the constructed xds picker if it has any ready pickers in their map - // otherwise pass a QueuePicker if any of the locality pickers are in a - // connecting or idle state, finally return a transient failure picker if all - // locality pickers are in transient failure - if (pickers.size() > 0) { - entry_->parent_->channel_control_helper()->UpdateState( - GRPC_CHANNEL_READY, - UniquePtr( - New(std::move(client_stats), std::move(pickers)))); - } else if (num_connecting > 0) { - entry_->parent_->channel_control_helper()->UpdateState( - GRPC_CHANNEL_CONNECTING, - UniquePtr(New( - this->entry_->parent_->Ref(DEBUG_LOCATION, "QueuePicker")))); - } else if (num_idle > 0) { - entry_->parent_->channel_control_helper()->UpdateState( - GRPC_CHANNEL_IDLE, - UniquePtr(New( - this->entry_->parent_->Ref(DEBUG_LOCATION, "QueuePicker")))); - } else { - GPR_ASSERT(num_transient_failures == locality_map.size()); - grpc_error* error = - grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING( - "connections to all localities failing"), - GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE); - entry_->parent_->channel_control_helper()->UpdateState( - state, UniquePtr(New(error))); - } + // Construct a new xds picker and pass it to the channel. + entry_->parent_->locality_map_.UpdateXdsPickerLocked(); } void XdsLb::LocalityMap::LocalityEntry::Helper::RequestReresolution() { @@ -2157,8 +2503,8 @@ void XdsLb::LocalityMap::LocalityEntry::Helper::RequestReresolution() { // from the balancer, so we can ignore the re-resolution request from // the child policy. Otherwise, pass the re-resolution request up to the // channel. - if (entry_->parent_->lb_chand_->lb_calld() == nullptr || - !entry_->parent_->lb_chand_->lb_calld()->seen_initial_response()) { + if (entry_->parent_->lb_chand_->eds_calld() == nullptr || + !entry_->parent_->lb_chand_->eds_calld()->seen_response()) { entry_->parent_->channel_control_helper()->RequestReresolution(); } } @@ -2243,10 +2589,6 @@ class XdsFactory : public LoadBalancingPolicyFactory { } } } - if (balancer_name == nullptr) { - error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING( - "field:balancerName error:not found")); - } if (error_list.empty()) { return RefCountedPtr(New( balancer_name, std::move(child_policy), std::move(fallback_policy))); diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc b/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc index cdf5408be36..85f7d669ec0 100644 --- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc +++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc @@ -26,60 +26,163 @@ namespace grpc_core { -void XdsLbClientStats::AddCallStarted() { - gpr_atm_full_fetch_add(&num_calls_started_, (gpr_atm)1); +namespace { + +template +T GetAndResetCounter(Atomic* from) { + return from->Exchange(0, MemoryOrder::RELAXED); +} + +} // namespace + +// +// XdsClientStats::LocalityStats::LoadMetric::Snapshot +// + +bool XdsClientStats::LocalityStats::LoadMetric::Snapshot::IsAllZero() const { + return total_metric_value == 0 && num_requests_finished_with_metric == 0; +} + +// +// XdsClientStats::LocalityStats::LoadMetric +// + +XdsClientStats::LocalityStats::LoadMetric::Snapshot +XdsClientStats::LocalityStats::LoadMetric::GetSnapshotAndReset() { + Snapshot metric = {num_requests_finished_with_metric_, total_metric_value_}; + num_requests_finished_with_metric_ = 0; + total_metric_value_ = 0; + return metric; } -void XdsLbClientStats::AddCallFinished(bool finished_with_client_failed_to_send, - bool finished_known_received) { - gpr_atm_full_fetch_add(&num_calls_finished_, (gpr_atm)1); - if (finished_with_client_failed_to_send) { - gpr_atm_full_fetch_add(&num_calls_finished_with_client_failed_to_send_, - (gpr_atm)1); +// +// XdsClientStats::LocalityStats::Snapshot +// + +bool XdsClientStats::LocalityStats::Snapshot::IsAllZero() { + if (total_successful_requests != 0 || total_requests_in_progress != 0 || + total_error_requests != 0 || total_issued_requests != 0) { + return false; } - if (finished_known_received) { - gpr_atm_full_fetch_add(&num_calls_finished_known_received_, (gpr_atm)1); + for (auto& p : load_metric_stats) { + const LoadMetric::Snapshot& metric_value = p.second; + if (!metric_value.IsAllZero()) return false; } + return true; } -void XdsLbClientStats::AddCallDroppedLocked(char* token) { - // Increment num_calls_started and num_calls_finished. - gpr_atm_full_fetch_add(&num_calls_started_, (gpr_atm)1); - gpr_atm_full_fetch_add(&num_calls_finished_, (gpr_atm)1); - // Record the drop. - if (drop_token_counts_ == nullptr) { - drop_token_counts_.reset(New()); - } - for (size_t i = 0; i < drop_token_counts_->size(); ++i) { - if (strcmp((*drop_token_counts_)[i].token.get(), token) == 0) { - ++(*drop_token_counts_)[i].count; - return; +// +// XdsClientStats::LocalityStats +// + +XdsClientStats::LocalityStats::Snapshot +XdsClientStats::LocalityStats::GetSnapshotAndReset() { + Snapshot snapshot = { + GetAndResetCounter(&total_successful_requests_), + // Don't reset total_requests_in_progress because it's not + // related to a single reporting interval. + total_requests_in_progress_.Load(MemoryOrder::RELAXED), + GetAndResetCounter(&total_error_requests_), + GetAndResetCounter(&total_issued_requests_)}; + { + MutexLock lock(&load_metric_stats_mu_); + for (auto& p : load_metric_stats_) { + const char* metric_name = p.first.get(); + LoadMetric& metric_value = p.second; + snapshot.load_metric_stats.emplace( + UniquePtr(gpr_strdup(metric_name)), + metric_value.GetSnapshotAndReset()); } } - // Not found, so add a new entry. - drop_token_counts_->emplace_back(UniquePtr(gpr_strdup(token)), 1); + return snapshot; } -namespace { +void XdsClientStats::LocalityStats::AddCallStarted() { + total_issued_requests_.FetchAdd(1, MemoryOrder::RELAXED); + total_requests_in_progress_.FetchAdd(1, MemoryOrder::RELAXED); +} -void AtomicGetAndResetCounter(int64_t* value, gpr_atm* counter) { - *value = static_cast(gpr_atm_full_xchg(counter, (gpr_atm)0)); +void XdsClientStats::LocalityStats::AddCallFinished(bool fail) { + Atomic& to_increment = + fail ? total_error_requests_ : total_successful_requests_; + to_increment.FetchAdd(1, MemoryOrder::RELAXED); + total_requests_in_progress_.FetchAdd(-1, MemoryOrder::ACQ_REL); } -} // namespace +// +// XdsClientStats::Snapshot +// -void XdsLbClientStats::GetLocked( - int64_t* num_calls_started, int64_t* num_calls_finished, - int64_t* num_calls_finished_with_client_failed_to_send, - int64_t* num_calls_finished_known_received, - UniquePtr* drop_token_counts) { - AtomicGetAndResetCounter(num_calls_started, &num_calls_started_); - AtomicGetAndResetCounter(num_calls_finished, &num_calls_finished_); - AtomicGetAndResetCounter(num_calls_finished_with_client_failed_to_send, - &num_calls_finished_with_client_failed_to_send_); - AtomicGetAndResetCounter(num_calls_finished_known_received, - &num_calls_finished_known_received_); - *drop_token_counts = std::move(drop_token_counts_); +bool XdsClientStats::Snapshot::IsAllZero() { + for (auto& p : upstream_locality_stats) { + if (!p.second.IsAllZero()) return false; + } + for (auto& p : dropped_requests) { + if (p.second != 0) return false; + } + return total_dropped_requests == 0; +} + +// +// XdsClientStats +// + +XdsClientStats::Snapshot XdsClientStats::GetSnapshotAndReset() { + grpc_millis now = ExecCtx::Get()->Now(); + // Record total_dropped_requests and reporting interval in the snapshot. + Snapshot snapshot; + snapshot.total_dropped_requests = + GetAndResetCounter(&total_dropped_requests_); + snapshot.load_report_interval = now - last_report_time_; + // Update last report time. + last_report_time_ = now; + // Snapshot all the other stats. + for (auto& p : upstream_locality_stats_) { + snapshot.upstream_locality_stats.emplace(p.first, + p.second->GetSnapshotAndReset()); + } + { + MutexLock lock(&dropped_requests_mu_); + snapshot.dropped_requests = std::move(dropped_requests_); + } + return snapshot; +} + +void XdsClientStats::MaybeInitLastReportTime() { + if (last_report_time_ == -1) last_report_time_ = ExecCtx::Get()->Now(); +} + +RefCountedPtr XdsClientStats::FindLocalityStats( + const RefCountedPtr& locality_name) { + auto iter = upstream_locality_stats_.find(locality_name); + if (iter == upstream_locality_stats_.end()) { + iter = upstream_locality_stats_ + .emplace(locality_name, MakeRefCounted()) + .first; + } + return iter->second; +} + +void XdsClientStats::PruneLocalityStats() { + auto iter = upstream_locality_stats_.begin(); + while (iter != upstream_locality_stats_.end()) { + if (iter->second->IsSafeToDelete()) { + iter = upstream_locality_stats_.erase(iter); + } else { + ++iter; + } + } +} + +void XdsClientStats::AddCallDropped(const UniquePtr& category) { + total_dropped_requests_.FetchAdd(1, MemoryOrder::RELAXED); + MutexLock lock(&dropped_requests_mu_); + auto iter = dropped_requests_.find(category); + if (iter == dropped_requests_.end()) { + dropped_requests_.emplace(UniquePtr(gpr_strdup(category.get())), 1); + } else { + ++iter->second; + } } } // namespace grpc_core diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h b/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h index fa0b9f4b635..6e8dd961ea9 100644 --- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h +++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h @@ -21,49 +21,207 @@ #include -#include +#include +#include "src/core/lib/gprpp/atomic.h" #include "src/core/lib/gprpp/inlined_vector.h" +#include "src/core/lib/gprpp/map.h" #include "src/core/lib/gprpp/memory.h" #include "src/core/lib/gprpp/ref_counted.h" +#include "src/core/lib/gprpp/sync.h" +#include "src/core/lib/iomgr/exec_ctx.h" namespace grpc_core { -class XdsLbClientStats : public RefCounted { +class XdsLocalityName : public RefCounted { public: - struct DropTokenCount { - UniquePtr token; - int64_t count; + struct Less { + bool operator()(const RefCountedPtr& lhs, + const RefCountedPtr& rhs) const { + int cmp_result = strcmp(lhs->region_.get(), rhs->region_.get()); + if (cmp_result != 0) return cmp_result < 0; + cmp_result = strcmp(lhs->zone_.get(), rhs->zone_.get()); + if (cmp_result != 0) return cmp_result < 0; + return strcmp(lhs->sub_zone_.get(), rhs->sub_zone_.get()) < 0; + } + }; + + XdsLocalityName(UniquePtr region, UniquePtr zone, + UniquePtr subzone) + : region_(std::move(region)), + zone_(std::move(zone)), + sub_zone_(std::move(subzone)) {} + + bool operator==(const XdsLocalityName& other) const { + return strcmp(region_.get(), other.region_.get()) == 0 && + strcmp(zone_.get(), other.zone_.get()) == 0 && + strcmp(sub_zone_.get(), other.sub_zone_.get()) == 0; + } + + const char* region() const { return region_.get(); } + const char* zone() const { return zone_.get(); } + const char* sub_zone() const { return sub_zone_.get(); } + + const char* AsHumanReadableString() { + if (human_readable_string_ == nullptr) { + char* tmp; + gpr_asprintf(&tmp, "{region=\"%s\", zone=\"%s\", sub_zone=\"%s\"}", + region_.get(), zone_.get(), sub_zone_.get()); + human_readable_string_.reset(tmp); + } + return human_readable_string_.get(); + } + + private: + UniquePtr region_; + UniquePtr zone_; + UniquePtr sub_zone_; + UniquePtr human_readable_string_; +}; + +// The stats classes (i.e., XdsClientStats, LocalityStats, and LoadMetric) can +// be taken a snapshot (and reset) to populate the load report. The snapshots +// are contained in the respective Snapshot structs. The Snapshot structs have +// no synchronization. The stats classes use several different synchronization +// methods. 1. Most of the counters are Atomic<>s for performance. 2. Some of +// the Map<>s are protected by Mutex if we are not guaranteed that the accesses +// to them are synchronized by the callers. 3. The Map<>s to which the accesses +// are already synchronized by the callers do not have additional +// synchronization here. Note that the Map<>s we mentioned in 2 and 3 refer to +// the map's tree structure rather than the content in each tree node. +class XdsClientStats { + public: + class LocalityStats : public RefCounted { + public: + class LoadMetric { + public: + struct Snapshot { + bool IsAllZero() const; - DropTokenCount(UniquePtr token, int64_t count) - : token(std::move(token)), count(count) {} + uint64_t num_requests_finished_with_metric; + double total_metric_value; + }; + + // Returns a snapshot of this instance and reset all the accumulative + // counters. + Snapshot GetSnapshotAndReset(); + + private: + uint64_t num_requests_finished_with_metric_{0}; + double total_metric_value_{0}; + }; + + using LoadMetricMap = Map, LoadMetric, StringLess>; + using LoadMetricSnapshotMap = + Map, LoadMetric::Snapshot, StringLess>; + + struct Snapshot { + // TODO(juanlishen): Change this to const method when const_iterator is + // added to Map<>. + bool IsAllZero(); + + uint64_t total_successful_requests; + uint64_t total_requests_in_progress; + uint64_t total_error_requests; + uint64_t total_issued_requests; + LoadMetricSnapshotMap load_metric_stats; + }; + + // Returns a snapshot of this instance and reset all the accumulative + // counters. + Snapshot GetSnapshotAndReset(); + + // Each XdsLb::PickerWrapper holds a ref to the perspective LocalityStats. + // If the refcount is 0, there won't be new calls recorded to the + // LocalityStats, so the LocalityStats can be safely deleted when all the + // in-progress calls have finished. + // Only be called from the control plane combiner. + void RefByPicker() { picker_refcount_.FetchAdd(1, MemoryOrder::ACQ_REL); } + // Might be called from the control plane combiner or the data plane + // combiner. + // TODO(juanlishen): Once https://github.com/grpc/grpc/pull/19390 is merged, + // this method will also only be invoked in the control plane combiner. + // We may then be able to simplify the LocalityStats' lifetime by making it + // RefCounted<> and populating the protobuf in its dtor. + void UnrefByPicker() { picker_refcount_.FetchSub(1, MemoryOrder::ACQ_REL); } + // Only be called from the control plane combiner. + // The only place where the picker_refcount_ can be increased is + // RefByPicker(), which also can only be called from the control plane + // combiner. Also, if the picker_refcount_ is 0, total_requests_in_progress_ + // can't be increased from 0. So it's safe to delete the LocalityStats right + // after this method returns true. + bool IsSafeToDelete() { + return picker_refcount_.FetchAdd(0, MemoryOrder::ACQ_REL) == 0 && + total_requests_in_progress_.FetchAdd(0, MemoryOrder::ACQ_REL) == 0; + } + + void AddCallStarted(); + void AddCallFinished(bool fail = false); + + private: + Atomic total_successful_requests_{0}; + Atomic total_requests_in_progress_{0}; + // Requests that were issued (not dropped) but failed. + Atomic total_error_requests_{0}; + Atomic total_issued_requests_{0}; + // Protects load_metric_stats_. A mutex is necessary because the length of + // load_metric_stats_ can be accessed by both the callback intercepting the + // call's recv_trailing_metadata (not from any combiner) and the load + // reporting thread (from the control plane combiner). + Mutex load_metric_stats_mu_; + LoadMetricMap load_metric_stats_; + // Can be accessed from either the control plane combiner or the data plane + // combiner. + Atomic picker_refcount_{0}; }; - typedef InlinedVector DroppedCallCounts; + // TODO(juanlishen): The value type of Map<> must be movable in current + // implementation. To avoid making LocalityStats movable, we wrap it by + // UniquePtr<>. We should remove this wrapper if the value type of Map<> + // doesn't have to be movable. + using LocalityStatsMap = + Map, RefCountedPtr, + XdsLocalityName::Less>; + using LocalityStatsSnapshotMap = + Map, LocalityStats::Snapshot, + XdsLocalityName::Less>; + using DroppedRequestsMap = Map, uint64_t, StringLess>; + using DroppedRequestsSnapshotMap = DroppedRequestsMap; - XdsLbClientStats() {} + struct Snapshot { + // TODO(juanlishen): Change this to const method when const_iterator is + // added to Map<>. + bool IsAllZero(); - void AddCallStarted(); - void AddCallFinished(bool finished_with_client_failed_to_send, - bool finished_known_received); + LocalityStatsSnapshotMap upstream_locality_stats; + uint64_t total_dropped_requests; + DroppedRequestsSnapshotMap dropped_requests; + // The actual load report interval. + grpc_millis load_report_interval; + }; - // This method is not thread-safe; caller must synchronize. - void AddCallDroppedLocked(char* token); + // Returns a snapshot of this instance and reset all the accumulative + // counters. + Snapshot GetSnapshotAndReset(); - // This method is not thread-safe; caller must synchronize. - void GetLocked(int64_t* num_calls_started, int64_t* num_calls_finished, - int64_t* num_calls_finished_with_client_failed_to_send, - int64_t* num_calls_finished_known_received, - UniquePtr* drop_token_counts); + void MaybeInitLastReportTime(); + RefCountedPtr FindLocalityStats( + const RefCountedPtr& locality_name); + void PruneLocalityStats(); + void AddCallDropped(const UniquePtr& category); private: - // This field must only be accessed via *_locked() methods. - UniquePtr drop_token_counts_; - // These fields may be accessed from multiple threads at a time. - gpr_atm num_calls_started_ = 0; - gpr_atm num_calls_finished_ = 0; - gpr_atm num_calls_finished_with_client_failed_to_send_ = 0; - gpr_atm num_calls_finished_known_received_ = 0; + // The stats for each locality. + LocalityStatsMap upstream_locality_stats_; + Atomic total_dropped_requests_{0}; + // Protects dropped_requests_. A mutex is necessary because the length of + // dropped_requests_ can be accessed by both the picker (from data plane + // combiner) and the load reporting thread (from the control plane combiner). + Mutex dropped_requests_mu_; + DroppedRequestsMap dropped_requests_; + // The timestamp of last reporting. For the LB-policy-wide first report, the + // last_report_time is the time we scheduled the first reporting timer. + grpc_millis last_report_time_ = -1; }; } // namespace grpc_core diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc b/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc index 58f26bf54ec..ac87053d47f 100644 --- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc +++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc @@ -18,294 +18,430 @@ #include -#include "pb_decode.h" -#include "pb_encode.h" -#include "src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h" +#include +#include #include +#include -/* invoked once for every Server in ServerList */ -static bool count_serverlist(pb_istream_t* stream, const pb_field_t* field, - void** arg) { - xds_grpclb_serverlist* sl = static_cast(*arg); - xds_grpclb_server server; - if (GPR_UNLIKELY(!pb_decode(stream, grpc_lb_v1_Server_fields, &server))) { - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(stream)); - return false; - } - ++sl->num_servers; - return true; -} +#include "src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h" +#include "src/core/lib/iomgr/error.h" +#include "src/core/lib/iomgr/sockaddr_utils.h" -typedef struct decode_serverlist_arg { - /* The decoding callback is invoked once per server in serverlist. Remember - * which index of the serverlist are we currently decoding */ - size_t decoding_idx; - /* The decoded serverlist */ - xds_grpclb_serverlist* serverlist; -} decode_serverlist_arg; +#include "envoy/api/v2/core/address.upb.h" +#include "envoy/api/v2/core/base.upb.h" +#include "envoy/api/v2/discovery.upb.h" +#include "envoy/api/v2/eds.upb.h" +#include "envoy/api/v2/endpoint/endpoint.upb.h" +#include "envoy/api/v2/endpoint/load_report.upb.h" +#include "envoy/service/load_stats/v2/lrs.upb.h" +#include "envoy/type/percent.upb.h" +#include "google/protobuf/any.upb.h" +#include "google/protobuf/duration.upb.h" +#include "google/protobuf/struct.upb.h" +#include "google/protobuf/timestamp.upb.h" +#include "google/protobuf/wrappers.upb.h" +#include "upb/upb.h" -/* invoked once for every Server in ServerList */ -static bool decode_serverlist(pb_istream_t* stream, const pb_field_t* field, - void** arg) { - decode_serverlist_arg* dec_arg = static_cast(*arg); - GPR_ASSERT(dec_arg->serverlist->num_servers >= dec_arg->decoding_idx); - xds_grpclb_server* server = - static_cast(gpr_zalloc(sizeof(xds_grpclb_server))); - if (GPR_UNLIKELY(!pb_decode(stream, grpc_lb_v1_Server_fields, server))) { - gpr_free(server); - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(stream)); - return false; - } - dec_arg->serverlist->servers[dec_arg->decoding_idx++] = server; - return true; -} +namespace grpc_core { -xds_grpclb_request* xds_grpclb_request_create(const char* lb_service_name) { - xds_grpclb_request* req = - static_cast(gpr_malloc(sizeof(xds_grpclb_request))); - req->has_client_stats = false; - req->has_initial_request = true; - req->initial_request.has_name = true; - // GCC warns (-Wstringop-truncation) because the destination - // buffer size is identical to max-size, leading to a potential - // char[] with no null terminator. nanopb can handle it fine, - // and parantheses around strncpy silence that compiler warning. - (strncpy(req->initial_request.name, lb_service_name, - XDS_SERVICE_NAME_MAX_LENGTH)); - return req; -} +namespace { -static void populate_timestamp(gpr_timespec timestamp, - xds_grpclb_timestamp* timestamp_pb) { - timestamp_pb->has_seconds = true; - timestamp_pb->seconds = timestamp.tv_sec; - timestamp_pb->has_nanos = true; - timestamp_pb->nanos = timestamp.tv_nsec; -} +constexpr char kEdsTypeUrl[] = + "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment"; +constexpr char kEndpointRequired[] = "endpointRequired"; -static bool encode_string(pb_ostream_t* stream, const pb_field_t* field, - void* const* arg) { - char* str = static_cast(*arg); - if (!pb_encode_tag_for_field(stream, field)) return false; - return pb_encode_string(stream, reinterpret_cast(str), strlen(str)); -} +} // namespace -static bool encode_drops(pb_ostream_t* stream, const pb_field_t* field, - void* const* arg) { - grpc_core::XdsLbClientStats::DroppedCallCounts* drop_entries = - static_cast(*arg); - if (drop_entries == nullptr) return true; - for (size_t i = 0; i < drop_entries->size(); ++i) { - if (!pb_encode_tag_for_field(stream, field)) return false; - grpc_lb_v1_ClientStatsPerToken drop_message; - drop_message.load_balance_token.funcs.encode = encode_string; - drop_message.load_balance_token.arg = (*drop_entries)[i].token.get(); - drop_message.has_num_calls = true; - drop_message.num_calls = (*drop_entries)[i].count; - if (!pb_encode_submessage(stream, grpc_lb_v1_ClientStatsPerToken_fields, - &drop_message)) { - return false; +bool XdsDropConfig::ShouldDrop(const UniquePtr** category_name) const { + for (size_t i = 0; i < drop_category_list_.size(); ++i) { + const auto& drop_category = drop_category_list_[i]; + // Generate a random number in [0, 1000000). + const int random = rand() % 1000000; + if (random < drop_category.parts_per_million) { + *category_name = &drop_category.name; + return true; } } - return true; + return false; } -xds_grpclb_request* xds_grpclb_load_report_request_create_locked( - grpc_core::XdsLbClientStats* client_stats) { - xds_grpclb_request* req = - static_cast(gpr_zalloc(sizeof(xds_grpclb_request))); - req->has_client_stats = true; - req->client_stats.has_timestamp = true; - populate_timestamp(gpr_now(GPR_CLOCK_REALTIME), &req->client_stats.timestamp); - req->client_stats.has_num_calls_started = true; - req->client_stats.has_num_calls_finished = true; - req->client_stats.has_num_calls_finished_with_client_failed_to_send = true; - req->client_stats.has_num_calls_finished_with_client_failed_to_send = true; - req->client_stats.has_num_calls_finished_known_received = true; - req->client_stats.calls_finished_with_drop.funcs.encode = encode_drops; - grpc_core::UniquePtr - drop_counts; - client_stats->GetLocked( - &req->client_stats.num_calls_started, - &req->client_stats.num_calls_finished, - &req->client_stats.num_calls_finished_with_client_failed_to_send, - &req->client_stats.num_calls_finished_known_received, &drop_counts); - // Will be deleted in xds_grpclb_request_destroy(). - req->client_stats.calls_finished_with_drop.arg = drop_counts.release(); - return req; +grpc_slice XdsEdsRequestCreateAndEncode(const char* service_name) { + upb::Arena arena; + // Create a request. + envoy_api_v2_DiscoveryRequest* request = + envoy_api_v2_DiscoveryRequest_new(arena.ptr()); + envoy_api_v2_core_Node* node = + envoy_api_v2_DiscoveryRequest_mutable_node(request, arena.ptr()); + google_protobuf_Struct* metadata = + envoy_api_v2_core_Node_mutable_metadata(node, arena.ptr()); + google_protobuf_Struct_FieldsEntry* field = + google_protobuf_Struct_add_fields(metadata, arena.ptr()); + google_protobuf_Struct_FieldsEntry_set_key( + field, upb_strview_makez(kEndpointRequired)); + google_protobuf_Value* value = + google_protobuf_Struct_FieldsEntry_mutable_value(field, arena.ptr()); + google_protobuf_Value_set_bool_value(value, true); + envoy_api_v2_DiscoveryRequest_add_resource_names( + request, upb_strview_makez(service_name), arena.ptr()); + envoy_api_v2_DiscoveryRequest_set_type_url(request, + upb_strview_makez(kEdsTypeUrl)); + // Encode the request. + size_t output_length; + char* output = envoy_api_v2_DiscoveryRequest_serialize(request, arena.ptr(), + &output_length); + return grpc_slice_from_copied_buffer(output, output_length); } -grpc_slice xds_grpclb_request_encode(const xds_grpclb_request* request) { - size_t encoded_length; - pb_ostream_t sizestream; - pb_ostream_t outputstream; - grpc_slice slice; - memset(&sizestream, 0, sizeof(pb_ostream_t)); - pb_encode(&sizestream, grpc_lb_v1_LoadBalanceRequest_fields, request); - encoded_length = sizestream.bytes_written; +namespace { - slice = GRPC_SLICE_MALLOC(encoded_length); - outputstream = - pb_ostream_from_buffer(GRPC_SLICE_START_PTR(slice), encoded_length); - GPR_ASSERT(pb_encode(&outputstream, grpc_lb_v1_LoadBalanceRequest_fields, - request) != 0); - return slice; -} - -void xds_grpclb_request_destroy(xds_grpclb_request* request) { - if (request->has_client_stats) { - grpc_core::XdsLbClientStats::DroppedCallCounts* drop_entries = - static_cast( - request->client_stats.calls_finished_with_drop.arg); - grpc_core::Delete(drop_entries); +grpc_error* ServerAddressParseAndAppend( + const envoy_api_v2_endpoint_LbEndpoint* lb_endpoint, + ServerAddressList* list) { + // Find the ip:port. + const envoy_api_v2_endpoint_Endpoint* endpoint = + envoy_api_v2_endpoint_LbEndpoint_endpoint(lb_endpoint); + const envoy_api_v2_core_Address* address = + envoy_api_v2_endpoint_Endpoint_address(endpoint); + const envoy_api_v2_core_SocketAddress* socket_address = + envoy_api_v2_core_Address_socket_address(address); + upb_strview address_strview = + envoy_api_v2_core_SocketAddress_address(socket_address); + uint32_t port = envoy_api_v2_core_SocketAddress_port_value(socket_address); + if (GPR_UNLIKELY(port >> 16) != 0) { + return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Invalid port."); } - gpr_free(request); + // Populate grpc_resolved_address. + grpc_resolved_address addr; + char* address_str = static_cast(gpr_malloc(address_strview.size + 1)); + memcpy(address_str, address_strview.data, address_strview.size); + address_str[address_strview.size] = '\0'; + grpc_string_to_sockaddr(&addr, address_str, port); + gpr_free(address_str); + // Append the address to the list. + list->emplace_back(addr, nullptr); + return GRPC_ERROR_NONE; } -typedef grpc_lb_v1_LoadBalanceResponse xds_grpclb_response; -xds_grpclb_initial_response* xds_grpclb_initial_response_parse( - const grpc_slice& encoded_xds_grpclb_response) { - pb_istream_t stream = pb_istream_from_buffer( - const_cast(GRPC_SLICE_START_PTR(encoded_xds_grpclb_response)), - GRPC_SLICE_LENGTH(encoded_xds_grpclb_response)); - xds_grpclb_response res; - memset(&res, 0, sizeof(xds_grpclb_response)); - if (GPR_UNLIKELY( - !pb_decode(&stream, grpc_lb_v1_LoadBalanceResponse_fields, &res))) { - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&stream)); - return nullptr; - } +namespace { - if (!res.has_initial_response) return nullptr; +UniquePtr StringCopy(const upb_strview& strview) { + char* str = static_cast(gpr_malloc(strview.size + 1)); + memcpy(str, strview.data, strview.size); + str[strview.size] = '\0'; + return UniquePtr(str); +} - xds_grpclb_initial_response* initial_res = - static_cast( - gpr_malloc(sizeof(xds_grpclb_initial_response))); - memcpy(initial_res, &res.initial_response, - sizeof(xds_grpclb_initial_response)); +} // namespace - return initial_res; +grpc_error* LocalityParse( + const envoy_api_v2_endpoint_LocalityLbEndpoints* locality_lb_endpoints, + XdsLocalityInfo* locality_info) { + // Parse LB weight. + const google_protobuf_UInt32Value* lb_weight = + envoy_api_v2_endpoint_LocalityLbEndpoints_load_balancing_weight( + locality_lb_endpoints); + // If LB weight is not specified, it means this locality is assigned no load. + // TODO(juanlishen): When we support CDS to configure the inter-locality + // policy, we should change the LB weight handling. + locality_info->lb_weight = + lb_weight != nullptr ? google_protobuf_UInt32Value_value(lb_weight) : 0; + if (locality_info->lb_weight == 0) return GRPC_ERROR_NONE; + // Parse locality name. + const envoy_api_v2_core_Locality* locality = + envoy_api_v2_endpoint_LocalityLbEndpoints_locality(locality_lb_endpoints); + locality_info->locality_name = MakeRefCounted( + StringCopy(envoy_api_v2_core_Locality_region(locality)), + StringCopy(envoy_api_v2_core_Locality_zone(locality)), + StringCopy(envoy_api_v2_core_Locality_sub_zone(locality))); + // Parse the addresses. + size_t size; + const envoy_api_v2_endpoint_LbEndpoint* const* lb_endpoints = + envoy_api_v2_endpoint_LocalityLbEndpoints_lb_endpoints( + locality_lb_endpoints, &size); + for (size_t i = 0; i < size; ++i) { + grpc_error* error = ServerAddressParseAndAppend(lb_endpoints[i], + &locality_info->serverlist); + if (error != GRPC_ERROR_NONE) return error; + } + // Parse the priority. + locality_info->priority = + envoy_api_v2_endpoint_LocalityLbEndpoints_priority(locality_lb_endpoints); + return GRPC_ERROR_NONE; } -xds_grpclb_serverlist* xds_grpclb_response_parse_serverlist( - const grpc_slice& encoded_xds_grpclb_response) { - pb_istream_t stream = pb_istream_from_buffer( - const_cast(GRPC_SLICE_START_PTR(encoded_xds_grpclb_response)), - GRPC_SLICE_LENGTH(encoded_xds_grpclb_response)); - pb_istream_t stream_at_start = stream; - xds_grpclb_serverlist* sl = static_cast( - gpr_zalloc(sizeof(xds_grpclb_serverlist))); - xds_grpclb_response res; - memset(&res, 0, sizeof(xds_grpclb_response)); - // First pass: count number of servers. - res.server_list.servers.funcs.decode = count_serverlist; - res.server_list.servers.arg = sl; - bool status = pb_decode(&stream, grpc_lb_v1_LoadBalanceResponse_fields, &res); - if (GPR_UNLIKELY(!status)) { - gpr_free(sl); - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&stream)); - return nullptr; +grpc_error* DropParseAndAppend( + const envoy_api_v2_ClusterLoadAssignment_Policy_DropOverload* drop_overload, + XdsDropConfig* drop_config, bool* drop_all) { + // Get the category. + upb_strview category = + envoy_api_v2_ClusterLoadAssignment_Policy_DropOverload_category( + drop_overload); + if (category.size == 0) { + return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty drop category name"); } - // Second pass: populate servers. - if (sl->num_servers > 0) { - sl->servers = static_cast( - gpr_zalloc(sizeof(xds_grpclb_server*) * sl->num_servers)); - decode_serverlist_arg decode_arg; - memset(&decode_arg, 0, sizeof(decode_arg)); - decode_arg.serverlist = sl; - res.server_list.servers.funcs.decode = decode_serverlist; - res.server_list.servers.arg = &decode_arg; - status = pb_decode(&stream_at_start, grpc_lb_v1_LoadBalanceResponse_fields, - &res); - if (GPR_UNLIKELY(!status)) { - xds_grpclb_destroy_serverlist(sl); - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&stream)); - return nullptr; - } + // Get the drop rate (per million). + const envoy_type_FractionalPercent* drop_percentage = + envoy_api_v2_ClusterLoadAssignment_Policy_DropOverload_drop_percentage( + drop_overload); + uint32_t numerator = envoy_type_FractionalPercent_numerator(drop_percentage); + const auto denominator = + static_cast( + envoy_type_FractionalPercent_denominator(drop_percentage)); + // Normalize to million. + switch (denominator) { + case envoy_type_FractionalPercent_HUNDRED: + numerator *= 10000; + break; + case envoy_type_FractionalPercent_TEN_THOUSAND: + numerator *= 100; + break; + case envoy_type_FractionalPercent_MILLION: + break; + default: + return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unknown denominator type"); } - return sl; + // Cap numerator to 1000000. + numerator = GPR_MIN(numerator, 1000000); + if (numerator == 1000000) *drop_all = true; + drop_config->AddCategory(StringCopy(category), numerator); + return GRPC_ERROR_NONE; } -void xds_grpclb_destroy_serverlist(xds_grpclb_serverlist* serverlist) { - if (serverlist == nullptr) { - return; +} // namespace + +grpc_error* XdsEdsResponseDecodeAndParse(const grpc_slice& encoded_response, + XdsUpdate* update) { + upb::Arena arena; + // Decode the response. + const envoy_api_v2_DiscoveryResponse* response = + envoy_api_v2_DiscoveryResponse_parse( + reinterpret_cast(GRPC_SLICE_START_PTR(encoded_response)), + GRPC_SLICE_LENGTH(encoded_response), arena.ptr()); + // Parse the response. + if (response == nullptr) { + return GRPC_ERROR_CREATE_FROM_STATIC_STRING("No response found."); } - for (size_t i = 0; i < serverlist->num_servers; i++) { - gpr_free(serverlist->servers[i]); + // Check the type_url of the response. + upb_strview type_url = envoy_api_v2_DiscoveryResponse_type_url(response); + upb_strview expected_type_url = upb_strview_makez(kEdsTypeUrl); + if (!upb_strview_eql(type_url, expected_type_url)) { + return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resource is not EDS."); } - gpr_free(serverlist->servers); - gpr_free(serverlist); -} - -xds_grpclb_serverlist* xds_grpclb_serverlist_copy( - const xds_grpclb_serverlist* sl) { - xds_grpclb_serverlist* copy = static_cast( - gpr_zalloc(sizeof(xds_grpclb_serverlist))); - copy->num_servers = sl->num_servers; - copy->servers = static_cast( - gpr_malloc(sizeof(xds_grpclb_server*) * sl->num_servers)); - for (size_t i = 0; i < sl->num_servers; i++) { - copy->servers[i] = - static_cast(gpr_malloc(sizeof(xds_grpclb_server))); - memcpy(copy->servers[i], sl->servers[i], sizeof(xds_grpclb_server)); + // Get the resources from the response. + size_t size; + const google_protobuf_Any* const* resources = + envoy_api_v2_DiscoveryResponse_resources(response, &size); + if (size < 1) { + return GRPC_ERROR_CREATE_FROM_STATIC_STRING( + "EDS response contains 0 resource."); } - return copy; -} - -bool xds_grpclb_serverlist_equals(const xds_grpclb_serverlist* lhs, - const xds_grpclb_serverlist* rhs) { - if (lhs == nullptr || rhs == nullptr) { - return false; + // Check the type_url of the resource. + type_url = google_protobuf_Any_type_url(resources[0]); + if (!upb_strview_eql(type_url, expected_type_url)) { + return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resource is not EDS."); } - if (lhs->num_servers != rhs->num_servers) { - return false; + // Get the cluster_load_assignment. + upb_strview encoded_cluster_load_assignment = + google_protobuf_Any_value(resources[0]); + envoy_api_v2_ClusterLoadAssignment* cluster_load_assignment = + envoy_api_v2_ClusterLoadAssignment_parse( + encoded_cluster_load_assignment.data, + encoded_cluster_load_assignment.size, arena.ptr()); + // Get the endpoints. + const envoy_api_v2_endpoint_LocalityLbEndpoints* const* endpoints = + envoy_api_v2_ClusterLoadAssignment_endpoints(cluster_load_assignment, + &size); + for (size_t i = 0; i < size; ++i) { + XdsLocalityInfo locality_info; + grpc_error* error = LocalityParse(endpoints[i], &locality_info); + if (error != GRPC_ERROR_NONE) return error; + // Filter out locality with weight 0. + if (locality_info.lb_weight == 0) continue; + update->locality_list.push_back(std::move(locality_info)); } - for (size_t i = 0; i < lhs->num_servers; i++) { - if (!xds_grpclb_server_equals(lhs->servers[i], rhs->servers[i])) { - return false; + // The locality list is sorted here into deterministic order so that it's + // easier to check if two locality lists contain the same set of localities. + std::sort(update->locality_list.data(), + update->locality_list.data() + update->locality_list.size(), + XdsLocalityInfo::Less()); + // Get the drop config. + update->drop_config = MakeRefCounted(); + const envoy_api_v2_ClusterLoadAssignment_Policy* policy = + envoy_api_v2_ClusterLoadAssignment_policy(cluster_load_assignment); + if (policy != nullptr) { + const envoy_api_v2_ClusterLoadAssignment_Policy_DropOverload* const* + drop_overload = + envoy_api_v2_ClusterLoadAssignment_Policy_drop_overloads(policy, + &size); + for (size_t i = 0; i < size; ++i) { + grpc_error* error = DropParseAndAppend( + drop_overload[i], update->drop_config.get(), &update->drop_all); + if (error != GRPC_ERROR_NONE) return error; } } - return true; + return GRPC_ERROR_NONE; } -bool xds_grpclb_server_equals(const xds_grpclb_server* lhs, - const xds_grpclb_server* rhs) { - return memcmp(lhs, rhs, sizeof(xds_grpclb_server)) == 0; +namespace { + +grpc_slice LrsRequestEncode( + const envoy_service_load_stats_v2_LoadStatsRequest* request, + upb_arena* arena) { + size_t output_length; + char* output = envoy_service_load_stats_v2_LoadStatsRequest_serialize( + request, arena, &output_length); + return grpc_slice_from_copied_buffer(output, output_length); } -int xds_grpclb_duration_compare(const xds_grpclb_duration* lhs, - const xds_grpclb_duration* rhs) { - GPR_ASSERT(lhs && rhs); - if (lhs->has_seconds && rhs->has_seconds) { - if (lhs->seconds < rhs->seconds) return -1; - if (lhs->seconds > rhs->seconds) return 1; - } else if (lhs->has_seconds) { - return 1; - } else if (rhs->has_seconds) { - return -1; - } +} // namespace - GPR_ASSERT(lhs->seconds == rhs->seconds); - if (lhs->has_nanos && rhs->has_nanos) { - if (lhs->nanos < rhs->nanos) return -1; - if (lhs->nanos > rhs->nanos) return 1; - } else if (lhs->has_nanos) { - return 1; - } else if (rhs->has_nanos) { - return -1; - } +grpc_slice XdsLrsRequestCreateAndEncode(const char* server_name) { + upb::Arena arena; + // Create a request. + envoy_service_load_stats_v2_LoadStatsRequest* request = + envoy_service_load_stats_v2_LoadStatsRequest_new(arena.ptr()); + // Add cluster stats. There is only one because we only use one server name in + // one channel. + envoy_api_v2_endpoint_ClusterStats* cluster_stats = + envoy_service_load_stats_v2_LoadStatsRequest_add_cluster_stats( + request, arena.ptr()); + // Set the cluster name. + envoy_api_v2_endpoint_ClusterStats_set_cluster_name( + cluster_stats, upb_strview_makez(server_name)); + return LrsRequestEncode(request, arena.ptr()); +} + +namespace { - return 0; +void LocalityStatsPopulate(envoy_api_v2_endpoint_UpstreamLocalityStats* output, + Pair, + XdsClientStats::LocalityStats::Snapshot>& input, + upb_arena* arena) { + // Set sub_zone. + envoy_api_v2_core_Locality* locality = + envoy_api_v2_endpoint_UpstreamLocalityStats_mutable_locality(output, + arena); + envoy_api_v2_core_Locality_set_sub_zone( + locality, upb_strview_makez(input.first->sub_zone())); + // Set total counts. + XdsClientStats::LocalityStats::Snapshot& snapshot = input.second; + envoy_api_v2_endpoint_UpstreamLocalityStats_set_total_successful_requests( + output, snapshot.total_successful_requests); + envoy_api_v2_endpoint_UpstreamLocalityStats_set_total_requests_in_progress( + output, snapshot.total_requests_in_progress); + envoy_api_v2_endpoint_UpstreamLocalityStats_set_total_error_requests( + output, snapshot.total_error_requests); + envoy_api_v2_endpoint_UpstreamLocalityStats_set_total_issued_requests( + output, snapshot.total_issued_requests); + // Add load metric stats. + for (auto& p : snapshot.load_metric_stats) { + const char* metric_name = p.first.get(); + const XdsClientStats::LocalityStats::LoadMetric::Snapshot& metric_value = + p.second; + envoy_api_v2_endpoint_EndpointLoadMetricStats* load_metric = + envoy_api_v2_endpoint_UpstreamLocalityStats_add_load_metric_stats( + output, arena); + envoy_api_v2_endpoint_EndpointLoadMetricStats_set_metric_name( + load_metric, upb_strview_makez(metric_name)); + envoy_api_v2_endpoint_EndpointLoadMetricStats_set_num_requests_finished_with_metric( + load_metric, metric_value.num_requests_finished_with_metric); + envoy_api_v2_endpoint_EndpointLoadMetricStats_set_total_metric_value( + load_metric, metric_value.total_metric_value); + } } -grpc_millis xds_grpclb_duration_to_millis(xds_grpclb_duration* duration_pb) { - return static_cast( - (duration_pb->has_seconds ? duration_pb->seconds : 0) * GPR_MS_PER_SEC + - (duration_pb->has_nanos ? duration_pb->nanos : 0) / GPR_NS_PER_MS); +} // namespace + +grpc_slice XdsLrsRequestCreateAndEncode(const char* server_name, + XdsClientStats* client_stats) { + upb::Arena arena; + XdsClientStats::Snapshot snapshot = client_stats->GetSnapshotAndReset(); + // Prune unused locality stats. + client_stats->PruneLocalityStats(); + // When all the counts are zero, return empty slice. + if (snapshot.IsAllZero()) return grpc_empty_slice(); + // Create a request. + envoy_service_load_stats_v2_LoadStatsRequest* request = + envoy_service_load_stats_v2_LoadStatsRequest_new(arena.ptr()); + // Add cluster stats. There is only one because we only use one server name in + // one channel. + envoy_api_v2_endpoint_ClusterStats* cluster_stats = + envoy_service_load_stats_v2_LoadStatsRequest_add_cluster_stats( + request, arena.ptr()); + // Set the cluster name. + envoy_api_v2_endpoint_ClusterStats_set_cluster_name( + cluster_stats, upb_strview_makez(server_name)); + // Add locality stats. + for (auto& p : snapshot.upstream_locality_stats) { + envoy_api_v2_endpoint_UpstreamLocalityStats* locality_stats = + envoy_api_v2_endpoint_ClusterStats_add_upstream_locality_stats( + cluster_stats, arena.ptr()); + LocalityStatsPopulate(locality_stats, p, arena.ptr()); + } + // Add dropped requests. + for (auto& p : snapshot.dropped_requests) { + const char* category = p.first.get(); + const uint64_t count = p.second; + envoy_api_v2_endpoint_ClusterStats_DroppedRequests* dropped_requests = + envoy_api_v2_endpoint_ClusterStats_add_dropped_requests(cluster_stats, + arena.ptr()); + envoy_api_v2_endpoint_ClusterStats_DroppedRequests_set_category( + dropped_requests, upb_strview_makez(category)); + envoy_api_v2_endpoint_ClusterStats_DroppedRequests_set_dropped_count( + dropped_requests, count); + } + // Set total dropped requests. + envoy_api_v2_endpoint_ClusterStats_set_total_dropped_requests( + cluster_stats, snapshot.total_dropped_requests); + // Set real load report interval. + gpr_timespec timespec = + grpc_millis_to_timespec(snapshot.load_report_interval, GPR_TIMESPAN); + google_protobuf_Duration* load_report_interval = + envoy_api_v2_endpoint_ClusterStats_mutable_load_report_interval( + cluster_stats, arena.ptr()); + google_protobuf_Duration_set_seconds(load_report_interval, timespec.tv_sec); + google_protobuf_Duration_set_nanos(load_report_interval, timespec.tv_nsec); + return LrsRequestEncode(request, arena.ptr()); } -void xds_grpclb_initial_response_destroy( - xds_grpclb_initial_response* response) { - gpr_free(response); +grpc_error* XdsLrsResponseDecodeAndParse(const grpc_slice& encoded_response, + grpc_millis* load_reporting_interval, + const char* expected_server_name) { + upb::Arena arena; + // Decode the response. + const envoy_service_load_stats_v2_LoadStatsResponse* decoded_response = + envoy_service_load_stats_v2_LoadStatsResponse_parse( + reinterpret_cast(GRPC_SLICE_START_PTR(encoded_response)), + GRPC_SLICE_LENGTH(encoded_response), arena.ptr()); + // Parse the response. + if (decoded_response == nullptr) { + return GRPC_ERROR_CREATE_FROM_STATIC_STRING("No response found."); + } + // Check the cluster size in the response. + size_t size; + const upb_strview* clusters = + envoy_service_load_stats_v2_LoadStatsResponse_clusters(decoded_response, + &size); + if (size != 1) { + return GRPC_ERROR_CREATE_FROM_STATIC_STRING( + "The number of clusters (server names) is not 1."); + } + // Check the cluster name in the response + if (strncmp(expected_server_name, clusters[0].data, clusters[0].size) != 0) { + return GRPC_ERROR_CREATE_FROM_STATIC_STRING( + "Unexpected cluster (server name)."); + } + // Get the load report interval. + const google_protobuf_Duration* load_reporting_interval_duration = + envoy_service_load_stats_v2_LoadStatsResponse_load_reporting_interval( + decoded_response); + gpr_timespec timespec{ + google_protobuf_Duration_seconds(load_reporting_interval_duration), + google_protobuf_Duration_nanos(load_reporting_interval_duration), + GPR_TIMESPAN}; + *load_reporting_interval = gpr_time_to_millis(timespec); + return GRPC_ERROR_NONE; } + +} // namespace grpc_core diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h b/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h index e52d20f8658..cea5b50b9ba 100644 --- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h +++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h @@ -23,67 +23,104 @@ #include -#include "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h" #include "src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h" -#include "src/core/lib/iomgr/exec_ctx.h" - -#define XDS_SERVICE_NAME_MAX_LENGTH 128 - -typedef grpc_lb_v1_Server_ip_address_t xds_grpclb_ip_address; -typedef grpc_lb_v1_LoadBalanceRequest xds_grpclb_request; -typedef grpc_lb_v1_InitialLoadBalanceResponse xds_grpclb_initial_response; -typedef grpc_lb_v1_Server xds_grpclb_server; -typedef google_protobuf_Duration xds_grpclb_duration; -typedef google_protobuf_Timestamp xds_grpclb_timestamp; - -typedef struct { - xds_grpclb_server** servers; - size_t num_servers; -} xds_grpclb_serverlist; - -/** Create a request for a gRPC LB service under \a lb_service_name */ -xds_grpclb_request* xds_grpclb_request_create(const char* lb_service_name); -xds_grpclb_request* xds_grpclb_load_report_request_create_locked( - grpc_core::XdsLbClientStats* client_stats); - -/** Protocol Buffers v3-encode \a request */ -grpc_slice xds_grpclb_request_encode(const xds_grpclb_request* request); - -/** Destroy \a request */ -void xds_grpclb_request_destroy(xds_grpclb_request* request); - -/** Parse (ie, decode) the bytes in \a encoded_xds_grpclb_response as a \a - * xds_grpclb_initial_response */ -xds_grpclb_initial_response* xds_grpclb_initial_response_parse( - const grpc_slice& encoded_xds_grpclb_response); - -/** Parse the list of servers from an encoded \a xds_grpclb_response */ -xds_grpclb_serverlist* xds_grpclb_response_parse_serverlist( - const grpc_slice& encoded_xds_grpclb_response); - -/** Return a copy of \a sl. The caller is responsible for calling \a - * xds_grpclb_destroy_serverlist on the returned copy. */ -xds_grpclb_serverlist* xds_grpclb_serverlist_copy( - const xds_grpclb_serverlist* sl); - -bool xds_grpclb_serverlist_equals(const xds_grpclb_serverlist* lhs, - const xds_grpclb_serverlist* rhs); - -bool xds_grpclb_server_equals(const xds_grpclb_server* lhs, - const xds_grpclb_server* rhs); - -/** Destroy \a serverlist */ -void xds_grpclb_destroy_serverlist(xds_grpclb_serverlist* serverlist); - -/** Compare \a lhs against \a rhs and return 0 if \a lhs and \a rhs are equal, - * < 0 if \a lhs represents a duration shorter than \a rhs and > 0 otherwise */ -int xds_grpclb_duration_compare(const xds_grpclb_duration* lhs, - const xds_grpclb_duration* rhs); - -grpc_millis xds_grpclb_duration_to_millis(xds_grpclb_duration* duration_pb); - -/** Destroy \a initial_response */ -void xds_grpclb_initial_response_destroy(xds_grpclb_initial_response* response); +#include "src/core/ext/filters/client_channel/server_address.h" + +namespace grpc_core { + +struct XdsLocalityInfo { + bool operator==(const XdsLocalityInfo& other) const { + return *locality_name == *other.locality_name && + serverlist == other.serverlist && lb_weight == other.lb_weight && + priority == other.priority; + } + + // This comparator only compares the locality names. + struct Less { + bool operator()(const XdsLocalityInfo& lhs, const XdsLocalityInfo& rhs) { + return XdsLocalityName::Less()(lhs.locality_name, rhs.locality_name); + } + }; + + RefCountedPtr locality_name; + ServerAddressList serverlist; + uint32_t lb_weight; + uint32_t priority; +}; + +using XdsLocalityList = InlinedVector; + +// There are two phases of accessing this class's content: +// 1. to initialize in the control plane combiner; +// 2. to use in the data plane combiner. +// So no additional synchronization is needed. +class XdsDropConfig : public RefCounted { + public: + struct DropCategory { + bool operator==(const DropCategory& other) const { + return strcmp(name.get(), other.name.get()) == 0 && + parts_per_million == other.parts_per_million; + } + + UniquePtr name; + const uint32_t parts_per_million; + }; + + using DropCategoryList = InlinedVector; + + void AddCategory(UniquePtr name, uint32_t parts_per_million) { + drop_category_list_.emplace_back( + DropCategory{std::move(name), parts_per_million}); + } + + // The only method invoked from the data plane combiner. + bool ShouldDrop(const UniquePtr** category_name) const; + + const DropCategoryList& drop_category_list() const { + return drop_category_list_; + } + + bool operator==(const XdsDropConfig& other) const { + return drop_category_list_ == other.drop_category_list_; + } + bool operator!=(const XdsDropConfig& other) const { + return !(*this == other); + } + + private: + DropCategoryList drop_category_list_; +}; + +struct XdsUpdate { + XdsLocalityList locality_list; + RefCountedPtr drop_config; + bool drop_all = false; +}; + +// Creates an EDS request querying \a service_name. +grpc_slice XdsEdsRequestCreateAndEncode(const char* service_name); + +// Parses the EDS response and returns the args to update locality map. If there +// is any error, the output update is invalid. +grpc_error* XdsEdsResponseDecodeAndParse(const grpc_slice& encoded_response, + XdsUpdate* update); + +// Creates an LRS request querying \a server_name. +grpc_slice XdsLrsRequestCreateAndEncode(const char* server_name); + +// Creates an LRS request sending client-side load reports. If all the counters +// in \a client_stats are zero, returns empty slice. +grpc_slice XdsLrsRequestCreateAndEncode(const char* server_name, + XdsClientStats* client_stats); + +// Parses the LRS response and returns the client-side load reporting interval. +// If there is any error (e.g., the found server name doesn't match \a +// expected_server_name), the output config is invalid. +grpc_error* XdsLrsResponseDecodeAndParse(const grpc_slice& encoded_response, + grpc_millis* load_reporting_interval, + const char* expected_server_name); + +} // namespace grpc_core #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_XDS_XDS_LOAD_BALANCER_API_H \ */ diff --git a/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc b/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc new file mode 100644 index 00000000000..8be1b89eee0 --- /dev/null +++ b/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc @@ -0,0 +1,89 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include + +#include "src/core/ext/filters/client_channel/resolver_registry.h" + +namespace grpc_core { + +namespace { + +class XdsResolver : public Resolver { + public: + explicit XdsResolver(ResolverArgs args) + : Resolver(args.combiner, std::move(args.result_handler)), + args_(grpc_channel_args_copy(args.args)) {} + ~XdsResolver() override { grpc_channel_args_destroy(args_); } + + void StartLocked() override; + + void ShutdownLocked() override{}; + + private: + const grpc_channel_args* args_; +}; + +void XdsResolver::StartLocked() { + static const char* service_config = + "{\n" + " \"loadBalancingConfig\":[\n" + " { \"xds_experimental\":{} }\n" + " ]\n" + "}"; + Result result; + result.args = args_; + args_ = nullptr; + grpc_error* error = GRPC_ERROR_NONE; + result.service_config = ServiceConfig::Create(service_config, &error); + result_handler()->ReturnResult(std::move(result)); +} + +// +// Factory +// + +class XdsResolverFactory : public ResolverFactory { + public: + bool IsValidUri(const grpc_uri* uri) const override { + if (GPR_UNLIKELY(0 != strcmp(uri->authority, ""))) { + gpr_log(GPR_ERROR, "URI authority not supported"); + return false; + } + return true; + } + + OrphanablePtr CreateResolver(ResolverArgs args) const override { + if (!IsValidUri(args.uri)) return nullptr; + return OrphanablePtr(New(std::move(args))); + } + + const char* scheme() const override { return "xds-experimental"; } +}; + +} // namespace + +} // namespace grpc_core + +void grpc_resolver_xds_init() { + grpc_core::ResolverRegistry::Builder::RegisterResolverFactory( + grpc_core::UniquePtr( + grpc_core::New())); +} + +void grpc_resolver_xds_shutdown() {} diff --git a/src/core/ext/filters/client_channel/server_address.cc b/src/core/ext/filters/client_channel/server_address.cc index 31c0edaca17..d46896b754b 100644 --- a/src/core/ext/filters/client_channel/server_address.cc +++ b/src/core/ext/filters/client_channel/server_address.cc @@ -20,8 +20,6 @@ #include "src/core/ext/filters/client_channel/server_address.h" -#include - namespace grpc_core { // @@ -39,7 +37,7 @@ ServerAddress::ServerAddress(const void* address, size_t address_len, address_.len = static_cast(address_len); } -bool ServerAddress::operator==(const grpc_core::ServerAddress& other) const { +bool ServerAddress::operator==(const ServerAddress& other) const { return address_.len == other.address_.len && memcmp(address_.addr, other.address_.addr, address_.len) == 0 && grpc_channel_args_compare(args_, other.args_) == 0; diff --git a/src/core/ext/filters/client_channel/server_address.h b/src/core/ext/filters/client_channel/server_address.h index 1b68a59ed85..acd71358810 100644 --- a/src/core/ext/filters/client_channel/server_address.h +++ b/src/core/ext/filters/client_channel/server_address.h @@ -24,7 +24,6 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/gprpp/inlined_vector.h" #include "src/core/lib/iomgr/resolve_address.h" -#include "src/core/lib/uri/uri_parser.h" // Channel arg key for a bool indicating whether an address is a grpclb // load balancer (as opposed to a backend). @@ -68,6 +67,7 @@ class ServerAddress { } ServerAddress& operator=(ServerAddress&& other) { address_ = other.address_; + grpc_channel_args_destroy(args_); args_ = other.args_; other.args_ = nullptr; return *this; diff --git a/src/core/ext/filters/client_channel/subchannel.cc b/src/core/ext/filters/client_channel/subchannel.cc index e248cc6b5fc..e30d915d03c 100644 --- a/src/core/ext/filters/client_channel/subchannel.cc +++ b/src/core/ext/filters/client_channel/subchannel.cc @@ -349,7 +349,7 @@ class Subchannel::ConnectedSubchannelStateWatcher { } c->connected_subchannel_.reset(); if (c->channelz_node() != nullptr) { - c->channelz_node()->SetChildSocketUuid(0); + c->channelz_node()->SetChildSocket(nullptr); } c->SetConnectivityStateLocked(GRPC_CHANNEL_TRANSIENT_FAILURE); c->backoff_begun_ = false; @@ -1072,8 +1072,9 @@ bool Subchannel::PublishTransportLocked() { GRPC_ERROR_UNREF(error); return false; } - intptr_t socket_uuid = connecting_result_.socket_uuid; - memset(&connecting_result_, 0, sizeof(connecting_result_)); + RefCountedPtr socket = + std::move(connecting_result_.socket); + connecting_result_.reset(); if (disconnected_) { grpc_channel_stack_destroy(stk); gpr_free(stk); @@ -1085,7 +1086,7 @@ bool Subchannel::PublishTransportLocked() { gpr_log(GPR_INFO, "New connected subchannel at %p for subchannel %p", connected_subchannel_.get(), this); if (channelz_node_ != nullptr) { - channelz_node_->SetChildSocketUuid(socket_uuid); + channelz_node_->SetChildSocket(std::move(socket)); } // Instantiate state watcher. Will clean itself up. New(this); diff --git a/src/core/ext/filters/client_idle/client_idle_filter.cc b/src/core/ext/filters/client_idle/client_idle_filter.cc index d2b23a9d20f..13c35ae3730 100644 --- a/src/core/ext/filters/client_idle/client_idle_filter.cc +++ b/src/core/ext/filters/client_idle/client_idle_filter.cc @@ -27,12 +27,12 @@ #include "src/core/lib/surface/channel_init.h" #include "src/core/lib/transport/http2_errors.h" -// The idle filter is disabled in client channel by default. -// To enable the idle filte, set GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS to [0, INT_MAX) -// in channel args. -// TODO(qianchengz): Find a reasonable default value. Maybe check what deault -// value Java uses. -#define DEFAULT_IDLE_TIMEOUT_MS INT_MAX +// The idle filter is enabled in client channel by default. +// Set GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS to [1000, INT_MAX) in channel args to +// configure the idle timeout. +#define DEFAULT_IDLE_TIMEOUT_MS (30 /*minutes*/ * 60 * 1000) +// The user input idle timeout smaller than this would be capped to it. +#define MIN_IDLE_TIMEOUT_MS (1 /*second*/ * 1000) namespace grpc_core { @@ -47,10 +47,82 @@ TraceFlag grpc_trace_client_idle_filter(false, "client_idle_filter"); namespace { +/* + client_idle_filter maintains a state tracking if there are active calls in the + channel and its internal idle_timer_. The states are specified as following: + + +--------------------------------------------+-------------+---------+ + | ChannelState | idle_timer_ | channel | + +--------------------------------------------+-------------+---------+ + | IDLE | unset | idle | + | CALLS_ACTIVE | unset | busy | + | TIMER_PENDING | set-valid | idle | + | TIMER_PENDING_CALLS_ACTIVE | set-invalid | busy | + | TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START | set-invalid | idle | + +--------------------------------------------+-------------+---------+ + + IDLE: The initial state of the client_idle_filter, indicating the channel is + in IDLE. + + CALLS_ACTIVE: The channel has 1 or 1+ active calls and the timer is not set. + + TIMER_PENDING: The state after the timer is set and no calls have arrived + after the timer is set. The channel must have 0 active call in this state. If + the timer is fired in this state, the channel will go into IDLE state. + + TIMER_PENDING_CALLS_ACTIVE: The state after the timer is set and at least one + call has arrived after the timer is set. The channel must have 1 or 1+ active + calls in this state. If the timer is fired in this state, we won't reschedule + it. + + TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START: The state after the timer is set + and at least one call has arrived after the timer is set, BUT the channel + currently has 0 active call. If the timer is fired in this state, we will + reschedule it according to the finish time of the latest call. + + PROCESSING: The state set to block other threads when the setting thread is + doing some work to keep state consistency. + + idle_timer_ will not be cancelled (unless the channel is shutting down). + If the timer callback is called when the idle_timer_ is valid (i.e. idle_state + is TIMER_PENDING), the channel will enter IDLE, otherwise the channel won't be + changed. + + State transitions: + IDLE + | ^ + --------------------------------- * + | * + v * + CALLS_ACTIVE =================> TIMER_PENDING + ^ | ^ + * ------------------------------ * + * | * + * v * +TIMER_PENDING_CALLS_ACTIVE ===> TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START + ^ | + | | + --------------------------------- + + ---> Triggered by IncreaseCallCount() + ===> Triggered by DecreaseCallCount() + ***> Triggered by IdleTimerCallback() +*/ +enum ChannelState { + IDLE, + CALLS_ACTIVE, + TIMER_PENDING, + TIMER_PENDING_CALLS_ACTIVE, + TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START, + PROCESSING +}; + grpc_millis GetClientIdleTimeout(const grpc_channel_args* args) { - return grpc_channel_arg_get_integer( - grpc_channel_args_find(args, GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS), - {DEFAULT_IDLE_TIMEOUT_MS, 0, INT_MAX}); + return GPR_MAX( + grpc_channel_arg_get_integer( + grpc_channel_args_find(args, GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS), + {DEFAULT_IDLE_TIMEOUT_MS, 0, INT_MAX}), + MIN_IDLE_TIMEOUT_MS); } class ChannelData { @@ -86,8 +158,9 @@ class ChannelData { const grpc_millis client_idle_timeout_; // Member data used to track the state of channel. - Mutex call_count_mu_; - size_t call_count_; + grpc_millis last_idle_time_; + Atomic call_count_{0}; + Atomic state_{IDLE}; // Idle timer and its callback closure. grpc_timer idle_timer_; @@ -115,37 +188,105 @@ void ChannelData::StartTransportOp(grpc_channel_element* elem, ChannelData* chand = static_cast(elem->channel_data); // Catch the disconnect_with_error transport op. if (op->disconnect_with_error != nullptr) { - // Disconnect. Cancel the timer if we set it before. - // IncreaseCallCount() introduces a dummy call. It will cancel the timer and - // prevent the timer from being reset by other threads. + // IncreaseCallCount() introduces a dummy call and prevent the timer from + // being reset by other threads. chand->IncreaseCallCount(); + // If the timer has been set, cancel the timer. + // No synchronization issues here. grpc_timer_cancel() is valid as long as + // the timer has been init()ed before. + grpc_timer_cancel(&chand->idle_timer_); } // Pass the op to the next filter. grpc_channel_next_op(elem, op); } void ChannelData::IncreaseCallCount() { - MutexLock lock(&call_count_mu_); - if (call_count_++ == 0) { - grpc_timer_cancel(&idle_timer_); + const intptr_t previous_value = call_count_.FetchAdd(1, MemoryOrder::RELAXED); + GRPC_IDLE_FILTER_LOG("call counter has increased to %" PRIuPTR, + previous_value + 1); + if (previous_value == 0) { + // This call is the one that makes the channel busy. + // Loop here to make sure the previous decrease operation has finished. + ChannelState state = state_.Load(MemoryOrder::RELAXED); + while (true) { + switch (state) { + // Timer has not been set. Switch to CALLS_ACTIVE. + case IDLE: + // In this case, no other threads will modify the state, so we can + // just store the value. + state_.Store(CALLS_ACTIVE, MemoryOrder::RELAXED); + return; + // Timer has been set. Switch to TIMER_PENDING_CALLS_ACTIVE. + case TIMER_PENDING: + case TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START: + // At this point, the state may have been switched to IDLE by the + // idle timer callback. Therefore, use CAS operation to change the + // state atomically. + // Use MemoryOrder::ACQUIRE on success to ensure last_idle_time_ has + // been properly set in DecreaseCallCount(). + if (state_.CompareExchangeWeak(&state, TIMER_PENDING_CALLS_ACTIVE, + MemoryOrder::ACQUIRE, + MemoryOrder::RELAXED)) { + return; + } + break; + default: + // The state has not been switched to desired value yet, try again. + state = state_.Load(MemoryOrder::RELAXED); + break; + } + } } - GRPC_IDLE_FILTER_LOG("call counter has increased to %" PRIuPTR, call_count_); } void ChannelData::DecreaseCallCount() { - MutexLock lock(&call_count_mu_); - if (call_count_-- == 1) { - StartIdleTimer(); + const intptr_t previous_value = call_count_.FetchSub(1, MemoryOrder::RELAXED); + GRPC_IDLE_FILTER_LOG("call counter has decreased to %" PRIuPTR, + previous_value - 1); + if (previous_value == 1) { + // This call is the one that makes the channel idle. + // last_idle_time_ does not need to be Atomic<> because busy-loops in + // IncreaseCallCount(), DecreaseCallCount() and IdleTimerCallback() will + // prevent multiple threads from simultaneously accessing this variable. + last_idle_time_ = ExecCtx::Get()->Now(); + ChannelState state = state_.Load(MemoryOrder::RELAXED); + while (true) { + switch (state) { + // Timer has not been set. Set the timer and switch to TIMER_PENDING + case CALLS_ACTIVE: + // Release store here to make other threads see the updated value of + // last_idle_time_. + StartIdleTimer(); + state_.Store(TIMER_PENDING, MemoryOrder::RELEASE); + return; + // Timer has been set. Switch to + // TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START + case TIMER_PENDING_CALLS_ACTIVE: + // At this point, the state may have been switched to CALLS_ACTIVE by + // the idle timer callback. Therefore, use CAS operation to change the + // state atomically. + // Release store here to make the idle timer callback see the updated + // value of last_idle_time_ to properly reset the idle timer. + if (state_.CompareExchangeWeak( + &state, TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START, + MemoryOrder::RELEASE, MemoryOrder::RELAXED)) { + return; + } + break; + default: + // The state has not been switched to desired value yet, try again. + state = state_.Load(MemoryOrder::RELAXED); + break; + } + } } - GRPC_IDLE_FILTER_LOG("call counter has decreased to %" PRIuPTR, call_count_); } ChannelData::ChannelData(grpc_channel_element* elem, grpc_channel_element_args* args, grpc_error** error) : elem_(elem), channel_stack_(args->channel_stack), - client_idle_timeout_(GetClientIdleTimeout(args->channel_args)), - call_count_(0) { + client_idle_timeout_(GetClientIdleTimeout(args->channel_args)) { // If the idle filter is explicitly disabled in channel args, this ctor should // not get called. GPR_ASSERT(client_idle_timeout_ != GRPC_MILLIS_INF_FUTURE); @@ -165,10 +306,45 @@ ChannelData::ChannelData(grpc_channel_element* elem, void ChannelData::IdleTimerCallback(void* arg, grpc_error* error) { GRPC_IDLE_FILTER_LOG("timer alarms"); ChannelData* chand = static_cast(arg); - { - MutexLock lock(&chand->call_count_mu_); - if (error == GRPC_ERROR_NONE && chand->call_count_ == 0) { - chand->EnterIdle(); + if (error != GRPC_ERROR_NONE) { + GRPC_IDLE_FILTER_LOG("timer canceled"); + GRPC_CHANNEL_STACK_UNREF(chand->channel_stack_, "max idle timer callback"); + return; + } + bool finished = false; + ChannelState state = chand->state_.Load(MemoryOrder::RELAXED); + while (!finished) { + switch (state) { + case TIMER_PENDING: + // Change the state to PROCESSING to block IncreaseCallCout() until the + // EnterIdle() operation finishes, preventing mistakenly entering IDLE + // when active RPC exists. + finished = chand->state_.CompareExchangeWeak( + &state, PROCESSING, MemoryOrder::RELAXED, MemoryOrder::RELAXED); + if (finished) { + chand->EnterIdle(); + chand->state_.Store(IDLE, MemoryOrder::RELAXED); + } + break; + case TIMER_PENDING_CALLS_ACTIVE: + finished = chand->state_.CompareExchangeWeak( + &state, CALLS_ACTIVE, MemoryOrder::RELAXED, MemoryOrder::RELAXED); + break; + case TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START: + // Change the state to PROCESSING to block IncreaseCallCount() until the + // StartIdleTimer() operation finishes, preventing mistakenly restarting + // the timer after grpc_timer_cancel() when shutdown. + finished = chand->state_.CompareExchangeWeak( + &state, PROCESSING, MemoryOrder::ACQUIRE, MemoryOrder::RELAXED); + if (finished) { + chand->StartIdleTimer(); + chand->state_.Store(TIMER_PENDING, MemoryOrder::RELAXED); + } + break; + default: + // The state has not been switched to desired value yet, try again. + state = chand->state_.Load(MemoryOrder::RELAXED); + break; } } GRPC_IDLE_FILTER_LOG("timer finishes"); @@ -185,7 +361,7 @@ void ChannelData::StartIdleTimer() { GRPC_IDLE_FILTER_LOG("timer has started"); // Hold a ref to the channel stack for the timer callback. GRPC_CHANNEL_STACK_REF(channel_stack_, "max idle timer callback"); - grpc_timer_init(&idle_timer_, ExecCtx::Get()->Now() + client_idle_timeout_, + grpc_timer_init(&idle_timer_, last_idle_time_ + client_idle_timeout_, &idle_timer_callback_); } diff --git a/src/core/ext/filters/http/client/http_client_filter.cc b/src/core/ext/filters/http/client/http_client_filter.cc index d014460b34e..b16d26b1f24 100644 --- a/src/core/ext/filters/http/client/http_client_filter.cc +++ b/src/core/ext/filters/http/client/http_client_filter.cc @@ -109,7 +109,7 @@ static grpc_error* client_filter_incoming_metadata(grpc_call_element* elem, if (b->idx.named.grpc_status != nullptr || grpc_mdelem_static_value_eq(b->idx.named.status->md, GRPC_MDELEM_STATUS_200)) { - grpc_metadata_batch_remove(b, b->idx.named.status); + grpc_metadata_batch_remove(b, GRPC_BATCH_STATUS); } else { char* val = grpc_dump_slice(GRPC_MDVALUE(b->idx.named.status->md), GPR_DUMP_ASCII); @@ -167,7 +167,7 @@ static grpc_error* client_filter_incoming_metadata(grpc_call_element* elem, gpr_free(val); } } - grpc_metadata_batch_remove(b, b->idx.named.content_type); + grpc_metadata_batch_remove(b, GRPC_BATCH_CONTENT_TYPE); } return GRPC_ERROR_NONE; @@ -304,7 +304,7 @@ static grpc_error* update_path_for_get(grpc_call_element* elem, estimated_len += grpc_base64_estimate_encoded_size( batch->payload->send_message.send_message->length(), true /* url_safe */, false /* multi_line */); - grpc_slice path_with_query_slice = GRPC_SLICE_MALLOC(estimated_len); + grpc_core::UnmanagedMemorySlice path_with_query_slice(estimated_len); /* memcopy individual pieces into this slice */ char* write_ptr = reinterpret_cast GRPC_SLICE_START_PTR(path_with_query_slice); @@ -336,7 +336,7 @@ static grpc_error* update_path_for_get(grpc_call_element* elem, static void remove_if_present(grpc_metadata_batch* batch, grpc_metadata_batch_callouts_index idx) { if (batch->idx.array[idx] != nullptr) { - grpc_metadata_batch_remove(batch, batch->idx.array[idx]); + grpc_metadata_batch_remove(batch, idx); } } @@ -433,23 +433,25 @@ static void hc_start_transport_stream_op_batch( layer headers. */ error = grpc_metadata_batch_add_head( batch->payload->send_initial_metadata.send_initial_metadata, - &calld->method, method); + &calld->method, method, GRPC_BATCH_METHOD); if (error != GRPC_ERROR_NONE) goto done; error = grpc_metadata_batch_add_head( batch->payload->send_initial_metadata.send_initial_metadata, - &calld->scheme, channeld->static_scheme); + &calld->scheme, channeld->static_scheme, GRPC_BATCH_SCHEME); if (error != GRPC_ERROR_NONE) goto done; error = grpc_metadata_batch_add_tail( batch->payload->send_initial_metadata.send_initial_metadata, - &calld->te_trailers, GRPC_MDELEM_TE_TRAILERS); + &calld->te_trailers, GRPC_MDELEM_TE_TRAILERS, GRPC_BATCH_TE); if (error != GRPC_ERROR_NONE) goto done; error = grpc_metadata_batch_add_tail( batch->payload->send_initial_metadata.send_initial_metadata, - &calld->content_type, GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC); + &calld->content_type, GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC, + GRPC_BATCH_CONTENT_TYPE); if (error != GRPC_ERROR_NONE) goto done; error = grpc_metadata_batch_add_tail( batch->payload->send_initial_metadata.send_initial_metadata, - &calld->user_agent, GRPC_MDELEM_REF(channeld->user_agent)); + &calld->user_agent, GRPC_MDELEM_REF(channeld->user_agent), + GRPC_BATCH_USER_AGENT); if (error != GRPC_ERROR_NONE) goto done; } @@ -514,13 +516,12 @@ static size_t max_payload_size_from_args(const grpc_channel_args* args) { return kMaxPayloadSizeForGet; } -static grpc_slice user_agent_from_args(const grpc_channel_args* args, - const char* transport_name) { +static grpc_core::ManagedMemorySlice user_agent_from_args( + const grpc_channel_args* args, const char* transport_name) { gpr_strvec v; size_t i; int is_first = 1; char* tmp; - grpc_slice result; gpr_strvec_init(&v); @@ -558,7 +559,7 @@ static grpc_slice user_agent_from_args(const grpc_channel_args* args, tmp = gpr_strvec_flatten(&v, nullptr); gpr_strvec_destroy(&v); - result = grpc_slice_intern(grpc_slice_from_static_string_internal(tmp)); + grpc_core::ManagedMemorySlice result(tmp); gpr_free(tmp); return result; diff --git a/src/core/ext/filters/http/client_authority_filter.cc b/src/core/ext/filters/http/client_authority_filter.cc index 4bd666ecfee..dc8beb986fc 100644 --- a/src/core/ext/filters/http/client_authority_filter.cc +++ b/src/core/ext/filters/http/client_authority_filter.cc @@ -44,7 +44,7 @@ struct call_data { }; struct channel_data { - grpc_slice default_authority; + grpc_core::ManagedMemorySlice default_authority; grpc_mdelem default_authority_mdelem; }; @@ -60,7 +60,7 @@ void authority_start_transport_stream_op_batch( initial_metadata->idx.named.authority == nullptr) { grpc_error* error = grpc_metadata_batch_add_head( initial_metadata, &calld->authority_storage, - GRPC_MDELEM_REF(chand->default_authority_mdelem)); + GRPC_MDELEM_REF(chand->default_authority_mdelem), GRPC_BATCH_AUTHORITY); if (error != GRPC_ERROR_NONE) { grpc_transport_stream_op_batch_finish_with_failure(batch, error, calld->call_combiner); @@ -101,8 +101,8 @@ grpc_error* init_channel_elem(grpc_channel_element* elem, return GRPC_ERROR_CREATE_FROM_STATIC_STRING( "GRPC_ARG_DEFAULT_AUTHORITY channel arg. must be a string"); } - chand->default_authority = grpc_slice_intern( - grpc_slice_from_static_string_internal(default_authority_str)); + chand->default_authority = + grpc_core::ManagedMemorySlice(default_authority_str); chand->default_authority_mdelem = grpc_mdelem_create( GRPC_MDSTR_AUTHORITY, chand->default_authority, nullptr); GPR_ASSERT(!args->is_last); diff --git a/src/core/ext/filters/http/message_compress/message_compress_filter.cc b/src/core/ext/filters/http/message_compress/message_compress_filter.cc index 3ce79b305df..9ef8e6a1990 100644 --- a/src/core/ext/filters/http/message_compress/message_compress_filter.cc +++ b/src/core/ext/filters/http/message_compress/message_compress_filter.cc @@ -72,29 +72,31 @@ struct call_data { GRPC_CLOSURE_INIT(&start_send_message_batch_in_call_combiner, start_send_message_batch, elem, grpc_schedule_on_exec_ctx); - grpc_slice_buffer_init(&slices); - GRPC_CLOSURE_INIT(&send_message_on_complete, ::send_message_on_complete, - elem, grpc_schedule_on_exec_ctx); - GRPC_CLOSURE_INIT(&on_send_message_next_done, ::on_send_message_next_done, - elem, grpc_schedule_on_exec_ctx); } ~call_data() { - grpc_slice_buffer_destroy_internal(&slices); + if (state_initialized) { + grpc_slice_buffer_destroy_internal(&slices); + } GRPC_ERROR_UNREF(cancel_error); } grpc_core::CallCombiner* call_combiner; - grpc_linked_mdelem message_compression_algorithm_storage; - grpc_linked_mdelem stream_compression_algorithm_storage; - grpc_linked_mdelem accept_encoding_storage; - grpc_linked_mdelem accept_stream_encoding_storage; grpc_message_compression_algorithm message_compression_algorithm = GRPC_MESSAGE_COMPRESS_NONE; - bool seen_initial_metadata = false; grpc_error* cancel_error = GRPC_ERROR_NONE; - grpc_closure start_send_message_batch_in_call_combiner; grpc_transport_stream_op_batch* send_message_batch = nullptr; + bool seen_initial_metadata = false; + /* Set to true, if the fields below are initialized. */ + bool state_initialized = false; + grpc_closure start_send_message_batch_in_call_combiner; + /* The fields below are only initialized when we compress the payload. + * Keep them at the bottom of the struct, so they don't pollute the + * cache-lines. */ + grpc_linked_mdelem message_compression_algorithm_storage; + grpc_linked_mdelem stream_compression_algorithm_storage; + grpc_linked_mdelem accept_encoding_storage; + grpc_linked_mdelem accept_stream_encoding_storage; grpc_slice_buffer slices; /**< Buffers up input slices to be compressed */ grpc_core::ManualConstructor replacement_stream; @@ -135,9 +137,8 @@ static grpc_compression_algorithm find_compression_algorithm( &compression_algorithm)); // Remove this metadata since it's an internal one (i.e., it won't be // transmitted out). - grpc_metadata_batch_remove( - initial_metadata, - initial_metadata->idx.named.grpc_internal_encoding_request); + grpc_metadata_batch_remove(initial_metadata, + GRPC_BATCH_GRPC_INTERNAL_ENCODING_REQUEST); // Check if that algorithm is enabled. Note that GRPC_COMPRESS_NONE is always // enabled. // TODO(juanlishen): Maybe use channel default or abort() if the algorithm @@ -157,6 +158,18 @@ static grpc_compression_algorithm find_compression_algorithm( return GRPC_COMPRESS_NONE; } +static void initialize_state(grpc_call_element* elem, call_data* calld) { + GPR_DEBUG_ASSERT(!calld->state_initialized); + calld->state_initialized = true; + grpc_slice_buffer_init(&calld->slices); + GRPC_CLOSURE_INIT(&calld->send_message_on_complete, + ::send_message_on_complete, elem, + grpc_schedule_on_exec_ctx); + GRPC_CLOSURE_INIT(&calld->on_send_message_next_done, + ::on_send_message_next_done, elem, + grpc_schedule_on_exec_ctx); +} + static grpc_error* process_send_initial_metadata( grpc_call_element* elem, grpc_metadata_batch* initial_metadata) GRPC_MUST_USE_RESULT; @@ -177,21 +190,26 @@ static grpc_error* process_send_initial_metadata( // Hint compression algorithm. grpc_error* error = GRPC_ERROR_NONE; if (calld->message_compression_algorithm != GRPC_MESSAGE_COMPRESS_NONE) { + initialize_state(elem, calld); error = grpc_metadata_batch_add_tail( initial_metadata, &calld->message_compression_algorithm_storage, grpc_message_compression_encoding_mdelem( - calld->message_compression_algorithm)); + calld->message_compression_algorithm), + GRPC_BATCH_GRPC_ENCODING); } else if (stream_compression_algorithm != GRPC_STREAM_COMPRESS_NONE) { + initialize_state(elem, calld); error = grpc_metadata_batch_add_tail( initial_metadata, &calld->stream_compression_algorithm_storage, - grpc_stream_compression_encoding_mdelem(stream_compression_algorithm)); + grpc_stream_compression_encoding_mdelem(stream_compression_algorithm), + GRPC_BATCH_CONTENT_ENCODING); } if (error != GRPC_ERROR_NONE) return error; // Convey supported compression algorithms. error = grpc_metadata_batch_add_tail( initial_metadata, &calld->accept_encoding_storage, GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS( - channeld->enabled_message_compression_algorithms_bitset)); + channeld->enabled_message_compression_algorithms_bitset), + GRPC_BATCH_GRPC_ACCEPT_ENCODING); if (error != GRPC_ERROR_NONE) return error; // Do not overwrite accept-encoding header if it already presents (e.g., added // by some proxy). @@ -199,7 +217,8 @@ static grpc_error* process_send_initial_metadata( error = grpc_metadata_batch_add_tail( initial_metadata, &calld->accept_stream_encoding_storage, GRPC_MDELEM_ACCEPT_STREAM_ENCODING_FOR_ALGORITHMS( - channeld->enabled_stream_compression_algorithms_bitset)); + channeld->enabled_stream_compression_algorithms_bitset), + GRPC_BATCH_ACCEPT_ENCODING); } return error; } @@ -225,6 +244,8 @@ static void send_message_batch_continue(grpc_call_element* elem) { static void finish_send_message(grpc_call_element* elem) { call_data* calld = static_cast(elem->call_data); + GPR_DEBUG_ASSERT(calld->message_compression_algorithm != + GRPC_MESSAGE_COMPRESS_NONE); // Compress the data if appropriate. grpc_slice_buffer tmp; grpc_slice_buffer_init(&tmp); diff --git a/src/core/ext/filters/http/server/http_server_filter.cc b/src/core/ext/filters/http/server/http_server_filter.cc index 028d268c7b3..99f6b65e424 100644 --- a/src/core/ext/filters/http/server/http_server_filter.cc +++ b/src/core/ext/filters/http/server/http_server_filter.cc @@ -124,6 +124,32 @@ static void hs_add_error(const char* error_name, grpc_error** cumulative, *cumulative = grpc_error_add_child(*cumulative, new_err); } +// Metadata equality within this filter leverages the fact that the sender was +// likely using the gRPC chttp2 transport, in which case the encoder would emit +// indexed values, in which case the local hpack parser would intern the +// relevant metadata, allowing a simple pointer comparison. +// +// That said, if the header was transmitted sans indexing/encoding, we still +// need to do the right thing. +// +// Assumptions: +// 1) The keys for a and b_static must match +// 2) b_static must be a statically allocated metadata object. +// 3) It is assumed that the remote end is indexing, but not necessary. +// TODO(arjunroy): Revisit this method when grpc_mdelem is strongly typed. +static bool md_strict_equal(grpc_mdelem a, grpc_mdelem b_static) { + // Hpack encoder on the remote side should emit indexed values, in which case + // hpack parser on this end should pick up interned values, in which case the + // pointer comparison alone is enough. + // + if (GPR_LIKELY(GRPC_MDELEM_IS_INTERNED(a))) { + return a.payload == b_static.payload; + } else { + return grpc_slice_eq_static_interned(GRPC_MDVALUE(a), + GRPC_MDVALUE(b_static)); + } +} + static grpc_error* hs_filter_incoming_metadata(grpc_call_element* elem, grpc_metadata_batch* b) { call_data* calld = static_cast(elem->call_data); @@ -131,19 +157,18 @@ static grpc_error* hs_filter_incoming_metadata(grpc_call_element* elem, static const char* error_name = "Failed processing incoming headers"; if (b->idx.named.method != nullptr) { - if (grpc_mdelem_static_value_eq(b->idx.named.method->md, - GRPC_MDELEM_METHOD_POST)) { + if (md_strict_equal(b->idx.named.method->md, GRPC_MDELEM_METHOD_POST)) { *calld->recv_initial_metadata_flags &= ~(GRPC_INITIAL_METADATA_CACHEABLE_REQUEST | GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST); - } else if (grpc_mdelem_static_value_eq(b->idx.named.method->md, - GRPC_MDELEM_METHOD_PUT)) { + } else if (md_strict_equal(b->idx.named.method->md, + GRPC_MDELEM_METHOD_PUT)) { *calld->recv_initial_metadata_flags &= ~GRPC_INITIAL_METADATA_CACHEABLE_REQUEST; *calld->recv_initial_metadata_flags |= GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST; - } else if (grpc_mdelem_static_value_eq(b->idx.named.method->md, - GRPC_MDELEM_METHOD_GET)) { + } else if (md_strict_equal(b->idx.named.method->md, + GRPC_MDELEM_METHOD_GET)) { *calld->recv_initial_metadata_flags |= GRPC_INITIAL_METADATA_CACHEABLE_REQUEST; *calld->recv_initial_metadata_flags &= @@ -154,7 +179,7 @@ static grpc_error* hs_filter_incoming_metadata(grpc_call_element* elem, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad header"), b->idx.named.method->md)); } - grpc_metadata_batch_remove(b, b->idx.named.method); + grpc_metadata_batch_remove(b, GRPC_BATCH_METHOD); } else { hs_add_error( error_name, &error, @@ -171,7 +196,7 @@ static grpc_error* hs_filter_incoming_metadata(grpc_call_element* elem, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad header"), b->idx.named.te->md)); } - grpc_metadata_batch_remove(b, b->idx.named.te); + grpc_metadata_batch_remove(b, GRPC_BATCH_TE); } else { hs_add_error(error_name, &error, grpc_error_set_str( @@ -180,10 +205,8 @@ static grpc_error* hs_filter_incoming_metadata(grpc_call_element* elem, } if (b->idx.named.scheme != nullptr) { - if (!grpc_mdelem_static_value_eq(b->idx.named.scheme->md, - GRPC_MDELEM_SCHEME_HTTP) && - !grpc_mdelem_static_value_eq(b->idx.named.scheme->md, - GRPC_MDELEM_SCHEME_HTTPS) && + if (!md_strict_equal(b->idx.named.scheme->md, GRPC_MDELEM_SCHEME_HTTP) && + !md_strict_equal(b->idx.named.scheme->md, GRPC_MDELEM_SCHEME_HTTPS) && !grpc_mdelem_static_value_eq(b->idx.named.scheme->md, GRPC_MDELEM_SCHEME_GRPC)) { hs_add_error(error_name, &error, @@ -191,7 +214,7 @@ static grpc_error* hs_filter_incoming_metadata(grpc_call_element* elem, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad header"), b->idx.named.scheme->md)); } - grpc_metadata_batch_remove(b, b->idx.named.scheme); + grpc_metadata_batch_remove(b, GRPC_BATCH_SCHEME); } else { hs_add_error( error_name, &error, @@ -227,7 +250,7 @@ static grpc_error* hs_filter_incoming_metadata(grpc_call_element* elem, gpr_free(val); } } - grpc_metadata_batch_remove(b, b->idx.named.content_type); + grpc_metadata_batch_remove(b, GRPC_BATCH_CONTENT_TYPE); } if (b->idx.named.path == nullptr) { @@ -282,12 +305,13 @@ static grpc_error* hs_filter_incoming_metadata(grpc_call_element* elem, grpc_linked_mdelem* el = b->idx.named.host; grpc_mdelem md = GRPC_MDELEM_REF(el->md); grpc_metadata_batch_remove(b, el); - hs_add_error(error_name, &error, - grpc_metadata_batch_add_head( - b, el, - grpc_mdelem_from_slices( - GRPC_MDSTR_AUTHORITY, - grpc_slice_ref_internal(GRPC_MDVALUE(md))))); + hs_add_error( + error_name, &error, + grpc_metadata_batch_add_head( + b, el, + grpc_mdelem_from_slices(GRPC_MDSTR_AUTHORITY, + grpc_slice_ref_internal(GRPC_MDVALUE(md))), + GRPC_BATCH_AUTHORITY)); GRPC_MDELEM_UNREF(md); } @@ -301,7 +325,7 @@ static grpc_error* hs_filter_incoming_metadata(grpc_call_element* elem, channel_data* chand = static_cast(elem->channel_data); if (!chand->surface_user_agent && b->idx.named.user_agent != nullptr) { - grpc_metadata_batch_remove(b, b->idx.named.user_agent); + grpc_metadata_batch_remove(b, GRPC_BATCH_USER_AGENT); } return error; @@ -392,15 +416,17 @@ static grpc_error* hs_mutate_op(grpc_call_element* elem, if (op->send_initial_metadata) { grpc_error* error = GRPC_ERROR_NONE; static const char* error_name = "Failed sending initial metadata"; - hs_add_error(error_name, &error, - grpc_metadata_batch_add_head( - op->payload->send_initial_metadata.send_initial_metadata, - &calld->status, GRPC_MDELEM_STATUS_200)); + hs_add_error( + error_name, &error, + grpc_metadata_batch_add_head( + op->payload->send_initial_metadata.send_initial_metadata, + &calld->status, GRPC_MDELEM_STATUS_200, GRPC_BATCH_STATUS)); hs_add_error(error_name, &error, grpc_metadata_batch_add_tail( op->payload->send_initial_metadata.send_initial_metadata, &calld->content_type, - GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC)); + GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC, + GRPC_BATCH_CONTENT_TYPE)); hs_add_error( error_name, &error, hs_filter_outgoing_metadata( diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc b/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc index 1d373c5b994..f48b0f4fdcf 100644 --- a/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc +++ b/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc @@ -18,12 +18,15 @@ #include +#include + #include #include #include #include #include +#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h" #include "src/core/ext/filters/client_channel/parse_address.h" #include "src/core/ext/filters/load_reporting/registered_opencensus_objects.h" #include "src/core/ext/filters/load_reporting/server_load_reporting_filter.h" @@ -225,7 +228,8 @@ grpc_filtered_mdelem ServerLoadReportingCallData::RecvInitialMetadataFilter( calld->target_host_[i] = static_cast( tolower(GRPC_SLICE_START_PTR(target_host_slice)[i])); } - } else if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_LB_TOKEN)) { + } else if (grpc_slice_str_cmp(GRPC_MDKEY(md), + grpc_core::kGrpcLbLbTokenMetadataKey) == 0) { if (calld->client_ip_and_lr_token_ == nullptr) { calld->StoreClientIpAndLrToken( reinterpret_cast GRPC_SLICE_START_PTR(GRPC_MDVALUE(md)), diff --git a/src/core/ext/transport/chttp2/client/chttp2_connector.cc b/src/core/ext/transport/chttp2/client/chttp2_connector.cc index c324c2c9243..6b6d299b6e2 100644 --- a/src/core/ext/transport/chttp2/client/chttp2_connector.cc +++ b/src/core/ext/transport/chttp2/client/chttp2_connector.cc @@ -111,15 +111,14 @@ static void on_handshake_done(void* arg, grpc_error* error) { } else { error = GRPC_ERROR_REF(error); } - memset(c->result, 0, sizeof(*c->result)); + c->result->reset(); } else { grpc_endpoint_delete_from_pollset_set(args->endpoint, c->args.interested_parties); c->result->transport = grpc_create_chttp2_transport(args->args, args->endpoint, true); - grpc_core::RefCountedPtr socket_node = + c->result->socket = grpc_chttp2_transport_get_socket_node(c->result->transport); - c->result->socket_uuid = socket_node == nullptr ? 0 : socket_node->uuid(); GPR_ASSERT(c->result->transport); // TODO(roth): We ideally want to wait until we receive HTTP/2 // settings from the server before we consider the connection @@ -180,7 +179,7 @@ static void connected(void* arg, grpc_error* error) { } else { error = GRPC_ERROR_REF(error); } - memset(c->result, 0, sizeof(*c->result)); + c->result->reset(); grpc_closure* notify = c->notify; c->notify = nullptr; GRPC_CLOSURE_SCHED(notify, error); diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.cc b/src/core/ext/transport/chttp2/server/chttp2_server.cc index dc60ec2487b..5e9cd77d18a 100644 --- a/src/core/ext/transport/chttp2/server/chttp2_server.cc +++ b/src/core/ext/transport/chttp2/server/chttp2_server.cc @@ -317,7 +317,7 @@ static grpc_error* chttp2_server_add_acceptor(grpc_server* server, *arg_val = grpc_tcp_server_create_fd_handler(tcp_server); grpc_server_add_listener(server, state, server_start_listener, - server_destroy_listener, /* socket_uuid */ 0); + server_destroy_listener, /* node */ nullptr); return err; /* Error path: cleanup and return */ @@ -345,7 +345,6 @@ grpc_error* grpc_chttp2_server_add_port(grpc_server* server, const char* addr, grpc_error** errors = nullptr; size_t naddrs = 0; const grpc_arg* arg = nullptr; - intptr_t socket_uuid = 0; *port_num = -1; @@ -413,15 +412,18 @@ grpc_error* grpc_chttp2_server_add_port(grpc_server* server, const char* addr, arg = grpc_channel_args_find(args, GRPC_ARG_ENABLE_CHANNELZ); if (grpc_channel_arg_get_bool(arg, GRPC_ENABLE_CHANNELZ_DEFAULT)) { + char* socket_name = nullptr; + gpr_asprintf(&socket_name, "chttp2 listener %s", addr); state->channelz_listen_socket = grpc_core::MakeRefCounted( - grpc_core::UniquePtr(gpr_strdup(addr))); - socket_uuid = state->channelz_listen_socket->uuid(); + grpc_core::UniquePtr(gpr_strdup(addr)), + grpc_core::UniquePtr(socket_name)); } /* Register with the server only upon success */ grpc_server_add_listener(server, state, server_start_listener, - server_destroy_listener, socket_uuid); + server_destroy_listener, + state->channelz_listen_socket); goto done; /* Error path: cleanup and return */ diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 43f2db1309f..73235756dfb 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -74,6 +74,8 @@ #define DEFAULT_MAX_PINGS_BETWEEN_DATA 2 #define DEFAULT_MAX_PING_STRIKES 2 +#define DEFAULT_MAX_PENDING_INDUCED_FRAMES 10000 + static int g_default_client_keepalive_time_ms = DEFAULT_CLIENT_KEEPALIVE_TIME_MS; static int g_default_client_keepalive_timeout_ms = @@ -105,6 +107,7 @@ static void write_action(void* t, grpc_error* error); static void write_action_end_locked(void* t, grpc_error* error); static void read_action_locked(void* t, grpc_error* error); +static void continue_read_action_locked(grpc_chttp2_transport* t); static void complete_fetch_locked(void* gs, grpc_error* error); /** Set a transport level setting, and push it to our peer */ @@ -378,10 +381,13 @@ static bool read_channel_args(grpc_chttp2_transport* t, if (channelz_enabled) { // TODO(ncteisen): add an API to endpoint to query for local addr, and pass // it in here, so SocketNode knows its own address. + char* socket_name = nullptr; + gpr_asprintf(&socket_name, "%s %s", get_vtable()->name, t->peer_string); t->channelz_socket = grpc_core::MakeRefCounted( grpc_core::UniquePtr(), - grpc_core::UniquePtr(gpr_strdup(t->peer_string))); + grpc_core::UniquePtr(gpr_strdup(t->peer_string)), + grpc_core::UniquePtr(socket_name)); } return enable_bdp; } @@ -782,12 +788,6 @@ static void destroy_stream(grpc_transport* gt, grpc_stream* gs, GRPC_ERROR_NONE); } -grpc_chttp2_stream* grpc_chttp2_parsing_lookup_stream(grpc_chttp2_transport* t, - uint32_t id) { - return static_cast( - grpc_chttp2_stream_map_find(&t->stream_map, id)); -} - grpc_chttp2_stream* grpc_chttp2_parsing_accept_stream(grpc_chttp2_transport* t, uint32_t id) { if (t->channel_callback.accept_stream == nullptr) { @@ -800,10 +800,8 @@ grpc_chttp2_stream* grpc_chttp2_parsing_accept_stream(grpc_chttp2_transport* t, !grpc_resource_user_safe_alloc(t->resource_user, GRPC_RESOURCE_QUOTA_CALL_SIZE)) { gpr_log(GPR_ERROR, "Memory exhausted, rejecting the stream."); - grpc_slice_buffer_add( - &t->qbuf, - grpc_chttp2_rst_stream_create( - id, static_cast(GRPC_HTTP2_REFUSED_STREAM), nullptr)); + grpc_chttp2_add_rst_stream_to_next_write(t, id, GRPC_HTTP2_REFUSED_STREAM, + nullptr); grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_RST_STREAM); return nullptr; } @@ -1048,6 +1046,19 @@ static void write_action_begin_locked(void* gt, grpc_error* error_ignored) { GRPC_CLOSURE_SCHED( GRPC_CLOSURE_INIT(&t->write_action, write_action, t, scheduler), GRPC_ERROR_NONE); + if (t->reading_paused_on_pending_induced_frames) { + GPR_ASSERT(t->num_pending_induced_frames == 0); + /* We had paused reading, because we had many induced frames (SETTINGS + * ACK, PINGS ACK and RST_STREAMS) pending in t->qbuf. Now that we have + * been able to flush qbuf, we can resume reading. */ + GRPC_CHTTP2_IF_TRACING(gpr_log( + GPR_INFO, + "transport %p : Resuming reading after being paused due to too " + "many unwritten SETTINGS ACK, PINGS ACK and RST_STREAM frames", + t)); + t->reading_paused_on_pending_induced_frames = false; + continue_read_action_locked(t); + } } else { GRPC_STATS_INC_HTTP2_SPURIOUS_WRITES_BEGUN(); set_write_state(t, GRPC_CHTTP2_WRITE_STATE_IDLE, "begin writing nothing"); @@ -1117,7 +1128,6 @@ static void write_action_end_locked(void* tp, grpc_error* error) { } grpc_chttp2_end_write(t, GRPC_ERROR_REF(error)); - GRPC_CHTTP2_UNREF_TRANSPORT(t, "writing"); } @@ -1157,10 +1167,12 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t, GRPC_CHTTP2_IF_TRACING( gpr_log(GPR_INFO, "transport %p got goaway with last stream id %d", t, last_stream_id)); - /* We want to log this irrespective of whether http tracing is enabled */ - gpr_log(GPR_INFO, "%s: Got goaway [%d] err=%s", t->peer_string, goaway_error, - grpc_error_string(t->goaway_error)); - + /* We want to log this irrespective of whether http tracing is enabled if we + * received a GOAWAY with a non NO_ERROR code. */ + if (goaway_error != GRPC_HTTP2_NO_ERROR) { + gpr_log(GPR_INFO, "%s: Got goaway [%d] err=%s", t->peer_string, + goaway_error, grpc_error_string(t->goaway_error)); + } /* When a client receives a GOAWAY with error code ENHANCE_YOUR_CALM and debug * data equal to "too_many_pings", it should log the occurrence at a log level * that is enabled by default and double the configured KEEPALIVE_TIME used @@ -1186,6 +1198,17 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t, static void maybe_start_some_streams(grpc_chttp2_transport* t) { grpc_chttp2_stream* s; + /* cancel out streams that haven't yet started if we have received a GOAWAY */ + if (t->goaway_error != GRPC_ERROR_NONE) { + while (grpc_chttp2_list_pop_waiting_for_concurrency(t, &s)) { + grpc_chttp2_cancel_stream( + t, s, + grpc_error_set_int( + GRPC_ERROR_CREATE_FROM_STATIC_STRING("GOAWAY received"), + GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE)); + } + return; + } /* start streams where we have free grpc_chttp2_stream ids and free * concurrency */ while (t->next_stream_id <= MAX_CLIENT_STREAM_ID && @@ -1214,13 +1237,14 @@ static void maybe_start_some_streams(grpc_chttp2_transport* t) { grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_START_NEW_STREAM); } /* cancel out streams that will never be started */ - while (t->next_stream_id >= MAX_CLIENT_STREAM_ID && - grpc_chttp2_list_pop_waiting_for_concurrency(t, &s)) { - grpc_chttp2_cancel_stream( - t, s, - grpc_error_set_int( - GRPC_ERROR_CREATE_FROM_STATIC_STRING("Stream IDs exhausted"), - GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE)); + if (t->next_stream_id >= MAX_CLIENT_STREAM_ID) { + while (grpc_chttp2_list_pop_waiting_for_concurrency(t, &s)) { + grpc_chttp2_cancel_stream( + t, s, + grpc_error_set_int( + GRPC_ERROR_CREATE_FROM_STATIC_STRING("Stream IDs exhausted"), + GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE)); + } } } @@ -1535,19 +1559,13 @@ static void perform_stream_op_locked(void* stream_op, on_complete->next_data.scratch |= CLOSURE_BARRIER_MAY_COVER_WRITE; s->fetching_send_message_finished = add_closure_barrier(op->on_complete); if (s->write_closed) { - // Return an error unless the client has already received trailing - // metadata from the server, since an application using a - // streaming call might send another message before getting a - // recv_message failure, breaking out of its loop, and then - // starting recv_trailing_metadata. + op->payload->send_message.stream_write_closed = true; + // We should NOT return an error here, so as to avoid a cancel OP being + // started. The surface layer will notice that the stream has been closed + // for writes and fail the send message op. op->payload->send_message.send_message.reset(); grpc_chttp2_complete_closure_step( - t, s, &s->fetching_send_message_finished, - t->is_client && s->received_trailing_metadata - ? GRPC_ERROR_NONE - : GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING( - "Attempt to send message after stream was closed", - &s->write_closed_error, 1), + t, s, &s->fetching_send_message_finished, GRPC_ERROR_NONE, "fetching_send_message_finished"); } else { GPR_ASSERT(s->fetching_send_message == nullptr); @@ -2066,7 +2084,7 @@ static void remove_stream(grpc_chttp2_transport* t, uint32_t id, grpc_error* error) { grpc_chttp2_stream* s = static_cast( grpc_chttp2_stream_map_delete(&t->stream_map, id)); - GPR_ASSERT(s); + GPR_DEBUG_ASSERT(s); if (t->incoming_stream == s) { t->incoming_stream = nullptr; grpc_chttp2_parsing_become_skip_parser(t); @@ -2116,10 +2134,8 @@ void grpc_chttp2_cancel_stream(grpc_chttp2_transport* t, grpc_chttp2_stream* s, grpc_http2_error_code http_error; grpc_error_get_status(due_to_error, s->deadline, nullptr, nullptr, &http_error, nullptr); - grpc_slice_buffer_add( - &t->qbuf, - grpc_chttp2_rst_stream_create( - s->id, static_cast(http_error), &s->stats.outgoing)); + grpc_chttp2_add_rst_stream_to_next_write( + t, s->id, static_cast(http_error), &s->stats.outgoing); grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_RST_STREAM); } } @@ -2152,7 +2168,7 @@ void grpc_chttp2_fake_status(grpc_chttp2_transport* t, grpc_chttp2_stream* s, &s->metadata_buffer[1], grpc_mdelem_from_slices( GRPC_MDSTR_GRPC_STATUS, - grpc_slice_from_copied_string(status_string)))); + grpc_core::UnmanagedMemorySlice(status_string)))); if (!GRPC_SLICE_IS_EMPTY(slice)) { GRPC_LOG_IF_ERROR( "add_status_message", @@ -2430,9 +2446,8 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s, grpc_slice_buffer_add(&t->qbuf, status_hdr); grpc_slice_buffer_add(&t->qbuf, message_pfx); grpc_slice_buffer_add(&t->qbuf, grpc_slice_ref_internal(slice)); - grpc_slice_buffer_add( - &t->qbuf, grpc_chttp2_rst_stream_create(s->id, GRPC_HTTP2_NO_ERROR, - &s->stats.outgoing)); + grpc_chttp2_add_rst_stream_to_next_write(t, s->id, GRPC_HTTP2_NO_ERROR, + &s->stats.outgoing); grpc_chttp2_mark_stream_closed(t, s, 1, 1, error); grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_CLOSE_FROM_API); @@ -2594,7 +2609,6 @@ static void read_action_locked(void* tp, grpc_error* error) { t->endpoint_reading = 0; } else if (t->closed_with_error == GRPC_ERROR_NONE) { keep_reading = true; - GRPC_CHTTP2_REF_TRANSPORT(t, "keep_reading"); /* Since we have read a byte, reset the keepalive timer */ if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING) { grpc_timer_cancel(&t->keepalive_ping_timer); @@ -2603,11 +2617,16 @@ static void read_action_locked(void* tp, grpc_error* error) { grpc_slice_buffer_reset_and_unref_internal(&t->read_buffer); if (keep_reading) { - const bool urgent = t->goaway_error != GRPC_ERROR_NONE; - grpc_endpoint_read(t->ep, &t->read_buffer, &t->read_action_locked, urgent); - grpc_chttp2_act_on_flowctl_action(t->flow_control->MakeAction(), t, - nullptr); - GRPC_CHTTP2_UNREF_TRANSPORT(t, "keep_reading"); + if (t->num_pending_induced_frames >= DEFAULT_MAX_PENDING_INDUCED_FRAMES) { + t->reading_paused_on_pending_induced_frames = true; + GRPC_CHTTP2_IF_TRACING( + gpr_log(GPR_INFO, + "transport %p : Pausing reading due to too " + "many unwritten SETTINGS ACK and RST_STREAM frames", + t)); + } else { + continue_read_action_locked(t); + } } else { GRPC_CHTTP2_UNREF_TRANSPORT(t, "reading_action"); } @@ -2615,6 +2634,12 @@ static void read_action_locked(void* tp, grpc_error* error) { GRPC_ERROR_UNREF(error); } +static void continue_read_action_locked(grpc_chttp2_transport* t) { + const bool urgent = t->goaway_error != GRPC_ERROR_NONE; + grpc_endpoint_read(t->ep, &t->read_buffer, &t->read_action_locked, urgent); + grpc_chttp2_act_on_flowctl_action(t->flow_control->MakeAction(), t, nullptr); +} + // t is reffed prior to calling the first time, and once the callback chain // that kicks off finishes, it's unreffed static void schedule_bdp_ping_locked(grpc_chttp2_transport* t) { diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.h b/src/core/ext/transport/chttp2/transport/chttp2_transport.h index c22cfb0ad7d..39574f93ec7 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.h +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.h @@ -29,6 +29,7 @@ extern grpc_core::TraceFlag grpc_http_trace; extern grpc_core::TraceFlag grpc_trace_http2_stream_state; extern grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_refcount; +extern grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_hpack_parser; extern bool g_flow_control_enabled; diff --git a/src/core/ext/transport/chttp2/transport/context_list.cc b/src/core/ext/transport/chttp2/transport/context_list.cc index df09809067d..245e8135833 100644 --- a/src/core/ext/transport/chttp2/transport/context_list.cc +++ b/src/core/ext/transport/chttp2/transport/context_list.cc @@ -46,7 +46,9 @@ void ContextList::Execute(void* arg, grpc_core::Timestamps* ts, ContextList* to_be_freed; while (head != nullptr) { if (write_timestamps_callback_g) { - ts->byte_offset = static_cast(head->byte_offset_); + if (ts) { + ts->byte_offset = static_cast(head->byte_offset_); + } write_timestamps_callback_g(head->trace_context_, ts, error); } to_be_freed = head; diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.cc b/src/core/ext/transport/chttp2/transport/frame_ping.cc index 9a56bf093f4..87c92dffc38 100644 --- a/src/core/ext/transport/chttp2/transport/frame_ping.cc +++ b/src/core/ext/transport/chttp2/transport/frame_ping.cc @@ -118,6 +118,7 @@ grpc_error* grpc_chttp2_ping_parser_parse(void* parser, t->ping_acks = static_cast(gpr_realloc( t->ping_acks, t->ping_ack_capacity * sizeof(*t->ping_acks))); } + t->num_pending_induced_frames++; t->ping_acks[t->ping_ack_count++] = p->opaque_8bytes; grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_PING_RESPONSE); } diff --git a/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc b/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc index cda09c3dea1..1350a967b9f 100644 --- a/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +++ b/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc @@ -58,6 +58,14 @@ grpc_slice grpc_chttp2_rst_stream_create(uint32_t id, uint32_t code, return slice; } +void grpc_chttp2_add_rst_stream_to_next_write( + grpc_chttp2_transport* t, uint32_t id, uint32_t code, + grpc_transport_one_way_stats* stats) { + t->num_pending_induced_frames++; + grpc_slice_buffer_add(&t->qbuf, + grpc_chttp2_rst_stream_create(id, code, stats)); +} + grpc_error* grpc_chttp2_rst_stream_parser_begin_frame( grpc_chttp2_rst_stream_parser* parser, uint32_t length, uint8_t flags) { if (length != 4) { diff --git a/src/core/ext/transport/chttp2/transport/frame_rst_stream.h b/src/core/ext/transport/chttp2/transport/frame_rst_stream.h index 64707666181..d61e62394a4 100644 --- a/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +++ b/src/core/ext/transport/chttp2/transport/frame_rst_stream.h @@ -33,6 +33,13 @@ typedef struct { grpc_slice grpc_chttp2_rst_stream_create(uint32_t stream_id, uint32_t code, grpc_transport_one_way_stats* stats); +// Adds RST_STREAM frame to t->qbuf (buffer for the next write). Should be +// called when we want to add RST_STREAM and we are not in +// write_action_begin_locked. +void grpc_chttp2_add_rst_stream_to_next_write( + grpc_chttp2_transport* t, uint32_t id, uint32_t code, + grpc_transport_one_way_stats* stats); + grpc_error* grpc_chttp2_rst_stream_parser_begin_frame( grpc_chttp2_rst_stream_parser* parser, uint32_t length, uint8_t flags); grpc_error* grpc_chttp2_rst_stream_parser_parse(void* parser, diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.cc b/src/core/ext/transport/chttp2/transport/frame_settings.cc index 3f84679ec31..ba57afa74b9 100644 --- a/src/core/ext/transport/chttp2/transport/frame_settings.cc +++ b/src/core/ext/transport/chttp2/transport/frame_settings.cc @@ -132,6 +132,7 @@ grpc_error* grpc_chttp2_settings_parser_parse(void* p, grpc_chttp2_transport* t, if (is_last) { memcpy(parser->target_settings, parser->incoming_settings, GRPC_CHTTP2_NUM_SETTINGS * sizeof(uint32_t)); + t->num_pending_induced_frames++; grpc_slice_buffer_add(&t->qbuf, grpc_chttp2_settings_ack_create()); if (t->notify_on_receive_settings != nullptr) { GRPC_CLOSURE_SCHED(t->notify_on_receive_settings, diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc index 2b40b7b03ed..e46504d9b30 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc @@ -604,8 +604,8 @@ static void deadline_enc(grpc_chttp2_hpack_compressor* c, grpc_millis deadline, grpc_mdelem mdelem; grpc_http2_encode_timeout(deadline - grpc_core::ExecCtx::Get()->Now(), timeout_str); - mdelem = grpc_mdelem_from_slices(GRPC_MDSTR_GRPC_TIMEOUT, - grpc_slice_from_copied_string(timeout_str)); + mdelem = grpc_mdelem_from_slices( + GRPC_MDSTR_GRPC_TIMEOUT, grpc_core::UnmanagedMemorySlice(timeout_str)); hpack_enc(c, mdelem, st); GRPC_MDELEM_UNREF(mdelem); } diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.cc b/src/core/ext/transport/chttp2/transport/hpack_parser.cc index 32848929363..7414fd7fff8 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_parser.cc @@ -38,6 +38,9 @@ #include "src/core/lib/surface/validate_metadata.h" #include "src/core/lib/transport/http2_errors.h" +grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_hpack_parser( + false, "chttp2_hpack_parser"); + typedef enum { NOT_BINARY, BINARY_BEGIN, @@ -643,7 +646,7 @@ static void GPR_ATTRIBUTE_NOINLINE on_hdr_log(grpc_mdelem md) { /* emission helpers */ template static grpc_error* on_hdr(grpc_chttp2_hpack_parser* p, grpc_mdelem md) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_chttp2_hpack_parser)) { on_hdr_log(md); } if (do_add) { @@ -660,24 +663,32 @@ static grpc_error* on_hdr(grpc_chttp2_hpack_parser* p, grpc_mdelem md) { return GRPC_ERROR_NONE; } -static grpc_slice take_string(grpc_chttp2_hpack_parser* p, - grpc_chttp2_hpack_parser_string* str, - bool intern) { - grpc_slice s; +static grpc_core::UnmanagedMemorySlice take_string_extern( + grpc_chttp2_hpack_parser* p, grpc_chttp2_hpack_parser_string* str) { + grpc_core::UnmanagedMemorySlice s; if (!str->copied) { - if (intern) { - s = grpc_slice_intern(str->data.referenced); - grpc_slice_unref_internal(str->data.referenced); - } else { - s = str->data.referenced; - } + GPR_DEBUG_ASSERT(!grpc_slice_is_interned(str->data.referenced)); + s = static_cast(str->data.referenced); + str->copied = true; + str->data.referenced = grpc_core::UnmanagedMemorySlice(); + } else { + s = grpc_core::UnmanagedMemorySlice(str->data.copied.str, + str->data.copied.length); + } + str->data.copied.length = 0; + return s; +} + +static grpc_core::ManagedMemorySlice take_string_intern( + grpc_chttp2_hpack_parser* p, grpc_chttp2_hpack_parser_string* str) { + grpc_core::ManagedMemorySlice s; + if (!str->copied) { + s = grpc_core::ManagedMemorySlice(&str->data.referenced); + grpc_slice_unref_internal(str->data.referenced); str->copied = true; str->data.referenced = grpc_empty_slice(); - } else if (intern) { - s = grpc_slice_intern(grpc_slice_from_static_buffer_internal( - str->data.copied.str, str->data.copied.length)); } else { - s = grpc_slice_from_copied_buffer(str->data.copied.str, + s = grpc_core::ManagedMemorySlice(str->data.copied.str, str->data.copied.length); } str->data.copied.length = 0; @@ -812,6 +823,12 @@ static grpc_mdelem get_precomputed_md_for_idx(grpc_chttp2_hpack_parser* p) { return md; } +static const grpc_core::ManagedMemorySlice& get_indexed_key(grpc_mdelem md) { + GPR_DEBUG_ASSERT(GRPC_MDELEM_IS_INTERNED(md)); + return static_cast( + grpc_slice_ref_internal(GRPC_MDKEY(md))); +} + /* finish a literal header with incremental indexing */ static grpc_error* finish_lithdr_incidx(grpc_chttp2_hpack_parser* p, const uint8_t* cur, @@ -819,8 +836,8 @@ static grpc_error* finish_lithdr_incidx(grpc_chttp2_hpack_parser* p, GRPC_STATS_INC_HPACK_RECV_LITHDR_INCIDX(); grpc_mdelem md = get_precomputed_md_for_idx(p); grpc_error* err = on_hdr( - p, grpc_mdelem_from_slices(grpc_slice_ref_internal(GRPC_MDKEY(md)), - take_string(p, &p->value, true))); + p, grpc_mdelem_from_slices(get_indexed_key(md), + take_string_intern(p, &p->value))); if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err); return parse_begin(p, cur, end); } @@ -830,9 +847,9 @@ static grpc_error* finish_lithdr_incidx_v(grpc_chttp2_hpack_parser* p, const uint8_t* cur, const uint8_t* end) { GRPC_STATS_INC_HPACK_RECV_LITHDR_INCIDX_V(); - grpc_error* err = - on_hdr(p, grpc_mdelem_from_slices(take_string(p, &p->key, true), - take_string(p, &p->value, true))); + grpc_error* err = on_hdr( + p, grpc_mdelem_from_slices(take_string_intern(p, &p->key), + take_string_intern(p, &p->value))); if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err); return parse_begin(p, cur, end); } @@ -883,8 +900,8 @@ static grpc_error* finish_lithdr_notidx(grpc_chttp2_hpack_parser* p, GRPC_STATS_INC_HPACK_RECV_LITHDR_NOTIDX(); grpc_mdelem md = get_precomputed_md_for_idx(p); grpc_error* err = on_hdr( - p, grpc_mdelem_from_slices(grpc_slice_ref_internal(GRPC_MDKEY(md)), - take_string(p, &p->value, false))); + p, grpc_mdelem_from_slices(get_indexed_key(md), + take_string_extern(p, &p->value))); if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err); return parse_begin(p, cur, end); } @@ -895,8 +912,8 @@ static grpc_error* finish_lithdr_notidx_v(grpc_chttp2_hpack_parser* p, const uint8_t* end) { GRPC_STATS_INC_HPACK_RECV_LITHDR_NOTIDX_V(); grpc_error* err = on_hdr( - p, grpc_mdelem_from_slices(take_string(p, &p->key, true), - take_string(p, &p->value, false))); + p, grpc_mdelem_from_slices(take_string_intern(p, &p->key), + take_string_extern(p, &p->value))); if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err); return parse_begin(p, cur, end); } @@ -947,8 +964,8 @@ static grpc_error* finish_lithdr_nvridx(grpc_chttp2_hpack_parser* p, GRPC_STATS_INC_HPACK_RECV_LITHDR_NVRIDX(); grpc_mdelem md = get_precomputed_md_for_idx(p); grpc_error* err = on_hdr( - p, grpc_mdelem_from_slices(grpc_slice_ref_internal(GRPC_MDKEY(md)), - take_string(p, &p->value, false))); + p, grpc_mdelem_from_slices(get_indexed_key(md), + take_string_extern(p, &p->value))); if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err); return parse_begin(p, cur, end); } @@ -959,8 +976,8 @@ static grpc_error* finish_lithdr_nvridx_v(grpc_chttp2_hpack_parser* p, const uint8_t* end) { GRPC_STATS_INC_HPACK_RECV_LITHDR_NVRIDX_V(); grpc_error* err = on_hdr( - p, grpc_mdelem_from_slices(take_string(p, &p->key, true), - take_string(p, &p->value, false))); + p, grpc_mdelem_from_slices(take_string_intern(p, &p->key), + take_string_extern(p, &p->value))); if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err); return parse_begin(p, cur, end); } @@ -1007,7 +1024,7 @@ static grpc_error* parse_lithdr_nvridx_v(grpc_chttp2_hpack_parser* p, /* finish parsing a max table size change */ static grpc_error* finish_max_tbl_size(grpc_chttp2_hpack_parser* p, const uint8_t* cur, const uint8_t* end) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_chttp2_hpack_parser)) { gpr_log(GPR_INFO, "MAX TABLE SIZE: %d", p->index); } grpc_error* err = @@ -1510,13 +1527,12 @@ static grpc_error* parse_key_string(grpc_chttp2_hpack_parser* p, static bool is_binary_literal_header(grpc_chttp2_hpack_parser* p) { /* We know that either argument here is a reference counter slice. - * 1. If a result of grpc_slice_from_static_buffer_internal, the refcount is - * set to kNoopRefcount. + * 1. If it is a grpc_core::StaticSlice, the refcount is set to kNoopRefcount. * 2. If it's p->key.data.referenced, then p->key.copied was set to false, * which occurs in begin_parse_string() - where the refcount is set to * p->current_slice_refcount, which is not null. */ return grpc_is_refcounted_slice_binary_header( - p->key.copied ? grpc_slice_from_static_buffer_internal( + p->key.copied ? grpc_core::ExternallyManagedSlice( p->key.data.copied.str, p->key.data.copied.length) : p->key.data.referenced); } @@ -1655,9 +1671,8 @@ static void force_client_rst_stream(void* sp, grpc_error* error) { grpc_chttp2_stream* s = static_cast(sp); grpc_chttp2_transport* t = s->t; if (!s->write_closed) { - grpc_slice_buffer_add( - &t->qbuf, grpc_chttp2_rst_stream_create(s->id, GRPC_HTTP2_NO_ERROR, - &s->stats.outgoing)); + grpc_chttp2_add_rst_stream_to_next_write(t, s->id, GRPC_HTTP2_NO_ERROR, + &s->stats.outgoing); grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_FORCE_RST_STREAM); grpc_chttp2_mark_stream_closed(t, s, true, true, GRPC_ERROR_NONE); } diff --git a/src/core/ext/transport/chttp2/transport/incoming_metadata.cc b/src/core/ext/transport/chttp2/transport/incoming_metadata.cc index 02623c978d7..d04630d726b 100644 --- a/src/core/ext/transport/chttp2/transport/incoming_metadata.cc +++ b/src/core/ext/transport/chttp2/transport/incoming_metadata.cc @@ -38,7 +38,8 @@ grpc_error* grpc_chttp2_incoming_metadata_buffer_add( storage = static_cast( buffer->arena->Alloc(sizeof(grpc_linked_mdelem))); } - return grpc_metadata_batch_add_tail(&buffer->batch, storage, elem); + storage->md = elem; + return grpc_metadata_batch_link_tail(&buffer->batch, storage); } grpc_error* grpc_chttp2_incoming_metadata_buffer_replace_or_add( diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 732bc38a0ac..6e1db8a5707 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -493,6 +493,13 @@ struct grpc_chttp2_transport { grpc_core::ContextList* cl = nullptr; grpc_core::RefCountedPtr channelz_socket; uint32_t num_messages_in_next_write = 0; + /** The number of pending induced frames (SETTINGS_ACK, PINGS_ACK and + * RST_STREAM) in the outgoing buffer (t->qbuf). If this number goes beyond + * DEFAULT_MAX_PENDING_INDUCED_FRAMES, we pause reading new frames. We would + * only continue reading when we are able to write to the socket again, + * thereby reducing the number of induced frames. */ + uint32_t num_pending_induced_frames = 0; + bool reading_paused_on_pending_induced_frames = false; }; typedef enum { @@ -564,8 +571,6 @@ struct grpc_chttp2_stream { /** Are we buffering writes on this stream? If yes, we won't become writable until there's enough queued up in the flow_controlled_buffer */ bool write_buffering = false; - /** Has trailing metadata been received. */ - bool received_trailing_metadata = false; /* have we sent or received the EOS bit? */ bool eos_received = false; @@ -745,8 +750,11 @@ void grpc_chttp2_act_on_flowctl_action( /********* End of Flow Control ***************/ -grpc_chttp2_stream* grpc_chttp2_parsing_lookup_stream(grpc_chttp2_transport* t, - uint32_t id); +inline grpc_chttp2_stream* grpc_chttp2_parsing_lookup_stream( + grpc_chttp2_transport* t, uint32_t id) { + return static_cast( + grpc_chttp2_stream_map_find(&t->stream_map, id)); +} grpc_chttp2_stream* grpc_chttp2_parsing_accept_stream(grpc_chttp2_transport* t, uint32_t id); diff --git a/src/core/ext/transport/chttp2/transport/parsing.cc b/src/core/ext/transport/chttp2/transport/parsing.cc index 4e6ff60caf8..2a2a8206cb6 100644 --- a/src/core/ext/transport/chttp2/transport/parsing.cc +++ b/src/core/ext/transport/chttp2/transport/parsing.cc @@ -108,7 +108,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t, /* fallthrough */ dts_fh_0: case GRPC_DTS_FH_0: - GPR_ASSERT(cur < end); + GPR_DEBUG_ASSERT(cur < end); t->incoming_frame_size = (static_cast(*cur)) << 16; if (++cur == end) { t->deframe_state = GRPC_DTS_FH_1; @@ -116,7 +116,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t, } /* fallthrough */ case GRPC_DTS_FH_1: - GPR_ASSERT(cur < end); + GPR_DEBUG_ASSERT(cur < end); t->incoming_frame_size |= (static_cast(*cur)) << 8; if (++cur == end) { t->deframe_state = GRPC_DTS_FH_2; @@ -124,7 +124,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t, } /* fallthrough */ case GRPC_DTS_FH_2: - GPR_ASSERT(cur < end); + GPR_DEBUG_ASSERT(cur < end); t->incoming_frame_size |= *cur; if (++cur == end) { t->deframe_state = GRPC_DTS_FH_3; @@ -132,7 +132,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t, } /* fallthrough */ case GRPC_DTS_FH_3: - GPR_ASSERT(cur < end); + GPR_DEBUG_ASSERT(cur < end); t->incoming_frame_type = *cur; if (++cur == end) { t->deframe_state = GRPC_DTS_FH_4; @@ -140,7 +140,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t, } /* fallthrough */ case GRPC_DTS_FH_4: - GPR_ASSERT(cur < end); + GPR_DEBUG_ASSERT(cur < end); t->incoming_frame_flags = *cur; if (++cur == end) { t->deframe_state = GRPC_DTS_FH_5; @@ -148,7 +148,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t, } /* fallthrough */ case GRPC_DTS_FH_5: - GPR_ASSERT(cur < end); + GPR_DEBUG_ASSERT(cur < end); t->incoming_stream_id = ((static_cast(*cur)) & 0x7f) << 24; if (++cur == end) { t->deframe_state = GRPC_DTS_FH_6; @@ -156,7 +156,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t, } /* fallthrough */ case GRPC_DTS_FH_6: - GPR_ASSERT(cur < end); + GPR_DEBUG_ASSERT(cur < end); t->incoming_stream_id |= (static_cast(*cur)) << 16; if (++cur == end) { t->deframe_state = GRPC_DTS_FH_7; @@ -164,7 +164,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t, } /* fallthrough */ case GRPC_DTS_FH_7: - GPR_ASSERT(cur < end); + GPR_DEBUG_ASSERT(cur < end); t->incoming_stream_id |= (static_cast(*cur)) << 8; if (++cur == end) { t->deframe_state = GRPC_DTS_FH_8; @@ -172,7 +172,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t, } /* fallthrough */ case GRPC_DTS_FH_8: - GPR_ASSERT(cur < end); + GPR_DEBUG_ASSERT(cur < end); t->incoming_stream_id |= (static_cast(*cur)); t->deframe_state = GRPC_DTS_FRAME; err = init_frame_parser(t); @@ -208,7 +208,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t, } /* fallthrough */ case GRPC_DTS_FRAME: - GPR_ASSERT(cur < end); + GPR_DEBUG_ASSERT(cur < end); if (static_cast(end - cur) == t->incoming_frame_size) { err = parse_frame_slice( t, @@ -382,10 +382,9 @@ error_handler: if (s != nullptr) { grpc_chttp2_mark_stream_closed(t, s, true, false, err); } - grpc_slice_buffer_add( - &t->qbuf, grpc_chttp2_rst_stream_create(t->incoming_stream_id, - GRPC_HTTP2_PROTOCOL_ERROR, - &s->stats.outgoing)); + grpc_chttp2_add_rst_stream_to_next_write(t, t->incoming_stream_id, + GRPC_HTTP2_PROTOCOL_ERROR, + &s->stats.outgoing); return init_skip_frame_parser(t, 0); } else { return err; @@ -425,7 +424,7 @@ static void on_initial_header(void* tp, grpc_mdelem md) { grpc_chttp2_transport* t = static_cast(tp); grpc_chttp2_stream* s = t->incoming_stream; - GPR_ASSERT(s != nullptr); + GPR_DEBUG_ASSERT(s != nullptr); if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { char* key = grpc_slice_to_c_string(GRPC_MDKEY(md)); @@ -473,7 +472,7 @@ static void on_initial_header(void* tp, grpc_mdelem md) { const size_t metadata_size_limit = t->settings[GRPC_ACKED_SETTINGS] [GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE]; - if (new_size > metadata_size_limit) { + if (GPR_UNLIKELY(new_size > metadata_size_limit)) { gpr_log(GPR_DEBUG, "received initial metadata size exceeds limit (%" PRIuPTR " vs. %" PRIuPTR ")", @@ -504,7 +503,7 @@ static void on_trailing_header(void* tp, grpc_mdelem md) { grpc_chttp2_transport* t = static_cast(tp); grpc_chttp2_stream* s = t->incoming_stream; - GPR_ASSERT(s != nullptr); + GPR_DEBUG_ASSERT(s != nullptr); if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { char* key = grpc_slice_to_c_string(GRPC_MDKEY(md)); @@ -627,7 +626,7 @@ static grpc_error* init_header_frame_parser(grpc_chttp2_transport* t, } else { t->incoming_stream = s; } - GPR_ASSERT(s != nullptr); + GPR_DEBUG_ASSERT(s != nullptr); s->stats.incoming.framing_bytes += 9; if (GPR_UNLIKELY(s->read_closed)) { GRPC_CHTTP2_IF_TRACING(gpr_log( @@ -648,7 +647,6 @@ static grpc_error* init_header_frame_parser(grpc_chttp2_transport* t, *s->trailing_metadata_available = true; } t->hpack_parser.on_header = on_trailing_header; - s->received_trailing_metadata = true; } else { GRPC_CHTTP2_IF_TRACING(gpr_log(GPR_INFO, "parsing initial_metadata")); t->hpack_parser.on_header = on_initial_header; @@ -657,7 +655,6 @@ static grpc_error* init_header_frame_parser(grpc_chttp2_transport* t, case 1: GRPC_CHTTP2_IF_TRACING(gpr_log(GPR_INFO, "parsing trailing_metadata")); t->hpack_parser.on_header = on_trailing_header; - s->received_trailing_metadata = true; break; case 2: gpr_log(GPR_ERROR, "too many header frames received"); @@ -765,10 +762,9 @@ static grpc_error* parse_frame_slice(grpc_chttp2_transport* t, grpc_chttp2_parsing_become_skip_parser(t); if (s) { s->forced_close_error = err; - grpc_slice_buffer_add( - &t->qbuf, grpc_chttp2_rst_stream_create(t->incoming_stream_id, - GRPC_HTTP2_PROTOCOL_ERROR, - &s->stats.outgoing)); + grpc_chttp2_add_rst_stream_to_next_write(t, t->incoming_stream_id, + GRPC_HTTP2_PROTOCOL_ERROR, + &s->stats.outgoing); } else { GRPC_ERROR_UNREF(err); } diff --git a/src/core/ext/transport/chttp2/transport/stream_map.cc b/src/core/ext/transport/chttp2/transport/stream_map.cc index f300e2356c9..647214b94a0 100644 --- a/src/core/ext/transport/chttp2/transport/stream_map.cc +++ b/src/core/ext/transport/chttp2/transport/stream_map.cc @@ -27,7 +27,7 @@ void grpc_chttp2_stream_map_init(grpc_chttp2_stream_map* map, size_t initial_capacity) { - GPR_ASSERT(initial_capacity > 1); + GPR_DEBUG_ASSERT(initial_capacity > 1); map->keys = static_cast(gpr_malloc(sizeof(uint32_t) * initial_capacity)); map->values = @@ -63,9 +63,17 @@ void grpc_chttp2_stream_map_add(grpc_chttp2_stream_map* map, uint32_t key, uint32_t* keys = map->keys; void** values = map->values; + // The first assertion ensures that the table is monotonically increasing. GPR_ASSERT(count == 0 || keys[count - 1] < key); - GPR_ASSERT(value); - GPR_ASSERT(grpc_chttp2_stream_map_find(map, key) == nullptr); + GPR_DEBUG_ASSERT(value); + // Asserting that the key is not already in the map can be a debug assertion. + // Why: we're already checking that the map elements are monotonically + // increasing. If we re-add a key, i.e. if the key is already present, then + // either it is the most recently added key in the map (in which case the + // first assertion fails due to key == last_key) or there is a more recently + // added (larger) key at the end of the map: in which case the first assertion + // still fails due to key < last_key. + GPR_DEBUG_ASSERT(grpc_chttp2_stream_map_find(map, key) == nullptr); if (count == capacity) { if (map->free > capacity / 4) { @@ -74,7 +82,7 @@ void grpc_chttp2_stream_map_add(grpc_chttp2_stream_map* map, uint32_t key, } else { /* resize when less than 25% of the table is free, because compaction won't help much */ - map->capacity = capacity = 3 * capacity / 2; + map->capacity = capacity = 2 * capacity; map->keys = keys = static_cast( gpr_realloc(keys, capacity * sizeof(uint32_t))); map->values = values = @@ -87,6 +95,7 @@ void grpc_chttp2_stream_map_add(grpc_chttp2_stream_map* map, uint32_t key, map->count = count + 1; } +template static void** find(grpc_chttp2_stream_map* map, uint32_t key) { size_t min_idx = 0; size_t max_idx = map->count; @@ -95,7 +104,8 @@ static void** find(grpc_chttp2_stream_map* map, uint32_t key) { void** values = map->values; uint32_t mid_key; - if (max_idx == 0) return nullptr; + GPR_DEBUG_ASSERT(!strict_find || max_idx > 0); + if (!strict_find && max_idx == 0) return nullptr; while (min_idx < max_idx) { /* find the midpoint, avoiding overflow */ @@ -112,28 +122,28 @@ static void** find(grpc_chttp2_stream_map* map, uint32_t key) { } } + GPR_DEBUG_ASSERT(!strict_find); return nullptr; } void* grpc_chttp2_stream_map_delete(grpc_chttp2_stream_map* map, uint32_t key) { - void** pvalue = find(map, key); - void* out = nullptr; - if (pvalue != nullptr) { - out = *pvalue; - *pvalue = nullptr; - map->free += (out != nullptr); - /* recognize complete emptyness and ensure we can skip - * defragmentation later */ - if (map->free == map->count) { - map->free = map->count = 0; - } - GPR_ASSERT(grpc_chttp2_stream_map_find(map, key) == nullptr); + void** pvalue = find(map, key); + GPR_DEBUG_ASSERT(pvalue != nullptr); + void* out = *pvalue; + GPR_DEBUG_ASSERT(out != nullptr); + *pvalue = nullptr; + map->free++; + /* recognize complete emptyness and ensure we can skip + defragmentation later */ + if (map->free == map->count) { + map->free = map->count = 0; } + GPR_DEBUG_ASSERT(grpc_chttp2_stream_map_find(map, key) == nullptr); return out; } void* grpc_chttp2_stream_map_find(grpc_chttp2_stream_map* map, uint32_t key) { - void** pvalue = find(map, key); + void** pvalue = find(map, key); return pvalue != nullptr ? *pvalue : nullptr; } diff --git a/src/core/ext/transport/chttp2/transport/writing.cc b/src/core/ext/transport/chttp2/transport/writing.cc index f3cb390dc7a..d6d9e4521f6 100644 --- a/src/core/ext/transport/chttp2/transport/writing.cc +++ b/src/core/ext/transport/chttp2/transport/writing.cc @@ -219,6 +219,7 @@ class WriteContext { void FlushQueuedBuffers() { /* simple writes are queued to qbuf, and flushed here */ grpc_slice_buffer_move_into(&t_->qbuf, &t_->outbuf); + t_->num_pending_induced_frames = 0; GPR_ASSERT(t_->qbuf.count == 0); } diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.cc b/src/core/ext/transport/cronet/transport/cronet_transport.cc index 28e6c04869e..19477bf9485 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.cc +++ b/src/core/ext/transport/cronet/transport/cronet_transport.cc @@ -40,6 +40,7 @@ #include "src/core/lib/surface/validate_metadata.h" #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/static_metadata.h" +#include "src/core/lib/transport/timeout_encoding.h" #include "src/core/lib/transport/transport_impl.h" #include "third_party/objective_c/Cronet/bidirectional_stream_c.h" @@ -718,16 +719,20 @@ static void create_grpc_frame(grpc_slice_buffer* write_slice_buffer, Convert metadata in a format that Cronet can consume */ static void convert_metadata_to_cronet_headers( - grpc_linked_mdelem* head, const char* host, char** pp_url, + grpc_metadata_batch* metadata, const char* host, char** pp_url, bidirectional_stream_header** pp_headers, size_t* p_num_headers, const char** method) { - grpc_linked_mdelem* curr = head; + grpc_linked_mdelem* curr = metadata->list.head; /* Walk the linked list and get number of header fields */ size_t num_headers_available = 0; while (curr != nullptr) { curr = curr->next; num_headers_available++; } + grpc_millis deadline = metadata->deadline; + if (deadline != GRPC_MILLIS_INF_FUTURE) { + num_headers_available++; + } /* Allocate enough memory. It is freed in the on_stream_ready callback */ bidirectional_stream_header* headers = @@ -740,7 +745,7 @@ static void convert_metadata_to_cronet_headers( are not used for cronet. TODO (makdharma): Eliminate need to traverse the LL second time for perf. */ - curr = head; + curr = metadata->list.head; size_t num_headers = 0; while (num_headers < num_headers_available) { grpc_mdelem mdelem = curr->md; @@ -788,6 +793,18 @@ static void convert_metadata_to_cronet_headers( break; } } + if (deadline != GRPC_MILLIS_INF_FUTURE) { + char* key = grpc_slice_to_c_string(GRPC_MDSTR_GRPC_TIMEOUT); + char* value = + static_cast(gpr_malloc(GRPC_HTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE)); + grpc_http2_encode_timeout(deadline - grpc_core::ExecCtx::Get()->Now(), + value); + headers[num_headers].key = key; + headers[num_headers].value = value; + + num_headers++; + } + *p_num_headers = num_headers; } @@ -1028,10 +1045,10 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) { char* url = nullptr; const char* method = "POST"; s->header_array.headers = nullptr; - convert_metadata_to_cronet_headers(stream_op->payload->send_initial_metadata - .send_initial_metadata->list.head, - t->host, &url, &s->header_array.headers, - &s->header_array.count, &method); + convert_metadata_to_cronet_headers( + stream_op->payload->send_initial_metadata.send_initial_metadata, + t->host, &url, &s->header_array.headers, &s->header_array.count, + &method); s->header_array.capacity = s->header_array.count; CRONET_LOG(GPR_DEBUG, "bidirectional_stream_start(%p, %s)", s->cbs, url); bidirectional_stream_start(s->cbs, url, 0, method, &s->header_array, false); diff --git a/src/core/ext/transport/inproc/inproc_transport.cc b/src/core/ext/transport/inproc/inproc_transport.cc index 8cb9ac4a2fd..a7f67879287 100644 --- a/src/core/ext/transport/inproc/inproc_transport.cc +++ b/src/core/ext/transport/inproc/inproc_transport.cc @@ -1203,7 +1203,7 @@ void inproc_transports_create(grpc_transport** server_transport, */ void grpc_inproc_transport_init(void) { grpc_core::ExecCtx exec_ctx; - g_empty_slice = grpc_slice_from_static_buffer_internal(nullptr, 0); + g_empty_slice = grpc_core::ExternallyManagedSlice(); grpc_slice key_tmp = grpc_slice_from_static_string(":path"); g_fake_path_key = grpc_slice_intern(key_tmp); diff --git a/src/core/ext/upb-generated/grpc/gcp/altscontext.upb.c b/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c similarity index 93% rename from src/core/ext/upb-generated/grpc/gcp/altscontext.upb.c rename to src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c index 52477e183dc..9ffd2fbb4c0 100644 --- a/src/core/ext/upb-generated/grpc/gcp/altscontext.upb.c +++ b/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c @@ -1,14 +1,14 @@ /* This file was generated by upbc (the upb compiler) from the input * file: * - * grpc/gcp/altscontext.proto + * src/proto/grpc/gcp/altscontext.proto * * Do not edit -- your changes will be discarded when the file is * regenerated. */ #include #include "upb/msg.h" -#include "grpc/gcp/altscontext.upb.h" +#include "src/proto/grpc/gcp/altscontext.upb.h" #include "src/proto/grpc/gcp/transport_security_common.upb.h" #include "upb/port_def.inc" diff --git a/src/core/ext/upb-generated/grpc/gcp/altscontext.upb.h b/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h similarity index 97% rename from src/core/ext/upb-generated/grpc/gcp/altscontext.upb.h rename to src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h index d9a4d58854d..ce32864cbc3 100644 --- a/src/core/ext/upb-generated/grpc/gcp/altscontext.upb.h +++ b/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h @@ -1,13 +1,13 @@ /* This file was generated by upbc (the upb compiler) from the input * file: * - * grpc/gcp/altscontext.proto + * src/proto/grpc/gcp/altscontext.proto * * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#ifndef GRPC_GCP_ALTSCONTEXT_PROTO_UPB_H_ -#define GRPC_GCP_ALTSCONTEXT_PROTO_UPB_H_ +#ifndef SRC_PROTO_GRPC_GCP_ALTSCONTEXT_PROTO_UPB_H_ +#define SRC_PROTO_GRPC_GCP_ALTSCONTEXT_PROTO_UPB_H_ #include "upb/generated_util.h" #include "upb/msg.h" @@ -123,4 +123,4 @@ UPB_INLINE void grpc_gcp_AltsContext_PeerAttributesEntry_set_value(grpc_gcp_Alts #include "upb/port_undef.inc" -#endif /* GRPC_GCP_ALTSCONTEXT_PROTO_UPB_H_ */ +#endif /* SRC_PROTO_GRPC_GCP_ALTSCONTEXT_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/grpc/gcp/handshaker.upb.c b/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c similarity index 98% rename from src/core/ext/upb-generated/grpc/gcp/handshaker.upb.c rename to src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c index 9e957538323..80f3a0a82dc 100644 --- a/src/core/ext/upb-generated/grpc/gcp/handshaker.upb.c +++ b/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c @@ -1,14 +1,14 @@ /* This file was generated by upbc (the upb compiler) from the input * file: * - * grpc/gcp/handshaker.proto + * src/proto/grpc/gcp/handshaker.proto * * Do not edit -- your changes will be discarded when the file is * regenerated. */ #include #include "upb/msg.h" -#include "grpc/gcp/handshaker.upb.h" +#include "src/proto/grpc/gcp/handshaker.upb.h" #include "src/proto/grpc/gcp/transport_security_common.upb.h" #include "upb/port_def.inc" diff --git a/src/core/ext/upb-generated/grpc/gcp/handshaker.upb.h b/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h similarity index 99% rename from src/core/ext/upb-generated/grpc/gcp/handshaker.upb.h rename to src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h index 97c8d44f45e..11a64324867 100644 --- a/src/core/ext/upb-generated/grpc/gcp/handshaker.upb.h +++ b/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h @@ -1,13 +1,13 @@ /* This file was generated by upbc (the upb compiler) from the input * file: * - * grpc/gcp/handshaker.proto + * src/proto/grpc/gcp/handshaker.proto * * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#ifndef GRPC_GCP_HANDSHAKER_PROTO_UPB_H_ -#define GRPC_GCP_HANDSHAKER_PROTO_UPB_H_ +#ifndef SRC_PROTO_GRPC_GCP_HANDSHAKER_PROTO_UPB_H_ +#define SRC_PROTO_GRPC_GCP_HANDSHAKER_PROTO_UPB_H_ #include "upb/generated_util.h" #include "upb/msg.h" @@ -678,4 +678,4 @@ UPB_INLINE struct grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerResp_mutable_sta #include "upb/port_undef.inc" -#endif /* GRPC_GCP_HANDSHAKER_PROTO_UPB_H_ */ +#endif /* SRC_PROTO_GRPC_GCP_HANDSHAKER_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/grpc/gcp/transport_security_common.upb.c b/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c similarity index 89% rename from src/core/ext/upb-generated/grpc/gcp/transport_security_common.upb.c rename to src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c index 19859504b87..9b6303458e2 100644 --- a/src/core/ext/upb-generated/grpc/gcp/transport_security_common.upb.c +++ b/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c @@ -1,14 +1,14 @@ /* This file was generated by upbc (the upb compiler) from the input * file: * - * grpc/gcp/transport_security_common.proto + * src/proto/grpc/gcp/transport_security_common.proto * * Do not edit -- your changes will be discarded when the file is * regenerated. */ #include #include "upb/msg.h" -#include "grpc/gcp/transport_security_common.upb.h" +#include "src/proto/grpc/gcp/transport_security_common.upb.h" #include "upb/port_def.inc" diff --git a/src/core/ext/upb-generated/grpc/gcp/transport_security_common.upb.h b/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h similarity index 95% rename from src/core/ext/upb-generated/grpc/gcp/transport_security_common.upb.h rename to src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h index 14d4898b2ab..0e55e45f4fb 100644 --- a/src/core/ext/upb-generated/grpc/gcp/transport_security_common.upb.h +++ b/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h @@ -1,13 +1,13 @@ /* This file was generated by upbc (the upb compiler) from the input * file: * - * grpc/gcp/transport_security_common.proto + * src/proto/grpc/gcp/transport_security_common.proto * * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#ifndef GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPB_H_ -#define GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPB_H_ +#ifndef SRC_PROTO_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPB_H_ +#define SRC_PROTO_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPB_H_ #include "upb/generated_util.h" #include "upb/msg.h" @@ -106,4 +106,4 @@ UPB_INLINE void grpc_gcp_RpcProtocolVersions_Version_set_minor(grpc_gcp_RpcProto #include "upb/port_undef.inc" -#endif /* GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPB_H_ */ +#endif /* SRC_PROTO_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/grpc/health/v1/health.upb.c b/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c similarity index 89% rename from src/core/ext/upb-generated/grpc/health/v1/health.upb.c rename to src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c index e672d431005..8a3359bb769 100644 --- a/src/core/ext/upb-generated/grpc/health/v1/health.upb.c +++ b/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c @@ -1,14 +1,14 @@ /* This file was generated by upbc (the upb compiler) from the input * file: * - * grpc/health/v1/health.proto + * src/proto/grpc/health/v1/health.proto * * Do not edit -- your changes will be discarded when the file is * regenerated. */ #include #include "upb/msg.h" -#include "grpc/health/v1/health.upb.h" +#include "src/proto/grpc/health/v1/health.upb.h" #include "upb/port_def.inc" diff --git a/src/core/ext/upb-generated/grpc/health/v1/health.upb.h b/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h similarity index 94% rename from src/core/ext/upb-generated/grpc/health/v1/health.upb.h rename to src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h index 536e7d8131b..103b4ddbafc 100644 --- a/src/core/ext/upb-generated/grpc/health/v1/health.upb.h +++ b/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h @@ -1,13 +1,13 @@ /* This file was generated by upbc (the upb compiler) from the input * file: * - * grpc/health/v1/health.proto + * src/proto/grpc/health/v1/health.proto * * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#ifndef GRPC_HEALTH_V1_HEALTH_PROTO_UPB_H_ -#define GRPC_HEALTH_V1_HEALTH_PROTO_UPB_H_ +#ifndef SRC_PROTO_GRPC_HEALTH_V1_HEALTH_PROTO_UPB_H_ +#define SRC_PROTO_GRPC_HEALTH_V1_HEALTH_PROTO_UPB_H_ #include "upb/generated_util.h" #include "upb/msg.h" @@ -81,4 +81,4 @@ UPB_INLINE void grpc_health_v1_HealthCheckResponse_set_status(grpc_health_v1_Hea #include "upb/port_undef.inc" -#endif /* GRPC_HEALTH_V1_HEALTH_PROTO_UPB_H_ */ +#endif /* SRC_PROTO_GRPC_HEALTH_V1_HEALTH_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/grpc/lb/v1/load_balancer.upb.c b/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c similarity index 97% rename from src/core/ext/upb-generated/grpc/lb/v1/load_balancer.upb.c rename to src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c index 74a01dc8d98..75f07614920 100644 --- a/src/core/ext/upb-generated/grpc/lb/v1/load_balancer.upb.c +++ b/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c @@ -1,14 +1,14 @@ /* This file was generated by upbc (the upb compiler) from the input * file: * - * grpc/lb/v1/load_balancer.proto + * src/proto/grpc/lb/v1/load_balancer.proto * * Do not edit -- your changes will be discarded when the file is * regenerated. */ #include #include "upb/msg.h" -#include "grpc/lb/v1/load_balancer.upb.h" +#include "src/proto/grpc/lb/v1/load_balancer.upb.h" #include "google/protobuf/duration.upb.h" #include "google/protobuf/timestamp.upb.h" diff --git a/src/core/ext/upb-generated/grpc/lb/v1/load_balancer.upb.h b/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h similarity index 99% rename from src/core/ext/upb-generated/grpc/lb/v1/load_balancer.upb.h rename to src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h index 398da3b71fe..64845660d17 100644 --- a/src/core/ext/upb-generated/grpc/lb/v1/load_balancer.upb.h +++ b/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h @@ -1,13 +1,13 @@ /* This file was generated by upbc (the upb compiler) from the input * file: * - * grpc/lb/v1/load_balancer.proto + * src/proto/grpc/lb/v1/load_balancer.proto * * Do not edit -- your changes will be discarded when the file is * regenerated. */ -#ifndef GRPC_LB_V1_LOAD_BALANCER_PROTO_UPB_H_ -#define GRPC_LB_V1_LOAD_BALANCER_PROTO_UPB_H_ +#ifndef SRC_PROTO_GRPC_LB_V1_LOAD_BALANCER_PROTO_UPB_H_ +#define SRC_PROTO_GRPC_LB_V1_LOAD_BALANCER_PROTO_UPB_H_ #include "upb/generated_util.h" #include "upb/msg.h" @@ -356,4 +356,4 @@ UPB_INLINE void grpc_lb_v1_Server_set_drop(grpc_lb_v1_Server *msg, bool value) { #include "upb/port_undef.inc" -#endif /* GRPC_LB_V1_LOAD_BALANCER_PROTO_UPB_H_ */ +#endif /* SRC_PROTO_GRPC_LB_V1_LOAD_BALANCER_PROTO_UPB_H_ */ diff --git a/src/core/lib/channel/channel_args.cc b/src/core/lib/channel/channel_args.cc index a35db186a30..60248f9d8fc 100644 --- a/src/core/lib/channel/channel_args.cc +++ b/src/core/lib/channel/channel_args.cc @@ -214,6 +214,8 @@ void grpc_channel_args_destroy(grpc_channel_args* a) { int grpc_channel_args_compare(const grpc_channel_args* a, const grpc_channel_args* b) { + if (a == nullptr && b == nullptr) return 0; + if (a == nullptr || b == nullptr) return a == nullptr ? -1 : 1; int c = GPR_ICMP(a->num_args, b->num_args); if (c != 0) return c; for (size_t i = 0; i < a->num_args; i++) { @@ -255,6 +257,13 @@ int grpc_channel_arg_get_integer(const grpc_arg* arg, return arg->value.integer; } +int grpc_channel_args_find_integer(const grpc_channel_args* args, + const char* name, + const grpc_integer_options options) { + const grpc_arg* arg = grpc_channel_args_find(args, name); + return grpc_channel_arg_get_integer(arg, options); +} + char* grpc_channel_arg_get_string(const grpc_arg* arg) { if (arg == nullptr) return nullptr; if (arg->type != GRPC_ARG_STRING) { @@ -264,6 +273,12 @@ char* grpc_channel_arg_get_string(const grpc_arg* arg) { return arg->value.string; } +char* grpc_channel_args_find_string(const grpc_channel_args* args, + const char* name) { + const grpc_arg* arg = grpc_channel_args_find(args, name); + return grpc_channel_arg_get_string(arg); +} + bool grpc_channel_arg_get_bool(const grpc_arg* arg, bool default_value) { if (arg == nullptr) return default_value; if (arg->type != GRPC_ARG_INTEGER) { @@ -282,6 +297,12 @@ bool grpc_channel_arg_get_bool(const grpc_arg* arg, bool default_value) { } } +bool grpc_channel_args_find_bool(const grpc_channel_args* args, + const char* name, bool default_value) { + const grpc_arg* arg = grpc_channel_args_find(args, name); + return grpc_channel_arg_get_bool(arg, default_value); +} + bool grpc_channel_args_want_minimal_stack(const grpc_channel_args* args) { return grpc_channel_arg_get_bool( grpc_channel_args_find(args, GRPC_ARG_MINIMAL_STACK), false); diff --git a/src/core/lib/channel/channel_args.h b/src/core/lib/channel/channel_args.h index 2b698a66cfb..5928802f288 100644 --- a/src/core/lib/channel/channel_args.h +++ b/src/core/lib/channel/channel_args.h @@ -73,16 +73,30 @@ typedef struct grpc_integer_options { int max_value; } grpc_integer_options; -/** Returns the value of \a arg, subject to the contraints in \a options. */ +/** Returns the value of \a arg, subject to the constraints in \a options. */ int grpc_channel_arg_get_integer(const grpc_arg* arg, const grpc_integer_options options); +/** Similar to the above, but needs to find the arg from \a args by the name + * first. */ +int grpc_channel_args_find_integer(const grpc_channel_args* args, + const char* name, + const grpc_integer_options options); /** Returns the value of \a arg if \a arg is of type GRPC_ARG_STRING. Otherwise, emits a warning log, and returns nullptr. If arg is nullptr, returns nullptr, and does not emit a warning. */ char* grpc_channel_arg_get_string(const grpc_arg* arg); - +/** Similar to the above, but needs to find the arg from \a args by the name + * first. */ +char* grpc_channel_args_find_string(const grpc_channel_args* args, + const char* name); +/** If \a arg is of type GRPC_ARG_INTEGER, returns true if it's non-zero. + * Returns \a default_value if \a arg is of other types. */ bool grpc_channel_arg_get_bool(const grpc_arg* arg, bool default_value); +/** Similar to the above, but needs to find the arg from \a args by the name + * first. */ +bool grpc_channel_args_find_bool(const grpc_channel_args* args, + const char* name, bool default_value); // Helpers for creating channel args. grpc_arg grpc_channel_arg_string_create(char* name, char* value); diff --git a/src/core/lib/channel/channelz.cc b/src/core/lib/channel/channelz.cc index f03c9adba26..fb913beb0f0 100644 --- a/src/core/lib/channel/channelz.cc +++ b/src/core/lib/channel/channelz.cc @@ -85,7 +85,8 @@ intptr_t GetParentUuidFromArgs(const grpc_channel_args& args) { // BaseNode // -BaseNode::BaseNode(EntityType type) : type_(type), uuid_(-1) { +BaseNode::BaseNode(EntityType type, UniquePtr name) + : type_(type), uuid_(-1), name_(std::move(name)) { // The registry will set uuid_ under its lock. ChannelzRegistry::Register(this); } @@ -106,51 +107,45 @@ char* BaseNode::RenderJsonString() { CallCountingHelper::CallCountingHelper() { num_cores_ = GPR_MAX(1, gpr_cpu_num_cores()); - per_cpu_counter_data_storage_ = static_cast( - gpr_zalloc(sizeof(AtomicCounterData) * num_cores_)); -} - -CallCountingHelper::~CallCountingHelper() { - gpr_free(per_cpu_counter_data_storage_); + per_cpu_counter_data_storage_.reserve(num_cores_); + for (size_t i = 0; i < num_cores_; ++i) { + per_cpu_counter_data_storage_.emplace_back(); + } } void CallCountingHelper::RecordCallStarted() { - gpr_atm_no_barrier_fetch_add( - &per_cpu_counter_data_storage_[grpc_core::ExecCtx::Get()->starting_cpu()] - .calls_started, - static_cast(1)); - gpr_atm_no_barrier_store( - &per_cpu_counter_data_storage_[grpc_core::ExecCtx::Get()->starting_cpu()] - .last_call_started_millis, - (gpr_atm)ExecCtx::Get()->Now()); + AtomicCounterData& data = + per_cpu_counter_data_storage_[ExecCtx::Get()->starting_cpu()]; + data.calls_started.FetchAdd(1, MemoryOrder::RELAXED); + data.last_call_started_cycle.Store(gpr_get_cycle_counter(), + MemoryOrder::RELAXED); } void CallCountingHelper::RecordCallFailed() { - gpr_atm_no_barrier_fetch_add( - &per_cpu_counter_data_storage_[grpc_core::ExecCtx::Get()->starting_cpu()] - .calls_failed, - static_cast(1)); + per_cpu_counter_data_storage_[ExecCtx::Get()->starting_cpu()] + .calls_failed.FetchAdd(1, MemoryOrder::RELAXED); } void CallCountingHelper::RecordCallSucceeded() { - gpr_atm_no_barrier_fetch_add( - &per_cpu_counter_data_storage_[grpc_core::ExecCtx::Get()->starting_cpu()] - .calls_succeeded, - static_cast(1)); + per_cpu_counter_data_storage_[ExecCtx::Get()->starting_cpu()] + .calls_succeeded.FetchAdd(1, MemoryOrder::RELAXED); } void CallCountingHelper::CollectData(CounterData* out) { for (size_t core = 0; core < num_cores_; ++core) { - out->calls_started += gpr_atm_no_barrier_load( - &per_cpu_counter_data_storage_[core].calls_started); - out->calls_succeeded += gpr_atm_no_barrier_load( - &per_cpu_counter_data_storage_[core].calls_succeeded); - out->calls_failed += gpr_atm_no_barrier_load( - &per_cpu_counter_data_storage_[core].calls_failed); - gpr_atm last_call = gpr_atm_no_barrier_load( - &per_cpu_counter_data_storage_[core].last_call_started_millis); - if (last_call > out->last_call_started_millis) { - out->last_call_started_millis = last_call; + AtomicCounterData& data = per_cpu_counter_data_storage_[core]; + + out->calls_started += data.calls_started.Load(MemoryOrder::RELAXED); + out->calls_succeeded += + per_cpu_counter_data_storage_[core].calls_succeeded.Load( + MemoryOrder::RELAXED); + out->calls_failed += per_cpu_counter_data_storage_[core].calls_failed.Load( + MemoryOrder::RELAXED); + const gpr_cycle_counter last_call = + per_cpu_counter_data_storage_[core].last_call_started_cycle.Load( + MemoryOrder::RELAXED); + if (last_call > out->last_call_started_cycle) { + out->last_call_started_cycle = last_call; } } } @@ -172,8 +167,9 @@ void CallCountingHelper::PopulateCallCounts(grpc_json* json) { json, json_iterator, "callsFailed", data.calls_failed); } if (data.calls_started != 0) { - gpr_timespec ts = grpc_millis_to_timespec(data.last_call_started_millis, - GPR_CLOCK_REALTIME); + gpr_timespec ts = gpr_convert_clock_type( + gpr_cycle_counter_to_time(data.last_call_started_cycle), + GPR_CLOCK_REALTIME); json_iterator = grpc_json_create_child(json_iterator, json, "lastCallStartedTimestamp", gpr_format_timespec(ts), GRPC_JSON_STRING, true); @@ -187,7 +183,8 @@ void CallCountingHelper::PopulateCallCounts(grpc_json* json) { ChannelNode::ChannelNode(UniquePtr target, size_t channel_tracer_max_nodes, intptr_t parent_uuid) : BaseNode(parent_uuid == 0 ? EntityType::kTopLevelChannel - : EntityType::kInternalChannel), + : EntityType::kInternalChannel, + UniquePtr(gpr_strdup(target.get()))), target_(std::move(target)), trace_(channel_tracer_max_nodes), parent_uuid_(parent_uuid) {} @@ -320,7 +317,8 @@ void ChannelNode::RemoveChildSubchannel(intptr_t child_uuid) { // ServerNode::ServerNode(grpc_server* server, size_t channel_tracer_max_nodes) - : BaseNode(EntityType::kServer), trace_(channel_tracer_max_nodes) {} + : BaseNode(EntityType::kServer, /* name */ nullptr), + trace_(channel_tracer_max_nodes) {} ServerNode::~ServerNode() {} @@ -334,9 +332,9 @@ void ServerNode::RemoveChildSocket(intptr_t child_uuid) { child_sockets_.erase(child_uuid); } -void ServerNode::AddChildListenSocket(intptr_t child_uuid) { +void ServerNode::AddChildListenSocket(RefCountedPtr node) { MutexLock lock(&child_mu_); - child_listen_sockets_.insert(MakePair(child_uuid, true)); + child_listen_sockets_.insert(MakePair(node->uuid(), std::move(node))); } void ServerNode::RemoveChildListenSocket(intptr_t child_uuid) { @@ -366,7 +364,7 @@ char* ServerNode::RenderServerSockets(intptr_t start_socket_id, json_iterator = grpc_json_add_number_string_child( socket_ref_json, nullptr, "socketId", it->first); grpc_json_create_child(json_iterator, socket_ref_json, "name", - it->second->remote(), GRPC_JSON_STRING, false); + it->second->name(), GRPC_JSON_STRING, false); } } if (sockets_rendered == child_sockets_.size()) { @@ -416,8 +414,10 @@ grpc_json* ServerNode::RenderJson() { json_iterator = grpc_json_create_child(json_iterator, array_parent, nullptr, nullptr, GRPC_JSON_OBJECT, false); - grpc_json_add_number_string_child(json_iterator, nullptr, "socketId", - it.first); + grpc_json* sibling_iterator = grpc_json_add_number_string_child( + json_iterator, nullptr, "socketId", it.first); + grpc_json_create_child(sibling_iterator, json_iterator, "name", + it.second->name(), GRPC_JSON_STRING, false); } } return top_level_json; @@ -480,33 +480,33 @@ void PopulateSocketAddressJson(grpc_json* json, const char* name, } // namespace -SocketNode::SocketNode(UniquePtr local, UniquePtr remote) - : BaseNode(EntityType::kSocket), +SocketNode::SocketNode(UniquePtr local, UniquePtr remote, + UniquePtr name) + : BaseNode(EntityType::kSocket, std::move(name)), local_(std::move(local)), remote_(std::move(remote)) {} void SocketNode::RecordStreamStartedFromLocal() { gpr_atm_no_barrier_fetch_add(&streams_started_, static_cast(1)); - gpr_atm_no_barrier_store(&last_local_stream_created_millis_, - (gpr_atm)ExecCtx::Get()->Now()); + gpr_atm_no_barrier_store(&last_local_stream_created_cycle_, + gpr_get_cycle_counter()); } void SocketNode::RecordStreamStartedFromRemote() { gpr_atm_no_barrier_fetch_add(&streams_started_, static_cast(1)); - gpr_atm_no_barrier_store(&last_remote_stream_created_millis_, - (gpr_atm)ExecCtx::Get()->Now()); + gpr_atm_no_barrier_store(&last_remote_stream_created_cycle_, + gpr_get_cycle_counter()); } void SocketNode::RecordMessagesSent(uint32_t num_sent) { gpr_atm_no_barrier_fetch_add(&messages_sent_, static_cast(num_sent)); - gpr_atm_no_barrier_store(&last_message_sent_millis_, - (gpr_atm)ExecCtx::Get()->Now()); + gpr_atm_no_barrier_store(&last_message_sent_cycle_, gpr_get_cycle_counter()); } void SocketNode::RecordMessageReceived() { gpr_atm_no_barrier_fetch_add(&messages_received_, static_cast(1)); - gpr_atm_no_barrier_store(&last_message_received_millis_, - (gpr_atm)ExecCtx::Get()->Now()); + gpr_atm_no_barrier_store(&last_message_received_cycle_, + gpr_get_cycle_counter()); } grpc_json* SocketNode::RenderJson() { @@ -521,6 +521,8 @@ grpc_json* SocketNode::RenderJson() { json_iterator = nullptr; json_iterator = grpc_json_add_number_string_child(json, json_iterator, "socketId", uuid()); + json_iterator = grpc_json_create_child(json_iterator, json, "name", name(), + GRPC_JSON_STRING, false); json = top_level_json; PopulateSocketAddressJson(json, "remote", remote_.get()); PopulateSocketAddressJson(json, "local", local_.get()); @@ -537,20 +539,22 @@ grpc_json* SocketNode::RenderJson() { if (streams_started != 0) { json_iterator = grpc_json_add_number_string_child( json, json_iterator, "streamsStarted", streams_started); - gpr_atm last_local_stream_created_millis = - gpr_atm_no_barrier_load(&last_local_stream_created_millis_); - if (last_local_stream_created_millis != 0) { - ts = grpc_millis_to_timespec(last_local_stream_created_millis, - GPR_CLOCK_REALTIME); + gpr_cycle_counter last_local_stream_created_cycle = + gpr_atm_no_barrier_load(&last_local_stream_created_cycle_); + if (last_local_stream_created_cycle != 0) { + ts = gpr_convert_clock_type( + gpr_cycle_counter_to_time(last_local_stream_created_cycle), + GPR_CLOCK_REALTIME); json_iterator = grpc_json_create_child( json_iterator, json, "lastLocalStreamCreatedTimestamp", gpr_format_timespec(ts), GRPC_JSON_STRING, true); } - gpr_atm last_remote_stream_created_millis = - gpr_atm_no_barrier_load(&last_remote_stream_created_millis_); - if (last_remote_stream_created_millis != 0) { - ts = grpc_millis_to_timespec(last_remote_stream_created_millis, - GPR_CLOCK_REALTIME); + gpr_cycle_counter last_remote_stream_created_cycle = + gpr_atm_no_barrier_load(&last_remote_stream_created_cycle_); + if (last_remote_stream_created_cycle != 0) { + ts = gpr_convert_clock_type( + gpr_cycle_counter_to_time(last_remote_stream_created_cycle), + GPR_CLOCK_REALTIME); json_iterator = grpc_json_create_child( json_iterator, json, "lastRemoteStreamCreatedTimestamp", gpr_format_timespec(ts), GRPC_JSON_STRING, true); @@ -570,8 +574,9 @@ grpc_json* SocketNode::RenderJson() { if (messages_sent != 0) { json_iterator = grpc_json_add_number_string_child( json, json_iterator, "messagesSent", messages_sent); - ts = grpc_millis_to_timespec( - gpr_atm_no_barrier_load(&last_message_sent_millis_), + ts = gpr_convert_clock_type( + gpr_cycle_counter_to_time( + gpr_atm_no_barrier_load(&last_message_sent_cycle_)), GPR_CLOCK_REALTIME); json_iterator = grpc_json_create_child(json_iterator, json, "lastMessageSentTimestamp", @@ -581,8 +586,9 @@ grpc_json* SocketNode::RenderJson() { if (messages_received != 0) { json_iterator = grpc_json_add_number_string_child( json, json_iterator, "messagesReceived", messages_received); - ts = grpc_millis_to_timespec( - gpr_atm_no_barrier_load(&last_message_received_millis_), + ts = gpr_convert_clock_type( + gpr_cycle_counter_to_time( + gpr_atm_no_barrier_load(&last_message_received_cycle_)), GPR_CLOCK_REALTIME); json_iterator = grpc_json_create_child( json_iterator, json, "lastMessageReceivedTimestamp", @@ -600,8 +606,10 @@ grpc_json* SocketNode::RenderJson() { // ListenSocketNode // -ListenSocketNode::ListenSocketNode(UniquePtr local_addr) - : BaseNode(EntityType::kSocket), local_addr_(std::move(local_addr)) {} +ListenSocketNode::ListenSocketNode(UniquePtr local_addr, + UniquePtr name) + : BaseNode(EntityType::kSocket, std::move(name)), + local_addr_(std::move(local_addr)) {} grpc_json* ListenSocketNode::RenderJson() { // We need to track these three json objects to build our object @@ -615,6 +623,8 @@ grpc_json* ListenSocketNode::RenderJson() { json_iterator = nullptr; json_iterator = grpc_json_add_number_string_child(json, json_iterator, "socketId", uuid()); + json_iterator = grpc_json_create_child(json_iterator, json, "name", name(), + GRPC_JSON_STRING, false); json = top_level_json; PopulateSocketAddressJson(json, "local", local_addr_.get()); diff --git a/src/core/lib/channel/channelz.h b/src/core/lib/channel/channelz.h index b0b137a1ec8..2561bff807e 100644 --- a/src/core/lib/channel/channelz.h +++ b/src/core/lib/channel/channelz.h @@ -24,6 +24,7 @@ #include #include "src/core/lib/channel/channel_trace.h" +#include "src/core/lib/gpr/time_precise.h" #include "src/core/lib/gprpp/inlined_vector.h" #include "src/core/lib/gprpp/manual_constructor.h" #include "src/core/lib/gprpp/map.h" @@ -59,6 +60,7 @@ grpc_arg MakeParentUuidArg(intptr_t parent_uuid); intptr_t GetParentUuidFromArgs(const grpc_channel_args& args); class SocketNode; +class ListenSocketNode; namespace testing { class CallCountingHelperPeer; @@ -79,7 +81,7 @@ class BaseNode : public RefCounted { kSocket, }; - explicit BaseNode(EntityType type); + BaseNode(EntityType type, UniquePtr name); virtual ~BaseNode(); // All children must implement this function. @@ -91,12 +93,14 @@ class BaseNode : public RefCounted { EntityType type() const { return type_; } intptr_t uuid() const { return uuid_; } + const char* name() const { return name_.get(); } private: // to allow the ChannelzRegistry to set uuid_ under its lock. friend class ChannelzRegistry; const EntityType type_; intptr_t uuid_; + UniquePtr name_; }; // This class is a helper class for channelz entities that deal with Channels, @@ -108,7 +112,6 @@ class BaseNode : public RefCounted { class CallCountingHelper { public: CallCountingHelper(); - ~CallCountingHelper(); void RecordCallStarted(); void RecordCallFailed(); @@ -121,24 +124,38 @@ class CallCountingHelper { // testing peer friend. friend class testing::CallCountingHelperPeer; + // TODO(soheil): add a proper PerCPU helper and use it here. struct AtomicCounterData { - gpr_atm calls_started = 0; - gpr_atm calls_succeeded = 0; - gpr_atm calls_failed = 0; - gpr_atm last_call_started_millis = 0; - }; + // Define the ctors so that we can use this structure in InlinedVector. + AtomicCounterData() = default; + AtomicCounterData(const AtomicCounterData& that) + : calls_started(that.calls_started.Load(MemoryOrder::RELAXED)), + calls_succeeded(that.calls_succeeded.Load(MemoryOrder::RELAXED)), + calls_failed(that.calls_failed.Load(MemoryOrder::RELAXED)), + last_call_started_cycle( + that.last_call_started_cycle.Load(MemoryOrder::RELAXED)) {} + + Atomic calls_started{0}; + Atomic calls_succeeded{0}; + Atomic calls_failed{0}; + Atomic last_call_started_cycle{0}; + // Make sure the size is exactly one cache line. + uint8_t padding[GPR_CACHELINE_SIZE - 3 * sizeof(Atomic) - + sizeof(Atomic)]; + } GPR_ALIGN_STRUCT(GPR_CACHELINE_SIZE); struct CounterData { intptr_t calls_started = 0; intptr_t calls_succeeded = 0; intptr_t calls_failed = 0; - intptr_t last_call_started_millis = 0; + gpr_cycle_counter last_call_started_cycle = 0; }; // collects the sharded data into one CounterData struct. void CollectData(CounterData* out); - AtomicCounterData* per_cpu_counter_data_storage_ = nullptr; + // Really zero-sized, but 0-sized arrays are illegal on MSVC. + InlinedVector per_cpu_counter_data_storage_; size_t num_cores_ = 0; }; @@ -172,9 +189,13 @@ class ChannelNode : public BaseNode { void SetConnectivityState(grpc_connectivity_state state); + // TODO(roth): take in a RefCountedPtr to the child channel so we can retrieve + // the human-readable name. void AddChildChannel(intptr_t child_uuid); void RemoveChildChannel(intptr_t child_uuid); + // TODO(roth): take in a RefCountedPtr to the child subchannel so we can + // retrieve the human-readable name. void AddChildSubchannel(intptr_t child_uuid); void RemoveChildSubchannel(intptr_t child_uuid); @@ -212,14 +233,11 @@ class ServerNode : public BaseNode { char* RenderServerSockets(intptr_t start_socket_id, intptr_t max_results); - void AddChildSocket(RefCountedPtr); + void AddChildSocket(RefCountedPtr node); void RemoveChildSocket(intptr_t child_uuid); - // TODO(ncteisen): This only takes in the uuid of the child socket for now, - // since that is all that is strictly needed. In a future enhancement we will - // add human readable names as in the channelz.proto - void AddChildListenSocket(intptr_t child_uuid); + void AddChildListenSocket(RefCountedPtr node); void RemoveChildListenSocket(intptr_t child_uuid); @@ -242,16 +260,14 @@ class ServerNode : public BaseNode { ChannelTrace trace_; Mutex child_mu_; // Guards child maps below. Map> child_sockets_; - // TODO(roth): We don't actually use the values here, only the keys, so - // these should be sets instead of maps, but we don't currently have a set - // implementation. Change this if/when we have one. - Map child_listen_sockets_; + Map> child_listen_sockets_; }; // Handles channelz bookkeeping for sockets class SocketNode : public BaseNode { public: - SocketNode(UniquePtr local, UniquePtr remote); + SocketNode(UniquePtr local, UniquePtr remote, + UniquePtr name); ~SocketNode() override {} grpc_json* RenderJson() override; @@ -279,10 +295,10 @@ class SocketNode : public BaseNode { gpr_atm messages_sent_ = 0; gpr_atm messages_received_ = 0; gpr_atm keepalives_sent_ = 0; - gpr_atm last_local_stream_created_millis_ = 0; - gpr_atm last_remote_stream_created_millis_ = 0; - gpr_atm last_message_sent_millis_ = 0; - gpr_atm last_message_received_millis_ = 0; + gpr_atm last_local_stream_created_cycle_ = 0; + gpr_atm last_remote_stream_created_cycle_ = 0; + gpr_atm last_message_sent_cycle_ = 0; + gpr_atm last_message_received_cycle_ = 0; UniquePtr local_; UniquePtr remote_; }; @@ -290,8 +306,7 @@ class SocketNode : public BaseNode { // Handles channelz bookkeeping for listen sockets class ListenSocketNode : public BaseNode { public: - // ListenSocketNode takes ownership of host. - explicit ListenSocketNode(UniquePtr local_addr); + ListenSocketNode(UniquePtr local_addr, UniquePtr name); ~ListenSocketNode() override {} grpc_json* RenderJson() override; diff --git a/src/core/lib/gpr/time_precise.cc b/src/core/lib/gpr/time_precise.cc index 1b34fd7eb1b..9d11c66831c 100644 --- a/src/core/lib/gpr/time_precise.cc +++ b/src/core/lib/gpr/time_precise.cc @@ -18,61 +18,132 @@ #include +#if GPR_LINUX +#include +#include +#endif + +#include + +#include #include #include -#include #include "src/core/lib/gpr/time_precise.h" -#ifdef GRPC_TIMERS_RDTSC -#if defined(__i386__) -static void gpr_get_cycle_counter(int64_t int* clk) { - int64_t int ret; - __asm__ volatile("rdtsc" : "=A"(ret)); - *clk = ret; +#if GPR_CYCLE_COUNTER_RDTSC_32 or GPR_CYCLE_COUNTER_RDTSC_64 +#if GPR_LINUX +static bool read_freq_from_kernel(double* freq) { + // Google production kernel export the frequency for us in kHz. + int fd = open("/sys/devices/system/cpu/cpu0/tsc_freq_khz", O_RDONLY); + if (fd == -1) { + return false; + } + char line[1024] = {}; + char* err; + bool ret = false; + int len = read(fd, line, sizeof(line) - 1); + if (len > 0) { + const long val = strtol(line, &err, 10); + if (line[0] != '\0' && (*err == '\n' || *err == '\0')) { + *freq = val * 1e3; // Value is kHz. + ret = true; + } + } + close(fd); + return ret; } +#endif /* GPR_LINUX */ + +static double cycles_per_second = 0; +static gpr_cycle_counter start_cycle; -// ---------------------------------------------------------------- -#elif defined(__x86_64__) || defined(__amd64__) -static void gpr_get_cycle_counter(int64_t* clk) { - uint64_t low, high; - __asm__ volatile("rdtsc" : "=a"(low), "=d"(high)); - *clk = (int64_t)(high << 32) | (int64_t)low; +static bool is_fake_clock() { + gpr_timespec start = gpr_now(GPR_CLOCK_MONOTONIC); + int64_t sum = 0; + for (int i = 0; i < 8; ++i) { + gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC); + gpr_timespec delta = gpr_time_sub(now, start); + sum += delta.tv_sec * GPR_NS_PER_SEC + delta.tv_nsec; + } + // If the clock doesn't move even a nano after 8 tries, it's a fake one. + return sum == 0; } -#endif -static double cycles_per_second = 0; -static int64_t start_cycle; void gpr_precise_clock_init(void) { - time_t start; - int64_t end_cycle; gpr_log(GPR_DEBUG, "Calibrating timers"); - start = time(NULL); - while (time(NULL) == start) - ; - gpr_get_cycle_counter(&start_cycle); - while (time(NULL) <= start + 10) - ; - gpr_get_cycle_counter(&end_cycle); - cycles_per_second = (double)(end_cycle - start_cycle) / 10.0; + +#if GPR_LINUX + if (read_freq_from_kernel(&cycles_per_second)) { + start_cycle = gpr_get_cycle_counter(); + return; + } +#endif /* GPR_LINUX */ + + if (is_fake_clock()) { + cycles_per_second = 1; + start_cycle = 0; + return; + } + // Start from a loop of 1ms, and gradually increase the loop duration + // until we either converge or we have passed 255ms (1ms+2ms+...+128ms). + int64_t measurement_ns = GPR_NS_PER_MS; + double last_freq = -1; + bool converged = false; + for (int i = 0; i < 8 && !converged; ++i, measurement_ns *= 2) { + start_cycle = gpr_get_cycle_counter(); + int64_t loop_ns; + gpr_timespec start = gpr_now(GPR_CLOCK_MONOTONIC); + do { + // TODO(soheil): Maybe sleep instead of busy polling. + gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC); + gpr_timespec delta = gpr_time_sub(now, start); + loop_ns = delta.tv_sec * GPR_NS_PER_SEC + delta.tv_nsec; + } while (loop_ns < measurement_ns); + gpr_cycle_counter end_cycle = gpr_get_cycle_counter(); + // Frequency should be in Hz. + const double freq = + static_cast(end_cycle - start_cycle) / loop_ns * GPR_NS_PER_SEC; + converged = + last_freq != -1 && (freq * 0.99 < last_freq && last_freq < freq * 1.01); + last_freq = freq; + } + cycles_per_second = last_freq; gpr_log(GPR_DEBUG, "... cycles_per_second = %f\n", cycles_per_second); } -void gpr_precise_clock_now(gpr_timespec* clk) { - int64_t counter; - double secs; - gpr_get_cycle_counter(&counter); - secs = (double)(counter - start_cycle) / cycles_per_second; - clk->clock_type = GPR_CLOCK_PRECISE; - clk->tv_sec = (int64_t)secs; - clk->tv_nsec = (int32_t)(1e9 * (secs - (double)clk->tv_sec)); +gpr_timespec gpr_cycle_counter_to_time(gpr_cycle_counter cycles) { + double secs = static_cast(cycles - start_cycle) / cycles_per_second; + gpr_timespec ts; + ts.tv_sec = static_cast(secs); + ts.tv_nsec = static_cast(GPR_NS_PER_SEC * + (secs - static_cast(ts.tv_sec))); + ts.clock_type = GPR_CLOCK_PRECISE; + return ts; } -#else /* GRPC_TIMERS_RDTSC */ +void gpr_precise_clock_now(gpr_timespec* clk) { + int64_t counter = gpr_get_cycle_counter(); + *clk = gpr_cycle_counter_to_time(counter); +} +#elif GPR_CYCLE_COUNTER_FALLBACK void gpr_precise_clock_init(void) {} +gpr_cycle_counter gpr_get_cycle_counter() { + gpr_timespec ts = gpr_now(GPR_CLOCK_REALTIME); + return gpr_timespec_to_micros(ts); +} + +gpr_timespec gpr_cycle_counter_to_time(gpr_cycle_counter cycles) { + gpr_timespec ts; + ts.tv_sec = cycles / GPR_US_PER_SEC; + ts.tv_nsec = (cycles - ts.tv_sec * GPR_US_PER_SEC) * GPR_NS_PER_US; + ts.clock_type = GPR_CLOCK_PRECISE; + return ts; +} + void gpr_precise_clock_now(gpr_timespec* clk) { *clk = gpr_now(GPR_CLOCK_REALTIME); clk->clock_type = GPR_CLOCK_PRECISE; } -#endif /* GRPC_TIMERS_RDTSC */ +#endif /* GPR_CYCLE_COUNTER_FALLBACK */ diff --git a/src/core/lib/gpr/time_precise.h b/src/core/lib/gpr/time_precise.h index a63ea9dc689..ce16bafab2d 100644 --- a/src/core/lib/gpr/time_precise.h +++ b/src/core/lib/gpr/time_precise.h @@ -21,9 +21,45 @@ #include +#include #include +// Depending on the platform gpr_get_cycle_counter() can have a resolution as +// low as a usec. Use other clock sources or gpr_precise_clock_now(), +// where you need high resolution clocks. +// +// Using gpr_get_cycle_counter() is preferred to using ExecCtx::Get()->Now() +// whenever possible. + +#if GPR_CYCLE_COUNTER_RDTSC_32 +typedef int64_t gpr_cycle_counter; +inline gpr_cycle_counter gpr_get_cycle_counter() { + int64_t ret; + __asm__ volatile("rdtsc" : "=A"(ret)); + return ret; +} +#elif GPR_CYCLE_COUNTER_RDTSC_64 +typedef int64_t gpr_cycle_counter; +inline gpr_cycle_counter gpr_get_cycle_counter() { + uint64_t low, high; + __asm__ volatile("rdtsc" : "=a"(low), "=d"(high)); + return (high << 32) | low; +} +#elif GPR_CYCLE_COUNTER_FALLBACK +// TODO(soheil): add support for mrs on Arm. + +// Real time in micros. +typedef double gpr_cycle_counter; +gpr_cycle_counter gpr_get_cycle_counter(); +#else +#error Must define exactly one of \ + GPR_CYCLE_COUNTER_RDTSC_32, \ + GPR_CYCLE_COUNTER_RDTSC_64, or \ + GPR_CYCLE_COUNTER_FALLBACK +#endif + void gpr_precise_clock_init(void); void gpr_precise_clock_now(gpr_timespec* clk); +gpr_timespec gpr_cycle_counter_to_time(gpr_cycle_counter cycles); #endif /* GRPC_CORE_LIB_GPR_TIME_PRECISE_H */ diff --git a/src/core/lib/gprpp/atomic.h b/src/core/lib/gprpp/atomic.h index 80412ef9583..095ebf12565 100644 --- a/src/core/lib/gprpp/atomic.h +++ b/src/core/lib/gprpp/atomic.h @@ -49,6 +49,10 @@ class Atomic { storage_.store(val, static_cast(order)); } + T Exchange(T desired, MemoryOrder order) { + return storage_.exchange(desired, static_cast(order)); + } + bool CompareExchangeWeak(T* expected, T desired, MemoryOrder success, MemoryOrder failure) { return GPR_ATM_INC_CAS_THEN(storage_.compare_exchange_weak( diff --git a/src/core/lib/gprpp/inlined_vector.h b/src/core/lib/gprpp/inlined_vector.h index ffc37387ec3..c5ae0e8e65d 100644 --- a/src/core/lib/gprpp/inlined_vector.h +++ b/src/core/lib/gprpp/inlined_vector.h @@ -100,16 +100,22 @@ class InlinedVector { bool operator==(const InlinedVector& other) const { if (size_ != other.size_) return false; for (size_t i = 0; i < size_; ++i) { - if (data()[i] != other.data()[i]) return false; + // Note that this uses == instead of != so that the data class doesn't + // have to implement !=. + if (!(data()[i] == other.data()[i])) return false; } return true; } void reserve(size_t capacity) { if (capacity > capacity_) { - T* new_dynamic = static_cast(gpr_malloc(sizeof(T) * capacity)); + T* new_dynamic = + std::alignment_of::value == 0 + ? static_cast(gpr_malloc(sizeof(T) * capacity)) + : static_cast(gpr_malloc_aligned( + sizeof(T) * capacity, std::alignment_of::value)); move_elements(data(), new_dynamic, size_); - gpr_free(dynamic_); + free_dynamic(); dynamic_ = new_dynamic; capacity_ = capacity; } @@ -194,7 +200,17 @@ class InlinedVector { T& value = data()[i]; value.~T(); } - gpr_free(dynamic_); + free_dynamic(); + } + + void free_dynamic() { + if (dynamic_ != nullptr) { + if (std::alignment_of::value == 0) { + gpr_free(dynamic_); + } else { + gpr_free_aligned(dynamic_); + } + } } typename std::aligned_storage::type inline_[N]; diff --git a/src/core/lib/gprpp/map.h b/src/core/lib/gprpp/map.h index 5238f43469f..8f0a26146b1 100644 --- a/src/core/lib/gprpp/map.h +++ b/src/core/lib/gprpp/map.h @@ -37,14 +37,15 @@ struct StringLess { bool operator()(const char* a, const char* b) const { return strcmp(a, b) < 0; } - bool operator()(const UniquePtr& k1, const UniquePtr& k2) { + bool operator()(const UniquePtr& k1, const UniquePtr& k2) const { return strcmp(k1.get(), k2.get()) < 0; } }; template struct RefCountedPtrLess { - bool operator()(const RefCountedPtr& p1, const RefCountedPtr& p2) { + bool operator()(const RefCountedPtr& p1, + const RefCountedPtr& p2) const { return p1.get() < p2.get(); } }; @@ -89,7 +90,7 @@ class Map { // Removes the current entry and points to the next one iterator erase(iterator iter); - size_t size() { return size_; } + size_t size() const { return size_; } template Pair emplace(Args&&... args); @@ -117,7 +118,11 @@ class Map { iterator end() { return iterator(this, nullptr); } iterator lower_bound(const Key& k) { - key_compare compare; + // This is a workaround for "const key_compare compare;" + // because some versions of compilers cannot build this by requiring + // a user-provided constructor. (ref: https://stackoverflow.com/q/7411515) + key_compare compare_tmp; + const key_compare& compare = compare_tmp; return std::find_if(begin(), end(), [&k, &compare](const value_type& v) { return !compare(v.first, k); }); @@ -448,7 +453,11 @@ Map::RemoveRecursive(Entry* root, const key_type& k) { template int Map::CompareKeys(const key_type& lhs, const key_type& rhs) { - key_compare compare; + // This is a workaround for "const key_compare compare;" + // because some versions of compilers cannot build this by requiring + // a user-provided constructor. (ref: https://stackoverflow.com/q/7411515) + key_compare compare_tmp; + const key_compare& compare = compare_tmp; bool left_comparison = compare(lhs, rhs); bool right_comparison = compare(rhs, lhs); // Both values are equal diff --git a/src/core/lib/gprpp/memory.h b/src/core/lib/gprpp/memory.h index 2e7658e4866..be158d118a1 100644 --- a/src/core/lib/gprpp/memory.h +++ b/src/core/lib/gprpp/memory.h @@ -30,6 +30,9 @@ // Add this to a class that want to use Delete(), but has a private or // protected destructor. +// Should not be used in new code. +// TODO(juanlishen): Remove this macro, and instead comment that the public dtor +// should not be used directly. #define GRPC_ALLOW_CLASS_TO_USE_NON_PUBLIC_DELETE \ template \ friend void ::grpc_core::Delete(_Delete_T*); \ @@ -38,6 +41,9 @@ // Add this to a class that want to use New(), but has a private or // protected constructor. +// Should not be used in new code. +// TODO(juanlishen): Remove this macro, and instead comment that the public dtor +// should not be used directly. #define GRPC_ALLOW_CLASS_TO_USE_NON_PUBLIC_NEW \ template \ friend _New_T* grpc_core::New(_New_Args&&...); diff --git a/src/core/lib/iomgr/cfstream_handle.cc b/src/core/lib/iomgr/cfstream_handle.cc index ea28e620695..c1e7d67e568 100644 --- a/src/core/lib/iomgr/cfstream_handle.cc +++ b/src/core/lib/iomgr/cfstream_handle.cc @@ -25,6 +25,7 @@ #import #import "src/core/lib/iomgr/cfstream_handle.h" +#include #include #include @@ -35,6 +36,10 @@ extern grpc_core::TraceFlag grpc_tcp_trace; +GrpcLibraryInitHolder::GrpcLibraryInitHolder() { grpc_init(); } + +GrpcLibraryInitHolder::~GrpcLibraryInitHolder() { grpc_shutdown(); } + void* CFStreamHandle::Retain(void* info) { CFStreamHandle* handle = static_cast(info); CFSTREAM_HANDLE_REF(handle, "retain"); diff --git a/src/core/lib/iomgr/cfstream_handle.h b/src/core/lib/iomgr/cfstream_handle.h index 05f45ed6251..5f3a525930c 100644 --- a/src/core/lib/iomgr/cfstream_handle.h +++ b/src/core/lib/iomgr/cfstream_handle.h @@ -33,11 +33,17 @@ #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/lockfree_event.h" -class CFStreamHandle final { +class GrpcLibraryInitHolder { + public: + GrpcLibraryInitHolder(); + virtual ~GrpcLibraryInitHolder(); +}; + +class CFStreamHandle : public GrpcLibraryInitHolder { public: static CFStreamHandle* CreateStreamHandle(CFReadStreamRef read_stream, CFWriteStreamRef write_stream); - ~CFStreamHandle(); + ~CFStreamHandle() override; CFStreamHandle(const CFStreamHandle& ref) = delete; CFStreamHandle(CFStreamHandle&& ref) = delete; CFStreamHandle& operator=(const CFStreamHandle& rhs) = delete; diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc index 08116b3ab53..c2d80c08ddb 100644 --- a/src/core/lib/iomgr/ev_epollex_linux.cc +++ b/src/core/lib/iomgr/ev_epollex_linux.cc @@ -47,6 +47,7 @@ #include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/inlined_vector.h" #include "src/core/lib/gprpp/manual_constructor.h" +#include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/iomgr/block_annotate.h" #include "src/core/lib/iomgr/iomgr_internal.h" @@ -89,7 +90,7 @@ typedef struct pollable pollable; /// - PO_MULTI - a pollable containing many fds struct pollable { pollable_type type; // immutable - gpr_refcount refs; + grpc_core::RefCount refs; int epfd; grpc_wakeup_fd wakeup; @@ -135,17 +136,26 @@ static char* pollable_desc(pollable* p) { static pollable* g_empty_pollable; static grpc_error* pollable_create(pollable_type type, pollable** p); -#ifdef NDEBUG -static pollable* pollable_ref(pollable* p); -static void pollable_unref(pollable* p); -#define POLLABLE_REF(p, r) pollable_ref(p) -#define POLLABLE_UNREF(p, r) pollable_unref(p) -#else -static pollable* pollable_ref(pollable* p, int line, const char* reason); -static void pollable_unref(pollable* p, int line, const char* reason); -#define POLLABLE_REF(p, r) pollable_ref((p), __LINE__, (r)) -#define POLLABLE_UNREF(p, r) pollable_unref((p), __LINE__, (r)) -#endif +static pollable* pollable_ref(pollable* p, + const grpc_core::DebugLocation& dbg_loc, + const char* reason) { + p->refs.Ref(dbg_loc, reason); + return p; +} +static void pollable_unref(pollable* p, const grpc_core::DebugLocation& dbg_loc, + const char* reason) { + if (p == nullptr) return; + if (GPR_UNLIKELY(p != nullptr && p->refs.Unref(dbg_loc, reason))) { + GRPC_FD_TRACE("pollable_unref: Closing epfd: %d", p->epfd); + close(p->epfd); + grpc_wakeup_fd_destroy(&p->wakeup); + gpr_mu_destroy(&p->owner_orphan_mu); + gpr_mu_destroy(&p->mu); + gpr_free(p); + } +} +#define POLLABLE_REF(p, r) pollable_ref((p), DEBUG_LOCATION, (r)) +#define POLLABLE_UNREF(p, r) pollable_unref((p), DEBUG_LOCATION, (r)) /******************************************************************************* * Fd Declarations @@ -283,7 +293,7 @@ struct grpc_pollset { */ struct grpc_pollset_set { - gpr_refcount refs; + grpc_core::RefCount refs; gpr_mu mu; grpc_pollset_set* parent; @@ -568,7 +578,7 @@ static grpc_error* pollable_create(pollable_type type, pollable** p) { } (*p)->type = type; - gpr_ref_init(&(*p)->refs, 1); + new (&(*p)->refs) grpc_core::RefCount(1, &grpc_trace_pollable_refcount); gpr_mu_init(&(*p)->mu); (*p)->epfd = epfd; (*p)->owner_fd = nullptr; @@ -582,41 +592,6 @@ static grpc_error* pollable_create(pollable_type type, pollable** p) { return GRPC_ERROR_NONE; } -#ifdef NDEBUG -static pollable* pollable_ref(pollable* p) { -#else -static pollable* pollable_ref(pollable* p, int line, const char* reason) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_pollable_refcount)) { - int r = static_cast gpr_atm_no_barrier_load(&p->refs.count); - gpr_log(__FILE__, line, GPR_LOG_SEVERITY_DEBUG, - "POLLABLE:%p ref %d->%d %s", p, r, r + 1, reason); - } -#endif - gpr_ref(&p->refs); - return p; -} - -#ifdef NDEBUG -static void pollable_unref(pollable* p) { -#else -static void pollable_unref(pollable* p, int line, const char* reason) { - if (p == nullptr) return; - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_pollable_refcount)) { - int r = static_cast gpr_atm_no_barrier_load(&p->refs.count); - gpr_log(__FILE__, line, GPR_LOG_SEVERITY_DEBUG, - "POLLABLE:%p unref %d->%d %s", p, r, r - 1, reason); - } -#endif - if (p != nullptr && gpr_unref(&p->refs)) { - GRPC_FD_TRACE("pollable_unref: Closing epfd: %d", p->epfd); - close(p->epfd); - grpc_wakeup_fd_destroy(&p->wakeup); - gpr_mu_destroy(&p->owner_orphan_mu); - gpr_mu_destroy(&p->mu); - gpr_free(p); - } -} - static grpc_error* pollable_add_fd(pollable* p, grpc_fd* fd) { grpc_error* error = GRPC_ERROR_NONE; static const char* err_desc = "pollable_add_fd"; @@ -1331,13 +1306,13 @@ static grpc_pollset_set* pollset_set_create(void) { grpc_pollset_set* pss = static_cast(gpr_zalloc(sizeof(*pss))); gpr_mu_init(&pss->mu); - gpr_ref_init(&pss->refs, 1); + new (&pss->refs) grpc_core::RefCount(); return pss; } static void pollset_set_unref(grpc_pollset_set* pss) { if (pss == nullptr) return; - if (!gpr_unref(&pss->refs)) return; + if (GPR_LIKELY(!pss->refs.Unref())) return; pollset_set_unref(pss->parent); gpr_mu_destroy(&pss->mu); for (size_t i = 0; i < pss->pollset_count; i++) { @@ -1528,7 +1503,7 @@ static void pollset_set_add_pollset_set(grpc_pollset_set* a, if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { gpr_log(GPR_INFO, "PSS: parent %p to %p", b, a); } - gpr_ref(&a->refs); + a->refs.Ref(); b->parent = a; if (a->fd_capacity < a->fd_count + b->fd_count) { a->fd_capacity = GPR_MAX(2 * a->fd_capacity, a->fd_count + b->fd_count); diff --git a/src/core/lib/iomgr/exec_ctx.cc b/src/core/lib/iomgr/exec_ctx.cc index f45def43397..a847b4dcefc 100644 --- a/src/core/lib/iomgr/exec_ctx.cc +++ b/src/core/lib/iomgr/exec_ctx.cc @@ -53,13 +53,6 @@ static void exec_ctx_sched(grpc_closure* closure, grpc_error* error) { static gpr_timespec g_start_time; -// For debug of the timer manager crash only. -// TODO (mxyan): remove after bug is fixed. -#ifdef GRPC_DEBUG_TIMER_MANAGER -extern int64_t g_start_time_sec; -extern int64_t g_start_time_nsec; -#endif // GRPC_DEBUG_TIMER_MANAGER - static grpc_millis timespec_to_millis_round_down(gpr_timespec ts) { ts = gpr_time_sub(ts, g_start_time); double x = GPR_MS_PER_SEC * static_cast(ts.tv_sec) + @@ -125,12 +118,6 @@ void ExecCtx::TestOnlyGlobalInit(gpr_timespec new_val) { void ExecCtx::GlobalInit(void) { g_start_time = gpr_now(GPR_CLOCK_MONOTONIC); - // For debug of the timer manager crash only. - // TODO (mxyan): remove after bug is fixed. -#ifdef GRPC_DEBUG_TIMER_MANAGER - g_start_time_sec = g_start_time.tv_sec; - g_start_time_nsec = g_start_time.tv_nsec; -#endif gpr_tls_init(&exec_ctx_); } diff --git a/src/core/lib/iomgr/executor/mpmcqueue.cc b/src/core/lib/iomgr/executor/mpmcqueue.cc index 72c318e2bb1..74096a4c5b0 100644 --- a/src/core/lib/iomgr/executor/mpmcqueue.cc +++ b/src/core/lib/iomgr/executor/mpmcqueue.cc @@ -26,18 +26,15 @@ DebugOnlyTraceFlag grpc_thread_pool_trace(false, "thread_pool"); inline void* InfLenFIFOQueue::PopFront() { // Caller should already check queue is not empty and has already held the - // mutex. This function will only do the job of removal. + // mutex. This function will assume that there is at least one element in the + // queue (i.e. queue_head_->content is valid). void* result = queue_head_->content; - Node* head_to_remove = queue_head_; - queue_head_ = queue_head_->next; - count_.Store(count_.Load(MemoryOrder::RELAXED) - 1, MemoryOrder::RELAXED); + // Updates Stats when trace flag turned on. if (GRPC_TRACE_FLAG_ENABLED(grpc_thread_pool_trace)) { gpr_timespec wait_time = - gpr_time_sub(gpr_now(GPR_CLOCK_MONOTONIC), head_to_remove->insert_time); - - // Updates Stats info + gpr_time_sub(gpr_now(GPR_CLOCK_MONOTONIC), queue_head_->insert_time); stats_.num_completed++; stats_.total_queue_time = gpr_time_add(stats_.total_queue_time, wait_time); stats_.max_queue_time = gpr_time_max( @@ -58,44 +55,89 @@ inline void* InfLenFIFOQueue::PopFront() { gpr_timespec_to_micros(stats_.busy_queue_time)); } - Delete(head_to_remove); + queue_head_ = queue_head_->next; // Signal waiting thread - if (count_.Load(MemoryOrder::RELAXED) > 0 && num_waiters_ > 0) { - wait_nonempty_.Signal(); + if (count_.Load(MemoryOrder::RELAXED) > 0) { + TopWaiter()->cv.Signal(); } return result; } +InfLenFIFOQueue::Node* InfLenFIFOQueue::AllocateNodes(int num) { + num_nodes_ = num_nodes_ + num; + Node* new_chunk = static_cast(gpr_zalloc(sizeof(Node) * num)); + new_chunk[0].next = &new_chunk[1]; + new_chunk[num - 1].prev = &new_chunk[num - 2]; + for (int i = 1; i < num - 1; ++i) { + new_chunk[i].prev = &new_chunk[i - 1]; + new_chunk[i].next = &new_chunk[i + 1]; + } + return new_chunk; +} + +InfLenFIFOQueue::InfLenFIFOQueue() { + delete_list_size_ = kDeleteListInitSize; + delete_list_ = + static_cast(gpr_zalloc(sizeof(Node*) * delete_list_size_)); + + Node* new_chunk = AllocateNodes(kQueueInitNumNodes); + delete_list_[delete_list_count_++] = new_chunk; + queue_head_ = queue_tail_ = new_chunk; + new_chunk[0].prev = &new_chunk[kQueueInitNumNodes - 1]; + new_chunk[kQueueInitNumNodes - 1].next = &new_chunk[0]; + + waiters_.next = &waiters_; + waiters_.prev = &waiters_; +} + InfLenFIFOQueue::~InfLenFIFOQueue() { GPR_ASSERT(count_.Load(MemoryOrder::RELAXED) == 0); - GPR_ASSERT(num_waiters_ == 0); + for (size_t i = 0; i < delete_list_count_; ++i) { + gpr_free(delete_list_[i]); + } + gpr_free(delete_list_); } void InfLenFIFOQueue::Put(void* elem) { MutexLock l(&mu_); - Node* new_node = New(elem); - if (count_.Load(MemoryOrder::RELAXED) == 0) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_thread_pool_trace)) { - busy_time = gpr_now(GPR_CLOCK_MONOTONIC); + int curr_count = count_.Load(MemoryOrder::RELAXED); + + if (queue_tail_ == queue_head_ && curr_count != 0) { + // List is full. Expands list to double size by inserting new chunk of nodes + Node* new_chunk = AllocateNodes(curr_count); + delete_list_[delete_list_count_++] = new_chunk; + // Expands delete list on full. + if (delete_list_count_ == delete_list_size_) { + delete_list_size_ = delete_list_size_ * 2; + delete_list_ = static_cast( + gpr_realloc(delete_list_, sizeof(Node*) * delete_list_size_)); } - queue_head_ = queue_tail_ = new_node; - } else { - queue_tail_->next = new_node; - queue_tail_ = queue_tail_->next; + new_chunk[0].prev = queue_tail_->prev; + new_chunk[curr_count - 1].next = queue_head_; + queue_tail_->prev->next = new_chunk; + queue_head_->prev = &new_chunk[curr_count - 1]; + queue_tail_ = new_chunk; } - count_.Store(count_.Load(MemoryOrder::RELAXED) + 1, MemoryOrder::RELAXED); + queue_tail_->content = static_cast(elem); + // Updates Stats info if (GRPC_TRACE_FLAG_ENABLED(grpc_thread_pool_trace)) { stats_.num_started++; gpr_log(GPR_INFO, "[InfLenFIFOQueue Put] num_started: %" PRIu64, stats_.num_started); + auto current_time = gpr_now(GPR_CLOCK_MONOTONIC); + if (curr_count == 0) { + busy_time = current_time; + } + queue_tail_->insert_time = current_time; } - if (num_waiters_ > 0) { - wait_nonempty_.Signal(); - } + count_.Store(curr_count + 1, MemoryOrder::RELAXED); + queue_tail_ = queue_tail_->next; + + TopWaiter()->cv.Signal(); } void* InfLenFIFOQueue::Get(gpr_timespec* wait_time) { @@ -108,11 +150,12 @@ void* InfLenFIFOQueue::Get(gpr_timespec* wait_time) { start_time = gpr_now(GPR_CLOCK_MONOTONIC); } - num_waiters_++; + Waiter self; + PushWaiter(&self); do { - wait_nonempty_.Wait(&mu_); + self.cv.Wait(&mu_); } while (count_.Load(MemoryOrder::RELAXED) == 0); - num_waiters_--; + RemoveWaiter(&self); if (GRPC_TRACE_FLAG_ENABLED(grpc_thread_pool_trace) && wait_time != nullptr) { *wait_time = gpr_time_sub(gpr_now(GPR_CLOCK_MONOTONIC), start_time); @@ -122,4 +165,19 @@ void* InfLenFIFOQueue::Get(gpr_timespec* wait_time) { return PopFront(); } +void InfLenFIFOQueue::PushWaiter(Waiter* waiter) { + waiter->next = waiters_.next; + waiter->prev = &waiters_; + waiter->next->prev = waiter; + waiter->prev->next = waiter; +} + +void InfLenFIFOQueue::RemoveWaiter(Waiter* waiter) { + GPR_DEBUG_ASSERT(waiter != &waiters_); + waiter->next->prev = waiter->prev; + waiter->prev->next = waiter->next; +} + +InfLenFIFOQueue::Waiter* InfLenFIFOQueue::TopWaiter() { return waiters_.next; } + } // namespace grpc_core diff --git a/src/core/lib/iomgr/executor/mpmcqueue.h b/src/core/lib/iomgr/executor/mpmcqueue.h index c6102b3add0..ab5c484e094 100644 --- a/src/core/lib/iomgr/executor/mpmcqueue.h +++ b/src/core/lib/iomgr/executor/mpmcqueue.h @@ -54,7 +54,7 @@ class MPMCQueueInterface { class InfLenFIFOQueue : public MPMCQueueInterface { public: // Creates a new MPMC Queue. The queue created will have infinite length. - InfLenFIFOQueue() {} + InfLenFIFOQueue(); // Releases all resources held by the queue. The queue must be empty, and no // one waits on conditional variables. @@ -66,8 +66,8 @@ class InfLenFIFOQueue : public MPMCQueueInterface { // Removes the oldest element from the queue and returns it. // This routine will cause the thread to block if queue is currently empty. - // Argument wait_time should be passed in when turning on the trace flag - // grpc_thread_pool_trace (for collecting stats info purpose.) + // Argument wait_time should be passed in when trace flag turning on (for + // collecting stats info purpose.) void* Get(gpr_timespec* wait_time = nullptr); // Returns number of elements in queue currently. @@ -75,24 +75,33 @@ class InfLenFIFOQueue : public MPMCQueueInterface { // quickly. int count() const { return count_.Load(MemoryOrder::RELAXED); } - private: - // For Internal Use Only. - // Removes the oldest element from the queue and returns it. This routine - // will NOT check whether queue is empty, and it will NOT acquire mutex. - // Caller should do the check and acquire mutex before callling. - void* PopFront(); - struct Node { - Node* next; // Linking + Node* next; // Linking + Node* prev; void* content; // Points to actual element gpr_timespec insert_time; // Time for stats - Node(void* c) : content(c) { - next = nullptr; - insert_time = gpr_now(GPR_CLOCK_MONOTONIC); + Node() { + next = prev = nullptr; + content = nullptr; } }; + // For test purpose only. Returns number of nodes allocated in queue. + // Any allocated node will be alive until the destruction of the queue. + int num_nodes() const { return num_nodes_; } + + // For test purpose only. Returns the initial number of nodes in queue. + int init_num_nodes() const { return kQueueInitNumNodes; } + + private: + // For Internal Use Only. + // Removes the oldest element from the queue and returns it. This routine + // will NOT check whether queue is empty, and it will NOT acquire mutex. + // Caller MUST check that queue is not empty and must acquire mutex before + // callling. + void* PopFront(); + // Stats of queue. This will only be collect when debug trace mode is on. // All printed stats info will have time measurement in microsecond. struct Stats { @@ -115,15 +124,53 @@ class InfLenFIFOQueue : public MPMCQueueInterface { } }; - Mutex mu_; // Protecting lock - CondVar wait_nonempty_; // Wait on empty queue on get - int num_waiters_ = 0; // Number of waiters + // Node for waiting thread queue. Stands for one waiting thread, should have + // exact one thread waiting on its CondVar. + // Using a doubly linked list for waiting thread queue to wake up waiting + // threads in LIFO order to reduce cache misses. + struct Waiter { + CondVar cv; + Waiter* next; + Waiter* prev; + }; + + // Pushs waiter to the front of queue, require caller held mutex + void PushWaiter(Waiter* waiter); + + // Removes waiter from queue, require caller held mutex + void RemoveWaiter(Waiter* waiter); + + // Returns pointer to the waiter that should be waken up next, should be the + // last added waiter. + Waiter* TopWaiter(); + + Mutex mu_; // Protecting lock + Waiter waiters_; // Head of waiting thread queue + + // Initial size for delete list + static const int kDeleteListInitSize = 1024; + // Initial number of nodes allocated + static const int kQueueInitNumNodes = 1024; + + Node** delete_list_ = nullptr; // Keeps track of all allocated array entries + // for deleting on destruction + size_t delete_list_count_ = 0; // Number of entries in list + size_t delete_list_size_ = 0; // Size of the list. List will be expanded to + // double size on full Node* queue_head_ = nullptr; // Head of the queue, remove position Node* queue_tail_ = nullptr; // End of queue, insert position Atomic count_{0}; // Number of elements in queue - Stats stats_; // Stats info - gpr_timespec busy_time; // Start time of busy queue + int num_nodes_ = 0; // Number of nodes allocated + + Stats stats_; // Stats info + gpr_timespec busy_time; // Start time of busy queue + + // Internal Helper. + // Allocates an array of nodes of size "num", links all nodes together except + // the first node's prev and last node's next. They should be set by caller + // manually afterward. + Node* AllocateNodes(int num); }; } // namespace grpc_core diff --git a/src/core/lib/iomgr/sockaddr_utils.cc b/src/core/lib/iomgr/sockaddr_utils.cc index baadf1da99e..2f8ed2225a6 100644 --- a/src/core/lib/iomgr/sockaddr_utils.cc +++ b/src/core/lib/iomgr/sockaddr_utils.cc @@ -201,13 +201,11 @@ int grpc_sockaddr_to_string(char** out, } void grpc_string_to_sockaddr(grpc_resolved_address* out, char* addr, int port) { + memset(out, 0, sizeof(grpc_resolved_address)); grpc_sockaddr_in6* addr6 = (grpc_sockaddr_in6*)out->addr; grpc_sockaddr_in* addr4 = (grpc_sockaddr_in*)out->addr; - if (grpc_inet_pton(GRPC_AF_INET6, addr, &addr6->sin6_addr) == 1) { addr6->sin6_family = GRPC_AF_INET6; - addr6->sin6_flowinfo = 0; - addr6->sin6_scope_id = 0; out->len = sizeof(grpc_sockaddr_in6); } else if (grpc_inet_pton(GRPC_AF_INET, addr, &addr4->sin_addr) == 1) { addr4->sin_family = GRPC_AF_INET; diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc index 819c5284256..498aecc069b 100644 --- a/src/core/lib/iomgr/tcp_posix.cc +++ b/src/core/lib/iomgr/tcp_posix.cc @@ -89,7 +89,7 @@ struct grpc_tcp { bool is_first_read; double target_length; double bytes_read_this_round; - gpr_refcount refcount; + grpc_core::RefCount refcount; gpr_atm shutdown_count; int min_read_chunk_size; @@ -359,41 +359,29 @@ static void tcp_free(grpc_tcp* tcp) { } #ifndef NDEBUG -#define TCP_UNREF(tcp, reason) tcp_unref((tcp), (reason), __FILE__, __LINE__) -#define TCP_REF(tcp, reason) tcp_ref((tcp), (reason), __FILE__, __LINE__) -static void tcp_unref(grpc_tcp* tcp, const char* reason, const char* file, - int line) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { - gpr_atm val = gpr_atm_no_barrier_load(&tcp->refcount.count); - gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, - "TCP unref %p : %s %" PRIdPTR " -> %" PRIdPTR, tcp, reason, val, - val - 1); - } - if (gpr_unref(&tcp->refcount)) { +#define TCP_UNREF(tcp, reason) tcp_unref((tcp), (reason), DEBUG_LOCATION) +#define TCP_REF(tcp, reason) tcp_ref((tcp), (reason), DEBUG_LOCATION) +static void tcp_unref(grpc_tcp* tcp, const char* reason, + const grpc_core::DebugLocation& debug_location) { + if (GPR_UNLIKELY(tcp->refcount.Unref(debug_location, reason))) { tcp_free(tcp); } } -static void tcp_ref(grpc_tcp* tcp, const char* reason, const char* file, - int line) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { - gpr_atm val = gpr_atm_no_barrier_load(&tcp->refcount.count); - gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, - "TCP ref %p : %s %" PRIdPTR " -> %" PRIdPTR, tcp, reason, val, - val + 1); - } - gpr_ref(&tcp->refcount); +static void tcp_ref(grpc_tcp* tcp, const char* reason, + const grpc_core::DebugLocation& debug_location) { + tcp->refcount.Ref(debug_location, reason); } #else #define TCP_UNREF(tcp, reason) tcp_unref((tcp)) #define TCP_REF(tcp, reason) tcp_ref((tcp)) static void tcp_unref(grpc_tcp* tcp) { - if (gpr_unref(&tcp->refcount)) { + if (GPR_UNLIKELY(tcp->refcount.Unref())) { tcp_free(tcp); } } -static void tcp_ref(grpc_tcp* tcp) { gpr_ref(&tcp->refcount); } +static void tcp_ref(grpc_tcp* tcp) { tcp->refcount.Ref(); } #endif static void tcp_destroy(grpc_endpoint* ep) { @@ -1230,7 +1218,7 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd, tcp->ts_capable = true; tcp->outgoing_buffer_arg = nullptr; /* paired with unref in grpc_tcp_destroy */ - gpr_ref_init(&tcp->refcount, 1); + new (&tcp->refcount) grpc_core::RefCount(1, &grpc_tcp_trace); gpr_atm_no_barrier_store(&tcp->shutdown_count, 0); tcp->em_fd = em_fd; grpc_slice_buffer_init(&tcp->last_read_buffer); diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc index 7a584835b96..87aa0357be7 100644 --- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc @@ -199,8 +199,8 @@ grpc_oauth2_token_fetcher_credentials_parse_server_response( *token_lifetime = strtol(expires_in->value, nullptr, 10) * GPR_MS_PER_SEC; if (!GRPC_MDISNULL(*token_md)) GRPC_MDELEM_UNREF(*token_md); *token_md = grpc_mdelem_from_slices( - grpc_slice_from_static_string(GRPC_AUTHORIZATION_METADATA_KEY), - grpc_slice_from_copied_string(new_access_token)); + grpc_core::ExternallyManagedSlice(GRPC_AUTHORIZATION_METADATA_KEY), + grpc_core::UnmanagedMemorySlice(new_access_token)); status = GRPC_CREDENTIALS_OK; } @@ -721,8 +721,8 @@ grpc_access_token_credentials::grpc_access_token_credentials( gpr_asprintf(&token_md_value, "Bearer %s", access_token); grpc_core::ExecCtx exec_ctx; access_token_md_ = grpc_mdelem_from_slices( - grpc_slice_from_static_string(GRPC_AUTHORIZATION_METADATA_KEY), - grpc_slice_from_copied_string(token_md_value)); + grpc_core::ExternallyManagedSlice(GRPC_AUTHORIZATION_METADATA_KEY), + grpc_core::UnmanagedMemorySlice(token_md_value)); gpr_free(token_md_value); } diff --git a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc index a6169a1b586..7e0af3dcc17 100644 --- a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +++ b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc @@ -157,6 +157,29 @@ int grpc_tls_key_materials_config_set_key_materials( return 1; } +int grpc_tls_key_materials_config_set_version( + grpc_tls_key_materials_config* config, int version) { + if (config == nullptr) { + gpr_log(GPR_ERROR, + "Invalid arguments to " + "grpc_tls_key_materials_config_set_version()"); + return 0; + } + config->set_version(version); + return 1; +} + +int grpc_tls_key_materials_config_get_version( + grpc_tls_key_materials_config* config) { + if (config == nullptr) { + gpr_log(GPR_ERROR, + "Invalid arguments to " + "grpc_tls_key_materials_config_get_version()"); + return -1; + } + return config->version(); +} + grpc_tls_credential_reload_config* grpc_tls_credential_reload_config_create( const void* config_user_data, int (*schedule)(void* config_user_data, diff --git a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h index aee9292acb8..af4074138cf 100644 --- a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +++ b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h @@ -39,12 +39,15 @@ struct grpc_tls_key_materials_config const PemKeyCertPairList& pem_key_cert_pair_list() const { return pem_key_cert_pair_list_; } + int version() const { return version_; } /** Setters for member fields. **/ void set_key_materials(grpc_core::UniquePtr pem_root_certs, PemKeyCertPairList pem_key_cert_pair_list); + void set_version(int version) { version_ = version; } private: + int version_ = 0; PemKeyCertPairList pem_key_cert_pair_list_; grpc_core::UniquePtr pem_root_certs_; }; diff --git a/src/core/lib/security/credentials/tls/spiffe_credentials.cc b/src/core/lib/security/credentials/tls/spiffe_credentials.cc index da764936c76..e8433bf09b8 100644 --- a/src/core/lib/security/credentials/tls/spiffe_credentials.cc +++ b/src/core/lib/security/credentials/tls/spiffe_credentials.cc @@ -84,7 +84,7 @@ SpiffeCredentials::create_security_connector( static_cast(arg->value.pointer.p); } } - grpc_core::RefCountedPtr sc = + grpc_core::RefCountedPtr sc = grpc_core:: SpiffeChannelSecurityConnector::CreateSpiffeChannelSecurityConnector( this->Ref(), std::move(call_creds), target_name, overridden_target_name, ssl_session_cache); @@ -106,8 +106,8 @@ SpiffeServerCredentials::~SpiffeServerCredentials() {} grpc_core::RefCountedPtr SpiffeServerCredentials::create_security_connector() { - return SpiffeServerSecurityConnector::CreateSpiffeServerSecurityConnector( - this->Ref()); + return grpc_core::SpiffeServerSecurityConnector:: + CreateSpiffeServerSecurityConnector(this->Ref()); } grpc_channel_credentials* grpc_tls_spiffe_credentials_create( diff --git a/src/core/lib/security/security_connector/tls/spiffe_security_connector.cc b/src/core/lib/security/security_connector/tls/spiffe_security_connector.cc index 5853de4fc13..be20b60645b 100644 --- a/src/core/lib/security/security_connector/tls/spiffe_security_connector.cc +++ b/src/core/lib/security/security_connector/tls/spiffe_security_connector.cc @@ -38,6 +38,8 @@ #include "src/core/tsi/ssl_transport_security.h" #include "src/core/tsi/transport_security.h" +namespace grpc_core { + namespace { tsi_ssl_pem_key_cert_pair* ConvertToTsiPemKeyCertPair( @@ -58,42 +60,55 @@ tsi_ssl_pem_key_cert_pair* ConvertToTsiPemKeyCertPair( return tsi_pairs; } -/** -- Util function to populate SPIFFE server/channel credentials. -- */ -grpc_core::RefCountedPtr -PopulateSpiffeCredentials(const grpc_tls_credentials_options& options) { - GPR_ASSERT(options.credential_reload_config() != nullptr || - options.key_materials_config() != nullptr); - grpc_core::RefCountedPtr key_materials_config; +} // namespace + +/** -- Util function to fetch SPIFFE server/channel credentials. -- */ +grpc_status_code TlsFetchKeyMaterials( + const grpc_core::RefCountedPtr& + key_materials_config, + const grpc_tls_credentials_options& options, + grpc_ssl_certificate_config_reload_status* reload_status) { + GPR_ASSERT(key_materials_config != nullptr); + bool is_key_materials_empty = + key_materials_config->pem_key_cert_pair_list().empty(); + if (options.credential_reload_config() == nullptr && is_key_materials_empty) { + gpr_log(GPR_ERROR, + "Either credential reload config or key materials should be " + "provisioned."); + return GRPC_STATUS_FAILED_PRECONDITION; + } + grpc_status_code status = GRPC_STATUS_OK; /* Use credential reload config to fetch credentials. */ if (options.credential_reload_config() != nullptr) { grpc_tls_credential_reload_arg* arg = grpc_core::New(); - key_materials_config = grpc_tls_key_materials_config_create()->Ref(); arg->key_materials_config = key_materials_config.get(); int result = options.credential_reload_config()->Schedule(arg); if (result) { /* Do not support async credential reload. */ gpr_log(GPR_ERROR, "Async credential reload is unsupported now."); + status = + is_key_materials_empty ? GRPC_STATUS_UNIMPLEMENTED : GRPC_STATUS_OK; } else { - grpc_ssl_certificate_config_reload_status status = arg->status; - if (status == GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED) { + GPR_ASSERT(reload_status != nullptr); + *reload_status = arg->status; + if (arg->status == GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED) { + /* Key materials is not empty. */ gpr_log(GPR_DEBUG, "Credential does not change after reload."); - } else if (status == GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL) { - gpr_log(GPR_ERROR, "Credential reload failed with an error: %s", - arg->error_details); + } else if (arg->status == GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL) { + gpr_log(GPR_ERROR, "Credential reload failed with an error:"); + if (arg->error_details != nullptr) { + gpr_log(GPR_ERROR, "%s", arg->error_details); + } + status = is_key_materials_empty ? GRPC_STATUS_INTERNAL : GRPC_STATUS_OK; } } gpr_free((void*)arg->error_details); grpc_core::Delete(arg); - /* Use existing key materials config. */ - } else { - key_materials_config = options.key_materials_config()->Ref(); } - return key_materials_config; + return status; } -} // namespace - SpiffeChannelSecurityConnector::SpiffeChannelSecurityConnector( grpc_core::RefCountedPtr channel_creds, grpc_core::RefCountedPtr request_metadata_creds, @@ -104,6 +119,7 @@ SpiffeChannelSecurityConnector::SpiffeChannelSecurityConnector( overridden_target_name_(overridden_target_name == nullptr ? nullptr : gpr_strdup(overridden_target_name)) { + key_materials_config_ = grpc_tls_key_materials_config_create()->Ref(); check_arg_ = ServerAuthorizationCheckArgCreate(this); grpc_core::StringView host; grpc_core::StringView port; @@ -115,12 +131,19 @@ SpiffeChannelSecurityConnector::~SpiffeChannelSecurityConnector() { if (client_handshaker_factory_ != nullptr) { tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory_); } + if (key_materials_config_.get() != nullptr) { + key_materials_config_.get()->Unref(); + } ServerAuthorizationCheckArgDestroy(check_arg_); } void SpiffeChannelSecurityConnector::add_handshakers( grpc_pollset_set* interested_parties, grpc_core::HandshakeManager* handshake_mgr) { + if (RefreshHandshakerFactory() != GRPC_SECURITY_OK) { + gpr_log(GPR_ERROR, "Handshaker factory refresh failed."); + return; + } // Instantiate TSI handshaker. tsi_handshaker* tsi_hs = nullptr; tsi_result result = tsi_ssl_client_handshaker_factory_create_handshaker( @@ -239,32 +262,75 @@ SpiffeChannelSecurityConnector::CreateSpiffeChannelSecurityConnector( std::move(channel_creds), std::move(request_metadata_creds), target_name, overridden_target_name); if (c->InitializeHandshakerFactory(ssl_session_cache) != GRPC_SECURITY_OK) { + gpr_log(GPR_ERROR, "Could not initialize client handshaker factory."); return nullptr; } return c; } -grpc_security_status -SpiffeChannelSecurityConnector::InitializeHandshakerFactory( +grpc_security_status SpiffeChannelSecurityConnector::ReplaceHandshakerFactory( tsi_ssl_session_cache* ssl_session_cache) { - const SpiffeCredentials* creds = - static_cast(channel_creds()); - auto key_materials_config = PopulateSpiffeCredentials(creds->options()); - if (key_materials_config->pem_key_cert_pair_list().empty()) { - key_materials_config->Unref(); - return GRPC_SECURITY_ERROR; + /* Free the client handshaker factory if exists. */ + if (client_handshaker_factory_) { + tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory_); } + GPR_ASSERT(!key_materials_config_->pem_key_cert_pair_list().empty()); tsi_ssl_pem_key_cert_pair* pem_key_cert_pair = ConvertToTsiPemKeyCertPair( - key_materials_config->pem_key_cert_pair_list()); + key_materials_config_->pem_key_cert_pair_list()); grpc_security_status status = grpc_ssl_tsi_client_handshaker_factory_init( - pem_key_cert_pair, key_materials_config->pem_root_certs(), + pem_key_cert_pair, key_materials_config_->pem_root_certs(), ssl_session_cache, &client_handshaker_factory_); - // Free memory. - key_materials_config->Unref(); + /* Free memory. */ grpc_tsi_ssl_pem_key_cert_pairs_destroy(pem_key_cert_pair, 1); return status; } +grpc_security_status +SpiffeChannelSecurityConnector::InitializeHandshakerFactory( + tsi_ssl_session_cache* ssl_session_cache) { + grpc_core::MutexLock lock(&mu_); + const SpiffeCredentials* creds = + static_cast(channel_creds()); + grpc_tls_key_materials_config* key_materials_config = + creds->options().key_materials_config(); + /* Copy key materials config from credential options. */ + if (key_materials_config != nullptr) { + grpc_tls_key_materials_config::PemKeyCertPairList cert_pair_list = + key_materials_config->pem_key_cert_pair_list(); + auto pem_root_certs = grpc_core::UniquePtr( + gpr_strdup(key_materials_config->pem_root_certs())); + key_materials_config_->set_key_materials(std::move(pem_root_certs), + std::move(cert_pair_list)); + } + grpc_ssl_certificate_config_reload_status reload_status = + GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; + if (TlsFetchKeyMaterials(key_materials_config_, creds->options(), + &reload_status) != GRPC_STATUS_OK) { + /* Raise an error if key materials are not populated. */ + return GRPC_SECURITY_ERROR; + } + return ReplaceHandshakerFactory(ssl_session_cache); +} + +grpc_security_status +SpiffeChannelSecurityConnector::RefreshHandshakerFactory() { + grpc_core::MutexLock lock(&mu_); + const SpiffeCredentials* creds = + static_cast(channel_creds()); + grpc_ssl_certificate_config_reload_status reload_status = + GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; + if (TlsFetchKeyMaterials(key_materials_config_, creds->options(), + &reload_status) != GRPC_STATUS_OK) { + return GRPC_SECURITY_ERROR; + } + if (reload_status != GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW) { + // Re-use existing handshaker factory. + return GRPC_SECURITY_OK; + } else { + return ReplaceHandshakerFactory(nullptr); + } +} + void SpiffeChannelSecurityConnector::ServerAuthorizationCheckDone( grpc_tls_server_authorization_check_arg* arg) { GPR_ASSERT(arg != nullptr); @@ -332,19 +398,28 @@ void SpiffeChannelSecurityConnector::ServerAuthorizationCheckArgDestroy( SpiffeServerSecurityConnector::SpiffeServerSecurityConnector( grpc_core::RefCountedPtr server_creds) : grpc_server_security_connector(GRPC_SSL_URL_SCHEME, - std::move(server_creds)) {} + std::move(server_creds)) { + key_materials_config_ = grpc_tls_key_materials_config_create()->Ref(); +} SpiffeServerSecurityConnector::~SpiffeServerSecurityConnector() { if (server_handshaker_factory_ != nullptr) { tsi_ssl_server_handshaker_factory_unref(server_handshaker_factory_); } + if (key_materials_config_.get() != nullptr) { + key_materials_config_.get()->Unref(); + } } void SpiffeServerSecurityConnector::add_handshakers( grpc_pollset_set* interested_parties, grpc_core::HandshakeManager* handshake_mgr) { + /* Refresh handshaker factory if needed. */ + if (RefreshHandshakerFactory() != GRPC_SECURITY_OK) { + gpr_log(GPR_ERROR, "Handshaker factory refresh failed."); + return; + } /* Create a TLS SPIFFE TSI handshaker for server. */ - RefreshServerHandshakerFactory(); tsi_handshaker* tsi_hs = nullptr; tsi_result result = tsi_ssl_server_handshaker_factory_create_handshaker( server_handshaker_factory_, &tsi_hs); @@ -384,39 +459,76 @@ SpiffeServerSecurityConnector::CreateSpiffeServerSecurityConnector( grpc_core::RefCountedPtr c = grpc_core::MakeRefCounted( std::move(server_creds)); - if (c->RefreshServerHandshakerFactory() != GRPC_SECURITY_OK) { + if (c->InitializeHandshakerFactory() != GRPC_SECURITY_OK) { + gpr_log(GPR_ERROR, "Could not initialize server handshaker factory."); return nullptr; } return c; } -grpc_security_status -SpiffeServerSecurityConnector::RefreshServerHandshakerFactory() { +grpc_security_status SpiffeServerSecurityConnector::ReplaceHandshakerFactory() { const SpiffeServerCredentials* creds = static_cast(server_creds()); - auto key_materials_config = PopulateSpiffeCredentials(creds->options()); - /* Credential reload does NOT take effect and we need to keep using - * the existing handshaker factory. */ - if (key_materials_config->pem_key_cert_pair_list().empty()) { - key_materials_config->Unref(); - return GRPC_SECURITY_ERROR; - } - /* Credential reload takes effect and we need to free the existing - * handshaker library. */ + /* Free the server handshaker factory if exists. */ if (server_handshaker_factory_) { tsi_ssl_server_handshaker_factory_unref(server_handshaker_factory_); } + GPR_ASSERT(!key_materials_config_->pem_key_cert_pair_list().empty()); tsi_ssl_pem_key_cert_pair* pem_key_cert_pairs = ConvertToTsiPemKeyCertPair( - key_materials_config->pem_key_cert_pair_list()); + key_materials_config_->pem_key_cert_pair_list()); size_t num_key_cert_pairs = - key_materials_config->pem_key_cert_pair_list().size(); + key_materials_config_->pem_key_cert_pair_list().size(); grpc_security_status status = grpc_ssl_tsi_server_handshaker_factory_init( pem_key_cert_pairs, num_key_cert_pairs, - key_materials_config->pem_root_certs(), + key_materials_config_->pem_root_certs(), creds->options().cert_request_type(), &server_handshaker_factory_); - // Free memory. - key_materials_config->Unref(); + /* Free memory. */ grpc_tsi_ssl_pem_key_cert_pairs_destroy(pem_key_cert_pairs, num_key_cert_pairs); return status; } + +grpc_security_status +SpiffeServerSecurityConnector::InitializeHandshakerFactory() { + grpc_core::MutexLock lock(&mu_); + const SpiffeServerCredentials* creds = + static_cast(server_creds()); + grpc_tls_key_materials_config* key_materials_config = + creds->options().key_materials_config(); + if (key_materials_config != nullptr) { + grpc_tls_key_materials_config::PemKeyCertPairList cert_pair_list = + key_materials_config->pem_key_cert_pair_list(); + auto pem_root_certs = grpc_core::UniquePtr( + gpr_strdup(key_materials_config->pem_root_certs())); + key_materials_config_->set_key_materials(std::move(pem_root_certs), + std::move(cert_pair_list)); + } + grpc_ssl_certificate_config_reload_status reload_status = + GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; + if (TlsFetchKeyMaterials(key_materials_config_, creds->options(), + &reload_status) != GRPC_STATUS_OK) { + /* Raise an error if key materials are not populated. */ + return GRPC_SECURITY_ERROR; + } + return ReplaceHandshakerFactory(); +} + +grpc_security_status SpiffeServerSecurityConnector::RefreshHandshakerFactory() { + grpc_core::MutexLock lock(&mu_); + const SpiffeServerCredentials* creds = + static_cast(server_creds()); + grpc_ssl_certificate_config_reload_status reload_status = + GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; + if (TlsFetchKeyMaterials(key_materials_config_, creds->options(), + &reload_status) != GRPC_STATUS_OK) { + return GRPC_SECURITY_ERROR; + } + if (reload_status != GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW) { + /* At this point, we should have key materials populated. */ + return GRPC_SECURITY_OK; + } else { + return ReplaceHandshakerFactory(); + } +} + +} // namespace grpc_core diff --git a/src/core/lib/security/security_connector/tls/spiffe_security_connector.h b/src/core/lib/security/security_connector/tls/spiffe_security_connector.h index 5ea00ee85b6..3739b463159 100644 --- a/src/core/lib/security/security_connector/tls/spiffe_security_connector.h +++ b/src/core/lib/security/security_connector/tls/spiffe_security_connector.h @@ -21,11 +21,14 @@ #include +#include "src/core/lib/gprpp/sync.h" #include "src/core/lib/security/context/security_context.h" #include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" #define GRPC_TLS_SPIFFE_TRANSPORT_SECURITY_TYPE "spiffe" +namespace grpc_core { + // Spiffe channel security connector. class SpiffeChannelSecurityConnector final : public grpc_channel_security_connector { @@ -66,6 +69,11 @@ class SpiffeChannelSecurityConnector final grpc_security_status InitializeHandshakerFactory( tsi_ssl_session_cache* ssl_session_cache); + // A util function to create a new client handshaker factory to replace + // the existing one if exists. + grpc_security_status ReplaceHandshakerFactory( + tsi_ssl_session_cache* ssl_session_cache); + // gRPC-provided callback executed by application, which servers to bring the // control back to gRPC core. static void ServerAuthorizationCheckDone( @@ -83,11 +91,17 @@ class SpiffeChannelSecurityConnector final static void ServerAuthorizationCheckArgDestroy( grpc_tls_server_authorization_check_arg* arg); + // A util function to refresh SSL TSI client handshaker factory with a valid + // credential. + grpc_security_status RefreshHandshakerFactory(); + + grpc_core::Mutex mu_; grpc_closure* on_peer_checked_; grpc_core::UniquePtr target_name_; grpc_core::UniquePtr overridden_target_name_; tsi_ssl_client_handshaker_factory* client_handshaker_factory_ = nullptr; grpc_tls_server_authorization_check_arg* check_arg_; + grpc_core::RefCountedPtr key_materials_config_; }; // Spiffe server security connector. @@ -113,11 +127,30 @@ class SpiffeServerSecurityConnector final int cmp(const grpc_security_connector* other) const override; private: + // Initialize SSL TSI server handshaker factory. + grpc_security_status InitializeHandshakerFactory(); + + // A util function to create a new server handshaker factory to replace the + // existing once if exists. + grpc_security_status ReplaceHandshakerFactory(); + // A util function to refresh SSL TSI server handshaker factory with a valid // credential. - grpc_security_status RefreshServerHandshakerFactory(); + grpc_security_status RefreshHandshakerFactory(); + + grpc_core::Mutex mu_; tsi_ssl_server_handshaker_factory* server_handshaker_factory_ = nullptr; + grpc_core::RefCountedPtr key_materials_config_; }; +// Exposed for testing only. +grpc_status_code TlsFetchKeyMaterials( + const grpc_core::RefCountedPtr& + key_materials_config, + const grpc_tls_credentials_options& options, + grpc_ssl_certificate_config_reload_status* status); + +} // namespace grpc_core + #endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_TLS_SPIFFE_SECURITY_CONNECTOR_H \ */ diff --git a/src/core/lib/slice/slice.cc b/src/core/lib/slice/slice.cc index 57862518feb..d3480abaa87 100644 --- a/src/core/lib/slice/slice.cc +++ b/src/core/lib/slice/slice.cc @@ -37,12 +37,7 @@ char* grpc_slice_to_c_string(grpc_slice slice) { return out; } -grpc_slice grpc_empty_slice(void) { - grpc_slice out; - out.refcount = nullptr; - out.data.inlined.length = 0; - return out; -} +grpc_slice grpc_empty_slice(void) { return grpc_core::UnmanagedMemorySlice(); } grpc_slice grpc_slice_copy(grpc_slice s) { grpc_slice out = GRPC_SLICE_MALLOC(GRPC_SLICE_LENGTH(s)); @@ -112,11 +107,11 @@ size_t grpc_slice_memory_usage(grpc_slice s) { } grpc_slice grpc_slice_from_static_buffer(const void* s, size_t len) { - return grpc_slice_from_static_buffer_internal(s, len); + return grpc_core::ExternallyManagedSlice(s, len); } grpc_slice grpc_slice_from_static_string(const char* s) { - return grpc_slice_from_static_buffer_internal(s, strlen(s)); + return grpc_core::ExternallyManagedSlice(s, strlen(s)); } grpc_slice grpc_slice_new_with_user_data(void* p, size_t len, @@ -202,15 +197,29 @@ grpc_slice grpc_slice_new_with_len(void* p, size_t len, return slice; } +grpc_core::UnmanagedMemorySlice::UnmanagedMemorySlice(const char* source, + size_t length) { + if (length <= sizeof(data.inlined.bytes)) { + refcount = nullptr; + data.inlined.length = static_cast(length); + } else { + HeapInit(length); + } + if (length > 0) { + memcpy(GRPC_SLICE_START_PTR(*this), source, length); + } +} + +grpc_core::UnmanagedMemorySlice::UnmanagedMemorySlice(const char* source) + : grpc_core::UnmanagedMemorySlice::UnmanagedMemorySlice(source, + strlen(source)) {} + grpc_slice grpc_slice_from_copied_buffer(const char* source, size_t length) { - if (length == 0) return grpc_empty_slice(); - grpc_slice slice = GRPC_SLICE_MALLOC(length); - memcpy(GRPC_SLICE_START_PTR(slice), source, length); - return slice; + return grpc_core::UnmanagedMemorySlice(source, length); } grpc_slice grpc_slice_from_copied_string(const char* source) { - return grpc_slice_from_copied_buffer(source, strlen(source)); + return grpc_core::UnmanagedMemorySlice(source, strlen(source)); } grpc_slice grpc_slice_from_moved_buffer(grpc_core::UniquePtr p, @@ -261,8 +270,11 @@ class MallocRefCount { } // namespace grpc_slice grpc_slice_malloc_large(size_t length) { - grpc_slice slice; + return grpc_core::UnmanagedMemorySlice( + length, grpc_core::UnmanagedMemorySlice::ForceHeapAllocation()); +} +void grpc_core::UnmanagedMemorySlice::HeapInit(size_t length) { /* Memory layout used by the slice created here: +-----------+----------------------------------------------------------+ @@ -281,29 +293,30 @@ grpc_slice grpc_slice_malloc_large(size_t length) { /* Build up the slice to be returned. */ /* The slices refcount points back to the allocated block. */ - slice.refcount = rc->base_refcount(); + refcount = rc->base_refcount(); /* The data bytes are placed immediately after the refcount struct */ - slice.data.refcounted.bytes = reinterpret_cast(rc + 1); + data.refcounted.bytes = reinterpret_cast(rc + 1); /* And the length of the block is set to the requested length */ - slice.data.refcounted.length = length; - return slice; + data.refcounted.length = length; } grpc_slice grpc_slice_malloc(size_t length) { - grpc_slice slice; + return grpc_core::UnmanagedMemorySlice(length); +} - if (length > sizeof(slice.data.inlined.bytes)) { - return grpc_slice_malloc_large(length); +grpc_core::UnmanagedMemorySlice::UnmanagedMemorySlice(size_t length) { + if (length > sizeof(data.inlined.bytes)) { + HeapInit(length); } else { /* small slice: just inline the data */ - slice.refcount = nullptr; - slice.data.inlined.length = static_cast(length); + refcount = nullptr; + data.inlined.length = static_cast(length); } - return slice; } -grpc_slice grpc_slice_sub_no_ref(grpc_slice source, size_t begin, size_t end) { - grpc_slice subset; +template +static Slice sub_no_ref(const Slice& source, size_t begin, size_t end) { + Slice subset; GPR_ASSERT(end >= begin); @@ -327,6 +340,15 @@ grpc_slice grpc_slice_sub_no_ref(grpc_slice source, size_t begin, size_t end) { return subset; } +grpc_slice grpc_slice_sub_no_ref(grpc_slice source, size_t begin, size_t end) { + return sub_no_ref(source, begin, end); +} + +grpc_core::UnmanagedMemorySlice grpc_slice_sub_no_ref( + const grpc_core::UnmanagedMemorySlice& source, size_t begin, size_t end) { + return sub_no_ref(source, begin, end); +} + grpc_slice grpc_slice_sub(grpc_slice source, size_t begin, size_t end) { grpc_slice subset; diff --git a/src/core/lib/slice/slice_intern.cc b/src/core/lib/slice/slice_intern.cc index 81d34ddce25..13fe1ab40e9 100644 --- a/src/core/lib/slice/slice_intern.cc +++ b/src/core/lib/slice/slice_intern.cc @@ -107,12 +107,10 @@ static void grow_shard(slice_shard* shard) { shard->capacity = capacity; } -static grpc_slice materialize(InternedSliceRefcount* s) { - grpc_slice slice; - slice.refcount = &s->base; - slice.data.refcounted.bytes = reinterpret_cast(s + 1); - slice.data.refcounted.length = s->length; - return slice; +grpc_core::InternedSlice::InternedSlice(InternedSliceRefcount* s) { + refcount = &s->base; + data.refcounted.bytes = reinterpret_cast(s + 1); + data.refcounted.length = s->length; } uint32_t grpc_slice_default_hash_impl(grpc_slice s) { @@ -152,57 +150,150 @@ grpc_slice grpc_slice_maybe_static_intern(grpc_slice slice, } grpc_slice grpc_slice_intern(grpc_slice slice) { - GPR_TIMER_SCOPE("grpc_slice_intern", 0); - if (GRPC_IS_STATIC_METADATA_STRING(slice)) { - return slice; - } - - uint32_t hash = grpc_slice_hash_internal(slice); + /* TODO(arjunroy): At present, this is capable of returning either a static or + an interned slice. This yields weirdness like the constructor for + ManagedMemorySlice instantiating itself as an instance of a derived type + (StaticMetadataSlice or InternedSlice). Should reexamine. */ + return grpc_core::ManagedMemorySlice(&slice); +} +// Attempt to see if the provided slice or string matches a static slice. +// SliceArgs... is either a const grpc_slice& or a string and length. In either +// case, hash is the pre-computed hash value. +// +// Returns: a matching static slice, or null. +template +static const grpc_core::StaticMetadataSlice* MatchStaticSlice( + uint32_t hash, SliceArgs&&... args) { for (uint32_t i = 0; i <= max_static_metadata_hash_probe; i++) { static_metadata_hash_ent ent = static_metadata_hash[(hash + i) % GPR_ARRAY_SIZE(static_metadata_hash)]; if (ent.hash == hash && ent.idx < GRPC_STATIC_MDSTR_COUNT && - grpc_slice_eq_static_interned(slice, - grpc_static_slice_table[ent.idx])) { - return grpc_static_slice_table[ent.idx]; + grpc_static_slice_table[ent.idx].Equals( + std::forward(args)...)) { + return &grpc_static_slice_table[ent.idx]; } } + return nullptr; +} - InternedSliceRefcount* s; - slice_shard* shard = &g_shards[SHARD_IDX(hash)]; +// Helper methods to enable us to select appropriately overloaded slice methods +// whether we're dealing with a slice, or a buffer with length, when interning +// strings. Helpers for FindOrCreateInternedSlice(). +static const void* GetBuffer(const void* buf, size_t len) { return buf; } +static size_t GetLength(const void* buf, size_t len) { return len; } +static const void* GetBuffer(const grpc_slice& slice) { + return GRPC_SLICE_START_PTR(slice); +} +static size_t GetLength(const grpc_slice& slice) { + return GRPC_SLICE_LENGTH(slice); +} - gpr_mu_lock(&shard->mu); +// Creates an interned slice for a string that does not currently exist in the +// intern table. SliceArgs... is either a const grpc_slice& or a string and +// length. In either case, hash is the pre-computed hash value. We must already +// hold the shard lock. Helper for FindOrCreateInternedSlice(). +// +// Returns: a newly interned slice. +template +static InternedSliceRefcount* InternNewStringLocked(slice_shard* shard, + size_t shard_idx, + uint32_t hash, + SliceArgs&&... args) { + /* string data goes after the internal_string header */ + size_t len = GetLength(std::forward(args)...); + const void* buffer = GetBuffer(std::forward(args)...); + InternedSliceRefcount* s = + static_cast(gpr_malloc(sizeof(*s) + len)); + new (s) grpc_core::InternedSliceRefcount(len, hash, shard->strs[shard_idx]); + memcpy(reinterpret_cast(s + 1), buffer, len); + shard->strs[shard_idx] = s; + shard->count++; + if (shard->count > shard->capacity * 2) { + grow_shard(shard); + } + return s; +} +// Attempt to see if the provided slice or string matches an existing interned +// slice. SliceArgs... is either a const grpc_slice& or a string and length. In +// either case, hash is the pre-computed hash value. We must already hold the +// shard lock. Helper for FindOrCreateInternedSlice(). +// +// Returns: a pre-existing matching static slice, or null. +template +static InternedSliceRefcount* MatchInternedSliceLocked(uint32_t hash, + size_t idx, + SliceArgs&&... args) { + InternedSliceRefcount* s; + slice_shard* shard = &g_shards[SHARD_IDX(hash)]; /* search for an existing string */ - size_t idx = TABLE_IDX(hash, shard->capacity); for (s = shard->strs[idx]; s; s = s->bucket_next) { if (s->hash == hash && - grpc_slice_eq_static_interned(slice, materialize(s))) { + grpc_core::InternedSlice(s).Equals(std::forward(args)...)) { if (s->refcnt.RefIfNonZero()) { - gpr_mu_unlock(&shard->mu); - return materialize(s); + return s; } } } + return nullptr; +} - /* not found: create a new string */ - /* string data goes after the internal_string header */ - s = static_cast( - gpr_malloc(sizeof(*s) + GRPC_SLICE_LENGTH(slice))); - - new (s) grpc_core::InternedSliceRefcount(GRPC_SLICE_LENGTH(slice), hash, - shard->strs[idx]); - memcpy(reinterpret_cast(s + 1), GRPC_SLICE_START_PTR(slice), - GRPC_SLICE_LENGTH(slice)); - shard->strs[idx] = s; - shard->count++; - if (shard->count > shard->capacity * 2) { - grow_shard(shard); +// Attempt to see if the provided slice or string matches an existing interned +// slice, and failing that, create an interned slice with its contents. Returns +// either the existing matching interned slice or the newly created one. +// SliceArgs... is either a const grpc_slice& or a string and length. In either +// case, hash is the pre-computed hash value. We do not hold the shard lock +// here, but do take it. +// +// Returns: an interned slice, either pre-existing/matched or newly created. +template +static InternedSliceRefcount* FindOrCreateInternedSlice(uint32_t hash, + SliceArgs&&... args) { + slice_shard* shard = &g_shards[SHARD_IDX(hash)]; + gpr_mu_lock(&shard->mu); + const size_t idx = TABLE_IDX(hash, shard->capacity); + InternedSliceRefcount* s = + MatchInternedSliceLocked(hash, idx, std::forward(args)...); + if (s == nullptr) { + s = InternNewStringLocked(shard, idx, hash, + std::forward(args)...); } - gpr_mu_unlock(&shard->mu); - return materialize(s); + return s; +} + +grpc_core::ManagedMemorySlice::ManagedMemorySlice(const char* string) + : grpc_core::ManagedMemorySlice::ManagedMemorySlice(string, + strlen(string)) {} + +grpc_core::ManagedMemorySlice::ManagedMemorySlice(const char* string, + size_t len) { + GPR_TIMER_SCOPE("grpc_slice_intern", 0); + const uint32_t hash = gpr_murmur_hash3(string, len, g_hash_seed); + const StaticMetadataSlice* static_slice = MatchStaticSlice(hash, string, len); + if (static_slice) { + *this = *static_slice; + } else { + *this = + grpc_core::InternedSlice(FindOrCreateInternedSlice(hash, string, len)); + } +} + +grpc_core::ManagedMemorySlice::ManagedMemorySlice(const grpc_slice* slice_ptr) { + GPR_TIMER_SCOPE("grpc_slice_intern", 0); + const grpc_slice& slice = *slice_ptr; + if (GRPC_IS_STATIC_METADATA_STRING(slice)) { + *this = static_cast(slice); + return; + } + const uint32_t hash = grpc_slice_hash_internal(slice); + const StaticMetadataSlice* static_slice = MatchStaticSlice(hash, slice); + if (static_slice) { + *this = *static_slice; + } else { + *this = grpc_core::InternedSlice(FindOrCreateInternedSlice(hash, slice)); + } } void grpc_test_only_set_slice_hash_seed(uint32_t seed) { @@ -259,8 +350,8 @@ void grpc_slice_intern_shutdown(void) { shard->count); for (size_t j = 0; j < shard->capacity; j++) { for (InternedSliceRefcount* s = shard->strs[j]; s; s = s->bucket_next) { - char* text = - grpc_dump_slice(materialize(s), GPR_DUMP_HEX | GPR_DUMP_ASCII); + char* text = grpc_dump_slice(grpc_core::InternedSlice(s), + GPR_DUMP_HEX | GPR_DUMP_ASCII); gpr_log(GPR_DEBUG, "LEAKED: %s", text); gpr_free(text); } diff --git a/src/core/lib/slice/slice_internal.h b/src/core/lib/slice/slice_internal.h index 54badeb9ab9..e61f57c01ab 100644 --- a/src/core/lib/slice/slice_internal.h +++ b/src/core/lib/slice/slice_internal.h @@ -30,6 +30,7 @@ #include "src/core/lib/gpr/murmur_hash.h" #include "src/core/lib/gprpp/memory.h" #include "src/core/lib/gprpp/ref_counted.h" +#include "src/core/lib/slice/slice_utils.h" #include "src/core/lib/transport/static_metadata.h" // Interned slices have specific fast-path operations for hashing. To inline @@ -95,6 +96,8 @@ extern uint32_t g_hash_seed; // In total, this saves us roughly 1-2% latency for unary calls, with smaller // calls benefitting. The effect is present, but not as useful, for larger calls // where the cost of sending the data dominates. +// TODO(arjunroy): Investigate if this can be removed with strongly typed +// grpc_slices. struct grpc_slice_refcount { public: enum class Type { @@ -171,6 +174,17 @@ struct grpc_slice_refcount { namespace grpc_core { +struct StaticSliceRefcount { + static grpc_slice_refcount kStaticSubRefcount; + + StaticSliceRefcount(uint32_t index) + : base(&kStaticSubRefcount, grpc_slice_refcount::Type::STATIC), + index(index) {} + + grpc_slice_refcount base; + uint32_t index; +}; + extern grpc_slice_refcount kNoopRefcount; struct InternedSliceRefcount { @@ -314,17 +328,7 @@ grpc_slice grpc_slice_from_moved_string(grpc_core::UniquePtr p); // 0. All other slices will return the size of the allocated chars. size_t grpc_slice_memory_usage(grpc_slice s); -inline grpc_slice grpc_slice_from_static_buffer_internal(const void* s, - size_t len) { - grpc_slice slice; - slice.refcount = &grpc_core::kNoopRefcount; - slice.data.refcounted.bytes = (uint8_t*)s; - slice.data.refcounted.length = len; - return slice; -} - -inline grpc_slice grpc_slice_from_static_string_internal(const char* s) { - return grpc_slice_from_static_buffer_internal(s, strlen(s)); -} +grpc_core::UnmanagedMemorySlice grpc_slice_sub_no_ref( + const grpc_core::UnmanagedMemorySlice& source, size_t begin, size_t end); #endif /* GRPC_CORE_LIB_SLICE_SLICE_INTERNAL_H */ diff --git a/src/core/lib/slice/slice_utils.h b/src/core/lib/slice/slice_utils.h index 7589bf8f0f7..161300abe1e 100644 --- a/src/core/lib/slice/slice_utils.h +++ b/src/core/lib/slice/slice_utils.h @@ -21,6 +21,8 @@ #include +#include + #include // When we compare two slices, and we know the latter is not inlined, we can @@ -36,6 +38,7 @@ // x86-64/clang with differs(). int grpc_slice_differs_refcounted(const grpc_slice& a, const grpc_slice& b_not_inline); + // When we compare two slices, and we *know* that one of them is static or // interned, we can short circuit our slice equality function. The second slice // here must be static or interned; slice a can be any slice, inlined or not. @@ -47,4 +50,121 @@ inline bool grpc_slice_eq_static_interned(const grpc_slice& a, return !grpc_slice_differs_refcounted(a, b_static_interned); } +// TODO(arjunroy): These type declarations ought to be in +// src/core/lib/slice/slice_internal.h instead; they are here due to a circular +// header depedency between slice_internal.h and +// src/core/lib/transport/metadata.h. We need to fix this circular reference and +// when we do, move these type declarations. +// +// Internal slice type declarations. +// Externally, a grpc_slice is a grpc_slice is a grpc_slice. +// Internally, we may have heap allocated slices, static slices, interned +// slices, and inlined slices. If we know the specific type of slice +// we're dealing with, we can save cycles (e.g. fast-paths when we know we don't +// need to take a reference on a slice). Rather than introducing new methods +// ad-hoc in these cases, we rely on type-system backed overloads to keep +// internal APIs clean. +// +// For each overload, the definition and layout of the underlying slice does not +// change; this is purely type-system information. +namespace grpc_core { + +// There are two main types of slices: those that have their memory +// managed by the slice library and those that do not. +// +// The following types of slices are not managed: +// - inlined slices (i.e., refcount is null) +// - slices that have a custom refcount type (i.e., not STATIC or INTERNED) +// - slices where the memory is managed by some external agent. The slice is not +// ref-counted by grpc, and the programmer is responsible for ensuring the +// data is valid for the duration of the period that grpc may access it. +// +// The following types of slices are managed: +// - static metadata slices (i.e., refcount type is STATIC) +// - interned slices (i.e., refcount type is INTERNED) +// +// This categorization is reflected in the following hierarchy: +// +// - grpc_slice +// > - UnmanagedMemorySlice +// > - ExternallyManagedSlice +// - ManagedMemorySlice +// > - InternedSlice +// - StaticMetadataSlice +// +struct ManagedMemorySlice : public grpc_slice { + ManagedMemorySlice() { + refcount = nullptr; + data.refcounted.bytes = nullptr; + data.refcounted.length = 0; + } + explicit ManagedMemorySlice(const char* string); + ManagedMemorySlice(const char* buf, size_t len); + explicit ManagedMemorySlice(const grpc_slice* slice); + bool Equals(const grpc_slice& other) const { + if (refcount == other.refcount) { + return true; + } + return !grpc_slice_differs_refcounted(other, *this); + } + bool Equals(const char* buf, const size_t len) const { + return data.refcounted.length == len && + memcmp(buf, data.refcounted.bytes, len) == 0; + } +}; +struct UnmanagedMemorySlice : public grpc_slice { + // TODO(arjunroy): Can we use a default=false param instead of this enum? + enum class ForceHeapAllocation {}; + UnmanagedMemorySlice() { + refcount = nullptr; + data.inlined.length = 0; + } + explicit UnmanagedMemorySlice(const char* source); + UnmanagedMemorySlice(const char* source, size_t length); + // The first constructor creates a slice that may be heap allocated, or + // inlined in the slice structure if length is small enough + // (< GRPC_SLICE_INLINED_SIZE). The second constructor forces heap alloc. + explicit UnmanagedMemorySlice(size_t length); + explicit UnmanagedMemorySlice(size_t length, const ForceHeapAllocation&) { + HeapInit(length); + } + + private: + void HeapInit(size_t length); +}; + +extern grpc_slice_refcount kNoopRefcount; + +struct ExternallyManagedSlice : public UnmanagedMemorySlice { + ExternallyManagedSlice() + : ExternallyManagedSlice(&kNoopRefcount, 0, nullptr) {} + explicit ExternallyManagedSlice(const char* s) + : ExternallyManagedSlice(s, strlen(s)) {} + ExternallyManagedSlice(const void* s, size_t len) + : ExternallyManagedSlice( + &kNoopRefcount, len, + reinterpret_cast(const_cast(s))) {} + ExternallyManagedSlice(grpc_slice_refcount* ref, size_t length, + uint8_t* bytes) { + refcount = ref; + data.refcounted.length = length; + data.refcounted.bytes = bytes; + } +}; + +struct StaticMetadataSlice : public ManagedMemorySlice { + StaticMetadataSlice(grpc_slice_refcount* ref, size_t length, uint8_t* bytes) { + refcount = ref; + data.refcounted.length = length; + data.refcounted.bytes = bytes; + } +}; + +struct InternedSliceRefcount; +struct InternedSlice : public ManagedMemorySlice { + explicit InternedSlice(InternedSliceRefcount* s); +}; + +} // namespace grpc_core + #endif /* GRPC_CORE_LIB_SLICE_SLICE_UTILS_H */ diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc index 13b1d126393..1331e57ab0c 100644 --- a/src/core/lib/surface/call.cc +++ b/src/core/lib/surface/call.cc @@ -1007,13 +1007,13 @@ static void recv_initial_filter(grpc_call* call, grpc_metadata_batch* b) { GPR_TIMER_SCOPE("incoming_stream_compression_algorithm", 0); set_incoming_stream_compression_algorithm( call, decode_stream_compression(b->idx.named.content_encoding->md)); - grpc_metadata_batch_remove(b, b->idx.named.content_encoding); + grpc_metadata_batch_remove(b, GRPC_BATCH_CONTENT_ENCODING); } if (b->idx.named.grpc_encoding != nullptr) { GPR_TIMER_SCOPE("incoming_message_compression_algorithm", 0); set_incoming_message_compression_algorithm( call, decode_message_compression(b->idx.named.grpc_encoding->md)); - grpc_metadata_batch_remove(b, b->idx.named.grpc_encoding); + grpc_metadata_batch_remove(b, GRPC_BATCH_GRPC_ENCODING); } uint32_t message_encodings_accepted_by_peer = 1u; uint32_t stream_encodings_accepted_by_peer = 1u; @@ -1021,13 +1021,13 @@ static void recv_initial_filter(grpc_call* call, grpc_metadata_batch* b) { GPR_TIMER_SCOPE("encodings_accepted_by_peer", 0); set_encodings_accepted_by_peer(call, b->idx.named.grpc_accept_encoding->md, &message_encodings_accepted_by_peer, false); - grpc_metadata_batch_remove(b, b->idx.named.grpc_accept_encoding); + grpc_metadata_batch_remove(b, GRPC_BATCH_GRPC_ACCEPT_ENCODING); } if (b->idx.named.accept_encoding != nullptr) { GPR_TIMER_SCOPE("stream_encodings_accepted_by_peer", 0); set_encodings_accepted_by_peer(call, b->idx.named.accept_encoding->md, &stream_encodings_accepted_by_peer, true); - grpc_metadata_batch_remove(b, b->idx.named.accept_encoding); + grpc_metadata_batch_remove(b, GRPC_BATCH_ACCEPT_ENCODING); } call->encodings_accepted_by_peer = grpc_compression_bitset_from_message_stream_compression_bitset( @@ -1059,13 +1059,13 @@ static void recv_trailing_filter(void* args, grpc_metadata_batch* b, error = grpc_error_set_str( error, GRPC_ERROR_STR_GRPC_MESSAGE, grpc_slice_ref_internal(GRPC_MDVALUE(b->idx.named.grpc_message->md))); - grpc_metadata_batch_remove(b, b->idx.named.grpc_message); + grpc_metadata_batch_remove(b, GRPC_BATCH_GRPC_MESSAGE); } else if (error != GRPC_ERROR_NONE) { error = grpc_error_set_str(error, GRPC_ERROR_STR_GRPC_MESSAGE, grpc_empty_slice()); } set_final_status(call, GRPC_ERROR_REF(error)); - grpc_metadata_batch_remove(b, b->idx.named.grpc_status); + grpc_metadata_batch_remove(b, GRPC_BATCH_GRPC_STATUS); GRPC_ERROR_UNREF(error); } else if (!call->is_client) { set_final_status(call, GRPC_ERROR_NONE); @@ -1175,6 +1175,12 @@ static void post_batch_completion(batch_control* bctl) { &call->metadata_batch[0 /* is_receiving */][0 /* is_trailing */]); } if (bctl->op.send_message) { + if (bctl->op.payload->send_message.stream_write_closed && + error == GRPC_ERROR_NONE) { + error = grpc_error_add_child( + error, GRPC_ERROR_CREATE_FROM_STATIC_STRING( + "Attempt to send message after stream was closed.")); + } call->sending_message = false; } if (bctl->op.send_trailing_metadata) { diff --git a/src/core/lib/surface/channel.cc b/src/core/lib/surface/channel.cc index aadb3f5fae3..24813407e28 100644 --- a/src/core/lib/surface/channel.cc +++ b/src/core/lib/surface/channel.cc @@ -416,13 +416,11 @@ void* grpc_channel_register_call(grpc_channel* channel, const char* method, GPR_ASSERT(!reserved); grpc_core::ExecCtx exec_ctx; - rc->path = grpc_mdelem_from_slices( - GRPC_MDSTR_PATH, - grpc_slice_intern(grpc_slice_from_static_string(method))); + rc->path = grpc_mdelem_from_slices(GRPC_MDSTR_PATH, + grpc_core::ExternallyManagedSlice(method)); rc->authority = - host ? grpc_mdelem_from_slices( - GRPC_MDSTR_AUTHORITY, - grpc_slice_intern(grpc_slice_from_static_string(host))) + host ? grpc_mdelem_from_slices(GRPC_MDSTR_AUTHORITY, + grpc_core::ExternallyManagedSlice(host)) : GRPC_MDNULL; gpr_mu_lock(&channel->registered_call_mu); rc->next = channel->registered_calls; @@ -513,5 +511,5 @@ grpc_mdelem grpc_channel_get_reffed_status_elem_slowpath(grpc_channel* channel, char tmp[GPR_LTOA_MIN_BUFSIZE]; gpr_ltoa(i, tmp); return grpc_mdelem_from_slices(GRPC_MDSTR_GRPC_STATUS, - grpc_slice_from_copied_string(tmp)); + grpc_core::UnmanagedMemorySlice(tmp)); } diff --git a/src/core/lib/surface/completion_queue.cc b/src/core/lib/surface/completion_queue.cc index 82f87e769bf..acdf42eae34 100644 --- a/src/core/lib/surface/completion_queue.cc +++ b/src/core/lib/surface/completion_queue.cc @@ -320,7 +320,7 @@ struct cq_callback_data { /* Completion queue structure */ struct grpc_completion_queue { /** Once owning_refs drops to zero, we will destroy the cq */ - gpr_refcount owning_refs; + grpc_core::RefCount owning_refs; gpr_mu* mu; @@ -518,7 +518,7 @@ grpc_completion_queue* grpc_completion_queue_create_internal( cq->poller_vtable = poller_vtable; /* One for destroy(), one for pollset_shutdown */ - gpr_ref_init(&cq->owning_refs, 2); + new (&cq->owning_refs) grpc_core::RefCount(2); poller_vtable->init(POLLSET_FROM_CQ(cq), &cq->mu); vtable->init(DATA_FROM_CQ(cq), shutdown_callback); @@ -573,16 +573,13 @@ int grpc_get_cq_poll_num(grpc_completion_queue* cq) { #ifndef NDEBUG void grpc_cq_internal_ref(grpc_completion_queue* cq, const char* reason, const char* file, int line) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_cq_refcount)) { - gpr_atm val = gpr_atm_no_barrier_load(&cq->owning_refs.count); - gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, - "CQ:%p ref %" PRIdPTR " -> %" PRIdPTR " %s", cq, val, val + 1, - reason); - } + grpc_core::DebugLocation debug_location(file, line); #else void grpc_cq_internal_ref(grpc_completion_queue* cq) { + grpc_core::DebugLocation debug_location; + const char* reason = nullptr; #endif - gpr_ref(&cq->owning_refs); + cq->owning_refs.Ref(debug_location, reason); } static void on_pollset_shutdown_done(void* arg, grpc_error* error) { @@ -593,16 +590,13 @@ static void on_pollset_shutdown_done(void* arg, grpc_error* error) { #ifndef NDEBUG void grpc_cq_internal_unref(grpc_completion_queue* cq, const char* reason, const char* file, int line) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_cq_refcount)) { - gpr_atm val = gpr_atm_no_barrier_load(&cq->owning_refs.count); - gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, - "CQ:%p unref %" PRIdPTR " -> %" PRIdPTR " %s", cq, val, val - 1, - reason); - } + grpc_core::DebugLocation debug_location(file, line); #else void grpc_cq_internal_unref(grpc_completion_queue* cq) { + grpc_core::DebugLocation debug_location; + const char* reason = nullptr; #endif - if (gpr_unref(&cq->owning_refs)) { + if (GPR_UNLIKELY(cq->owning_refs.Unref(debug_location, reason))) { cq->vtable->destroy(DATA_FROM_CQ(cq)); cq->poller_vtable->destroy(POLLSET_FROM_CQ(cq)); #ifndef NDEBUG diff --git a/src/core/lib/surface/lame_client.cc b/src/core/lib/surface/lame_client.cc index dde39b8c681..10a27924073 100644 --- a/src/core/lib/surface/lame_client.cc +++ b/src/core/lib/surface/lame_client.cc @@ -61,10 +61,10 @@ static void fill_metadata(grpc_call_element* elem, grpc_metadata_batch* mdb) { char tmp[GPR_LTOA_MIN_BUFSIZE]; gpr_ltoa(chand->error_code, tmp); calld->status.md = grpc_mdelem_from_slices( - GRPC_MDSTR_GRPC_STATUS, grpc_slice_from_copied_string(tmp)); + GRPC_MDSTR_GRPC_STATUS, grpc_core::UnmanagedMemorySlice(tmp)); calld->details.md = grpc_mdelem_from_slices( GRPC_MDSTR_GRPC_MESSAGE, - grpc_slice_from_copied_string(chand->error_message)); + grpc_core::UnmanagedMemorySlice(chand->error_message)); calld->status.prev = calld->details.next = nullptr; calld->status.next = &calld->details; calld->details.prev = &calld->status; diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index 702853e0afe..2cc7e88cab4 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -256,7 +256,7 @@ struct grpc_server { listener* listeners; int listeners_destroyed; - gpr_refcount internal_refcount; + grpc_core::RefCount internal_refcount; /** when did we print the last shutdown progress message */ gpr_timespec last_shutdown_message_time; @@ -400,9 +400,7 @@ static void request_matcher_kill_requests(grpc_server* server, * server proper */ -static void server_ref(grpc_server* server) { - gpr_ref(&server->internal_refcount); -} +static void server_ref(grpc_server* server) { server->internal_refcount.Ref(); } static void server_delete(grpc_server* server) { registered_method* rm; @@ -434,7 +432,7 @@ static void server_delete(grpc_server* server) { } static void server_unref(grpc_server* server) { - if (gpr_unref(&server->internal_refcount)) { + if (GPR_UNLIKELY(server->internal_refcount.Unref())) { server_delete(server); } } @@ -746,19 +744,18 @@ static void server_on_recv_initial_metadata(void* ptr, grpc_error* error) { grpc_millis op_deadline; if (error == GRPC_ERROR_NONE) { - GPR_ASSERT(calld->recv_initial_metadata->idx.named.path != nullptr); - GPR_ASSERT(calld->recv_initial_metadata->idx.named.authority != nullptr); + GPR_DEBUG_ASSERT(calld->recv_initial_metadata->idx.named.path != nullptr); + GPR_DEBUG_ASSERT(calld->recv_initial_metadata->idx.named.authority != + nullptr); calld->path = grpc_slice_ref_internal( GRPC_MDVALUE(calld->recv_initial_metadata->idx.named.path->md)); calld->host = grpc_slice_ref_internal( GRPC_MDVALUE(calld->recv_initial_metadata->idx.named.authority->md)); calld->path_set = true; calld->host_set = true; + grpc_metadata_batch_remove(calld->recv_initial_metadata, GRPC_BATCH_PATH); grpc_metadata_batch_remove(calld->recv_initial_metadata, - calld->recv_initial_metadata->idx.named.path); - grpc_metadata_batch_remove( - calld->recv_initial_metadata, - calld->recv_initial_metadata->idx.named.authority); + GRPC_BATCH_AUTHORITY); } else { GRPC_ERROR_REF(error); } @@ -1031,7 +1028,7 @@ grpc_server* grpc_server_create(const grpc_channel_args* args, void* reserved) { gpr_cv_init(&server->starting_cv); /* decremented by grpc_server_destroy */ - gpr_ref_init(&server->internal_refcount, 1); + new (&server->internal_refcount) grpc_core::RefCount(); server->root_channel_data.next = server->root_channel_data.prev = &server->root_channel_data; @@ -1395,20 +1392,22 @@ void grpc_server_destroy(grpc_server* server) { server_unref(server); } -void grpc_server_add_listener(grpc_server* server, void* arg, - void (*start)(grpc_server* server, void* arg, - grpc_pollset** pollsets, - size_t pollset_count), - void (*destroy)(grpc_server* server, void* arg, - grpc_closure* on_done), - intptr_t socket_uuid) { +void grpc_server_add_listener( + grpc_server* server, void* listener_arg, + void (*start)(grpc_server* server, void* arg, grpc_pollset** pollsets, + size_t pollset_count), + void (*destroy)(grpc_server* server, void* arg, grpc_closure* on_done), + grpc_core::RefCountedPtr node) { listener* l = static_cast(gpr_malloc(sizeof(listener))); - l->arg = arg; + l->arg = listener_arg; l->start = start; l->destroy = destroy; - l->socket_uuid = socket_uuid; - if (server->channelz_server != nullptr && socket_uuid != 0) { - server->channelz_server->AddChildListenSocket(socket_uuid); + l->socket_uuid = 0; + if (node != nullptr) { + l->socket_uuid = node->uuid(); + if (server->channelz_server != nullptr) { + server->channelz_server->AddChildListenSocket(std::move(node)); + } } l->next = server->listeners; server->listeners = l; diff --git a/src/core/lib/surface/server.h b/src/core/lib/surface/server.h index 67ad0310a96..2285821e11b 100644 --- a/src/core/lib/surface/server.h +++ b/src/core/lib/surface/server.h @@ -34,13 +34,12 @@ extern grpc_core::TraceFlag grpc_server_channel_trace; /* Add a listener to the server: when the server starts, it will call start, and when it shuts down, it will call destroy */ -void grpc_server_add_listener(grpc_server* server, void* listener, - void (*start)(grpc_server* server, void* arg, - grpc_pollset** pollsets, - size_t npollsets), - void (*destroy)(grpc_server* server, void* arg, - grpc_closure* on_done), - intptr_t socket_uuid); +void grpc_server_add_listener( + grpc_server* server, void* listener_arg, + void (*start)(grpc_server* server, void* arg, grpc_pollset** pollsets, + size_t npollsets), + void (*destroy)(grpc_server* server, void* arg, grpc_closure* on_done), + grpc_core::RefCountedPtr node); /* Setup a transport - creates a channel stack, binds the transport to the server */ diff --git a/src/core/lib/surface/version.cc b/src/core/lib/surface/version.cc index 848a49d1eff..71eb89a1b42 100644 --- a/src/core/lib/surface/version.cc +++ b/src/core/lib/surface/version.cc @@ -23,6 +23,6 @@ #include -const char* grpc_version_string(void) { return "7.0.0"; } +const char* grpc_version_string(void) { return "8.0.0"; } -const char* grpc_g_stands_for(void) { return "gangnam"; } +const char* grpc_g_stands_for(void) { return "ganges"; } diff --git a/src/core/lib/transport/error_utils.cc b/src/core/lib/transport/error_utils.cc index 5be98c9f04f..78a324b2d7f 100644 --- a/src/core/lib/transport/error_utils.cc +++ b/src/core/lib/transport/error_utils.cc @@ -61,7 +61,7 @@ void grpc_error_get_status(grpc_error* error, grpc_millis deadline, // 3) The resulting slice is statically known. // 4) Said resulting slice is of length 0 (""). // This means 3 movs, instead of 10s of instructions and a strlen. - *slice = grpc_slice_from_static_string_internal(""); + *slice = grpc_core::ExternallyManagedSlice(""); } if (http_error != nullptr) { *http_error = GRPC_HTTP2_NO_ERROR; diff --git a/src/core/lib/transport/metadata.cc b/src/core/lib/transport/metadata.cc index 7766ee186c6..4242923283e 100644 --- a/src/core/lib/transport/metadata.cc +++ b/src/core/lib/transport/metadata.cc @@ -68,8 +68,8 @@ void grpc_mdelem_trace_ref(void* md, const grpc_slice& key, char* key_str = grpc_slice_to_c_string(key); char* value_str = grpc_slice_to_c_string(value); gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, - "ELM REF:%p:%" PRIdPTR "->%" PRIdPTR ": '%s' = '%s'", md, refcnt, - refcnt + 1, key_str, value_str); + "mdelem REF:%p:%" PRIdPTR "->%" PRIdPTR ": '%s' = '%s'", md, + refcnt, refcnt + 1, key_str, value_str); gpr_free(key_str); gpr_free(value_str); } @@ -82,7 +82,7 @@ void grpc_mdelem_trace_unref(void* md, const grpc_slice& key, char* key_str = grpc_slice_to_c_string(key); char* value_str = grpc_slice_to_c_string(value); gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, - "ELM UNREF:%p:%" PRIdPTR "->%" PRIdPTR ": '%s' = '%s'", md, + "mdelem UNREF:%p:%" PRIdPTR "->%" PRIdPTR ": '%s' = '%s'", md, refcnt, refcnt - 1, key_str, value_str); gpr_free(key_str); gpr_free(value_str); @@ -112,14 +112,33 @@ AllocatedMetadata::AllocatedMetadata(const grpc_slice& key, : RefcountedMdBase(grpc_slice_ref_internal(key), grpc_slice_ref_internal(value)) { #ifndef NDEBUG - if (grpc_trace_metadata.enabled()) { - char* key_str = grpc_slice_to_c_string(key); - char* value_str = grpc_slice_to_c_string(value); - gpr_log(GPR_DEBUG, "ELM ALLOC:%p:%" PRIdPTR ": '%s' = '%s'", this, - RefValue(), key_str, value_str); - gpr_free(key_str); - gpr_free(value_str); - } + TraceAtStart("ALLOC_MD"); +#endif +} + +AllocatedMetadata::AllocatedMetadata(const grpc_slice& key, + const grpc_slice& value, const NoRefKey*) + : RefcountedMdBase(key, grpc_slice_ref_internal(value)) { +#ifndef NDEBUG + TraceAtStart("ALLOC_MD_NOREF_KEY"); +#endif +} + +AllocatedMetadata::AllocatedMetadata( + const grpc_core::ManagedMemorySlice& key, + const grpc_core::UnmanagedMemorySlice& value) + : RefcountedMdBase(key, value) { +#ifndef NDEBUG + TraceAtStart("ALLOC_MD_NOREF_KEY_VAL"); +#endif +} + +AllocatedMetadata::AllocatedMetadata( + const grpc_core::ExternallyManagedSlice& key, + const grpc_core::UnmanagedMemorySlice& value) + : RefcountedMdBase(key, value) { +#ifndef NDEBUG + TraceAtStart("ALLOC_MD_NOREF_KEY_VAL"); #endif } @@ -134,6 +153,19 @@ AllocatedMetadata::~AllocatedMetadata() { } } +#ifndef NDEBUG +void grpc_core::RefcountedMdBase::TraceAtStart(const char* tag) { + if (grpc_trace_metadata.enabled()) { + char* key_str = grpc_slice_to_c_string(key()); + char* value_str = grpc_slice_to_c_string(value()); + gpr_log(GPR_DEBUG, "mdelem %s:%p:%" PRIdPTR ": '%s' = '%s'", tag, this, + RefValue(), key_str, value_str); + gpr_free(key_str); + gpr_free(value_str); + } +} +#endif + InternedMetadata::InternedMetadata(const grpc_slice& key, const grpc_slice& value, uint32_t hash, InternedMetadata* next) @@ -141,14 +173,16 @@ InternedMetadata::InternedMetadata(const grpc_slice& key, grpc_slice_ref_internal(value), hash), link_(next) { #ifndef NDEBUG - if (grpc_trace_metadata.enabled()) { - char* key_str = grpc_slice_to_c_string(key); - char* value_str = grpc_slice_to_c_string(value); - gpr_log(GPR_DEBUG, "ELM NEW:%p:%" PRIdPTR ": '%s' = '%s'", this, - RefValue(), key_str, value_str); - gpr_free(key_str); - gpr_free(value_str); - } + TraceAtStart("INTERNED_MD"); +#endif +} + +InternedMetadata::InternedMetadata(const grpc_slice& key, + const grpc_slice& value, uint32_t hash, + InternedMetadata* next, const NoRefKey*) + : RefcountedMdBase(key, grpc_slice_ref_internal(value), hash), link_(next) { +#ifndef NDEBUG + TraceAtStart("INTERNED_MD_NOREF_KEY"); #endif } @@ -248,8 +282,8 @@ void InternedMetadata::RefWithShardLocked(mdtab_shard* shard) { char* value_str = grpc_slice_to_c_string(value()); intptr_t value = RefValue(); gpr_log(__FILE__, __LINE__, GPR_LOG_SEVERITY_DEBUG, - "ELM REF:%p:%" PRIdPTR "->%" PRIdPTR ": '%s' = '%s'", this, value, - value + 1, key_str, value_str); + "mdelem REF:%p:%" PRIdPTR "->%" PRIdPTR ": '%s' = '%s'", this, + value, value + 1, key_str, value_str); gpr_free(key_str); gpr_free(value_str); } @@ -307,36 +341,100 @@ static void rehash_mdtab(mdtab_shard* shard) { } } -grpc_mdelem grpc_mdelem_create( +template +static grpc_mdelem md_create_maybe_static(const grpc_slice& key, + const grpc_slice& value); +template +static grpc_mdelem md_create_must_intern(const grpc_slice& key, + const grpc_slice& value, + uint32_t hash); + +template +static grpc_mdelem md_create( const grpc_slice& key, const grpc_slice& value, grpc_mdelem_data* compatible_external_backing_store) { + // Ensure slices are, in fact, static if we claimed they were. + GPR_DEBUG_ASSERT(!key_definitely_static || + GRPC_IS_STATIC_METADATA_STRING(key)); + GPR_DEBUG_ASSERT(!value_definitely_static || + GRPC_IS_STATIC_METADATA_STRING(value)); + const bool key_is_interned = + key_definitely_static || grpc_slice_is_interned(key); + const bool value_is_interned = + value_definitely_static || grpc_slice_is_interned(value); // External storage if either slice is not interned and the caller already // created a backing store. If no backing store, we allocate one. - if (!grpc_slice_is_interned(key) || !grpc_slice_is_interned(value)) { + if (!key_is_interned || !value_is_interned) { if (compatible_external_backing_store != nullptr) { // Caller provided backing store. return GRPC_MAKE_MDELEM(compatible_external_backing_store, GRPC_MDELEM_STORAGE_EXTERNAL); } else { // We allocate backing store. - return GRPC_MAKE_MDELEM(grpc_core::New(key, value), - GRPC_MDELEM_STORAGE_ALLOCATED); + return key_definitely_static + ? GRPC_MAKE_MDELEM( + grpc_core::New( + key, value, + static_cast( + nullptr)), + GRPC_MDELEM_STORAGE_ALLOCATED) + : GRPC_MAKE_MDELEM( + grpc_core::New(key, value), + GRPC_MDELEM_STORAGE_ALLOCATED); } } + return md_create_maybe_static( + key, value); +} + +template +static grpc_mdelem md_create_maybe_static(const grpc_slice& key, + const grpc_slice& value) { + // Ensure slices are, in fact, static if we claimed they were. + GPR_DEBUG_ASSERT(!key_definitely_static || + GRPC_IS_STATIC_METADATA_STRING(key)); + GPR_DEBUG_ASSERT(!value_definitely_static || + GRPC_IS_STATIC_METADATA_STRING(value)); + GPR_DEBUG_ASSERT(key.refcount != nullptr); + GPR_DEBUG_ASSERT(value.refcount != nullptr); + + const bool key_is_static_mdstr = + key_definitely_static || + key.refcount->GetType() == grpc_slice_refcount::Type::STATIC; + const bool value_is_static_mdstr = + value_definitely_static || + value.refcount->GetType() == grpc_slice_refcount::Type::STATIC; + + const intptr_t kidx = GRPC_STATIC_METADATA_INDEX(key); // Not all static slice input yields a statically stored metadata element. - // It may be worth documenting why. - if (GRPC_IS_STATIC_METADATA_STRING(key) && - GRPC_IS_STATIC_METADATA_STRING(value)) { + if (key_is_static_mdstr && value_is_static_mdstr) { grpc_mdelem static_elem = grpc_static_mdelem_for_static_strings( - GRPC_STATIC_METADATA_INDEX(key), GRPC_STATIC_METADATA_INDEX(value)); + kidx, GRPC_STATIC_METADATA_INDEX(value)); if (!GRPC_MDISNULL(static_elem)) { return static_elem; } } - uint32_t hash = GRPC_MDSTR_KV_HASH(grpc_slice_hash_refcounted(key), - grpc_slice_hash_refcounted(value)); + uint32_t khash = key_definitely_static + ? grpc_static_metadata_hash_values[kidx] + : grpc_slice_hash_refcounted(key); + + uint32_t hash = GRPC_MDSTR_KV_HASH(khash, grpc_slice_hash_refcounted(value)); + return md_create_must_intern(key, value, hash); +} + +template +static grpc_mdelem md_create_must_intern(const grpc_slice& key, + const grpc_slice& value, + uint32_t hash) { + // Here, we know both key and value are both at least interned, and both + // possibly static. We know that anything inside the shared interned table is + // also at least interned (and maybe static). Note that equality for a static + // and interned slice implies that they are both the same exact slice. + // The same applies to a pair of interned slices, or a pair of static slices. + // Rather than run the full equality check, we can therefore just do a pointer + // comparison of the refcounts. InternedMetadata* md; mdtab_shard* shard = &g_shards[SHARD_IDX(hash)]; size_t idx; @@ -348,7 +446,8 @@ grpc_mdelem grpc_mdelem_create( idx = TABLE_IDX(hash, shard->capacity); /* search for an existing pair */ for (md = shard->elems[idx].next; md; md = md->bucket_next()) { - if (grpc_slice_eq(key, md->key()) && grpc_slice_eq(value, md->value())) { + if (grpc_slice_static_interned_equal(key, md->key()) && + grpc_slice_static_interned_equal(value, md->value())) { md->RefWithShardLocked(shard); gpr_mu_unlock(&shard->mu); return GRPC_MAKE_MDELEM(md, GRPC_MDELEM_STORAGE_INTERNED); @@ -356,8 +455,12 @@ grpc_mdelem grpc_mdelem_create( } /* not found: create a new pair */ - md = grpc_core::New(key, value, hash, - shard->elems[idx].next); + md = key_definitely_static + ? grpc_core::New( + key, value, hash, shard->elems[idx].next, + static_cast(nullptr)) + : grpc_core::New(key, value, hash, + shard->elems[idx].next); shard->elems[idx].next = md; shard->count++; @@ -370,9 +473,68 @@ grpc_mdelem grpc_mdelem_create( return GRPC_MAKE_MDELEM(md, GRPC_MDELEM_STORAGE_INTERNED); } +grpc_mdelem grpc_mdelem_create( + const grpc_slice& key, const grpc_slice& value, + grpc_mdelem_data* compatible_external_backing_store) { + return md_create(key, value, compatible_external_backing_store); +} + +grpc_mdelem grpc_mdelem_create( + const grpc_core::StaticMetadataSlice& key, const grpc_slice& value, + grpc_mdelem_data* compatible_external_backing_store) { + return md_create(key, value, compatible_external_backing_store); +} + +/* Create grpc_mdelem from provided slices. We specify via template parameter + whether we know that the input key is static or not. If it is, we short + circuit various comparisons and a no-op unref. */ +template +static grpc_mdelem md_from_slices(const grpc_slice& key, + const grpc_slice& value) { + // Ensure key is, in fact, static if we claimed it was. + GPR_DEBUG_ASSERT(!key_definitely_static || + GRPC_IS_STATIC_METADATA_STRING(key)); + grpc_mdelem out = md_create(key, value, nullptr); + if (!key_definitely_static) { + grpc_slice_unref_internal(key); + } + grpc_slice_unref_internal(value); + return out; +} + grpc_mdelem grpc_mdelem_from_slices(const grpc_slice& key, const grpc_slice& value) { - grpc_mdelem out = grpc_mdelem_create(key, value, nullptr); + return md_from_slices(key, value); +} + +grpc_mdelem grpc_mdelem_from_slices(const grpc_core::StaticMetadataSlice& key, + const grpc_slice& value) { + return md_from_slices(key, value); +} + +grpc_mdelem grpc_mdelem_from_slices( + const grpc_core::StaticMetadataSlice& key, + const grpc_core::StaticMetadataSlice& value) { + grpc_mdelem out = md_create_maybe_static(key, value); + return out; +} + +grpc_mdelem grpc_mdelem_from_slices( + const grpc_core::StaticMetadataSlice& key, + const grpc_core::ManagedMemorySlice& value) { + // TODO(arjunroy): We can save the unref if md_create_maybe_static ended up + // creating a new interned metadata. But otherwise - we need this here. + grpc_mdelem out = md_create_maybe_static(key, value); + grpc_slice_unref_internal(value); + return out; +} + +grpc_mdelem grpc_mdelem_from_slices( + const grpc_core::ManagedMemorySlice& key, + const grpc_core::ManagedMemorySlice& value) { + grpc_mdelem out = md_create_maybe_static(key, value); + // TODO(arjunroy): We can save the unref if md_create_maybe_static ended up + // creating a new interned metadata. But otherwise - we need this here. grpc_slice_unref_internal(key); grpc_slice_unref_internal(value); return out; diff --git a/src/core/lib/transport/metadata.h b/src/core/lib/transport/metadata.h index 4621433bf01..3d3a68119f2 100644 --- a/src/core/lib/transport/metadata.h +++ b/src/core/lib/transport/metadata.h @@ -118,10 +118,31 @@ struct grpc_mdelem { ((grpc_mdelem_data_storage)((md).payload & \ (uintptr_t)GRPC_MDELEM_STORAGE_INTERNED_BIT)) -/* Unrefs the slices. */ +/* Given arbitrary input slices, create a grpc_mdelem object. The caller refs + * the input slices; we unref them. This method is always safe to call; however, + * if we know data about the slices in question (e.g. if we knew our key was + * static) we can call specializations that save on cycle count. */ grpc_mdelem grpc_mdelem_from_slices(const grpc_slice& key, const grpc_slice& value); +/* Like grpc_mdelem_from_slices, but we know that key is a static slice. This + saves us a few branches and a no-op call to md_unref() for the key. */ +grpc_mdelem grpc_mdelem_from_slices(const grpc_core::StaticMetadataSlice& key, + const grpc_slice& value); + +/* Like grpc_mdelem_from_slices, but key is static and val is static. */ +grpc_mdelem grpc_mdelem_from_slices( + const grpc_core::StaticMetadataSlice& key, + const grpc_core::StaticMetadataSlice& value); + +/* Like grpc_mdelem_from_slices, but key is static and val is interned. */ +grpc_mdelem grpc_mdelem_from_slices(const grpc_core::StaticMetadataSlice& key, + const grpc_core::ManagedMemorySlice& value); + +/* Like grpc_mdelem_from_slices, but key and val are interned. */ +grpc_mdelem grpc_mdelem_from_slices(const grpc_core::ManagedMemorySlice& key, + const grpc_core::ManagedMemorySlice& value); + /* Cheaply convert a grpc_metadata to a grpc_mdelem; may use the grpc_metadata object as backing storage (so lifetimes should align) */ grpc_mdelem grpc_mdelem_from_grpc_metadata(grpc_metadata* metadata); @@ -134,6 +155,11 @@ grpc_mdelem grpc_mdelem_create( const grpc_slice& key, const grpc_slice& value, grpc_mdelem_data* compatible_external_backing_store); +/* Like grpc_mdelem_create, but we know that key is static. */ +grpc_mdelem grpc_mdelem_create( + const grpc_core::StaticMetadataSlice& key, const grpc_slice& value, + grpc_mdelem_data* compatible_external_backing_store); + #define GRPC_MDKEY(md) (GRPC_MDELEM_DATA(md)->key) #define GRPC_MDVALUE(md) (GRPC_MDELEM_DATA(md)->value) @@ -239,6 +265,10 @@ class RefcountedMdBase { } protected: +#ifndef NDEBUG + void TraceAtStart(const char* tag); +#endif + intptr_t RefValue() { return refcnt_.Load(MemoryOrder::RELAXED); } bool AllRefsDropped() { return refcnt_.Load(MemoryOrder::ACQUIRE) == 0; } bool FirstRef() { return refcnt_.FetchAdd(1, MemoryOrder::RELAXED) == 0; } @@ -253,16 +283,19 @@ class RefcountedMdBase { class InternedMetadata : public RefcountedMdBase { public: + // TODO(arjunroy): Change to use strongly typed slices instead. + struct NoRefKey {}; struct BucketLink { explicit BucketLink(InternedMetadata* md) : next(md) {} InternedMetadata* next = nullptr; }; - InternedMetadata(const grpc_slice& key, const grpc_slice& value, uint32_t hash, InternedMetadata* next); - ~InternedMetadata(); + InternedMetadata(const grpc_slice& key, const grpc_slice& value, + uint32_t hash, InternedMetadata* next, const NoRefKey*); + ~InternedMetadata(); void RefWithShardLocked(mdtab_shard* shard); UserData* user_data() { return &user_data_; } InternedMetadata* bucket_next() { return link_.next; } @@ -278,7 +311,15 @@ class InternedMetadata : public RefcountedMdBase { /* Shadow structure for grpc_mdelem_data for allocated elements */ class AllocatedMetadata : public RefcountedMdBase { public: + // TODO(arjunroy): Change to use strongly typed slices instead. + struct NoRefKey {}; AllocatedMetadata(const grpc_slice& key, const grpc_slice& value); + AllocatedMetadata(const grpc_core::ManagedMemorySlice& key, + const grpc_core::UnmanagedMemorySlice& value); + AllocatedMetadata(const grpc_core::ExternallyManagedSlice& key, + const grpc_core::UnmanagedMemorySlice& value); + AllocatedMetadata(const grpc_slice& key, const grpc_slice& value, + const NoRefKey*); ~AllocatedMetadata(); UserData* user_data() { return &user_data_; } @@ -374,4 +415,35 @@ inline void grpc_mdelem_unref(grpc_mdelem gmd) { void grpc_mdctx_global_init(void); void grpc_mdctx_global_shutdown(); +/* Like grpc_mdelem_from_slices, but we know that key is a static or interned + slice and value is not static or interned. This gives us an inlinable + fastpath - we know we must allocate metadata now, and that we do not need to + unref the value (rather, we just transfer the ref). We can avoid a ref since: + 1) the key slice is passed in already ref'd + 2) We're guaranteed to create a new Allocated slice, thus meaning the + ref can be considered 'transferred'.*/ +inline grpc_mdelem grpc_mdelem_from_slices( + const grpc_core::ManagedMemorySlice& key, + const grpc_core::UnmanagedMemorySlice& value) { + using grpc_core::AllocatedMetadata; + return GRPC_MAKE_MDELEM(grpc_core::New(key, value), + GRPC_MDELEM_STORAGE_ALLOCATED); +} + +inline grpc_mdelem grpc_mdelem_from_slices( + const grpc_core::ExternallyManagedSlice& key, + const grpc_core::UnmanagedMemorySlice& value) { + using grpc_core::AllocatedMetadata; + return GRPC_MAKE_MDELEM(grpc_core::New(key, value), + GRPC_MDELEM_STORAGE_ALLOCATED); +} + +inline grpc_mdelem grpc_mdelem_from_slices( + const grpc_core::StaticMetadataSlice& key, + const grpc_core::UnmanagedMemorySlice& value) { + using grpc_core::AllocatedMetadata; + return GRPC_MAKE_MDELEM(grpc_core::New(key, value), + GRPC_MDELEM_STORAGE_ALLOCATED); +} + #endif /* GRPC_CORE_LIB_TRANSPORT_METADATA_H */ diff --git a/src/core/lib/transport/metadata_batch.cc b/src/core/lib/transport/metadata_batch.cc index 49a56e709d5..560342cecc6 100644 --- a/src/core/lib/transport/metadata_batch.cc +++ b/src/core/lib/transport/metadata_batch.cc @@ -93,6 +93,23 @@ grpc_error* grpc_attach_md_to_error(grpc_error* src, grpc_mdelem md) { return out; } +static grpc_error* GPR_ATTRIBUTE_NOINLINE error_with_md(grpc_mdelem md) { + return grpc_attach_md_to_error( + GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unallowed duplicate metadata"), md); +} + +static grpc_error* link_callout(grpc_metadata_batch* batch, + grpc_linked_mdelem* storage, + grpc_metadata_batch_callouts_index idx) { + GPR_DEBUG_ASSERT(idx >= 0 && idx < GRPC_BATCH_CALLOUTS_COUNT); + if (GPR_LIKELY(batch->idx.array[idx] == nullptr)) { + ++batch->list.default_count; + batch->idx.array[idx] = storage; + return GRPC_ERROR_NONE; + } + return error_with_md(storage->md); +} + static grpc_error* maybe_link_callout(grpc_metadata_batch* batch, grpc_linked_mdelem* storage) GRPC_MUST_USE_RESULT; @@ -104,14 +121,7 @@ static grpc_error* maybe_link_callout(grpc_metadata_batch* batch, if (idx == GRPC_BATCH_CALLOUTS_COUNT) { return GRPC_ERROR_NONE; } - if (batch->idx.array[idx] == nullptr) { - ++batch->list.default_count; - batch->idx.array[idx] = storage; - return GRPC_ERROR_NONE; - } - return grpc_attach_md_to_error( - GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unallowed duplicate metadata"), - storage->md); + return link_callout(batch, storage, idx); } static void maybe_unlink_callout(grpc_metadata_batch* batch, @@ -122,21 +132,21 @@ static void maybe_unlink_callout(grpc_metadata_batch* batch, return; } --batch->list.default_count; - GPR_ASSERT(batch->idx.array[idx] != nullptr); + GPR_DEBUG_ASSERT(batch->idx.array[idx] != nullptr); batch->idx.array[idx] = nullptr; } grpc_error* grpc_metadata_batch_add_head(grpc_metadata_batch* batch, grpc_linked_mdelem* storage, grpc_mdelem elem_to_add) { - GPR_ASSERT(!GRPC_MDISNULL(elem_to_add)); + GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add)); storage->md = elem_to_add; return grpc_metadata_batch_link_head(batch, storage); } static void link_head(grpc_mdelem_list* list, grpc_linked_mdelem* storage) { assert_valid_list(list); - GPR_ASSERT(!GRPC_MDISNULL(storage->md)); + GPR_DEBUG_ASSERT(!GRPC_MDISNULL(storage->md)); storage->prev = nullptr; storage->next = list->head; storage->reserved = nullptr; @@ -163,17 +173,35 @@ grpc_error* grpc_metadata_batch_link_head(grpc_metadata_batch* batch, return GRPC_ERROR_NONE; } +// TODO(arjunroy): Need to revisit this and see what guarantees exist between +// C-core and the internal-metadata subsystem. E.g. can we ensure a particular +// metadata is never added twice, even in the presence of user supplied data? +grpc_error* grpc_metadata_batch_link_head( + grpc_metadata_batch* batch, grpc_linked_mdelem* storage, + grpc_metadata_batch_callouts_index idx) { + GPR_DEBUG_ASSERT(GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md)) == idx); + assert_valid_callouts(batch); + grpc_error* err = link_callout(batch, storage, idx); + if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) { + assert_valid_callouts(batch); + return err; + } + link_head(&batch->list, storage); + assert_valid_callouts(batch); + return GRPC_ERROR_NONE; +} + grpc_error* grpc_metadata_batch_add_tail(grpc_metadata_batch* batch, grpc_linked_mdelem* storage, grpc_mdelem elem_to_add) { - GPR_ASSERT(!GRPC_MDISNULL(elem_to_add)); + GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add)); storage->md = elem_to_add; return grpc_metadata_batch_link_tail(batch, storage); } static void link_tail(grpc_mdelem_list* list, grpc_linked_mdelem* storage) { assert_valid_list(list); - GPR_ASSERT(!GRPC_MDISNULL(storage->md)); + GPR_DEBUG_ASSERT(!GRPC_MDISNULL(storage->md)); storage->prev = list->tail; storage->next = nullptr; storage->reserved = nullptr; @@ -200,6 +228,21 @@ grpc_error* grpc_metadata_batch_link_tail(grpc_metadata_batch* batch, return GRPC_ERROR_NONE; } +grpc_error* grpc_metadata_batch_link_tail( + grpc_metadata_batch* batch, grpc_linked_mdelem* storage, + grpc_metadata_batch_callouts_index idx) { + GPR_DEBUG_ASSERT(GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md)) == idx); + assert_valid_callouts(batch); + grpc_error* err = link_callout(batch, storage, idx); + if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) { + assert_valid_callouts(batch); + return err; + } + link_tail(&batch->list, storage); + assert_valid_callouts(batch); + return GRPC_ERROR_NONE; +} + static void unlink_storage(grpc_mdelem_list* list, grpc_linked_mdelem* storage) { assert_valid_list(list); @@ -226,6 +269,18 @@ void grpc_metadata_batch_remove(grpc_metadata_batch* batch, assert_valid_callouts(batch); } +void grpc_metadata_batch_remove(grpc_metadata_batch* batch, + grpc_metadata_batch_callouts_index idx) { + assert_valid_callouts(batch); + grpc_linked_mdelem* storage = batch->idx.array[idx]; + GPR_DEBUG_ASSERT(storage != nullptr); + --batch->list.default_count; + batch->idx.array[idx] = nullptr; + unlink_storage(&batch->list, storage); + GRPC_MDELEM_UNREF(storage->md); + assert_valid_callouts(batch); +} + void grpc_metadata_batch_set_value(grpc_linked_mdelem* storage, const grpc_slice& value) { grpc_mdelem old_mdelem = storage->md; @@ -313,13 +368,14 @@ void grpc_metadata_batch_copy(grpc_metadata_batch* src, size_t i = 0; for (grpc_linked_mdelem* elem = src->list.head; elem != nullptr; elem = elem->next) { - grpc_error* error = grpc_metadata_batch_add_tail(dst, &storage[i++], - GRPC_MDELEM_REF(elem->md)); + // Error unused in non-debug builds. + grpc_error* GRPC_UNUSED error = grpc_metadata_batch_add_tail( + dst, &storage[i++], GRPC_MDELEM_REF(elem->md)); // The only way that grpc_metadata_batch_add_tail() can fail is if // there's a duplicate entry for a callout. However, that can't be // the case here, because we would not have been allowed to create // a source batch that had that kind of conflict. - GPR_ASSERT(error == GRPC_ERROR_NONE); + GPR_DEBUG_ASSERT(error == GRPC_ERROR_NONE); } } diff --git a/src/core/lib/transport/metadata_batch.h b/src/core/lib/transport/metadata_batch.h index d87a8b0886d..46a437e4f1b 100644 --- a/src/core/lib/transport/metadata_batch.h +++ b/src/core/lib/transport/metadata_batch.h @@ -67,6 +67,8 @@ size_t grpc_metadata_batch_size(grpc_metadata_batch* batch); /** Remove \a storage from the batch, unreffing the mdelem contained */ void grpc_metadata_batch_remove(grpc_metadata_batch* batch, grpc_linked_mdelem* storage); +void grpc_metadata_batch_remove(grpc_metadata_batch* batch, + grpc_metadata_batch_callouts_index idx); /** Substitute a new mdelem for an old value */ grpc_error* grpc_metadata_batch_substitute(grpc_metadata_batch* batch, @@ -84,6 +86,9 @@ void grpc_metadata_batch_set_value(grpc_linked_mdelem* storage, grpc_error* grpc_metadata_batch_link_head(grpc_metadata_batch* batch, grpc_linked_mdelem* storage) GRPC_MUST_USE_RESULT; +grpc_error* grpc_metadata_batch_link_head( + grpc_metadata_batch* batch, grpc_linked_mdelem* storage, + grpc_metadata_batch_callouts_index idx) GRPC_MUST_USE_RESULT; /** Add \a storage to the end of \a batch. storage->md is assumed to be valid. @@ -93,6 +98,9 @@ grpc_error* grpc_metadata_batch_link_head(grpc_metadata_batch* batch, grpc_error* grpc_metadata_batch_link_tail(grpc_metadata_batch* batch, grpc_linked_mdelem* storage) GRPC_MUST_USE_RESULT; +grpc_error* grpc_metadata_batch_link_tail( + grpc_metadata_batch* batch, grpc_linked_mdelem* storage, + grpc_metadata_batch_callouts_index idx) GRPC_MUST_USE_RESULT; /** Add \a elem_to_add as the first element in \a batch, using \a storage as backing storage for the linked list element. @@ -104,6 +112,22 @@ grpc_error* grpc_metadata_batch_add_head( grpc_metadata_batch* batch, grpc_linked_mdelem* storage, grpc_mdelem elem_to_add) GRPC_MUST_USE_RESULT; +// TODO(arjunroy, roth): Remove redundant methods. +// add/link_head/tail are almost identical. +inline grpc_error* GRPC_MUST_USE_RESULT grpc_metadata_batch_add_head( + grpc_metadata_batch* batch, grpc_linked_mdelem* storage, + grpc_metadata_batch_callouts_index idx) { + return grpc_metadata_batch_link_head(batch, storage, idx); +} + +inline grpc_error* GRPC_MUST_USE_RESULT grpc_metadata_batch_add_head( + grpc_metadata_batch* batch, grpc_linked_mdelem* storage, + grpc_mdelem elem_to_add, grpc_metadata_batch_callouts_index idx) { + GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add)); + storage->md = elem_to_add; + return grpc_metadata_batch_add_head(batch, storage, idx); +} + /** Add \a elem_to_add as the last element in \a batch, using \a storage as backing storage for the linked list element. \a storage is owned by the caller and must survive for the @@ -114,6 +138,20 @@ grpc_error* grpc_metadata_batch_add_tail( grpc_metadata_batch* batch, grpc_linked_mdelem* storage, grpc_mdelem elem_to_add) GRPC_MUST_USE_RESULT; +inline grpc_error* GRPC_MUST_USE_RESULT grpc_metadata_batch_add_tail( + grpc_metadata_batch* batch, grpc_linked_mdelem* storage, + grpc_metadata_batch_callouts_index idx) { + return grpc_metadata_batch_link_tail(batch, storage, idx); +} + +inline grpc_error* GRPC_MUST_USE_RESULT grpc_metadata_batch_add_tail( + grpc_metadata_batch* batch, grpc_linked_mdelem* storage, + grpc_mdelem elem_to_add, grpc_metadata_batch_callouts_index idx) { + GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add)); + storage->md = elem_to_add; + return grpc_metadata_batch_add_tail(batch, storage, idx); +} + grpc_error* grpc_attach_md_to_error(grpc_error* src, grpc_mdelem md); typedef struct { diff --git a/src/core/lib/transport/static_metadata.cc b/src/core/lib/transport/static_metadata.cc index 8b0a6f482d7..e2e618726f1 100644 --- a/src/core/lib/transport/static_metadata.cc +++ b/src/core/lib/transport/static_metadata.cc @@ -49,292 +49,412 @@ static uint8_t g_bytes[] = { 101, 113, 117, 101, 115, 116, 103, 114, 112, 99, 45, 105, 110, 116, 101, 114, 110, 97, 108, 45, 115, 116, 114, 101, 97, 109, 45, 101, 110, 99, 111, 100, 105, 110, 103, 45, 114, 101, 113, 117, 101, 115, 116, 117, 115, - 101, 114, 45, 97, 103, 101, 110, 116, 104, 111, 115, 116, 108, 98, 45, - 116, 111, 107, 101, 110, 103, 114, 112, 99, 45, 112, 114, 101, 118, 105, - 111, 117, 115, 45, 114, 112, 99, 45, 97, 116, 116, 101, 109, 112, 116, - 115, 103, 114, 112, 99, 45, 114, 101, 116, 114, 121, 45, 112, 117, 115, - 104, 98, 97, 99, 107, 45, 109, 115, 103, 114, 112, 99, 45, 116, 105, - 109, 101, 111, 117, 116, 49, 50, 51, 52, 103, 114, 112, 99, 46, 119, - 97, 105, 116, 95, 102, 111, 114, 95, 114, 101, 97, 100, 121, 103, 114, - 112, 99, 46, 116, 105, 109, 101, 111, 117, 116, 103, 114, 112, 99, 46, - 109, 97, 120, 95, 114, 101, 113, 117, 101, 115, 116, 95, 109, 101, 115, - 115, 97, 103, 101, 95, 98, 121, 116, 101, 115, 103, 114, 112, 99, 46, - 109, 97, 120, 95, 114, 101, 115, 112, 111, 110, 115, 101, 95, 109, 101, - 115, 115, 97, 103, 101, 95, 98, 121, 116, 101, 115, 47, 103, 114, 112, - 99, 46, 108, 98, 46, 118, 49, 46, 76, 111, 97, 100, 66, 97, 108, - 97, 110, 99, 101, 114, 47, 66, 97, 108, 97, 110, 99, 101, 76, 111, - 97, 100, 47, 103, 114, 112, 99, 46, 104, 101, 97, 108, 116, 104, 46, - 118, 49, 46, 72, 101, 97, 108, 116, 104, 47, 87, 97, 116, 99, 104, - 47, 101, 110, 118, 111, 121, 46, 115, 101, 114, 118, 105, 99, 101, 46, - 100, 105, 115, 99, 111, 118, 101, 114, 121, 46, 118, 50, 46, 65, 103, - 103, 114, 101, 103, 97, 116, 101, 100, 68, 105, 115, 99, 111, 118, 101, - 114, 121, 83, 101, 114, 118, 105, 99, 101, 47, 83, 116, 114, 101, 97, - 109, 65, 103, 103, 114, 101, 103, 97, 116, 101, 100, 82, 101, 115, 111, - 117, 114, 99, 101, 115, 100, 101, 102, 108, 97, 116, 101, 103, 122, 105, - 112, 115, 116, 114, 101, 97, 109, 47, 103, 122, 105, 112, 71, 69, 84, - 80, 79, 83, 84, 47, 47, 105, 110, 100, 101, 120, 46, 104, 116, 109, - 108, 104, 116, 116, 112, 104, 116, 116, 112, 115, 50, 48, 48, 50, 48, - 52, 50, 48, 54, 51, 48, 52, 52, 48, 48, 52, 48, 52, 53, 48, - 48, 97, 99, 99, 101, 112, 116, 45, 99, 104, 97, 114, 115, 101, 116, - 103, 122, 105, 112, 44, 32, 100, 101, 102, 108, 97, 116, 101, 97, 99, - 99, 101, 112, 116, 45, 108, 97, 110, 103, 117, 97, 103, 101, 97, 99, - 99, 101, 112, 116, 45, 114, 97, 110, 103, 101, 115, 97, 99, 99, 101, - 112, 116, 97, 99, 99, 101, 115, 115, 45, 99, 111, 110, 116, 114, 111, - 108, 45, 97, 108, 108, 111, 119, 45, 111, 114, 105, 103, 105, 110, 97, - 103, 101, 97, 108, 108, 111, 119, 97, 117, 116, 104, 111, 114, 105, 122, - 97, 116, 105, 111, 110, 99, 97, 99, 104, 101, 45, 99, 111, 110, 116, - 114, 111, 108, 99, 111, 110, 116, 101, 110, 116, 45, 100, 105, 115, 112, - 111, 115, 105, 116, 105, 111, 110, 99, 111, 110, 116, 101, 110, 116, 45, - 108, 97, 110, 103, 117, 97, 103, 101, 99, 111, 110, 116, 101, 110, 116, - 45, 108, 101, 110, 103, 116, 104, 99, 111, 110, 116, 101, 110, 116, 45, - 108, 111, 99, 97, 116, 105, 111, 110, 99, 111, 110, 116, 101, 110, 116, - 45, 114, 97, 110, 103, 101, 99, 111, 111, 107, 105, 101, 100, 97, 116, - 101, 101, 116, 97, 103, 101, 120, 112, 101, 99, 116, 101, 120, 112, 105, - 114, 101, 115, 102, 114, 111, 109, 105, 102, 45, 109, 97, 116, 99, 104, - 105, 102, 45, 109, 111, 100, 105, 102, 105, 101, 100, 45, 115, 105, 110, - 99, 101, 105, 102, 45, 110, 111, 110, 101, 45, 109, 97, 116, 99, 104, - 105, 102, 45, 114, 97, 110, 103, 101, 105, 102, 45, 117, 110, 109, 111, - 100, 105, 102, 105, 101, 100, 45, 115, 105, 110, 99, 101, 108, 97, 115, - 116, 45, 109, 111, 100, 105, 102, 105, 101, 100, 108, 105, 110, 107, 108, - 111, 99, 97, 116, 105, 111, 110, 109, 97, 120, 45, 102, 111, 114, 119, - 97, 114, 100, 115, 112, 114, 111, 120, 121, 45, 97, 117, 116, 104, 101, - 110, 116, 105, 99, 97, 116, 101, 112, 114, 111, 120, 121, 45, 97, 117, - 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 114, 97, 110, 103, - 101, 114, 101, 102, 101, 114, 101, 114, 114, 101, 102, 114, 101, 115, 104, - 114, 101, 116, 114, 121, 45, 97, 102, 116, 101, 114, 115, 101, 114, 118, - 101, 114, 115, 101, 116, 45, 99, 111, 111, 107, 105, 101, 115, 116, 114, - 105, 99, 116, 45, 116, 114, 97, 110, 115, 112, 111, 114, 116, 45, 115, - 101, 99, 117, 114, 105, 116, 121, 116, 114, 97, 110, 115, 102, 101, 114, - 45, 101, 110, 99, 111, 100, 105, 110, 103, 118, 97, 114, 121, 118, 105, - 97, 119, 119, 119, 45, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, - 116, 101, 48, 105, 100, 101, 110, 116, 105, 116, 121, 116, 114, 97, 105, - 108, 101, 114, 115, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, - 47, 103, 114, 112, 99, 103, 114, 112, 99, 80, 85, 84, 108, 98, 45, - 99, 111, 115, 116, 45, 98, 105, 110, 105, 100, 101, 110, 116, 105, 116, - 121, 44, 100, 101, 102, 108, 97, 116, 101, 105, 100, 101, 110, 116, 105, - 116, 121, 44, 103, 122, 105, 112, 100, 101, 102, 108, 97, 116, 101, 44, - 103, 122, 105, 112, 105, 100, 101, 110, 116, 105, 116, 121, 44, 100, 101, - 102, 108, 97, 116, 101, 44, 103, 122, 105, 112}; + 101, 114, 45, 97, 103, 101, 110, 116, 104, 111, 115, 116, 103, 114, 112, + 99, 45, 112, 114, 101, 118, 105, 111, 117, 115, 45, 114, 112, 99, 45, + 97, 116, 116, 101, 109, 112, 116, 115, 103, 114, 112, 99, 45, 114, 101, + 116, 114, 121, 45, 112, 117, 115, 104, 98, 97, 99, 107, 45, 109, 115, + 103, 114, 112, 99, 45, 116, 105, 109, 101, 111, 117, 116, 49, 50, 51, + 52, 103, 114, 112, 99, 46, 119, 97, 105, 116, 95, 102, 111, 114, 95, + 114, 101, 97, 100, 121, 103, 114, 112, 99, 46, 116, 105, 109, 101, 111, + 117, 116, 103, 114, 112, 99, 46, 109, 97, 120, 95, 114, 101, 113, 117, + 101, 115, 116, 95, 109, 101, 115, 115, 97, 103, 101, 95, 98, 121, 116, + 101, 115, 103, 114, 112, 99, 46, 109, 97, 120, 95, 114, 101, 115, 112, + 111, 110, 115, 101, 95, 109, 101, 115, 115, 97, 103, 101, 95, 98, 121, + 116, 101, 115, 47, 103, 114, 112, 99, 46, 108, 98, 46, 118, 49, 46, + 76, 111, 97, 100, 66, 97, 108, 97, 110, 99, 101, 114, 47, 66, 97, + 108, 97, 110, 99, 101, 76, 111, 97, 100, 47, 101, 110, 118, 111, 121, + 46, 115, 101, 114, 118, 105, 99, 101, 46, 108, 111, 97, 100, 95, 115, + 116, 97, 116, 115, 46, 118, 50, 46, 76, 111, 97, 100, 82, 101, 112, + 111, 114, 116, 105, 110, 103, 83, 101, 114, 118, 105, 99, 101, 47, 83, + 116, 114, 101, 97, 109, 76, 111, 97, 100, 83, 116, 97, 116, 115, 47, + 101, 110, 118, 111, 121, 46, 97, 112, 105, 46, 118, 50, 46, 69, 110, + 100, 112, 111, 105, 110, 116, 68, 105, 115, 99, 111, 118, 101, 114, 121, + 83, 101, 114, 118, 105, 99, 101, 47, 83, 116, 114, 101, 97, 109, 69, + 110, 100, 112, 111, 105, 110, 116, 115, 47, 103, 114, 112, 99, 46, 104, + 101, 97, 108, 116, 104, 46, 118, 49, 46, 72, 101, 97, 108, 116, 104, + 47, 87, 97, 116, 99, 104, 47, 101, 110, 118, 111, 121, 46, 115, 101, + 114, 118, 105, 99, 101, 46, 100, 105, 115, 99, 111, 118, 101, 114, 121, + 46, 118, 50, 46, 65, 103, 103, 114, 101, 103, 97, 116, 101, 100, 68, + 105, 115, 99, 111, 118, 101, 114, 121, 83, 101, 114, 118, 105, 99, 101, + 47, 83, 116, 114, 101, 97, 109, 65, 103, 103, 114, 101, 103, 97, 116, + 101, 100, 82, 101, 115, 111, 117, 114, 99, 101, 115, 100, 101, 102, 108, + 97, 116, 101, 103, 122, 105, 112, 115, 116, 114, 101, 97, 109, 47, 103, + 122, 105, 112, 71, 69, 84, 80, 79, 83, 84, 47, 47, 105, 110, 100, + 101, 120, 46, 104, 116, 109, 108, 104, 116, 116, 112, 104, 116, 116, 112, + 115, 50, 48, 48, 50, 48, 52, 50, 48, 54, 51, 48, 52, 52, 48, + 48, 52, 48, 52, 53, 48, 48, 97, 99, 99, 101, 112, 116, 45, 99, + 104, 97, 114, 115, 101, 116, 103, 122, 105, 112, 44, 32, 100, 101, 102, + 108, 97, 116, 101, 97, 99, 99, 101, 112, 116, 45, 108, 97, 110, 103, + 117, 97, 103, 101, 97, 99, 99, 101, 112, 116, 45, 114, 97, 110, 103, + 101, 115, 97, 99, 99, 101, 112, 116, 97, 99, 99, 101, 115, 115, 45, + 99, 111, 110, 116, 114, 111, 108, 45, 97, 108, 108, 111, 119, 45, 111, + 114, 105, 103, 105, 110, 97, 103, 101, 97, 108, 108, 111, 119, 97, 117, + 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 99, 97, 99, 104, + 101, 45, 99, 111, 110, 116, 114, 111, 108, 99, 111, 110, 116, 101, 110, + 116, 45, 100, 105, 115, 112, 111, 115, 105, 116, 105, 111, 110, 99, 111, + 110, 116, 101, 110, 116, 45, 108, 97, 110, 103, 117, 97, 103, 101, 99, + 111, 110, 116, 101, 110, 116, 45, 108, 101, 110, 103, 116, 104, 99, 111, + 110, 116, 101, 110, 116, 45, 108, 111, 99, 97, 116, 105, 111, 110, 99, + 111, 110, 116, 101, 110, 116, 45, 114, 97, 110, 103, 101, 99, 111, 111, + 107, 105, 101, 100, 97, 116, 101, 101, 116, 97, 103, 101, 120, 112, 101, + 99, 116, 101, 120, 112, 105, 114, 101, 115, 102, 114, 111, 109, 105, 102, + 45, 109, 97, 116, 99, 104, 105, 102, 45, 109, 111, 100, 105, 102, 105, + 101, 100, 45, 115, 105, 110, 99, 101, 105, 102, 45, 110, 111, 110, 101, + 45, 109, 97, 116, 99, 104, 105, 102, 45, 114, 97, 110, 103, 101, 105, + 102, 45, 117, 110, 109, 111, 100, 105, 102, 105, 101, 100, 45, 115, 105, + 110, 99, 101, 108, 97, 115, 116, 45, 109, 111, 100, 105, 102, 105, 101, + 100, 108, 105, 110, 107, 108, 111, 99, 97, 116, 105, 111, 110, 109, 97, + 120, 45, 102, 111, 114, 119, 97, 114, 100, 115, 112, 114, 111, 120, 121, + 45, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 112, 114, + 111, 120, 121, 45, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, + 111, 110, 114, 97, 110, 103, 101, 114, 101, 102, 101, 114, 101, 114, 114, + 101, 102, 114, 101, 115, 104, 114, 101, 116, 114, 121, 45, 97, 102, 116, + 101, 114, 115, 101, 114, 118, 101, 114, 115, 101, 116, 45, 99, 111, 111, + 107, 105, 101, 115, 116, 114, 105, 99, 116, 45, 116, 114, 97, 110, 115, + 112, 111, 114, 116, 45, 115, 101, 99, 117, 114, 105, 116, 121, 116, 114, + 97, 110, 115, 102, 101, 114, 45, 101, 110, 99, 111, 100, 105, 110, 103, + 118, 97, 114, 121, 118, 105, 97, 119, 119, 119, 45, 97, 117, 116, 104, + 101, 110, 116, 105, 99, 97, 116, 101, 48, 105, 100, 101, 110, 116, 105, + 116, 121, 116, 114, 97, 105, 108, 101, 114, 115, 97, 112, 112, 108, 105, + 99, 97, 116, 105, 111, 110, 47, 103, 114, 112, 99, 103, 114, 112, 99, + 80, 85, 84, 108, 98, 45, 99, 111, 115, 116, 45, 98, 105, 110, 105, + 100, 101, 110, 116, 105, 116, 121, 44, 100, 101, 102, 108, 97, 116, 101, + 105, 100, 101, 110, 116, 105, 116, 121, 44, 103, 122, 105, 112, 100, 101, + 102, 108, 97, 116, 101, 44, 103, 122, 105, 112, 105, 100, 101, 110, 116, + 105, 116, 121, 44, 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, 105, + 112}; -static grpc_slice_refcount static_sub_refcnt; -grpc_slice_refcount grpc_static_metadata_refcounts[GRPC_STATIC_MDSTR_COUNT] = { - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), - grpc_slice_refcount(&static_sub_refcnt, grpc_slice_refcount::Type::STATIC), +grpc_slice_refcount grpc_core::StaticSliceRefcount::kStaticSubRefcount; +grpc_core::StaticSliceRefcount + grpc_static_metadata_refcounts[GRPC_STATIC_MDSTR_COUNT] = { + grpc_core::StaticSliceRefcount(0), + grpc_core::StaticSliceRefcount(1), + grpc_core::StaticSliceRefcount(2), + grpc_core::StaticSliceRefcount(3), + grpc_core::StaticSliceRefcount(4), + grpc_core::StaticSliceRefcount(5), + grpc_core::StaticSliceRefcount(6), + grpc_core::StaticSliceRefcount(7), + grpc_core::StaticSliceRefcount(8), + grpc_core::StaticSliceRefcount(9), + grpc_core::StaticSliceRefcount(10), + grpc_core::StaticSliceRefcount(11), + grpc_core::StaticSliceRefcount(12), + grpc_core::StaticSliceRefcount(13), + grpc_core::StaticSliceRefcount(14), + grpc_core::StaticSliceRefcount(15), + grpc_core::StaticSliceRefcount(16), + grpc_core::StaticSliceRefcount(17), + grpc_core::StaticSliceRefcount(18), + grpc_core::StaticSliceRefcount(19), + grpc_core::StaticSliceRefcount(20), + grpc_core::StaticSliceRefcount(21), + grpc_core::StaticSliceRefcount(22), + grpc_core::StaticSliceRefcount(23), + grpc_core::StaticSliceRefcount(24), + grpc_core::StaticSliceRefcount(25), + grpc_core::StaticSliceRefcount(26), + grpc_core::StaticSliceRefcount(27), + grpc_core::StaticSliceRefcount(28), + grpc_core::StaticSliceRefcount(29), + grpc_core::StaticSliceRefcount(30), + grpc_core::StaticSliceRefcount(31), + grpc_core::StaticSliceRefcount(32), + grpc_core::StaticSliceRefcount(33), + grpc_core::StaticSliceRefcount(34), + grpc_core::StaticSliceRefcount(35), + grpc_core::StaticSliceRefcount(36), + grpc_core::StaticSliceRefcount(37), + grpc_core::StaticSliceRefcount(38), + grpc_core::StaticSliceRefcount(39), + grpc_core::StaticSliceRefcount(40), + grpc_core::StaticSliceRefcount(41), + grpc_core::StaticSliceRefcount(42), + grpc_core::StaticSliceRefcount(43), + grpc_core::StaticSliceRefcount(44), + grpc_core::StaticSliceRefcount(45), + grpc_core::StaticSliceRefcount(46), + grpc_core::StaticSliceRefcount(47), + grpc_core::StaticSliceRefcount(48), + grpc_core::StaticSliceRefcount(49), + grpc_core::StaticSliceRefcount(50), + grpc_core::StaticSliceRefcount(51), + grpc_core::StaticSliceRefcount(52), + grpc_core::StaticSliceRefcount(53), + grpc_core::StaticSliceRefcount(54), + grpc_core::StaticSliceRefcount(55), + grpc_core::StaticSliceRefcount(56), + grpc_core::StaticSliceRefcount(57), + grpc_core::StaticSliceRefcount(58), + grpc_core::StaticSliceRefcount(59), + grpc_core::StaticSliceRefcount(60), + grpc_core::StaticSliceRefcount(61), + grpc_core::StaticSliceRefcount(62), + grpc_core::StaticSliceRefcount(63), + grpc_core::StaticSliceRefcount(64), + grpc_core::StaticSliceRefcount(65), + grpc_core::StaticSliceRefcount(66), + grpc_core::StaticSliceRefcount(67), + grpc_core::StaticSliceRefcount(68), + grpc_core::StaticSliceRefcount(69), + grpc_core::StaticSliceRefcount(70), + grpc_core::StaticSliceRefcount(71), + grpc_core::StaticSliceRefcount(72), + grpc_core::StaticSliceRefcount(73), + grpc_core::StaticSliceRefcount(74), + grpc_core::StaticSliceRefcount(75), + grpc_core::StaticSliceRefcount(76), + grpc_core::StaticSliceRefcount(77), + grpc_core::StaticSliceRefcount(78), + grpc_core::StaticSliceRefcount(79), + grpc_core::StaticSliceRefcount(80), + grpc_core::StaticSliceRefcount(81), + grpc_core::StaticSliceRefcount(82), + grpc_core::StaticSliceRefcount(83), + grpc_core::StaticSliceRefcount(84), + grpc_core::StaticSliceRefcount(85), + grpc_core::StaticSliceRefcount(86), + grpc_core::StaticSliceRefcount(87), + grpc_core::StaticSliceRefcount(88), + grpc_core::StaticSliceRefcount(89), + grpc_core::StaticSliceRefcount(90), + grpc_core::StaticSliceRefcount(91), + grpc_core::StaticSliceRefcount(92), + grpc_core::StaticSliceRefcount(93), + grpc_core::StaticSliceRefcount(94), + grpc_core::StaticSliceRefcount(95), + grpc_core::StaticSliceRefcount(96), + grpc_core::StaticSliceRefcount(97), + grpc_core::StaticSliceRefcount(98), + grpc_core::StaticSliceRefcount(99), + grpc_core::StaticSliceRefcount(100), + grpc_core::StaticSliceRefcount(101), + grpc_core::StaticSliceRefcount(102), + grpc_core::StaticSliceRefcount(103), + grpc_core::StaticSliceRefcount(104), + grpc_core::StaticSliceRefcount(105), + grpc_core::StaticSliceRefcount(106), + grpc_core::StaticSliceRefcount(107), }; -const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT] = { - {&grpc_static_metadata_refcounts[0], {{5, g_bytes + 0}}}, - {&grpc_static_metadata_refcounts[1], {{7, g_bytes + 5}}}, - {&grpc_static_metadata_refcounts[2], {{7, g_bytes + 12}}}, - {&grpc_static_metadata_refcounts[3], {{10, g_bytes + 19}}}, - {&grpc_static_metadata_refcounts[4], {{7, g_bytes + 29}}}, - {&grpc_static_metadata_refcounts[5], {{2, g_bytes + 36}}}, - {&grpc_static_metadata_refcounts[6], {{12, g_bytes + 38}}}, - {&grpc_static_metadata_refcounts[7], {{11, g_bytes + 50}}}, - {&grpc_static_metadata_refcounts[8], {{16, g_bytes + 61}}}, - {&grpc_static_metadata_refcounts[9], {{13, g_bytes + 77}}}, - {&grpc_static_metadata_refcounts[10], {{20, g_bytes + 90}}}, - {&grpc_static_metadata_refcounts[11], {{21, g_bytes + 110}}}, - {&grpc_static_metadata_refcounts[12], {{13, g_bytes + 131}}}, - {&grpc_static_metadata_refcounts[13], {{14, g_bytes + 144}}}, - {&grpc_static_metadata_refcounts[14], {{12, g_bytes + 158}}}, - {&grpc_static_metadata_refcounts[15], {{16, g_bytes + 170}}}, - {&grpc_static_metadata_refcounts[16], {{15, g_bytes + 186}}}, - {&grpc_static_metadata_refcounts[17], {{30, g_bytes + 201}}}, - {&grpc_static_metadata_refcounts[18], {{37, g_bytes + 231}}}, - {&grpc_static_metadata_refcounts[19], {{10, g_bytes + 268}}}, - {&grpc_static_metadata_refcounts[20], {{4, g_bytes + 278}}}, - {&grpc_static_metadata_refcounts[21], {{8, g_bytes + 282}}}, - {&grpc_static_metadata_refcounts[22], {{26, g_bytes + 290}}}, - {&grpc_static_metadata_refcounts[23], {{22, g_bytes + 316}}}, - {&grpc_static_metadata_refcounts[24], {{12, g_bytes + 338}}}, - {&grpc_static_metadata_refcounts[25], {{1, g_bytes + 350}}}, - {&grpc_static_metadata_refcounts[26], {{1, g_bytes + 351}}}, - {&grpc_static_metadata_refcounts[27], {{1, g_bytes + 352}}}, - {&grpc_static_metadata_refcounts[28], {{1, g_bytes + 353}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, - {&grpc_static_metadata_refcounts[30], {{19, g_bytes + 354}}}, - {&grpc_static_metadata_refcounts[31], {{12, g_bytes + 373}}}, - {&grpc_static_metadata_refcounts[32], {{30, g_bytes + 385}}}, - {&grpc_static_metadata_refcounts[33], {{31, g_bytes + 415}}}, - {&grpc_static_metadata_refcounts[34], {{36, g_bytes + 446}}}, - {&grpc_static_metadata_refcounts[35], {{28, g_bytes + 482}}}, - {&grpc_static_metadata_refcounts[36], {{80, g_bytes + 510}}}, - {&grpc_static_metadata_refcounts[37], {{7, g_bytes + 590}}}, - {&grpc_static_metadata_refcounts[38], {{4, g_bytes + 597}}}, - {&grpc_static_metadata_refcounts[39], {{11, g_bytes + 601}}}, - {&grpc_static_metadata_refcounts[40], {{3, g_bytes + 612}}}, - {&grpc_static_metadata_refcounts[41], {{4, g_bytes + 615}}}, - {&grpc_static_metadata_refcounts[42], {{1, g_bytes + 619}}}, - {&grpc_static_metadata_refcounts[43], {{11, g_bytes + 620}}}, - {&grpc_static_metadata_refcounts[44], {{4, g_bytes + 631}}}, - {&grpc_static_metadata_refcounts[45], {{5, g_bytes + 635}}}, - {&grpc_static_metadata_refcounts[46], {{3, g_bytes + 640}}}, - {&grpc_static_metadata_refcounts[47], {{3, g_bytes + 643}}}, - {&grpc_static_metadata_refcounts[48], {{3, g_bytes + 646}}}, - {&grpc_static_metadata_refcounts[49], {{3, g_bytes + 649}}}, - {&grpc_static_metadata_refcounts[50], {{3, g_bytes + 652}}}, - {&grpc_static_metadata_refcounts[51], {{3, g_bytes + 655}}}, - {&grpc_static_metadata_refcounts[52], {{3, g_bytes + 658}}}, - {&grpc_static_metadata_refcounts[53], {{14, g_bytes + 661}}}, - {&grpc_static_metadata_refcounts[54], {{13, g_bytes + 675}}}, - {&grpc_static_metadata_refcounts[55], {{15, g_bytes + 688}}}, - {&grpc_static_metadata_refcounts[56], {{13, g_bytes + 703}}}, - {&grpc_static_metadata_refcounts[57], {{6, g_bytes + 716}}}, - {&grpc_static_metadata_refcounts[58], {{27, g_bytes + 722}}}, - {&grpc_static_metadata_refcounts[59], {{3, g_bytes + 749}}}, - {&grpc_static_metadata_refcounts[60], {{5, g_bytes + 752}}}, - {&grpc_static_metadata_refcounts[61], {{13, g_bytes + 757}}}, - {&grpc_static_metadata_refcounts[62], {{13, g_bytes + 770}}}, - {&grpc_static_metadata_refcounts[63], {{19, g_bytes + 783}}}, - {&grpc_static_metadata_refcounts[64], {{16, g_bytes + 802}}}, - {&grpc_static_metadata_refcounts[65], {{14, g_bytes + 818}}}, - {&grpc_static_metadata_refcounts[66], {{16, g_bytes + 832}}}, - {&grpc_static_metadata_refcounts[67], {{13, g_bytes + 848}}}, - {&grpc_static_metadata_refcounts[68], {{6, g_bytes + 861}}}, - {&grpc_static_metadata_refcounts[69], {{4, g_bytes + 867}}}, - {&grpc_static_metadata_refcounts[70], {{4, g_bytes + 871}}}, - {&grpc_static_metadata_refcounts[71], {{6, g_bytes + 875}}}, - {&grpc_static_metadata_refcounts[72], {{7, g_bytes + 881}}}, - {&grpc_static_metadata_refcounts[73], {{4, g_bytes + 888}}}, - {&grpc_static_metadata_refcounts[74], {{8, g_bytes + 892}}}, - {&grpc_static_metadata_refcounts[75], {{17, g_bytes + 900}}}, - {&grpc_static_metadata_refcounts[76], {{13, g_bytes + 917}}}, - {&grpc_static_metadata_refcounts[77], {{8, g_bytes + 930}}}, - {&grpc_static_metadata_refcounts[78], {{19, g_bytes + 938}}}, - {&grpc_static_metadata_refcounts[79], {{13, g_bytes + 957}}}, - {&grpc_static_metadata_refcounts[80], {{4, g_bytes + 970}}}, - {&grpc_static_metadata_refcounts[81], {{8, g_bytes + 974}}}, - {&grpc_static_metadata_refcounts[82], {{12, g_bytes + 982}}}, - {&grpc_static_metadata_refcounts[83], {{18, g_bytes + 994}}}, - {&grpc_static_metadata_refcounts[84], {{19, g_bytes + 1012}}}, - {&grpc_static_metadata_refcounts[85], {{5, g_bytes + 1031}}}, - {&grpc_static_metadata_refcounts[86], {{7, g_bytes + 1036}}}, - {&grpc_static_metadata_refcounts[87], {{7, g_bytes + 1043}}}, - {&grpc_static_metadata_refcounts[88], {{11, g_bytes + 1050}}}, - {&grpc_static_metadata_refcounts[89], {{6, g_bytes + 1061}}}, - {&grpc_static_metadata_refcounts[90], {{10, g_bytes + 1067}}}, - {&grpc_static_metadata_refcounts[91], {{25, g_bytes + 1077}}}, - {&grpc_static_metadata_refcounts[92], {{17, g_bytes + 1102}}}, - {&grpc_static_metadata_refcounts[93], {{4, g_bytes + 1119}}}, - {&grpc_static_metadata_refcounts[94], {{3, g_bytes + 1123}}}, - {&grpc_static_metadata_refcounts[95], {{16, g_bytes + 1126}}}, - {&grpc_static_metadata_refcounts[96], {{1, g_bytes + 1142}}}, - {&grpc_static_metadata_refcounts[97], {{8, g_bytes + 1143}}}, - {&grpc_static_metadata_refcounts[98], {{8, g_bytes + 1151}}}, - {&grpc_static_metadata_refcounts[99], {{16, g_bytes + 1159}}}, - {&grpc_static_metadata_refcounts[100], {{4, g_bytes + 1175}}}, - {&grpc_static_metadata_refcounts[101], {{3, g_bytes + 1179}}}, - {&grpc_static_metadata_refcounts[102], {{11, g_bytes + 1182}}}, - {&grpc_static_metadata_refcounts[103], {{16, g_bytes + 1193}}}, - {&grpc_static_metadata_refcounts[104], {{13, g_bytes + 1209}}}, - {&grpc_static_metadata_refcounts[105], {{12, g_bytes + 1222}}}, - {&grpc_static_metadata_refcounts[106], {{21, g_bytes + 1234}}}, +const grpc_core::StaticMetadataSlice + grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT] = { + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[0].base, + 5, g_bytes + 0), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[1].base, + 7, g_bytes + 5), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[2].base, + 7, g_bytes + 12), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[3].base, + 10, g_bytes + 19), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[4].base, + 7, g_bytes + 29), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[5].base, + 2, g_bytes + 36), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[6].base, + 12, g_bytes + 38), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[7].base, + 11, g_bytes + 50), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[8].base, + 16, g_bytes + 61), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[9].base, + 13, g_bytes + 77), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[10].base, + 20, g_bytes + 90), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[11].base, + 21, g_bytes + 110), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[12].base, + 13, g_bytes + 131), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[13].base, + 14, g_bytes + 144), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[14].base, + 12, g_bytes + 158), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[15].base, + 16, g_bytes + 170), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[16].base, + 15, g_bytes + 186), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[17].base, + 30, g_bytes + 201), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[18].base, + 37, g_bytes + 231), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[19].base, + 10, g_bytes + 268), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[20].base, + 4, g_bytes + 278), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[21].base, + 26, g_bytes + 282), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[22].base, + 22, g_bytes + 308), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[23].base, + 12, g_bytes + 330), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[24].base, + 1, g_bytes + 342), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[25].base, + 1, g_bytes + 343), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[26].base, + 1, g_bytes + 344), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[27].base, + 1, g_bytes + 345), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[29].base, + 19, g_bytes + 346), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[30].base, + 12, g_bytes + 365), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[31].base, + 30, g_bytes + 377), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[32].base, + 31, g_bytes + 407), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[33].base, + 36, g_bytes + 438), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[34].base, + 65, g_bytes + 474), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[35].base, + 54, g_bytes + 539), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[36].base, + 28, g_bytes + 593), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[37].base, + 80, g_bytes + 621), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[38].base, + 7, g_bytes + 701), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[39].base, + 4, g_bytes + 708), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[40].base, + 11, g_bytes + 712), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[41].base, + 3, g_bytes + 723), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[42].base, + 4, g_bytes + 726), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[43].base, + 1, g_bytes + 730), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[44].base, + 11, g_bytes + 731), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[45].base, + 4, g_bytes + 742), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[46].base, + 5, g_bytes + 746), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[47].base, + 3, g_bytes + 751), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[48].base, + 3, g_bytes + 754), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[49].base, + 3, g_bytes + 757), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[50].base, + 3, g_bytes + 760), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[51].base, + 3, g_bytes + 763), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[52].base, + 3, g_bytes + 766), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[53].base, + 3, g_bytes + 769), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[54].base, + 14, g_bytes + 772), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[55].base, + 13, g_bytes + 786), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[56].base, + 15, g_bytes + 799), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[57].base, + 13, g_bytes + 814), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[58].base, + 6, g_bytes + 827), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[59].base, + 27, g_bytes + 833), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[60].base, + 3, g_bytes + 860), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[61].base, + 5, g_bytes + 863), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[62].base, + 13, g_bytes + 868), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[63].base, + 13, g_bytes + 881), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[64].base, + 19, g_bytes + 894), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[65].base, + 16, g_bytes + 913), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[66].base, + 14, g_bytes + 929), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[67].base, + 16, g_bytes + 943), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[68].base, + 13, g_bytes + 959), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[69].base, + 6, g_bytes + 972), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[70].base, + 4, g_bytes + 978), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[71].base, + 4, g_bytes + 982), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[72].base, + 6, g_bytes + 986), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[73].base, + 7, g_bytes + 992), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[74].base, + 4, g_bytes + 999), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[75].base, + 8, g_bytes + 1003), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[76].base, + 17, g_bytes + 1011), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[77].base, + 13, g_bytes + 1028), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[78].base, + 8, g_bytes + 1041), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[79].base, + 19, g_bytes + 1049), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[80].base, + 13, g_bytes + 1068), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[81].base, + 4, g_bytes + 1081), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[82].base, + 8, g_bytes + 1085), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[83].base, + 12, g_bytes + 1093), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[84].base, + 18, g_bytes + 1105), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[85].base, + 19, g_bytes + 1123), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[86].base, + 5, g_bytes + 1142), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[87].base, + 7, g_bytes + 1147), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[88].base, + 7, g_bytes + 1154), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[89].base, + 11, g_bytes + 1161), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[90].base, + 6, g_bytes + 1172), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[91].base, + 10, g_bytes + 1178), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[92].base, + 25, g_bytes + 1188), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[93].base, + 17, g_bytes + 1213), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[94].base, + 4, g_bytes + 1230), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[95].base, + 3, g_bytes + 1234), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[96].base, + 16, g_bytes + 1237), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[97].base, + 1, g_bytes + 1253), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[98].base, + 8, g_bytes + 1254), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[99].base, + 8, g_bytes + 1262), + grpc_core::StaticMetadataSlice( + &grpc_static_metadata_refcounts[100].base, 16, g_bytes + 1270), + grpc_core::StaticMetadataSlice( + &grpc_static_metadata_refcounts[101].base, 4, g_bytes + 1286), + grpc_core::StaticMetadataSlice( + &grpc_static_metadata_refcounts[102].base, 3, g_bytes + 1290), + grpc_core::StaticMetadataSlice( + &grpc_static_metadata_refcounts[103].base, 11, g_bytes + 1293), + grpc_core::StaticMetadataSlice( + &grpc_static_metadata_refcounts[104].base, 16, g_bytes + 1304), + grpc_core::StaticMetadataSlice( + &grpc_static_metadata_refcounts[105].base, 13, g_bytes + 1320), + grpc_core::StaticMetadataSlice( + &grpc_static_metadata_refcounts[106].base, 12, g_bytes + 1333), + grpc_core::StaticMetadataSlice( + &grpc_static_metadata_refcounts[107].base, 21, g_bytes + 1345), }; /* Warning: the core static metadata currently operates under the soft @@ -716,65 +836,60 @@ grpc_mdelem grpc_static_mdelem_manifested[GRPC_STATIC_MDELEM_COUNT] = { GRPC_MAKE_MDELEM( &grpc_static_mdelem_table[73].data(), GRPC_MDELEM_STORAGE_STATIC), - /* GRPC_MDELEM_LB_TOKEN_EMPTY: - "lb-token": "" */ - GRPC_MAKE_MDELEM( - &grpc_static_mdelem_table[74].data(), - GRPC_MDELEM_STORAGE_STATIC), /* GRPC_MDELEM_LB_COST_BIN_EMPTY: "lb-cost-bin": "" */ GRPC_MAKE_MDELEM( - &grpc_static_mdelem_table[75].data(), + &grpc_static_mdelem_table[74].data(), GRPC_MDELEM_STORAGE_STATIC), /* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY: "grpc-accept-encoding": "identity" */ GRPC_MAKE_MDELEM( - &grpc_static_mdelem_table[76].data(), + &grpc_static_mdelem_table[75].data(), GRPC_MDELEM_STORAGE_STATIC), /* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE: "grpc-accept-encoding": "deflate" */ GRPC_MAKE_MDELEM( - &grpc_static_mdelem_table[77].data(), + &grpc_static_mdelem_table[76].data(), GRPC_MDELEM_STORAGE_STATIC), /* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE: "grpc-accept-encoding": "identity,deflate" */ GRPC_MAKE_MDELEM( - &grpc_static_mdelem_table[78].data(), + &grpc_static_mdelem_table[77].data(), GRPC_MDELEM_STORAGE_STATIC), /* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_GZIP: "grpc-accept-encoding": "gzip" */ GRPC_MAKE_MDELEM( - &grpc_static_mdelem_table[79].data(), + &grpc_static_mdelem_table[78].data(), GRPC_MDELEM_STORAGE_STATIC), /* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP: "grpc-accept-encoding": "identity,gzip" */ GRPC_MAKE_MDELEM( - &grpc_static_mdelem_table[80].data(), + &grpc_static_mdelem_table[79].data(), GRPC_MDELEM_STORAGE_STATIC), /* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE_COMMA_GZIP: "grpc-accept-encoding": "deflate,gzip" */ GRPC_MAKE_MDELEM( - &grpc_static_mdelem_table[81].data(), + &grpc_static_mdelem_table[80].data(), GRPC_MDELEM_STORAGE_STATIC), /* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE_COMMA_GZIP: "grpc-accept-encoding": "identity,deflate,gzip" */ GRPC_MAKE_MDELEM( - &grpc_static_mdelem_table[82].data(), + &grpc_static_mdelem_table[81].data(), GRPC_MDELEM_STORAGE_STATIC), /* GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY: "accept-encoding": "identity" */ GRPC_MAKE_MDELEM( - &grpc_static_mdelem_table[83].data(), + &grpc_static_mdelem_table[82].data(), GRPC_MDELEM_STORAGE_STATIC), /* GRPC_MDELEM_ACCEPT_ENCODING_GZIP: "accept-encoding": "gzip" */ GRPC_MAKE_MDELEM( - &grpc_static_mdelem_table[84].data(), + &grpc_static_mdelem_table[83].data(), GRPC_MDELEM_STORAGE_STATIC), /* GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP: "accept-encoding": "identity,gzip" */ GRPC_MAKE_MDELEM( - &grpc_static_mdelem_table[85].data(), + &grpc_static_mdelem_table[84].data(), GRPC_MDELEM_STORAGE_STATIC) // clang-format on }; @@ -782,20 +897,20 @@ uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 6, 6, 8, 8, 2, 4, 4}; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 6, 6, 8, 8, 2, 4, 4}; static const int8_t elems_r[] = { - 15, 10, -8, 0, 2, -42, -81, -43, 0, 6, -8, 0, 0, 0, 2, - -3, -10, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -64, 0, -67, -68, -69, -70, 0, - 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, - 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, - 5, 4, 5, 4, 4, 8, 8, 0, 0, 0, 0, 0, 0, -5, 0}; + 15, 10, -8, 0, 2, -43, -80, -44, 0, 4, -8, 0, 0, 0, 6, -1, + -8, 0, 0, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -65, 0, -68, -69, -50, -72, -73, 0, 32, 31, + 30, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 17, + 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 4, 3, + 3, 7, 0, 0, 0, 0, 0, 0, -5, 0}; static uint32_t elems_phash(uint32_t i) { - i -= 42; - uint32_t x = i % 105; - uint32_t y = i / 105; + i -= 43; + uint32_t x = i % 106; + uint32_t y = i / 106; uint32_t h = x; if (y < GPR_ARRAY_SIZE(elems_r)) { uint32_t delta = (uint32_t)elems_r[y]; @@ -805,29 +920,29 @@ static uint32_t elems_phash(uint32_t i) { } static const uint16_t elem_keys[] = { - 260, 261, 262, 263, 264, 265, 266, 1107, 1108, 1741, 147, 148, - 472, 473, 1634, 42, 43, 1527, 1750, 1000, 1001, 774, 775, 1643, - 633, 845, 2062, 2169, 2276, 5700, 5914, 6021, 6128, 6235, 1766, 6342, - 6449, 6556, 6663, 6770, 6877, 6984, 7091, 7198, 7305, 7412, 7519, 7626, - 7733, 7840, 7947, 8054, 8161, 8268, 8375, 8482, 8589, 8696, 8803, 8910, - 9017, 9124, 9231, 9338, 9445, 9552, 9659, 1167, 528, 9766, 9873, 208, - 9980, 1173, 1174, 1175, 1176, 1809, 10087, 1060, 10194, 10943, 1702, 0, - 1816, 0, 0, 1597, 0, 0, 350, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0}; + 263, 264, 265, 266, 267, 268, 269, 1118, 1119, 1756, 149, 150, + 477, 478, 1648, 43, 44, 1010, 1011, 1540, 1767, 780, 781, 639, + 853, 1659, 2080, 2188, 5860, 6076, 6184, 6400, 6508, 6616, 6724, 6832, + 1783, 6940, 7048, 7156, 7264, 7372, 7480, 7588, 7696, 7804, 7912, 8020, + 8128, 8236, 8344, 6292, 8452, 8560, 8668, 8776, 8884, 8992, 9100, 9208, + 9316, 9424, 9532, 9640, 9748, 9856, 9964, 1178, 533, 10072, 10180, 210, + 10288, 1184, 1185, 1186, 1187, 1070, 10396, 1826, 11152, 0, 0, 0, + 1718, 0, 1833, 0, 0, 352, 0, 1612, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}; static const uint8_t elem_idxs[] = { - 7, 8, 9, 10, 11, 12, 13, 77, 79, 71, 1, 2, 5, 6, 25, 3, - 4, 30, 84, 66, 65, 62, 63, 73, 67, 61, 57, 37, 74, 14, 16, 17, - 18, 19, 15, 20, 21, 22, 23, 24, 26, 27, 28, 29, 31, 32, 33, 34, - 35, 36, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 76, 69, 55, 56, 70, 58, 78, 80, 81, 82, 83, 59, 64, - 60, 75, 72, 255, 85, 255, 255, 68, 255, 255, 0}; + 7, 8, 9, 10, 11, 12, 13, 76, 78, 71, 1, 2, 5, 6, 25, 3, + 4, 66, 65, 30, 83, 62, 63, 67, 61, 73, 57, 37, 14, 16, 17, 19, + 20, 21, 22, 23, 15, 24, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, + 38, 39, 40, 18, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 75, 69, 56, 58, 70, 59, 77, 79, 80, 81, 64, 60, 82, + 74, 255, 255, 255, 72, 255, 84, 255, 255, 0, 255, 68}; grpc_mdelem grpc_static_mdelem_for_static_strings(intptr_t a, intptr_t b) { if (a == -1 || b == -1) return GRPC_MDNULL; - uint32_t k = static_cast(a * 107 + b); + uint32_t k = static_cast(a * 108 + b); uint32_t h = elems_phash(k); return h < GPR_ARRAY_SIZE(elem_keys) && elem_keys[h] == k && elem_idxs[h] != 255 @@ -838,265 +953,517 @@ grpc_mdelem grpc_static_mdelem_for_static_strings(intptr_t a, intptr_t b) { grpc_core::StaticMetadata grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = { grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[3], {{10, g_bytes + 19}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 0), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[1], {{7, g_bytes + 5}}}, - {&grpc_static_metadata_refcounts[40], {{3, g_bytes + 612}}}, 1), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[1], {{7, g_bytes + 5}}}, - {&grpc_static_metadata_refcounts[41], {{4, g_bytes + 615}}}, 2), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[0], {{5, g_bytes + 0}}}, - {&grpc_static_metadata_refcounts[42], {{1, g_bytes + 619}}}, 3), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[0], {{5, g_bytes + 0}}}, - {&grpc_static_metadata_refcounts[43], {{11, g_bytes + 620}}}, 4), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[4], {{7, g_bytes + 29}}}, - {&grpc_static_metadata_refcounts[44], {{4, g_bytes + 631}}}, 5), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[4], {{7, g_bytes + 29}}}, - {&grpc_static_metadata_refcounts[45], {{5, g_bytes + 635}}}, 6), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[2], {{7, g_bytes + 12}}}, - {&grpc_static_metadata_refcounts[46], {{3, g_bytes + 640}}}, 7), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[2], {{7, g_bytes + 12}}}, - {&grpc_static_metadata_refcounts[47], {{3, g_bytes + 643}}}, 8), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[2], {{7, g_bytes + 12}}}, - {&grpc_static_metadata_refcounts[48], {{3, g_bytes + 646}}}, 9), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[2], {{7, g_bytes + 12}}}, - {&grpc_static_metadata_refcounts[49], {{3, g_bytes + 649}}}, 10), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[2], {{7, g_bytes + 12}}}, - {&grpc_static_metadata_refcounts[50], {{3, g_bytes + 652}}}, 11), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[2], {{7, g_bytes + 12}}}, - {&grpc_static_metadata_refcounts[51], {{3, g_bytes + 655}}}, 12), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[2], {{7, g_bytes + 12}}}, - {&grpc_static_metadata_refcounts[52], {{3, g_bytes + 658}}}, 13), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[53], {{14, g_bytes + 661}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 14), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[16], {{15, g_bytes + 186}}}, - {&grpc_static_metadata_refcounts[54], {{13, g_bytes + 675}}}, 15), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[55], {{15, g_bytes + 688}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 16), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[56], {{13, g_bytes + 703}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 17), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[57], {{6, g_bytes + 716}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 18), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[58], {{27, g_bytes + 722}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 19), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[59], {{3, g_bytes + 749}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 20), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[60], {{5, g_bytes + 752}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 21), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[61], {{13, g_bytes + 757}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 22), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[62], {{13, g_bytes + 770}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 23), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[63], {{19, g_bytes + 783}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 24), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[15], {{16, g_bytes + 170}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 25), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[64], {{16, g_bytes + 802}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 26), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[65], {{14, g_bytes + 818}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 27), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[66], {{16, g_bytes + 832}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 28), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[67], {{13, g_bytes + 848}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 29), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[14], {{12, g_bytes + 158}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 30), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[68], {{6, g_bytes + 861}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 31), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[69], {{4, g_bytes + 867}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 32), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[70], {{4, g_bytes + 871}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 33), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[71], {{6, g_bytes + 875}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 34), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[72], {{7, g_bytes + 881}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 35), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[73], {{4, g_bytes + 888}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 36), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[20], {{4, g_bytes + 278}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 37), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[74], {{8, g_bytes + 892}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 38), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[75], {{17, g_bytes + 900}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 39), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[76], {{13, g_bytes + 917}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 40), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[77], {{8, g_bytes + 930}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 41), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[78], {{19, g_bytes + 938}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 42), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[79], {{13, g_bytes + 957}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 43), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[80], {{4, g_bytes + 970}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 44), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[81], {{8, g_bytes + 974}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 45), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[82], {{12, g_bytes + 982}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 46), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[83], {{18, g_bytes + 994}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 47), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[84], {{19, g_bytes + 1012}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 48), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[85], {{5, g_bytes + 1031}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 49), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[86], {{7, g_bytes + 1036}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 50), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[87], {{7, g_bytes + 1043}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 51), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[88], {{11, g_bytes + 1050}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 52), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[89], {{6, g_bytes + 1061}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 53), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[90], {{10, g_bytes + 1067}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 54), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[91], {{25, g_bytes + 1077}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 55), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[92], {{17, g_bytes + 1102}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 56), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[19], {{10, g_bytes + 268}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 57), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[93], {{4, g_bytes + 1119}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 58), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[94], {{3, g_bytes + 1123}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 59), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[95], {{16, g_bytes + 1126}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 60), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[7], {{11, g_bytes + 50}}}, - {&grpc_static_metadata_refcounts[96], {{1, g_bytes + 1142}}}, 61), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[7], {{11, g_bytes + 50}}}, - {&grpc_static_metadata_refcounts[25], {{1, g_bytes + 350}}}, 62), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[7], {{11, g_bytes + 50}}}, - {&grpc_static_metadata_refcounts[26], {{1, g_bytes + 351}}}, 63), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[9], {{13, g_bytes + 77}}}, - {&grpc_static_metadata_refcounts[97], {{8, g_bytes + 1143}}}, 64), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[9], {{13, g_bytes + 77}}}, - {&grpc_static_metadata_refcounts[38], {{4, g_bytes + 597}}}, 65), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[9], {{13, g_bytes + 77}}}, - {&grpc_static_metadata_refcounts[37], {{7, g_bytes + 590}}}, 66), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[5], {{2, g_bytes + 36}}}, - {&grpc_static_metadata_refcounts[98], {{8, g_bytes + 1151}}}, 67), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[14], {{12, g_bytes + 158}}}, - {&grpc_static_metadata_refcounts[99], {{16, g_bytes + 1159}}}, 68), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[4], {{7, g_bytes + 29}}}, - {&grpc_static_metadata_refcounts[100], {{4, g_bytes + 1175}}}, 69), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[1], {{7, g_bytes + 5}}}, - {&grpc_static_metadata_refcounts[101], {{3, g_bytes + 1179}}}, 70), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[16], {{15, g_bytes + 186}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 71), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[15], {{16, g_bytes + 170}}}, - {&grpc_static_metadata_refcounts[97], {{8, g_bytes + 1143}}}, 72), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[15], {{16, g_bytes + 170}}}, - {&grpc_static_metadata_refcounts[38], {{4, g_bytes + 597}}}, 73), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[21], {{8, g_bytes + 282}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 74), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[102], {{11, g_bytes + 1182}}}, - {&grpc_static_metadata_refcounts[29], {{0, g_bytes + 354}}}, 75), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[10], {{20, g_bytes + 90}}}, - {&grpc_static_metadata_refcounts[97], {{8, g_bytes + 1143}}}, 76), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[10], {{20, g_bytes + 90}}}, - {&grpc_static_metadata_refcounts[37], {{7, g_bytes + 590}}}, 77), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[10], {{20, g_bytes + 90}}}, - {&grpc_static_metadata_refcounts[103], {{16, g_bytes + 1193}}}, 78), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[10], {{20, g_bytes + 90}}}, - {&grpc_static_metadata_refcounts[38], {{4, g_bytes + 597}}}, 79), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[10], {{20, g_bytes + 90}}}, - {&grpc_static_metadata_refcounts[104], {{13, g_bytes + 1209}}}, 80), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[10], {{20, g_bytes + 90}}}, - {&grpc_static_metadata_refcounts[105], {{12, g_bytes + 1222}}}, 81), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[10], {{20, g_bytes + 90}}}, - {&grpc_static_metadata_refcounts[106], {{21, g_bytes + 1234}}}, 82), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[16], {{15, g_bytes + 186}}}, - {&grpc_static_metadata_refcounts[97], {{8, g_bytes + 1143}}}, 83), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[16], {{15, g_bytes + 186}}}, - {&grpc_static_metadata_refcounts[38], {{4, g_bytes + 597}}}, 84), - grpc_core::StaticMetadata( - {&grpc_static_metadata_refcounts[16], {{15, g_bytes + 186}}}, - {&grpc_static_metadata_refcounts[104], {{13, g_bytes + 1209}}}, 85), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[3].base, + 10, g_bytes + 19), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 0), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[1].base, + 7, g_bytes + 5), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[41].base, + 3, g_bytes + 723), + 1), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[1].base, + 7, g_bytes + 5), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[42].base, + 4, g_bytes + 726), + 2), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[0].base, + 5, g_bytes + 0), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[43].base, + 1, g_bytes + 730), + 3), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[0].base, + 5, g_bytes + 0), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[44].base, + 11, g_bytes + 731), + 4), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[4].base, + 7, g_bytes + 29), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[45].base, + 4, g_bytes + 742), + 5), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[4].base, + 7, g_bytes + 29), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[46].base, + 5, g_bytes + 746), + 6), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[2].base, + 7, g_bytes + 12), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[47].base, + 3, g_bytes + 751), + 7), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[2].base, + 7, g_bytes + 12), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[48].base, + 3, g_bytes + 754), + 8), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[2].base, + 7, g_bytes + 12), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[49].base, + 3, g_bytes + 757), + 9), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[2].base, + 7, g_bytes + 12), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[50].base, + 3, g_bytes + 760), + 10), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[2].base, + 7, g_bytes + 12), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[51].base, + 3, g_bytes + 763), + 11), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[2].base, + 7, g_bytes + 12), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[52].base, + 3, g_bytes + 766), + 12), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[2].base, + 7, g_bytes + 12), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[53].base, + 3, g_bytes + 769), + 13), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[54].base, + 14, g_bytes + 772), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 14), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[16].base, + 15, g_bytes + 186), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[55].base, + 13, g_bytes + 786), + 15), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[56].base, + 15, g_bytes + 799), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 16), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[57].base, + 13, g_bytes + 814), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 17), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[58].base, + 6, g_bytes + 827), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 18), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[59].base, + 27, g_bytes + 833), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 19), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[60].base, + 3, g_bytes + 860), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 20), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[61].base, + 5, g_bytes + 863), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 21), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[62].base, + 13, g_bytes + 868), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 22), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[63].base, + 13, g_bytes + 881), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 23), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[64].base, + 19, g_bytes + 894), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 24), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[15].base, + 16, g_bytes + 170), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 25), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[65].base, + 16, g_bytes + 913), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 26), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[66].base, + 14, g_bytes + 929), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 27), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[67].base, + 16, g_bytes + 943), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 28), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[68].base, + 13, g_bytes + 959), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 29), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[14].base, + 12, g_bytes + 158), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 30), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[69].base, + 6, g_bytes + 972), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 31), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[70].base, + 4, g_bytes + 978), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 32), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[71].base, + 4, g_bytes + 982), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 33), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[72].base, + 6, g_bytes + 986), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 34), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[73].base, + 7, g_bytes + 992), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 35), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[74].base, + 4, g_bytes + 999), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 36), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[20].base, + 4, g_bytes + 278), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 37), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[75].base, + 8, g_bytes + 1003), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 38), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[76].base, + 17, g_bytes + 1011), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 39), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[77].base, + 13, g_bytes + 1028), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 40), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[78].base, + 8, g_bytes + 1041), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 41), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[79].base, + 19, g_bytes + 1049), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 42), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[80].base, + 13, g_bytes + 1068), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 43), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[81].base, + 4, g_bytes + 1081), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 44), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[82].base, + 8, g_bytes + 1085), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 45), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[83].base, + 12, g_bytes + 1093), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 46), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[84].base, + 18, g_bytes + 1105), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 47), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[85].base, + 19, g_bytes + 1123), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 48), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[86].base, + 5, g_bytes + 1142), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 49), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[87].base, + 7, g_bytes + 1147), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 50), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[88].base, + 7, g_bytes + 1154), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 51), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[89].base, + 11, g_bytes + 1161), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 52), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[90].base, + 6, g_bytes + 1172), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 53), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[91].base, + 10, g_bytes + 1178), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 54), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[92].base, + 25, g_bytes + 1188), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 55), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[93].base, + 17, g_bytes + 1213), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 56), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[19].base, + 10, g_bytes + 268), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 57), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[94].base, + 4, g_bytes + 1230), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 58), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[95].base, + 3, g_bytes + 1234), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 59), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[96].base, + 16, g_bytes + 1237), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 60), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[7].base, + 11, g_bytes + 50), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[97].base, + 1, g_bytes + 1253), + 61), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[7].base, + 11, g_bytes + 50), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[24].base, + 1, g_bytes + 342), + 62), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[7].base, + 11, g_bytes + 50), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[25].base, + 1, g_bytes + 343), + 63), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[9].base, + 13, g_bytes + 77), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[98].base, + 8, g_bytes + 1254), + 64), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[9].base, + 13, g_bytes + 77), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[39].base, + 4, g_bytes + 708), + 65), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[9].base, + 13, g_bytes + 77), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[38].base, + 7, g_bytes + 701), + 66), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[5].base, + 2, g_bytes + 36), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[99].base, + 8, g_bytes + 1262), + 67), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[14].base, + 12, g_bytes + 158), + grpc_core::StaticMetadataSlice( + &grpc_static_metadata_refcounts[100].base, 16, g_bytes + 1270), + 68), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[4].base, + 7, g_bytes + 29), + grpc_core::StaticMetadataSlice( + &grpc_static_metadata_refcounts[101].base, 4, g_bytes + 1286), + 69), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[1].base, + 7, g_bytes + 5), + grpc_core::StaticMetadataSlice( + &grpc_static_metadata_refcounts[102].base, 3, g_bytes + 1290), + 70), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[16].base, + 15, g_bytes + 186), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 71), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[15].base, + 16, g_bytes + 170), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[98].base, + 8, g_bytes + 1254), + 72), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[15].base, + 16, g_bytes + 170), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[39].base, + 4, g_bytes + 708), + 73), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice( + &grpc_static_metadata_refcounts[103].base, 11, g_bytes + 1293), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[28].base, + 0, g_bytes + 346), + 74), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[10].base, + 20, g_bytes + 90), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[98].base, + 8, g_bytes + 1254), + 75), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[10].base, + 20, g_bytes + 90), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[38].base, + 7, g_bytes + 701), + 76), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[10].base, + 20, g_bytes + 90), + grpc_core::StaticMetadataSlice( + &grpc_static_metadata_refcounts[104].base, 16, g_bytes + 1304), + 77), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[10].base, + 20, g_bytes + 90), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[39].base, + 4, g_bytes + 708), + 78), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[10].base, + 20, g_bytes + 90), + grpc_core::StaticMetadataSlice( + &grpc_static_metadata_refcounts[105].base, 13, g_bytes + 1320), + 79), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[10].base, + 20, g_bytes + 90), + grpc_core::StaticMetadataSlice( + &grpc_static_metadata_refcounts[106].base, 12, g_bytes + 1333), + 80), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[10].base, + 20, g_bytes + 90), + grpc_core::StaticMetadataSlice( + &grpc_static_metadata_refcounts[107].base, 21, g_bytes + 1345), + 81), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[16].base, + 15, g_bytes + 186), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[98].base, + 8, g_bytes + 1254), + 82), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[16].base, + 15, g_bytes + 186), + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[39].base, + 4, g_bytes + 708), + 83), + grpc_core::StaticMetadata( + grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[16].base, + 15, g_bytes + 186), + grpc_core::StaticMetadataSlice( + &grpc_static_metadata_refcounts[105].base, 13, g_bytes + 1320), + 84), }; -const uint8_t grpc_static_accept_encoding_metadata[8] = {0, 76, 77, 78, - 79, 80, 81, 82}; +const uint8_t grpc_static_accept_encoding_metadata[8] = {0, 75, 76, 77, + 78, 79, 80, 81}; -const uint8_t grpc_static_accept_stream_encoding_metadata[4] = {0, 83, 84, 85}; +const uint8_t grpc_static_accept_stream_encoding_metadata[4] = {0, 82, 83, 84}; diff --git a/src/core/lib/transport/static_metadata.h b/src/core/lib/transport/static_metadata.h index 458e87d30a7..7ea000e1066 100644 --- a/src/core/lib/transport/static_metadata.h +++ b/src/core/lib/transport/static_metadata.h @@ -33,8 +33,12 @@ #include "src/core/lib/transport/metadata.h" -#define GRPC_STATIC_MDSTR_COUNT 107 -extern const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT]; +static_assert( + std::is_trivially_destructible::value, + "grpc_core::StaticMetadataSlice must be trivially destructible."); +#define GRPC_STATIC_MDSTR_COUNT 108 +extern const grpc_core::StaticMetadataSlice + grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT]; /* ":path" */ #define GRPC_MDSTR_PATH (grpc_static_slice_table[0]) /* ":method" */ @@ -78,197 +82,204 @@ extern const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT]; #define GRPC_MDSTR_USER_AGENT (grpc_static_slice_table[19]) /* "host" */ #define GRPC_MDSTR_HOST (grpc_static_slice_table[20]) -/* "lb-token" */ -#define GRPC_MDSTR_LB_TOKEN (grpc_static_slice_table[21]) /* "grpc-previous-rpc-attempts" */ -#define GRPC_MDSTR_GRPC_PREVIOUS_RPC_ATTEMPTS (grpc_static_slice_table[22]) +#define GRPC_MDSTR_GRPC_PREVIOUS_RPC_ATTEMPTS (grpc_static_slice_table[21]) /* "grpc-retry-pushback-ms" */ -#define GRPC_MDSTR_GRPC_RETRY_PUSHBACK_MS (grpc_static_slice_table[23]) +#define GRPC_MDSTR_GRPC_RETRY_PUSHBACK_MS (grpc_static_slice_table[22]) /* "grpc-timeout" */ -#define GRPC_MDSTR_GRPC_TIMEOUT (grpc_static_slice_table[24]) +#define GRPC_MDSTR_GRPC_TIMEOUT (grpc_static_slice_table[23]) /* "1" */ -#define GRPC_MDSTR_1 (grpc_static_slice_table[25]) +#define GRPC_MDSTR_1 (grpc_static_slice_table[24]) /* "2" */ -#define GRPC_MDSTR_2 (grpc_static_slice_table[26]) +#define GRPC_MDSTR_2 (grpc_static_slice_table[25]) /* "3" */ -#define GRPC_MDSTR_3 (grpc_static_slice_table[27]) +#define GRPC_MDSTR_3 (grpc_static_slice_table[26]) /* "4" */ -#define GRPC_MDSTR_4 (grpc_static_slice_table[28]) +#define GRPC_MDSTR_4 (grpc_static_slice_table[27]) /* "" */ -#define GRPC_MDSTR_EMPTY (grpc_static_slice_table[29]) +#define GRPC_MDSTR_EMPTY (grpc_static_slice_table[28]) /* "grpc.wait_for_ready" */ -#define GRPC_MDSTR_GRPC_DOT_WAIT_FOR_READY (grpc_static_slice_table[30]) +#define GRPC_MDSTR_GRPC_DOT_WAIT_FOR_READY (grpc_static_slice_table[29]) /* "grpc.timeout" */ -#define GRPC_MDSTR_GRPC_DOT_TIMEOUT (grpc_static_slice_table[31]) +#define GRPC_MDSTR_GRPC_DOT_TIMEOUT (grpc_static_slice_table[30]) /* "grpc.max_request_message_bytes" */ #define GRPC_MDSTR_GRPC_DOT_MAX_REQUEST_MESSAGE_BYTES \ - (grpc_static_slice_table[32]) + (grpc_static_slice_table[31]) /* "grpc.max_response_message_bytes" */ #define GRPC_MDSTR_GRPC_DOT_MAX_RESPONSE_MESSAGE_BYTES \ - (grpc_static_slice_table[33]) + (grpc_static_slice_table[32]) /* "/grpc.lb.v1.LoadBalancer/BalanceLoad" */ #define GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD \ + (grpc_static_slice_table[33]) +/* "/envoy.service.load_stats.v2.LoadReportingService/StreamLoadStats" */ +#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V2_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS \ (grpc_static_slice_table[34]) +/* "/envoy.api.v2.EndpointDiscoveryService/StreamEndpoints" */ +#define GRPC_MDSTR_SLASH_ENVOY_DOT_API_DOT_V2_DOT_ENDPOINTDISCOVERYSERVICE_SLASH_STREAMENDPOINTS \ + (grpc_static_slice_table[35]) /* "/grpc.health.v1.Health/Watch" */ #define GRPC_MDSTR_SLASH_GRPC_DOT_HEALTH_DOT_V1_DOT_HEALTH_SLASH_WATCH \ - (grpc_static_slice_table[35]) + (grpc_static_slice_table[36]) /* "/envoy.service.discovery.v2.AggregatedDiscoveryService/StreamAggregatedResources" */ #define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V2_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES \ - (grpc_static_slice_table[36]) + (grpc_static_slice_table[37]) /* "deflate" */ -#define GRPC_MDSTR_DEFLATE (grpc_static_slice_table[37]) +#define GRPC_MDSTR_DEFLATE (grpc_static_slice_table[38]) /* "gzip" */ -#define GRPC_MDSTR_GZIP (grpc_static_slice_table[38]) +#define GRPC_MDSTR_GZIP (grpc_static_slice_table[39]) /* "stream/gzip" */ -#define GRPC_MDSTR_STREAM_SLASH_GZIP (grpc_static_slice_table[39]) +#define GRPC_MDSTR_STREAM_SLASH_GZIP (grpc_static_slice_table[40]) /* "GET" */ -#define GRPC_MDSTR_GET (grpc_static_slice_table[40]) +#define GRPC_MDSTR_GET (grpc_static_slice_table[41]) /* "POST" */ -#define GRPC_MDSTR_POST (grpc_static_slice_table[41]) +#define GRPC_MDSTR_POST (grpc_static_slice_table[42]) /* "/" */ -#define GRPC_MDSTR_SLASH (grpc_static_slice_table[42]) +#define GRPC_MDSTR_SLASH (grpc_static_slice_table[43]) /* "/index.html" */ -#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table[43]) +#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table[44]) /* "http" */ -#define GRPC_MDSTR_HTTP (grpc_static_slice_table[44]) +#define GRPC_MDSTR_HTTP (grpc_static_slice_table[45]) /* "https" */ -#define GRPC_MDSTR_HTTPS (grpc_static_slice_table[45]) +#define GRPC_MDSTR_HTTPS (grpc_static_slice_table[46]) /* "200" */ -#define GRPC_MDSTR_200 (grpc_static_slice_table[46]) +#define GRPC_MDSTR_200 (grpc_static_slice_table[47]) /* "204" */ -#define GRPC_MDSTR_204 (grpc_static_slice_table[47]) +#define GRPC_MDSTR_204 (grpc_static_slice_table[48]) /* "206" */ -#define GRPC_MDSTR_206 (grpc_static_slice_table[48]) +#define GRPC_MDSTR_206 (grpc_static_slice_table[49]) /* "304" */ -#define GRPC_MDSTR_304 (grpc_static_slice_table[49]) +#define GRPC_MDSTR_304 (grpc_static_slice_table[50]) /* "400" */ -#define GRPC_MDSTR_400 (grpc_static_slice_table[50]) +#define GRPC_MDSTR_400 (grpc_static_slice_table[51]) /* "404" */ -#define GRPC_MDSTR_404 (grpc_static_slice_table[51]) +#define GRPC_MDSTR_404 (grpc_static_slice_table[52]) /* "500" */ -#define GRPC_MDSTR_500 (grpc_static_slice_table[52]) +#define GRPC_MDSTR_500 (grpc_static_slice_table[53]) /* "accept-charset" */ -#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table[53]) +#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table[54]) /* "gzip, deflate" */ -#define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table[54]) +#define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table[55]) /* "accept-language" */ -#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table[55]) +#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table[56]) /* "accept-ranges" */ -#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table[56]) +#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table[57]) /* "accept" */ -#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table[57]) +#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table[58]) /* "access-control-allow-origin" */ -#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table[58]) +#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table[59]) /* "age" */ -#define GRPC_MDSTR_AGE (grpc_static_slice_table[59]) +#define GRPC_MDSTR_AGE (grpc_static_slice_table[60]) /* "allow" */ -#define GRPC_MDSTR_ALLOW (grpc_static_slice_table[60]) +#define GRPC_MDSTR_ALLOW (grpc_static_slice_table[61]) /* "authorization" */ -#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table[61]) +#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table[62]) /* "cache-control" */ -#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table[62]) +#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table[63]) /* "content-disposition" */ -#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table[63]) +#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table[64]) /* "content-language" */ -#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table[64]) +#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table[65]) /* "content-length" */ -#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table[65]) +#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table[66]) /* "content-location" */ -#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table[66]) +#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table[67]) /* "content-range" */ -#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table[67]) +#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table[68]) /* "cookie" */ -#define GRPC_MDSTR_COOKIE (grpc_static_slice_table[68]) +#define GRPC_MDSTR_COOKIE (grpc_static_slice_table[69]) /* "date" */ -#define GRPC_MDSTR_DATE (grpc_static_slice_table[69]) +#define GRPC_MDSTR_DATE (grpc_static_slice_table[70]) /* "etag" */ -#define GRPC_MDSTR_ETAG (grpc_static_slice_table[70]) +#define GRPC_MDSTR_ETAG (grpc_static_slice_table[71]) /* "expect" */ -#define GRPC_MDSTR_EXPECT (grpc_static_slice_table[71]) +#define GRPC_MDSTR_EXPECT (grpc_static_slice_table[72]) /* "expires" */ -#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table[72]) +#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table[73]) /* "from" */ -#define GRPC_MDSTR_FROM (grpc_static_slice_table[73]) +#define GRPC_MDSTR_FROM (grpc_static_slice_table[74]) /* "if-match" */ -#define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table[74]) +#define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table[75]) /* "if-modified-since" */ -#define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table[75]) +#define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table[76]) /* "if-none-match" */ -#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table[76]) +#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table[77]) /* "if-range" */ -#define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table[77]) +#define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table[78]) /* "if-unmodified-since" */ -#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table[78]) +#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table[79]) /* "last-modified" */ -#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table[79]) +#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table[80]) /* "link" */ -#define GRPC_MDSTR_LINK (grpc_static_slice_table[80]) +#define GRPC_MDSTR_LINK (grpc_static_slice_table[81]) /* "location" */ -#define GRPC_MDSTR_LOCATION (grpc_static_slice_table[81]) +#define GRPC_MDSTR_LOCATION (grpc_static_slice_table[82]) /* "max-forwards" */ -#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table[82]) +#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table[83]) /* "proxy-authenticate" */ -#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table[83]) +#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table[84]) /* "proxy-authorization" */ -#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table[84]) +#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table[85]) /* "range" */ -#define GRPC_MDSTR_RANGE (grpc_static_slice_table[85]) +#define GRPC_MDSTR_RANGE (grpc_static_slice_table[86]) /* "referer" */ -#define GRPC_MDSTR_REFERER (grpc_static_slice_table[86]) +#define GRPC_MDSTR_REFERER (grpc_static_slice_table[87]) /* "refresh" */ -#define GRPC_MDSTR_REFRESH (grpc_static_slice_table[87]) +#define GRPC_MDSTR_REFRESH (grpc_static_slice_table[88]) /* "retry-after" */ -#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table[88]) +#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table[89]) /* "server" */ -#define GRPC_MDSTR_SERVER (grpc_static_slice_table[89]) +#define GRPC_MDSTR_SERVER (grpc_static_slice_table[90]) /* "set-cookie" */ -#define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table[90]) +#define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table[91]) /* "strict-transport-security" */ -#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table[91]) +#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table[92]) /* "transfer-encoding" */ -#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table[92]) +#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table[93]) /* "vary" */ -#define GRPC_MDSTR_VARY (grpc_static_slice_table[93]) +#define GRPC_MDSTR_VARY (grpc_static_slice_table[94]) /* "via" */ -#define GRPC_MDSTR_VIA (grpc_static_slice_table[94]) +#define GRPC_MDSTR_VIA (grpc_static_slice_table[95]) /* "www-authenticate" */ -#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table[95]) +#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table[96]) /* "0" */ -#define GRPC_MDSTR_0 (grpc_static_slice_table[96]) +#define GRPC_MDSTR_0 (grpc_static_slice_table[97]) /* "identity" */ -#define GRPC_MDSTR_IDENTITY (grpc_static_slice_table[97]) +#define GRPC_MDSTR_IDENTITY (grpc_static_slice_table[98]) /* "trailers" */ -#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table[98]) +#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table[99]) /* "application/grpc" */ -#define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table[99]) +#define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table[100]) /* "grpc" */ -#define GRPC_MDSTR_GRPC (grpc_static_slice_table[100]) +#define GRPC_MDSTR_GRPC (grpc_static_slice_table[101]) /* "PUT" */ -#define GRPC_MDSTR_PUT (grpc_static_slice_table[101]) +#define GRPC_MDSTR_PUT (grpc_static_slice_table[102]) /* "lb-cost-bin" */ -#define GRPC_MDSTR_LB_COST_BIN (grpc_static_slice_table[102]) +#define GRPC_MDSTR_LB_COST_BIN (grpc_static_slice_table[103]) /* "identity,deflate" */ -#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table[103]) +#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table[104]) /* "identity,gzip" */ -#define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table[104]) +#define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table[105]) /* "deflate,gzip" */ -#define GRPC_MDSTR_DEFLATE_COMMA_GZIP (grpc_static_slice_table[105]) +#define GRPC_MDSTR_DEFLATE_COMMA_GZIP (grpc_static_slice_table[106]) /* "identity,deflate,gzip" */ #define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \ - (grpc_static_slice_table[106]) + (grpc_static_slice_table[107]) -extern grpc_slice_refcount +namespace grpc_core { +struct StaticSliceRefcount; +} +extern grpc_core::StaticSliceRefcount grpc_static_metadata_refcounts[GRPC_STATIC_MDSTR_COUNT]; #define GRPC_IS_STATIC_METADATA_STRING(slice) \ ((slice).refcount != NULL && \ (slice).refcount->GetType() == grpc_slice_refcount::Type::STATIC) -#define GRPC_STATIC_METADATA_INDEX(static_slice) \ - (static_cast( \ - ((static_slice).refcount - grpc_static_metadata_refcounts))) +#define GRPC_STATIC_METADATA_INDEX(static_slice) \ + (reinterpret_cast((static_slice).refcount) \ + ->index) -#define GRPC_STATIC_MDELEM_COUNT 86 +#define GRPC_STATIC_MDELEM_COUNT 85 extern grpc_core::StaticMetadata grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT]; extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; @@ -429,38 +440,36 @@ extern grpc_mdelem grpc_static_mdelem_manifested[GRPC_STATIC_MDELEM_COUNT]; (grpc_static_mdelem_manifested[72]) /* "content-encoding": "gzip" */ #define GRPC_MDELEM_CONTENT_ENCODING_GZIP (grpc_static_mdelem_manifested[73]) -/* "lb-token": "" */ -#define GRPC_MDELEM_LB_TOKEN_EMPTY (grpc_static_mdelem_manifested[74]) /* "lb-cost-bin": "" */ -#define GRPC_MDELEM_LB_COST_BIN_EMPTY (grpc_static_mdelem_manifested[75]) +#define GRPC_MDELEM_LB_COST_BIN_EMPTY (grpc_static_mdelem_manifested[74]) /* "grpc-accept-encoding": "identity" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY \ - (grpc_static_mdelem_manifested[76]) + (grpc_static_mdelem_manifested[75]) /* "grpc-accept-encoding": "deflate" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE \ - (grpc_static_mdelem_manifested[77]) + (grpc_static_mdelem_manifested[76]) /* "grpc-accept-encoding": "identity,deflate" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE \ - (grpc_static_mdelem_manifested[78]) + (grpc_static_mdelem_manifested[77]) /* "grpc-accept-encoding": "gzip" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_GZIP \ - (grpc_static_mdelem_manifested[79]) + (grpc_static_mdelem_manifested[78]) /* "grpc-accept-encoding": "identity,gzip" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP \ - (grpc_static_mdelem_manifested[80]) + (grpc_static_mdelem_manifested[79]) /* "grpc-accept-encoding": "deflate,gzip" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE_COMMA_GZIP \ - (grpc_static_mdelem_manifested[81]) + (grpc_static_mdelem_manifested[80]) /* "grpc-accept-encoding": "identity,deflate,gzip" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \ - (grpc_static_mdelem_manifested[82]) + (grpc_static_mdelem_manifested[81]) /* "accept-encoding": "identity" */ -#define GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY (grpc_static_mdelem_manifested[83]) +#define GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY (grpc_static_mdelem_manifested[82]) /* "accept-encoding": "gzip" */ -#define GRPC_MDELEM_ACCEPT_ENCODING_GZIP (grpc_static_mdelem_manifested[84]) +#define GRPC_MDELEM_ACCEPT_ENCODING_GZIP (grpc_static_mdelem_manifested[83]) /* "accept-encoding": "identity,gzip" */ #define GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP \ - (grpc_static_mdelem_manifested[85]) + (grpc_static_mdelem_manifested[84]) grpc_mdelem grpc_static_mdelem_for_static_strings(intptr_t a, intptr_t b); typedef enum { @@ -485,7 +494,6 @@ typedef enum { GRPC_BATCH_GRPC_INTERNAL_STREAM_ENCODING_REQUEST, GRPC_BATCH_USER_AGENT, GRPC_BATCH_HOST, - GRPC_BATCH_LB_TOKEN, GRPC_BATCH_GRPC_PREVIOUS_RPC_ATTEMPTS, GRPC_BATCH_GRPC_RETRY_PUSHBACK_MS, GRPC_BATCH_CALLOUTS_COUNT @@ -515,17 +523,19 @@ typedef union { struct grpc_linked_mdelem* grpc_internal_stream_encoding_request; struct grpc_linked_mdelem* user_agent; struct grpc_linked_mdelem* host; - struct grpc_linked_mdelem* lb_token; struct grpc_linked_mdelem* grpc_previous_rpc_attempts; struct grpc_linked_mdelem* grpc_retry_pushback_ms; } named; } grpc_metadata_batch_callouts; -#define GRPC_BATCH_INDEX_OF(slice) \ - (GRPC_IS_STATIC_METADATA_STRING((slice)) \ - ? static_cast( \ - GPR_CLAMP(GRPC_STATIC_METADATA_INDEX((slice)), 0, \ - static_cast(GRPC_BATCH_CALLOUTS_COUNT))) \ +#define GRPC_BATCH_INDEX_OF(slice) \ + (GRPC_IS_STATIC_METADATA_STRING((slice)) && \ + reinterpret_cast((slice).refcount) \ + ->index <= static_cast(GRPC_BATCH_CALLOUTS_COUNT) \ + ? static_cast( \ + reinterpret_cast( \ + (slice).refcount) \ + ->index) \ : GRPC_BATCH_CALLOUTS_COUNT) extern const uint8_t grpc_static_accept_encoding_metadata[8]; diff --git a/src/core/lib/transport/transport.h b/src/core/lib/transport/transport.h index 17608f4bc60..c40b290d535 100644 --- a/src/core/lib/transport/transport.h +++ b/src/core/lib/transport/transport.h @@ -245,6 +245,18 @@ struct grpc_transport_stream_op_batch_payload { // The batch's on_complete will not be called until after the byte // stream is orphaned. grpc_core::OrphanablePtr send_message; + // Set by the transport if the stream has been closed for writes. If this + // is set and send message op is present, we set the operation to be a + // failure without sending a cancel OP down the stack. This is so that the + // status of the call does not get overwritten by the Cancel OP, which would + // be especially problematic if we had received a valid status from the + // server. + // For send_initial_metadata, it is fine for the status to be overwritten + // because at that point, the client will not have received a status. + // For send_trailing_metadata, we might overwrite the status if we have + // non-zero metadata to send. This is fine because the API does not allow + // the client to send trailing metadata. + bool stream_write_closed = false; } send_message; struct { diff --git a/src/core/plugin_registry/grpc_plugin_registry.cc b/src/core/plugin_registry/grpc_plugin_registry.cc index 9b011d8df0f..ebe3def245a 100644 --- a/src/core/plugin_registry/grpc_plugin_registry.cc +++ b/src/core/plugin_registry/grpc_plugin_registry.cc @@ -46,6 +46,8 @@ void grpc_resolver_dns_native_init(void); void grpc_resolver_dns_native_shutdown(void); void grpc_resolver_sockaddr_init(void); void grpc_resolver_sockaddr_shutdown(void); +void grpc_resolver_xds_init(void); +void grpc_resolver_xds_shutdown(void); void grpc_client_idle_filter_init(void); void grpc_client_idle_filter_shutdown(void); void grpc_max_age_filter_init(void); @@ -84,6 +86,8 @@ void grpc_register_built_in_plugins(void) { grpc_resolver_dns_native_shutdown); grpc_register_plugin(grpc_resolver_sockaddr_init, grpc_resolver_sockaddr_shutdown); + grpc_register_plugin(grpc_resolver_xds_init, + grpc_resolver_xds_shutdown); grpc_register_plugin(grpc_client_idle_filter_init, grpc_client_idle_filter_shutdown); grpc_register_plugin(grpc_max_age_filter_init, diff --git a/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc index 055c3ccc134..6668836f02f 100644 --- a/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc +++ b/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc @@ -38,6 +38,8 @@ void grpc_resolver_sockaddr_init(void); void grpc_resolver_sockaddr_shutdown(void); void grpc_resolver_fake_init(void); void grpc_resolver_fake_shutdown(void); +void grpc_resolver_xds_init(void); +void grpc_resolver_xds_shutdown(void); void grpc_lb_policy_grpclb_init(void); void grpc_lb_policy_grpclb_shutdown(void); void grpc_lb_policy_xds_init(void); @@ -76,6 +78,8 @@ void grpc_register_built_in_plugins(void) { grpc_resolver_sockaddr_shutdown); grpc_register_plugin(grpc_resolver_fake_init, grpc_resolver_fake_shutdown); + grpc_register_plugin(grpc_resolver_xds_init, + grpc_resolver_xds_shutdown); grpc_register_plugin(grpc_lb_policy_grpclb_init, grpc_lb_policy_grpclb_shutdown); grpc_register_plugin(grpc_lb_policy_xds_init, diff --git a/src/core/tsi/alts/handshaker/alts_handshaker_client.cc b/src/core/tsi/alts/handshaker/alts_handshaker_client.cc index 464de9e00d0..55fd066dba5 100644 --- a/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +++ b/src/core/tsi/alts/handshaker/alts_handshaker_client.cc @@ -27,7 +27,6 @@ #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/surface/call.h" #include "src/core/lib/surface/channel.h" -#include "src/core/tsi/alts/handshaker/alts_handshaker_service_api.h" #include "src/core/tsi/alts/handshaker/alts_shared_resource.h" #include "src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h" #include "src/core/tsi/alts/handshaker/alts_tsi_utils.h" @@ -91,9 +90,9 @@ static void handshaker_client_send_buffer_destroy( client->send_buffer = nullptr; } -static bool is_handshake_finished_properly(grpc_gcp_handshaker_resp* resp) { +static bool is_handshake_finished_properly(grpc_gcp_HandshakerResp* resp) { GPR_ASSERT(resp != nullptr); - if (resp->has_result) { + if (grpc_gcp_HandshakerResp_result(resp)) { return true; } return false; @@ -140,8 +139,9 @@ void alts_handshaker_client_handle_response(alts_handshaker_client* c, cb(TSI_INTERNAL_ERROR, user_data, nullptr, 0, nullptr); return; } - grpc_gcp_handshaker_resp* resp = - alts_tsi_utils_deserialize_response(recv_buffer); + upb::Arena arena; + grpc_gcp_HandshakerResp* resp = + alts_tsi_utils_deserialize_response(recv_buffer, arena.ptr()); grpc_byte_buffer_destroy(client->recv_buffer); client->recv_buffer = nullptr; /* Invalid handshaker response check. */ @@ -150,35 +150,44 @@ void alts_handshaker_client_handle_response(alts_handshaker_client* c, cb(TSI_DATA_CORRUPTED, user_data, nullptr, 0, nullptr); return; } - grpc_slice* slice = static_cast(resp->out_frames.arg); + const grpc_gcp_HandshakerStatus* resp_status = + grpc_gcp_HandshakerResp_status(resp); + if (resp_status == nullptr) { + gpr_log(GPR_ERROR, "No status in HandshakerResp"); + cb(TSI_DATA_CORRUPTED, user_data, nullptr, 0, nullptr); + return; + } + upb_strview out_frames = grpc_gcp_HandshakerResp_out_frames(resp); unsigned char* bytes_to_send = nullptr; size_t bytes_to_send_size = 0; - if (slice != nullptr) { - bytes_to_send_size = GRPC_SLICE_LENGTH(*slice); + if (out_frames.size > 0) { + bytes_to_send_size = out_frames.size; while (bytes_to_send_size > client->buffer_size) { client->buffer_size *= 2; client->buffer = static_cast( gpr_realloc(client->buffer, client->buffer_size)); } - memcpy(client->buffer, GRPC_SLICE_START_PTR(*slice), bytes_to_send_size); + memcpy(client->buffer, out_frames.data, bytes_to_send_size); bytes_to_send = client->buffer; } tsi_handshaker_result* result = nullptr; if (is_handshake_finished_properly(resp)) { alts_tsi_handshaker_result_create(resp, client->is_client, &result); - alts_tsi_handshaker_result_set_unused_bytes(result, &client->recv_bytes, - resp->bytes_consumed); + alts_tsi_handshaker_result_set_unused_bytes( + result, &client->recv_bytes, + grpc_gcp_HandshakerResp_bytes_consumed(resp)); } - grpc_status_code code = static_cast(resp->status.code); + grpc_status_code code = static_cast( + grpc_gcp_HandshakerStatus_code(resp_status)); if (code != GRPC_STATUS_OK) { - grpc_slice* details = static_cast(resp->status.details.arg); - if (details != nullptr) { - char* error_details = grpc_slice_to_c_string(*details); + upb_strview details = grpc_gcp_HandshakerStatus_details(resp_status); + if (details.size > 0) { + char* error_details = (char*)gpr_zalloc(details.size + 1); + memcpy(error_details, details.data, details.size); gpr_log(GPR_ERROR, "Error from handshaker service:%s", error_details); gpr_free(error_details); } } - grpc_gcp_handshaker_resp_destroy(resp); cb(alts_tsi_utils_convert_to_tsi_result(code), user_data, bytes_to_send, bytes_to_send_size, result); } @@ -223,43 +232,59 @@ static tsi_result make_grpc_call(alts_handshaker_client* c, bool is_start) { return TSI_OK; } +/* Serializes a grpc_gcp_HandshakerReq message into a buffer and returns newly + * grpc_byte_buffer holding it. */ +static grpc_byte_buffer* get_serialized_handshaker_req( + grpc_gcp_HandshakerReq* req, upb_arena* arena) { + size_t buf_length; + char* buf = grpc_gcp_HandshakerReq_serialize(req, arena, &buf_length); + if (buf == nullptr) { + return nullptr; + } + grpc_slice slice = grpc_slice_from_copied_buffer(buf, buf_length); + grpc_byte_buffer* byte_buffer = grpc_raw_byte_buffer_create(&slice, 1); + grpc_slice_unref_internal(slice); + return byte_buffer; +} + /* Create and populate a client_start handshaker request, then serialize it. */ static grpc_byte_buffer* get_serialized_start_client( alts_handshaker_client* c) { GPR_ASSERT(c != nullptr); alts_grpc_handshaker_client* client = reinterpret_cast(c); - bool ok = true; - grpc_gcp_handshaker_req* req = - grpc_gcp_handshaker_req_create(CLIENT_START_REQ); - ok &= grpc_gcp_handshaker_req_set_handshake_protocol( - req, grpc_gcp_HandshakeProtocol_ALTS); - ok &= grpc_gcp_handshaker_req_add_application_protocol( - req, ALTS_APPLICATION_PROTOCOL); - ok &= grpc_gcp_handshaker_req_add_record_protocol(req, ALTS_RECORD_PROTOCOL); - grpc_gcp_rpc_protocol_versions* versions = &client->options->rpc_versions; - ok &= grpc_gcp_handshaker_req_set_rpc_versions( - req, versions->max_rpc_version.major, versions->max_rpc_version.minor, - versions->min_rpc_version.major, versions->min_rpc_version.minor); - char* target_name = grpc_slice_to_c_string(client->target_name); - ok &= grpc_gcp_handshaker_req_set_target_name(req, target_name); + upb::Arena arena; + grpc_gcp_HandshakerReq* req = grpc_gcp_HandshakerReq_new(arena.ptr()); + grpc_gcp_StartClientHandshakeReq* start_client = + grpc_gcp_HandshakerReq_mutable_client_start(req, arena.ptr()); + grpc_gcp_StartClientHandshakeReq_set_handshake_security_protocol( + start_client, grpc_gcp_ALTS); + grpc_gcp_StartClientHandshakeReq_add_application_protocols( + start_client, upb_strview_makez(ALTS_APPLICATION_PROTOCOL), arena.ptr()); + grpc_gcp_StartClientHandshakeReq_add_record_protocols( + start_client, upb_strview_makez(ALTS_RECORD_PROTOCOL), arena.ptr()); + grpc_gcp_RpcProtocolVersions* client_version = + grpc_gcp_StartClientHandshakeReq_mutable_rpc_versions(start_client, + arena.ptr()); + grpc_gcp_RpcProtocolVersions_assign_from_struct( + client_version, arena.ptr(), &client->options->rpc_versions); + grpc_gcp_StartClientHandshakeReq_set_target_name( + start_client, + upb_strview_make(reinterpret_cast( + GRPC_SLICE_START_PTR(client->target_name)), + GRPC_SLICE_LENGTH(client->target_name))); target_service_account* ptr = (reinterpret_cast(client->options)) ->target_account_list_head; while (ptr != nullptr) { - grpc_gcp_handshaker_req_add_target_identity_service_account(req, ptr->data); + grpc_gcp_Identity* target_identity = + grpc_gcp_StartClientHandshakeReq_add_target_identities(start_client, + arena.ptr()); + grpc_gcp_Identity_set_service_account(target_identity, + upb_strview_makez(ptr->data)); ptr = ptr->next; } - grpc_slice slice; - ok &= grpc_gcp_handshaker_req_encode(req, &slice); - grpc_byte_buffer* buffer = nullptr; - if (ok) { - buffer = grpc_raw_byte_buffer_create(&slice, 1 /* number of slices */); - } - grpc_slice_unref_internal(slice); - gpr_free(target_name); - grpc_gcp_handshaker_req_destroy(req); - return buffer; + return get_serialized_handshaker_req(req, arena.ptr()); } static tsi_result handshaker_client_start_client(alts_handshaker_client* c) { @@ -290,28 +315,35 @@ static grpc_byte_buffer* get_serialized_start_server( GPR_ASSERT(bytes_received != nullptr); alts_grpc_handshaker_client* client = reinterpret_cast(c); - grpc_gcp_handshaker_req* req = - grpc_gcp_handshaker_req_create(SERVER_START_REQ); - bool ok = grpc_gcp_handshaker_req_add_application_protocol( - req, ALTS_APPLICATION_PROTOCOL); - ok &= grpc_gcp_handshaker_req_param_add_record_protocol( - req, grpc_gcp_HandshakeProtocol_ALTS, ALTS_RECORD_PROTOCOL); - ok &= grpc_gcp_handshaker_req_set_in_bytes( - req, reinterpret_cast GRPC_SLICE_START_PTR(*bytes_received), - GRPC_SLICE_LENGTH(*bytes_received)); - grpc_gcp_rpc_protocol_versions* versions = &client->options->rpc_versions; - ok &= grpc_gcp_handshaker_req_set_rpc_versions( - req, versions->max_rpc_version.major, versions->max_rpc_version.minor, - versions->min_rpc_version.major, versions->min_rpc_version.minor); - grpc_slice req_slice; - ok &= grpc_gcp_handshaker_req_encode(req, &req_slice); - grpc_byte_buffer* buffer = nullptr; - if (ok) { - buffer = grpc_raw_byte_buffer_create(&req_slice, 1 /* number of slices */); - } - grpc_slice_unref_internal(req_slice); - grpc_gcp_handshaker_req_destroy(req); - return buffer; + + upb::Arena arena; + grpc_gcp_HandshakerReq* req = grpc_gcp_HandshakerReq_new(arena.ptr()); + + grpc_gcp_StartServerHandshakeReq* start_server = + grpc_gcp_HandshakerReq_mutable_server_start(req, arena.ptr()); + grpc_gcp_StartServerHandshakeReq_add_application_protocols( + start_server, upb_strview_makez(ALTS_APPLICATION_PROTOCOL), arena.ptr()); + grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry* param = + grpc_gcp_StartServerHandshakeReq_add_handshake_parameters(start_server, + arena.ptr()); + grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_set_key( + param, grpc_gcp_ALTS); + grpc_gcp_ServerHandshakeParameters* value = + grpc_gcp_ServerHandshakeParameters_new(arena.ptr()); + grpc_gcp_ServerHandshakeParameters_add_record_protocols( + value, upb_strview_makez(ALTS_RECORD_PROTOCOL), arena.ptr()); + grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_set_value(param, + value); + grpc_gcp_StartServerHandshakeReq_set_in_bytes( + start_server, upb_strview_make(reinterpret_cast( + GRPC_SLICE_START_PTR(*bytes_received)), + GRPC_SLICE_LENGTH(*bytes_received))); + grpc_gcp_RpcProtocolVersions* server_version = + grpc_gcp_StartServerHandshakeReq_mutable_rpc_versions(start_server, + arena.ptr()); + grpc_gcp_RpcProtocolVersions_assign_from_struct( + server_version, arena.ptr(), &client->options->rpc_versions); + return get_serialized_handshaker_req(req, arena.ptr()); } static tsi_result handshaker_client_start_server(alts_handshaker_client* c, @@ -339,19 +371,15 @@ static tsi_result handshaker_client_start_server(alts_handshaker_client* c, /* Create and populate a next handshaker request, then serialize it. */ static grpc_byte_buffer* get_serialized_next(grpc_slice* bytes_received) { GPR_ASSERT(bytes_received != nullptr); - grpc_gcp_handshaker_req* req = grpc_gcp_handshaker_req_create(NEXT_REQ); - bool ok = grpc_gcp_handshaker_req_set_in_bytes( - req, reinterpret_cast GRPC_SLICE_START_PTR(*bytes_received), - GRPC_SLICE_LENGTH(*bytes_received)); - grpc_slice req_slice; - ok &= grpc_gcp_handshaker_req_encode(req, &req_slice); - grpc_byte_buffer* buffer = nullptr; - if (ok) { - buffer = grpc_raw_byte_buffer_create(&req_slice, 1 /* number of slices */); - } - grpc_slice_unref_internal(req_slice); - grpc_gcp_handshaker_req_destroy(req); - return buffer; + upb::Arena arena; + grpc_gcp_HandshakerReq* req = grpc_gcp_HandshakerReq_new(arena.ptr()); + grpc_gcp_NextHandshakeMessageReq* next = + grpc_gcp_HandshakerReq_mutable_next(req, arena.ptr()); + grpc_gcp_NextHandshakeMessageReq_set_in_bytes( + next, upb_strview_make(reinterpret_cast GRPC_SLICE_START_PTR( + *bytes_received), + GRPC_SLICE_LENGTH(*bytes_received))); + return get_serialized_handshaker_req(req, arena.ptr()); } static tsi_result handshaker_client_next(alts_handshaker_client* c, diff --git a/src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc b/src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc deleted file mode 100644 index 256e414ae43..00000000000 --- a/src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc +++ /dev/null @@ -1,520 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include - -#include "src/core/tsi/alts/handshaker/alts_handshaker_service_api.h" - -#include -#include - -#include "src/core/tsi/alts/handshaker/transport_security_common_api.h" - -/* HandshakerReq */ -grpc_gcp_handshaker_req* grpc_gcp_handshaker_req_create( - grpc_gcp_handshaker_req_type type) { - grpc_gcp_handshaker_req* req = - static_cast(gpr_zalloc(sizeof(*req))); - switch (type) { - case CLIENT_START_REQ: - req->has_client_start = true; - break; - case SERVER_START_REQ: - req->has_server_start = true; - break; - case NEXT_REQ: - req->has_next = true; - break; - } - return req; -} - -void grpc_gcp_handshaker_req_destroy(grpc_gcp_handshaker_req* req) { - if (req == nullptr) { - return; - } - if (req->has_client_start) { - /* Destroy client_start request. */ - destroy_repeated_field_list_identity( - static_cast(req->client_start.target_identities.arg)); - destroy_repeated_field_list_string(static_cast( - req->client_start.application_protocols.arg)); - destroy_repeated_field_list_string( - static_cast(req->client_start.record_protocols.arg)); - if (req->client_start.has_local_identity) { - destroy_slice(static_cast( - req->client_start.local_identity.hostname.arg)); - destroy_slice(static_cast( - req->client_start.local_identity.service_account.arg)); - } - if (req->client_start.has_local_endpoint) { - destroy_slice(static_cast( - req->client_start.local_endpoint.ip_address.arg)); - } - if (req->client_start.has_remote_endpoint) { - destroy_slice(static_cast( - req->client_start.remote_endpoint.ip_address.arg)); - } - destroy_slice(static_cast(req->client_start.target_name.arg)); - } else if (req->has_server_start) { - /* Destroy server_start request. */ - size_t i = 0; - for (i = 0; i < req->server_start.handshake_parameters_count; i++) { - destroy_repeated_field_list_identity( - static_cast(req->server_start.handshake_parameters[i] - .value.local_identities.arg)); - destroy_repeated_field_list_string( - static_cast(req->server_start.handshake_parameters[i] - .value.record_protocols.arg)); - } - destroy_repeated_field_list_string(static_cast( - req->server_start.application_protocols.arg)); - if (req->server_start.has_local_endpoint) { - destroy_slice(static_cast( - req->server_start.local_endpoint.ip_address.arg)); - } - if (req->server_start.has_remote_endpoint) { - destroy_slice(static_cast( - req->server_start.remote_endpoint.ip_address.arg)); - } - destroy_slice(static_cast(req->server_start.in_bytes.arg)); - } else { - /* Destroy next request. */ - destroy_slice(static_cast(req->next.in_bytes.arg)); - } - gpr_free(req); -} - -bool grpc_gcp_handshaker_req_set_handshake_protocol( - grpc_gcp_handshaker_req* req, - grpc_gcp_handshake_protocol handshake_protocol) { - if (req == nullptr || !req->has_client_start) { - gpr_log(GPR_ERROR, - "Invalid arguments to " - "grpc_gcp_handshaker_req_set_handshake_protocol()."); - return false; - } - req->client_start.has_handshake_security_protocol = true; - req->client_start.handshake_security_protocol = handshake_protocol; - return true; -} - -bool grpc_gcp_handshaker_req_set_target_name(grpc_gcp_handshaker_req* req, - const char* target_name) { - if (req == nullptr || target_name == nullptr || !req->has_client_start) { - gpr_log(GPR_ERROR, - "Invalid arguments to " - "grpc_gcp_handshaker_req_set_target_name()."); - return false; - } - grpc_slice* slice = create_slice(target_name, strlen(target_name)); - req->client_start.target_name.arg = slice; - req->client_start.target_name.funcs.encode = encode_string_or_bytes_cb; - return true; -} - -bool grpc_gcp_handshaker_req_add_application_protocol( - grpc_gcp_handshaker_req* req, const char* application_protocol) { - if (req == nullptr || application_protocol == nullptr || req->has_next) { - gpr_log(GPR_ERROR, - "Invalid arguments to " - "grpc_gcp_handshaker_req_add_application_protocol()."); - return false; - } - grpc_slice* slice = - create_slice(application_protocol, strlen(application_protocol)); - if (req->has_client_start) { - add_repeated_field(reinterpret_cast( - &req->client_start.application_protocols.arg), - slice); - req->client_start.application_protocols.funcs.encode = - encode_repeated_string_cb; - } else { - add_repeated_field(reinterpret_cast( - &req->server_start.application_protocols.arg), - slice); - req->server_start.application_protocols.funcs.encode = - encode_repeated_string_cb; - } - return true; -} - -bool grpc_gcp_handshaker_req_add_record_protocol(grpc_gcp_handshaker_req* req, - const char* record_protocol) { - if (req == nullptr || record_protocol == nullptr || !req->has_client_start) { - gpr_log(GPR_ERROR, - "Invalid arguments to " - "grpc_gcp_handshaker_req_add_record_protocol()."); - return false; - } - grpc_slice* slice = create_slice(record_protocol, strlen(record_protocol)); - add_repeated_field(reinterpret_cast( - &req->client_start.record_protocols.arg), - slice); - req->client_start.record_protocols.funcs.encode = encode_repeated_string_cb; - return true; -} - -static void set_identity_hostname(grpc_gcp_identity* identity, - const char* hostname) { - grpc_slice* slice = create_slice(hostname, strlen(hostname)); - identity->hostname.arg = slice; - identity->hostname.funcs.encode = encode_string_or_bytes_cb; -} - -static void set_identity_service_account(grpc_gcp_identity* identity, - const char* service_account) { - grpc_slice* slice = create_slice(service_account, strlen(service_account)); - identity->service_account.arg = slice; - identity->service_account.funcs.encode = encode_string_or_bytes_cb; -} - -bool grpc_gcp_handshaker_req_add_target_identity_hostname( - grpc_gcp_handshaker_req* req, const char* hostname) { - if (req == nullptr || hostname == nullptr || !req->has_client_start) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to " - "grpc_gcp_handshaker_req_add_target_identity_hostname()."); - return false; - } - grpc_gcp_identity* target_identity = - static_cast(gpr_zalloc(sizeof(*target_identity))); - set_identity_hostname(target_identity, hostname); - req->client_start.target_identities.funcs.encode = - encode_repeated_identity_cb; - add_repeated_field(reinterpret_cast( - &req->client_start.target_identities.arg), - target_identity); - return true; -} - -bool grpc_gcp_handshaker_req_add_target_identity_service_account( - grpc_gcp_handshaker_req* req, const char* service_account) { - if (req == nullptr || service_account == nullptr || !req->has_client_start) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to " - "grpc_gcp_handshaker_req_add_target_identity_service_account()."); - return false; - } - grpc_gcp_identity* target_identity = - static_cast(gpr_zalloc(sizeof(*target_identity))); - set_identity_service_account(target_identity, service_account); - req->client_start.target_identities.funcs.encode = - encode_repeated_identity_cb; - add_repeated_field(reinterpret_cast( - &req->client_start.target_identities.arg), - target_identity); - return true; -} - -bool grpc_gcp_handshaker_req_set_local_identity_hostname( - grpc_gcp_handshaker_req* req, const char* hostname) { - if (req == nullptr || hostname == nullptr || !req->has_client_start) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to " - "grpc_gcp_handshaker_req_set_local_identity_hostname()."); - return false; - } - req->client_start.has_local_identity = true; - set_identity_hostname(&req->client_start.local_identity, hostname); - return true; -} - -bool grpc_gcp_handshaker_req_set_local_identity_service_account( - grpc_gcp_handshaker_req* req, const char* service_account) { - if (req == nullptr || service_account == nullptr || !req->has_client_start) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to " - "grpc_gcp_handshaker_req_set_local_identity_service_account()."); - return false; - } - req->client_start.has_local_identity = true; - set_identity_service_account(&req->client_start.local_identity, - service_account); - return true; -} - -static void set_endpoint(grpc_gcp_endpoint* endpoint, const char* ip_address, - size_t port, grpc_gcp_network_protocol protocol) { - grpc_slice* slice = create_slice(ip_address, strlen(ip_address)); - endpoint->ip_address.arg = slice; - endpoint->ip_address.funcs.encode = encode_string_or_bytes_cb; - endpoint->has_port = true; - endpoint->port = static_cast(port); - endpoint->has_protocol = true; - endpoint->protocol = protocol; -} - -bool grpc_gcp_handshaker_req_set_rpc_versions(grpc_gcp_handshaker_req* req, - uint32_t max_major, - uint32_t max_minor, - uint32_t min_major, - uint32_t min_minor) { - if (req == nullptr || req->has_next) { - gpr_log(GPR_ERROR, - "Invalid arguments to " - "grpc_gcp_handshaker_req_set_rpc_versions()."); - return false; - } - if (req->has_client_start) { - req->client_start.has_rpc_versions = true; - grpc_gcp_rpc_protocol_versions_set_max(&req->client_start.rpc_versions, - max_major, max_minor); - grpc_gcp_rpc_protocol_versions_set_min(&req->client_start.rpc_versions, - min_major, min_minor); - } else { - req->server_start.has_rpc_versions = true; - grpc_gcp_rpc_protocol_versions_set_max(&req->server_start.rpc_versions, - max_major, max_minor); - grpc_gcp_rpc_protocol_versions_set_min(&req->server_start.rpc_versions, - min_major, min_minor); - } - return true; -} - -bool grpc_gcp_handshaker_req_set_local_endpoint( - grpc_gcp_handshaker_req* req, const char* ip_address, size_t port, - grpc_gcp_network_protocol protocol) { - if (req == nullptr || ip_address == nullptr || port > 65535 || - req->has_next) { - gpr_log(GPR_ERROR, - "Invalid arguments to " - "grpc_gcp_handshaker_req_set_local_endpoint()."); - return false; - } - if (req->has_client_start) { - req->client_start.has_local_endpoint = true; - set_endpoint(&req->client_start.local_endpoint, ip_address, port, protocol); - } else { - req->server_start.has_local_endpoint = true; - set_endpoint(&req->server_start.local_endpoint, ip_address, port, protocol); - } - return true; -} - -bool grpc_gcp_handshaker_req_set_remote_endpoint( - grpc_gcp_handshaker_req* req, const char* ip_address, size_t port, - grpc_gcp_network_protocol protocol) { - if (req == nullptr || ip_address == nullptr || port > 65535 || - req->has_next) { - gpr_log(GPR_ERROR, - "Invalid arguments to " - "grpc_gcp_handshaker_req_set_remote_endpoint()."); - return false; - } - if (req->has_client_start) { - req->client_start.has_remote_endpoint = true; - set_endpoint(&req->client_start.remote_endpoint, ip_address, port, - protocol); - } else { - req->server_start.has_remote_endpoint = true; - set_endpoint(&req->server_start.remote_endpoint, ip_address, port, - protocol); - } - return true; -} - -bool grpc_gcp_handshaker_req_set_in_bytes(grpc_gcp_handshaker_req* req, - const char* in_bytes, size_t size) { - if (req == nullptr || in_bytes == nullptr || req->has_client_start) { - gpr_log(GPR_ERROR, - "Invalid arguments to " - "grpc_gcp_handshaker_req_set_in_bytes()."); - return false; - } - grpc_slice* slice = create_slice(in_bytes, size); - if (req->has_next) { - req->next.in_bytes.arg = slice; - req->next.in_bytes.funcs.encode = &encode_string_or_bytes_cb; - } else { - req->server_start.in_bytes.arg = slice; - req->server_start.in_bytes.funcs.encode = &encode_string_or_bytes_cb; - } - return true; -} - -static grpc_gcp_server_handshake_parameters* server_start_find_param( - grpc_gcp_handshaker_req* req, int32_t key) { - size_t i = 0; - for (i = 0; i < req->server_start.handshake_parameters_count; i++) { - if (req->server_start.handshake_parameters[i].key == key) { - return &req->server_start.handshake_parameters[i].value; - } - } - req->server_start - .handshake_parameters[req->server_start.handshake_parameters_count] - .has_key = true; - req->server_start - .handshake_parameters[req->server_start.handshake_parameters_count] - .has_value = true; - req->server_start - .handshake_parameters[req->server_start.handshake_parameters_count++] - .key = key; - return &req->server_start - .handshake_parameters - [req->server_start.handshake_parameters_count - 1] - .value; -} - -bool grpc_gcp_handshaker_req_param_add_record_protocol( - grpc_gcp_handshaker_req* req, grpc_gcp_handshake_protocol key, - const char* record_protocol) { - if (req == nullptr || record_protocol == nullptr || !req->has_server_start) { - gpr_log(GPR_ERROR, - "Invalid arguments to " - "grpc_gcp_handshaker_req_param_add_record_protocol()."); - return false; - } - grpc_gcp_server_handshake_parameters* param = - server_start_find_param(req, key); - grpc_slice* slice = create_slice(record_protocol, strlen(record_protocol)); - add_repeated_field( - reinterpret_cast(¶m->record_protocols.arg), slice); - param->record_protocols.funcs.encode = &encode_repeated_string_cb; - return true; -} - -bool grpc_gcp_handshaker_req_param_add_local_identity_hostname( - grpc_gcp_handshaker_req* req, grpc_gcp_handshake_protocol key, - const char* hostname) { - if (req == nullptr || hostname == nullptr || !req->has_server_start) { - gpr_log(GPR_ERROR, - "Invalid arguments to " - "grpc_gcp_handshaker_req_param_add_local_identity_hostname()."); - return false; - } - grpc_gcp_server_handshake_parameters* param = - server_start_find_param(req, key); - grpc_gcp_identity* local_identity = - static_cast(gpr_zalloc(sizeof(*local_identity))); - set_identity_hostname(local_identity, hostname); - add_repeated_field( - reinterpret_cast(¶m->local_identities.arg), - local_identity); - param->local_identities.funcs.encode = &encode_repeated_identity_cb; - return true; -} - -bool grpc_gcp_handshaker_req_param_add_local_identity_service_account( - grpc_gcp_handshaker_req* req, grpc_gcp_handshake_protocol key, - const char* service_account) { - if (req == nullptr || service_account == nullptr || !req->has_server_start) { - gpr_log( - GPR_ERROR, - "Invalid arguments to " - "grpc_gcp_handshaker_req_param_add_local_identity_service_account()."); - return false; - } - grpc_gcp_server_handshake_parameters* param = - server_start_find_param(req, key); - grpc_gcp_identity* local_identity = - static_cast(gpr_zalloc(sizeof(*local_identity))); - set_identity_service_account(local_identity, service_account); - add_repeated_field( - reinterpret_cast(¶m->local_identities.arg), - local_identity); - param->local_identities.funcs.encode = &encode_repeated_identity_cb; - return true; -} - -bool grpc_gcp_handshaker_req_encode(grpc_gcp_handshaker_req* req, - grpc_slice* slice) { - if (req == nullptr || slice == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to grpc_gcp_handshaker_req_encode()."); - return false; - } - pb_ostream_t size_stream; - memset(&size_stream, 0, sizeof(pb_ostream_t)); - if (!pb_encode(&size_stream, grpc_gcp_HandshakerReq_fields, req)) { - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&size_stream)); - return false; - } - size_t encoded_length = size_stream.bytes_written; - *slice = grpc_slice_malloc(encoded_length); - pb_ostream_t output_stream = - pb_ostream_from_buffer(GRPC_SLICE_START_PTR(*slice), encoded_length); - if (!pb_encode(&output_stream, grpc_gcp_HandshakerReq_fields, req) != 0) { - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&output_stream)); - return false; - } - return true; -} - -/* HandshakerResp. */ -grpc_gcp_handshaker_resp* grpc_gcp_handshaker_resp_create(void) { - grpc_gcp_handshaker_resp* resp = - static_cast(gpr_zalloc(sizeof(*resp))); - return resp; -} - -void grpc_gcp_handshaker_resp_destroy(grpc_gcp_handshaker_resp* resp) { - if (resp != nullptr) { - destroy_slice(static_cast(resp->out_frames.arg)); - if (resp->has_status) { - destroy_slice(static_cast(resp->status.details.arg)); - } - if (resp->has_result) { - destroy_slice( - static_cast(resp->result.application_protocol.arg)); - destroy_slice(static_cast(resp->result.record_protocol.arg)); - destroy_slice(static_cast(resp->result.key_data.arg)); - if (resp->result.has_local_identity) { - destroy_slice( - static_cast(resp->result.local_identity.hostname.arg)); - destroy_slice(static_cast( - resp->result.local_identity.service_account.arg)); - } - if (resp->result.has_peer_identity) { - destroy_slice( - static_cast(resp->result.peer_identity.hostname.arg)); - destroy_slice(static_cast( - resp->result.peer_identity.service_account.arg)); - } - } - gpr_free(resp); - } -} - -bool grpc_gcp_handshaker_resp_decode(grpc_slice encoded_handshaker_resp, - grpc_gcp_handshaker_resp* resp) { - if (resp == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr argument to grpc_gcp_handshaker_resp_decode()."); - return false; - } - pb_istream_t stream = - pb_istream_from_buffer(GRPC_SLICE_START_PTR(encoded_handshaker_resp), - GRPC_SLICE_LENGTH(encoded_handshaker_resp)); - resp->out_frames.funcs.decode = decode_string_or_bytes_cb; - resp->status.details.funcs.decode = decode_string_or_bytes_cb; - resp->result.application_protocol.funcs.decode = decode_string_or_bytes_cb; - resp->result.record_protocol.funcs.decode = decode_string_or_bytes_cb; - resp->result.key_data.funcs.decode = decode_string_or_bytes_cb; - resp->result.peer_identity.hostname.funcs.decode = decode_string_or_bytes_cb; - resp->result.peer_identity.service_account.funcs.decode = - decode_string_or_bytes_cb; - resp->result.local_identity.hostname.funcs.decode = decode_string_or_bytes_cb; - resp->result.local_identity.service_account.funcs.decode = - decode_string_or_bytes_cb; - if (!pb_decode(&stream, grpc_gcp_HandshakerResp_fields, resp)) { - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&stream)); - return false; - } - return true; -} diff --git a/src/core/tsi/alts/handshaker/alts_handshaker_service_api.h b/src/core/tsi/alts/handshaker/alts_handshaker_service_api.h deleted file mode 100644 index 5df56a86fae..00000000000 --- a/src/core/tsi/alts/handshaker/alts_handshaker_service_api.h +++ /dev/null @@ -1,323 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_SERVICE_API_H -#define GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_SERVICE_API_H - -#include - -#include "src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h" - -/** - * An implementation of nanopb thin wrapper used to set/get and - * serialize/de-serialize of ALTS handshake requests and responses. - * - * All APIs in the header are thread-compatible. A typical usage of this API at - * the client side is as follows: - * - * ----------------------------------------------------------------------------- - * // Create, populate, and serialize an ALTS client_start handshake request to - * // send to the server. - * grpc_gcp_handshaker_req* req = - * grpc_gcp_handshaker_req_create(CLIENT_START_REQ); - * grpc_gcp_handshaker_req_set_handshake_protocol( - req, grpc_gcp_HandshakeProtocol_ALTS); - * grpc_gcp_handshaker_req_add_application_protocol(req, "grpc"); - * grpc_gcp_handshaker_req_add_record_protocol(req, "ALTSRP_GCM_AES128"); - * grpc_slice client_slice; - * if (!grpc_gcp_handshaker_req_encode(req, &client_slice)) { - * fprintf(stderr, "ALTS handshake request encoding failed."; - * } - * - * // De-serialize a data stream received from the server, and store the result - * // at ALTS handshake response. - * grpc_gcp_handshaker_resp* resp = grpc_gcp_handshaker_resp_create(); - * if (!grpc_gcp_handshaker_resp_decode(server_slice, resp)) { - * fprintf(stderr, "ALTS handshake response decoding failed."); - * } - * // To access a variable-length datatype field (i.e., pb_callback_t), - * // access its "arg" subfield (if it has been set). - * if (resp->out_frames.arg != nullptr) { - * grpc_slice* slice = resp->out_frames.arg; - * } - * // To access a fixed-length datatype field (i.e., not pb_calback_t), - * // access the field directly (if it has been set). - * if (resp->has_status && resp->status->has_code) { - * uint32_t code = resp->status->code; - * } - *------------------------------------------------------------------------------ - */ - -/** - * This method creates an ALTS handshake request. - * - * - type: an enum type value that can be either CLIENT_START_REQ, - * SERVER_START_REQ, or NEXT_REQ to indicate the created instance will be - * client_start, server_start, and next handshake request message - * respectively. - * - * The method returns a pointer to the created instance. - */ -grpc_gcp_handshaker_req* grpc_gcp_handshaker_req_create( - grpc_gcp_handshaker_req_type type); - -/** - * This method sets the value for handshake_security_protocol field of ALTS - * client_start handshake request. - * - * - req: an ALTS handshake request. - * - handshake_protocol: a enum type value representing the handshake security - * protocol. - * - * The method returns true on success and false otherwise. - */ -bool grpc_gcp_handshaker_req_set_handshake_protocol( - grpc_gcp_handshaker_req* req, - grpc_gcp_handshake_protocol handshake_protocol); - -/** - * This method sets the value for target_name field of ALTS client_start - * handshake request. - * - * - req: an ALTS handshake request. - * - target_name: a target name to be set. - * - * The method returns true on success and false otherwise. - */ -bool grpc_gcp_handshaker_req_set_target_name(grpc_gcp_handshaker_req* req, - const char* target_name); - -/** - * This method adds an application protocol supported by the server (or - * client) to ALTS server_start (or client_start) handshake request. - * - * - req: an ALTS handshake request. - * - application_protocol: an application protocol (e.g., grpc) to be added. - * - * The method returns true on success and false otherwise. - */ -bool grpc_gcp_handshaker_req_add_application_protocol( - grpc_gcp_handshaker_req* req, const char* application_protocol); - -/** - * This method adds a record protocol supported by the client to ALTS - * client_start handshake request. - * - * - req: an ALTS handshake request. - * - record_protocol: a record protocol (e.g., ALTSRP_GCM_AES128) to be - * added. - * - * The method returns true on success and false otherwise. - */ -bool grpc_gcp_handshaker_req_add_record_protocol(grpc_gcp_handshaker_req* req, - const char* record_protocol); - -/** - * This method adds a target server identity represented as hostname and - * acceptable by a client to ALTS client_start handshake request. - * - * - req: an ALTS handshake request. - * - hostname: a string representation of hostname at the connection - * endpoint to be added. - * - * The method returns true on success and false otherwise. - */ -bool grpc_gcp_handshaker_req_add_target_identity_hostname( - grpc_gcp_handshaker_req* req, const char* hostname); - -/** - * This method adds a target server identity represented as service account and - * acceptable by a client to ALTS client_start handshake request. - * - * - req: an ALTS handshake request. - * - service_account: a string representation of service account at the - * connection endpoint to be added. - * - * The method returns true on success and false otherwise. - */ -bool grpc_gcp_handshaker_req_add_target_identity_service_account( - grpc_gcp_handshaker_req* req, const char* service_account); - -/** - * This method sets the hostname for local_identity field of ALTS client_start - * handshake request. - * - * - req: an ALTS handshake request. - * - hostname: a string representation of hostname. - * - * The method returns true on success and false otherwise. - */ -bool grpc_gcp_handshaker_req_set_local_identity_hostname( - grpc_gcp_handshaker_req* req, const char* hostname); - -/** - * This method sets the service account for local_identity field of ALTS - * client_start handshake request. - * - * - req: an ALTS handshake request. - * - service_account: a string representation of service account. - * - * The method returns true on success and false otherwise. - */ -bool grpc_gcp_handshaker_req_set_local_identity_service_account( - grpc_gcp_handshaker_req* req, const char* service_account); - -/** - * This method sets the value for local_endpoint field of either ALTS - * client_start or server_start handshake request. - * - * - req: an ALTS handshake request. - * - ip_address: a string representation of ip address associated with the - * local endpoint, that could be either IPv4 or IPv6. - * - port: a port number associated with the local endpoint. - * - protocol: a network protocol (e.g., TCP or UDP) associated with the - * local endpoint. - * - * The method returns true on success and false otherwise. - */ -bool grpc_gcp_handshaker_req_set_local_endpoint( - grpc_gcp_handshaker_req* req, const char* ip_address, size_t port, - grpc_gcp_network_protocol protocol); - -/** - * This method sets the value for remote_endpoint field of either ALTS - * client_start or server_start handshake request. - * - * - req: an ALTS handshake request. - * - ip_address: a string representation of ip address associated with the - * remote endpoint, that could be either IPv4 or IPv6. - * - port: a port number associated with the remote endpoint. - * - protocol: a network protocol (e.g., TCP or UDP) associated with the - * remote endpoint. - * - * The method returns true on success and false otherwise. - */ -bool grpc_gcp_handshaker_req_set_remote_endpoint( - grpc_gcp_handshaker_req* req, const char* ip_address, size_t port, - grpc_gcp_network_protocol protocol); - -/** - * This method sets the value for in_bytes field of either ALTS server_start or - * next handshake request. - * - * - req: an ALTS handshake request. - * - in_bytes: a buffer containing bytes taken from out_frames of the peer's - * ALTS handshake response. It is possible that the peer's out_frames are - * split into multiple handshake request messages. - * - size: size of in_bytes buffer. - * - * The method returns true on success and false otherwise. - */ -bool grpc_gcp_handshaker_req_set_in_bytes(grpc_gcp_handshaker_req* req, - const char* in_bytes, size_t size); - -/** - * This method adds a record protocol to handshake parameters mapped by the - * handshake protocol for ALTS server_start handshake request. - * - * - req: an ALTS handshake request. - * - key: an enum type value representing a handshake security protocol. - * - record_protocol: a record protocol to be added. - * - * The method returns true on success and false otherwise. - */ -bool grpc_gcp_handshaker_req_param_add_record_protocol( - grpc_gcp_handshaker_req* req, grpc_gcp_handshake_protocol key, - const char* record_protocol); - -/** - * This method adds a local identity represented as hostname to handshake - * parameters mapped by the handshake protocol for ALTS server_start handshake - * request. - * - * - req: an ALTS handshake request. - * - key: an enum type value representing a handshake security protocol. - * - hostname: a string representation of hostname to be added. - * - * The method returns true on success and false otherwise. - */ -bool grpc_gcp_handshaker_req_param_add_local_identity_hostname( - grpc_gcp_handshaker_req* req, grpc_gcp_handshake_protocol key, - const char* hostname); - -/** - * This method adds a local identity represented as service account to handshake - * parameters mapped by the handshake protocol for ALTS server_start handshake - * request. - * - * - req: an ALTS handshake request. - * - key: an enum type value representing a handshake security protocol. - * - service_account: a string representation of service account to be added. - * - * The method returns true on success and false otherwise. - */ -bool grpc_gcp_handshaker_req_param_add_local_identity_service_account( - grpc_gcp_handshaker_req* req, grpc_gcp_handshake_protocol key, - const char* service_account); - -/** - * This method sets the value for rpc_versions field of either ALTS - * client_start or server_start handshake request. - * - * - req: an ALTS handshake request. - * - max_major: a major version of maximum supported RPC version. - * - max_minor: a minor version of maximum supported RPC version. - * - min_major: a major version of minimum supported RPC version. - * - min_minor: a minor version of minimum supported RPC version. - * - * The method returns true on success and false otherwise. - */ -bool grpc_gcp_handshaker_req_set_rpc_versions(grpc_gcp_handshaker_req* req, - uint32_t max_major, - uint32_t max_minor, - uint32_t min_major, - uint32_t min_minor); - -/** - * This method serializes an ALTS handshake request and returns a data stream. - * - * - req: an ALTS handshake request. - * - slice: a data stream where the serialized result will be written. - * - * The method returns true on success and false otherwise. - */ -bool grpc_gcp_handshaker_req_encode(grpc_gcp_handshaker_req* req, - grpc_slice* slice); - -/* This method destroys an ALTS handshake request. */ -void grpc_gcp_handshaker_req_destroy(grpc_gcp_handshaker_req* req); - -/* This method creates an ALTS handshake response. */ -grpc_gcp_handshaker_resp* grpc_gcp_handshaker_resp_create(void); - -/** - * This method de-serializes a data stream and stores the result - * in an ALTS handshake response. - * - * - slice: a data stream containing a serialized ALTS handshake response. - * - resp: an ALTS handshake response used to hold de-serialized result. - * - * The method returns true on success and false otherwise. - */ -bool grpc_gcp_handshaker_resp_decode(grpc_slice slice, - grpc_gcp_handshaker_resp* resp); - -/* This method destroys an ALTS handshake response. */ -void grpc_gcp_handshaker_resp_destroy(grpc_gcp_handshaker_resp* resp); - -#endif /* GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_SERVICE_API_H */ diff --git a/src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc b/src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc deleted file mode 100644 index d63d3538c56..00000000000 --- a/src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc +++ /dev/null @@ -1,145 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include - -#include "src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h" - -#include "src/core/lib/slice/slice_internal.h" - -void add_repeated_field(repeated_field** head, const void* data) { - repeated_field* field = - static_cast(gpr_zalloc(sizeof(*field))); - field->data = data; - if (*head == nullptr) { - *head = field; - (*head)->next = nullptr; - } else { - field->next = *head; - *head = field; - } -} - -void destroy_repeated_field_list_identity(repeated_field* head) { - repeated_field* field = head; - while (field != nullptr) { - repeated_field* next_field = field->next; - const grpc_gcp_identity* identity = - static_cast(field->data); - destroy_slice(static_cast(identity->hostname.arg)); - destroy_slice(static_cast(identity->service_account.arg)); - gpr_free((void*)identity); - gpr_free(field); - field = next_field; - } -} - -void destroy_repeated_field_list_string(repeated_field* head) { - repeated_field* field = head; - while (field != nullptr) { - repeated_field* next_field = field->next; - destroy_slice((grpc_slice*)field->data); - gpr_free(field); - field = next_field; - } -} - -grpc_slice* create_slice(const char* data, size_t size) { - grpc_slice slice = grpc_slice_from_copied_buffer(data, size); - grpc_slice* cb_slice = - static_cast(gpr_zalloc(sizeof(*cb_slice))); - memcpy(cb_slice, &slice, sizeof(*cb_slice)); - return cb_slice; -} - -void destroy_slice(grpc_slice* slice) { - if (slice != nullptr) { - grpc_slice_unref_internal(*slice); - gpr_free(slice); - } -} - -bool encode_string_or_bytes_cb(pb_ostream_t* stream, const pb_field_t* field, - void* const* arg) { - grpc_slice* slice = static_cast(*arg); - if (!pb_encode_tag_for_field(stream, field)) return false; - return pb_encode_string(stream, GRPC_SLICE_START_PTR(*slice), - GRPC_SLICE_LENGTH(*slice)); -} - -bool encode_repeated_identity_cb(pb_ostream_t* stream, const pb_field_t* field, - void* const* arg) { - repeated_field* var = static_cast(*arg); - while (var != nullptr) { - if (!pb_encode_tag_for_field(stream, field)) return false; - if (!pb_encode_submessage(stream, grpc_gcp_Identity_fields, - (grpc_gcp_identity*)var->data)) - return false; - var = var->next; - } - return true; -} - -bool encode_repeated_string_cb(pb_ostream_t* stream, const pb_field_t* field, - void* const* arg) { - repeated_field* var = static_cast(*arg); - while (var != nullptr) { - if (!pb_encode_tag_for_field(stream, field)) return false; - const grpc_slice* slice = static_cast(var->data); - if (!pb_encode_string(stream, GRPC_SLICE_START_PTR(*slice), - GRPC_SLICE_LENGTH(*slice))) - return false; - var = var->next; - } - return true; -} - -bool decode_string_or_bytes_cb(pb_istream_t* stream, const pb_field_t* field, - void** arg) { - grpc_slice slice = grpc_slice_malloc(stream->bytes_left); - grpc_slice* cb_slice = - static_cast(gpr_zalloc(sizeof(*cb_slice))); - memcpy(cb_slice, &slice, sizeof(*cb_slice)); - if (!pb_read(stream, GRPC_SLICE_START_PTR(*cb_slice), stream->bytes_left)) - return false; - *arg = cb_slice; - return true; -} - -bool decode_repeated_identity_cb(pb_istream_t* stream, const pb_field_t* field, - void** arg) { - grpc_gcp_identity* identity = - static_cast(gpr_zalloc(sizeof(*identity))); - identity->hostname.funcs.decode = decode_string_or_bytes_cb; - identity->service_account.funcs.decode = decode_string_or_bytes_cb; - add_repeated_field(reinterpret_cast(arg), identity); - if (!pb_decode(stream, grpc_gcp_Identity_fields, identity)) return false; - return true; -} - -bool decode_repeated_string_cb(pb_istream_t* stream, const pb_field_t* field, - void** arg) { - grpc_slice slice = grpc_slice_malloc(stream->bytes_left); - grpc_slice* cb_slice = - static_cast(gpr_zalloc(sizeof(*cb_slice))); - memcpy(cb_slice, &slice, sizeof(grpc_slice)); - if (!pb_read(stream, GRPC_SLICE_START_PTR(*cb_slice), stream->bytes_left)) - return false; - add_repeated_field(reinterpret_cast(arg), cb_slice); - return true; -} diff --git a/src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h b/src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h deleted file mode 100644 index 966ea45617e..00000000000 --- a/src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h +++ /dev/null @@ -1,149 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_SERVICE_API_UTIL_H -#define GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_SERVICE_API_UTIL_H - -#include - -#include "pb_decode.h" -#include "pb_encode.h" - -#include -#include -#include -#include - -#include "src/core/tsi/alts/handshaker/handshaker.pb.h" - -/** - * An implementation of utility functions used to serialize/ - * de-serialize ALTS handshake requests/responses. All APIs in the header - * are thread-compatible. - */ - -/* Renaming of message/field structs generated by nanopb compiler. */ -typedef grpc_gcp_HandshakeProtocol grpc_gcp_handshake_protocol; -typedef grpc_gcp_NetworkProtocol grpc_gcp_network_protocol; -typedef grpc_gcp_Identity grpc_gcp_identity; -typedef grpc_gcp_NextHandshakeMessageReq grpc_gcp_next_handshake_message_req; -typedef grpc_gcp_ServerHandshakeParameters grpc_gcp_server_handshake_parameters; -typedef grpc_gcp_Endpoint grpc_gcp_endpoint; -typedef grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry - grpc_gcp_handshake_parameters_entry; -typedef grpc_gcp_StartClientHandshakeReq grpc_gcp_start_client_handshake_req; -typedef grpc_gcp_StartServerHandshakeReq grpc_gcp_start_server_handshake_req; -typedef grpc_gcp_HandshakerReq grpc_gcp_handshaker_req; -typedef grpc_gcp_HandshakerResult grpc_gcp_handshaker_result; -typedef grpc_gcp_HandshakerStatus grpc_gcp_handshaker_status; -typedef grpc_gcp_HandshakerResp grpc_gcp_handshaker_resp; - -typedef enum { - CLIENT_START_REQ = 0, /* StartClientHandshakeReq. */ - SERVER_START_REQ = 1, /* StartServerHandshakeReq. */ - NEXT_REQ = 2, /* NextHandshakeMessageReq. */ -} grpc_gcp_handshaker_req_type; - -/** - * A struct representing a repeated field. The struct is used to organize all - * instances of a specific repeated field into a linked list, which then will - * be used at encode/decode phase. For instance at the encode phase, the encode - * function will iterate through the list, encode each field, and then output - * the result to the stream. - */ -typedef struct repeated_field_ { - struct repeated_field_* next; - const void* data; -} repeated_field; - -/** - * This method adds a repeated field to the head of repeated field list. - * - * - head: a head of repeated field list. - * - field: a repeated field to be added to the list. - */ -void add_repeated_field(repeated_field** head, const void* field); - -/** - * This method destroys a repeated field list that consists of string type - * fields. - * - * - head: a head of repeated field list. - */ -void destroy_repeated_field_list_string(repeated_field* head); - -/** - * This method destroys a repeated field list that consists of - * grpc_gcp_identity type fields. - * - * - head: a head of repeated field list. - */ -void destroy_repeated_field_list_identity(repeated_field* head); - -/** - * This method creates a grpc_slice instance by copying a data buffer. It is - * similar to grpc_slice_from_copied_buffer() except that it returns an instance - * allocated from the heap. - * - * - data: a data buffer to be copied to grpc_slice instance. - * - size: size of data buffer. - */ -grpc_slice* create_slice(const char* data, size_t size); - -/* This method destroys a grpc_slice instance. */ -void destroy_slice(grpc_slice* slice); - -/** - * The following encode/decode functions will be assigned to encode/decode - * function pointers of pb_callback_t struct (defined in - * //third_party/nanopb/pb.h), that represent a repeated field with a dynamic - * length (e.g., a string type or repeated field). - */ - -/* This method is an encode callback function for a string or byte array. */ -bool encode_string_or_bytes_cb(pb_ostream_t* stream, const pb_field_t* field, - void* const* arg); - -/** - * This method is an encode callback function for a repeated grpc_gcp_identity - * field. - */ -bool encode_repeated_identity_cb(pb_ostream_t* stream, const pb_field_t* field, - void* const* arg); - -/* This method is an encode callback function for a repeated string field. */ -bool encode_repeated_string_cb(pb_ostream_t* stream, const pb_field_t* field, - void* const* arg); - -/** - * This method is a decode callback function for a string or byte array field. - */ -bool decode_string_or_bytes_cb(pb_istream_t* stream, const pb_field_t* field, - void** arg); -/** - * This method is a decode callback function for a repeated grpc_gcp_identity - * field. - */ -bool decode_repeated_identity_cb(pb_istream_t* stream, const pb_field_t* field, - void** arg); - -/* This method is a decode callback function for a repeated string field. */ -bool decode_repeated_string_cb(pb_istream_t* stream, const pb_field_t* field, - void** arg); - -#endif /* GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_SERVICE_API_UTIL_H */ diff --git a/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc b/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc index 0d28303e7dd..917d375fd82 100644 --- a/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +++ b/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc @@ -192,38 +192,49 @@ static const tsi_handshaker_result_vtable result_vtable = { handshaker_result_create_frame_protector, handshaker_result_get_unused_bytes, handshaker_result_destroy}; -tsi_result alts_tsi_handshaker_result_create(grpc_gcp_handshaker_resp* resp, +tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp, bool is_client, tsi_handshaker_result** self) { if (self == nullptr || resp == nullptr) { gpr_log(GPR_ERROR, "Invalid arguments to create_handshaker_result()"); return TSI_INVALID_ARGUMENT; } - grpc_slice* key = static_cast(resp->result.key_data.arg); - GPR_ASSERT(key != nullptr); - grpc_slice* identity = - static_cast(resp->result.peer_identity.service_account.arg); + const grpc_gcp_HandshakerResult* hresult = + grpc_gcp_HandshakerResp_result(resp); + const grpc_gcp_Identity* identity = + grpc_gcp_HandshakerResult_peer_identity(hresult); if (identity == nullptr) { + gpr_log(GPR_ERROR, "Invalid identity"); + return TSI_FAILED_PRECONDITION; + } + upb_strview service_account = grpc_gcp_Identity_service_account(identity); + if (service_account.size == 0) { gpr_log(GPR_ERROR, "Invalid service account"); return TSI_FAILED_PRECONDITION; } - if (GRPC_SLICE_LENGTH(*key) < kAltsAes128GcmRekeyKeyLength) { + upb_strview key_data = grpc_gcp_HandshakerResult_key_data(hresult); + if (key_data.size < kAltsAes128GcmRekeyKeyLength) { gpr_log(GPR_ERROR, "Bad key length"); return TSI_FAILED_PRECONDITION; } + const grpc_gcp_RpcProtocolVersions* peer_rpc_version = + grpc_gcp_HandshakerResult_peer_rpc_versions(hresult); + if (peer_rpc_version == nullptr) { + gpr_log(GPR_ERROR, "Peer does not set RPC protocol versions."); + return TSI_FAILED_PRECONDITION; + } alts_tsi_handshaker_result* result = static_cast(gpr_zalloc(sizeof(*result))); result->key_data = static_cast(gpr_zalloc(kAltsAes128GcmRekeyKeyLength)); - memcpy(result->key_data, GRPC_SLICE_START_PTR(*key), - kAltsAes128GcmRekeyKeyLength); - result->peer_identity = grpc_slice_to_c_string(*identity); - if (!resp->result.has_peer_rpc_versions) { - gpr_log(GPR_ERROR, "Peer does not set RPC protocol versions."); - return TSI_FAILED_PRECONDITION; - } - if (!grpc_gcp_rpc_protocol_versions_encode(&resp->result.peer_rpc_versions, - &result->rpc_versions)) { + memcpy(result->key_data, key_data.data, kAltsAes128GcmRekeyKeyLength); + result->peer_identity = + static_cast(gpr_zalloc(service_account.size + 1)); + memcpy(result->peer_identity, service_account.data, service_account.size); + upb::Arena arena; + bool serialized = grpc_gcp_rpc_protocol_versions_encode( + peer_rpc_version, arena.ptr(), &result->rpc_versions); + if (!serialized) { gpr_log(GPR_ERROR, "Failed to serialize peer's RPC protocol versions."); return TSI_FAILED_PRECONDITION; } diff --git a/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h b/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h index 32f94bc9d3f..6be45d7b447 100644 --- a/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +++ b/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h @@ -26,9 +26,9 @@ #include "src/core/lib/iomgr/pollset_set.h" #include "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h" #include "src/core/tsi/alts/handshaker/alts_handshaker_client.h" -#include "src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h" #include "src/core/tsi/transport_security.h" #include "src/core/tsi/transport_security_interface.h" +#include "src/proto/grpc/gcp/handshaker.upb.h" #define TSI_ALTS_SERVICE_ACCOUNT_PEER_PROPERTY "service_accont" #define TSI_ALTS_CERTIFICATE_TYPE "ALTS" @@ -70,7 +70,7 @@ tsi_result alts_tsi_handshaker_create( * client or not. * - result: address of ALTS TSI handshaker result instance. */ -tsi_result alts_tsi_handshaker_result_create(grpc_gcp_handshaker_resp* resp, +tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp, bool is_client, tsi_handshaker_result** result); diff --git a/src/core/tsi/alts/handshaker/alts_tsi_utils.cc b/src/core/tsi/alts/handshaker/alts_tsi_utils.cc index 1747f1ad04f..f80498db990 100644 --- a/src/core/tsi/alts/handshaker/alts_tsi_utils.cc +++ b/src/core/tsi/alts/handshaker/alts_tsi_utils.cc @@ -41,18 +41,22 @@ tsi_result alts_tsi_utils_convert_to_tsi_result(grpc_status_code code) { } } -grpc_gcp_handshaker_resp* alts_tsi_utils_deserialize_response( - grpc_byte_buffer* resp_buffer) { +grpc_gcp_HandshakerResp* alts_tsi_utils_deserialize_response( + grpc_byte_buffer* resp_buffer, upb_arena* arena) { GPR_ASSERT(resp_buffer != nullptr); + GPR_ASSERT(arena != nullptr); grpc_byte_buffer_reader bbr; grpc_byte_buffer_reader_init(&bbr, resp_buffer); grpc_slice slice = grpc_byte_buffer_reader_readall(&bbr); - grpc_gcp_handshaker_resp* resp = grpc_gcp_handshaker_resp_create(); - bool ok = grpc_gcp_handshaker_resp_decode(slice, resp); + size_t buf_size = GPR_SLICE_LENGTH(slice); + void* buf = upb_arena_malloc(arena, buf_size); + memcpy(buf, reinterpret_cast(GPR_SLICE_START_PTR(slice)), + buf_size); + grpc_gcp_HandshakerResp* resp = grpc_gcp_HandshakerResp_parse( + reinterpret_cast(buf), buf_size, arena); grpc_slice_unref_internal(slice); grpc_byte_buffer_reader_destroy(&bbr); - if (!ok) { - grpc_gcp_handshaker_resp_destroy(resp); + if (resp == nullptr) { gpr_log(GPR_ERROR, "grpc_gcp_handshaker_resp_decode() failed"); return nullptr; } diff --git a/src/core/tsi/alts/handshaker/alts_tsi_utils.h b/src/core/tsi/alts/handshaker/alts_tsi_utils.h index 9ef649de2b9..a20e5e9cd99 100644 --- a/src/core/tsi/alts/handshaker/alts_tsi_utils.h +++ b/src/core/tsi/alts/handshaker/alts_tsi_utils.h @@ -24,8 +24,8 @@ #include #include -#include "src/core/tsi/alts/handshaker/alts_handshaker_service_api.h" #include "src/core/tsi/transport_security_interface.h" +#include "src/proto/grpc/gcp/handshaker.upb.h" /** * This method converts grpc_status_code code to the corresponding tsi_result @@ -42,11 +42,12 @@ tsi_result alts_tsi_utils_convert_to_tsi_result(grpc_status_code code); * service. * * - bytes_received: data returned from ALTS handshaker service. + * - arena: upb arena. * * It returns a deserialized handshaker response on success and nullptr on * failure. */ -grpc_gcp_handshaker_resp* alts_tsi_utils_deserialize_response( - grpc_byte_buffer* resp_buffer); +grpc_gcp_HandshakerResp* alts_tsi_utils_deserialize_response( + grpc_byte_buffer* resp_buffer, upb_arena* arena); #endif /* GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_TSI_UTILS_H */ diff --git a/src/core/tsi/alts/handshaker/altscontext.pb.c b/src/core/tsi/alts/handshaker/altscontext.pb.c deleted file mode 100644 index 5fb152a558e..00000000000 --- a/src/core/tsi/alts/handshaker/altscontext.pb.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.7-dev */ - -#include "src/core/tsi/alts/handshaker/altscontext.pb.h" -/* @@protoc_insertion_point(includes) */ -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - - - -const pb_field_t grpc_gcp_AltsContext_fields[7] = { - PB_FIELD( 1, STRING , OPTIONAL, CALLBACK, FIRST, grpc_gcp_AltsContext, application_protocol, application_protocol, 0), - PB_FIELD( 2, STRING , OPTIONAL, CALLBACK, OTHER, grpc_gcp_AltsContext, record_protocol, application_protocol, 0), - PB_FIELD( 3, UENUM , OPTIONAL, STATIC , OTHER, grpc_gcp_AltsContext, security_level, record_protocol, 0), - PB_FIELD( 4, STRING , OPTIONAL, CALLBACK, OTHER, grpc_gcp_AltsContext, peer_service_account, security_level, 0), - PB_FIELD( 5, STRING , OPTIONAL, CALLBACK, OTHER, grpc_gcp_AltsContext, local_service_account, peer_service_account, 0), - PB_FIELD( 6, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_gcp_AltsContext, peer_rpc_versions, local_service_account, &grpc_gcp_RpcProtocolVersions_fields), - PB_LAST_FIELD -}; - - -/* Check that field information fits in pb_field_t */ -#if !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_32BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in 8 or 16 bit - * field descriptors. - */ -PB_STATIC_ASSERT((pb_membersize(grpc_gcp_AltsContext, peer_rpc_versions) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_gcp_AltsContext) -#endif - -#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_16BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in the default - * 8 bit descriptors. - */ -PB_STATIC_ASSERT((pb_membersize(grpc_gcp_AltsContext, peer_rpc_versions) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_gcp_AltsContext) -#endif - - -/* @@protoc_insertion_point(eof) */ diff --git a/src/core/tsi/alts/handshaker/altscontext.pb.h b/src/core/tsi/alts/handshaker/altscontext.pb.h deleted file mode 100644 index 632b20c0e2a..00000000000 --- a/src/core/tsi/alts/handshaker/altscontext.pb.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.7-dev */ - -#ifndef PB_GRPC_GCP_ALTSCONTEXT_PB_H_INCLUDED -#define PB_GRPC_GCP_ALTSCONTEXT_PB_H_INCLUDED -#include "pb.h" -#include "src/core/tsi/alts/handshaker/transport_security_common.pb.h" -/* @@protoc_insertion_point(includes) */ -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Struct definitions */ -typedef struct _grpc_gcp_AltsContext { - pb_callback_t application_protocol; - pb_callback_t record_protocol; - bool has_security_level; - grpc_gcp_SecurityLevel security_level; - pb_callback_t peer_service_account; - pb_callback_t local_service_account; - bool has_peer_rpc_versions; - grpc_gcp_RpcProtocolVersions peer_rpc_versions; -/* @@protoc_insertion_point(struct:grpc_gcp_AltsContext) */ -} grpc_gcp_AltsContext; - -/* Default values for struct fields */ - -/* Initializer values for message structs */ -#define grpc_gcp_AltsContext_init_default {{{NULL}, NULL}, {{NULL}, NULL}, false, (grpc_gcp_SecurityLevel)0, {{NULL}, NULL}, {{NULL}, NULL}, false, grpc_gcp_RpcProtocolVersions_init_default} -#define grpc_gcp_AltsContext_init_zero {{{NULL}, NULL}, {{NULL}, NULL}, false, (grpc_gcp_SecurityLevel)0, {{NULL}, NULL}, {{NULL}, NULL}, false, grpc_gcp_RpcProtocolVersions_init_zero} - -/* Field tags (for use in manual encoding/decoding) */ -#define grpc_gcp_AltsContext_application_protocol_tag 1 -#define grpc_gcp_AltsContext_record_protocol_tag 2 -#define grpc_gcp_AltsContext_security_level_tag 3 -#define grpc_gcp_AltsContext_peer_service_account_tag 4 -#define grpc_gcp_AltsContext_local_service_account_tag 5 -#define grpc_gcp_AltsContext_peer_rpc_versions_tag 6 - -/* Struct field encoding specification for nanopb */ -extern const pb_field_t grpc_gcp_AltsContext_fields[7]; - -/* Maximum encoded size of messages (where known) */ -/* grpc_gcp_AltsContext_size depends on runtime parameters */ - -/* Message IDs (where set with "msgid" option) */ -#ifdef PB_MSGID - -#define ALTSCONTEXT_MESSAGES \ - - -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif -/* @@protoc_insertion_point(eof) */ - -#endif diff --git a/src/core/tsi/alts/handshaker/handshaker.pb.c b/src/core/tsi/alts/handshaker/handshaker.pb.c deleted file mode 100644 index 5450b1602d4..00000000000 --- a/src/core/tsi/alts/handshaker/handshaker.pb.c +++ /dev/null @@ -1,122 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.7-dev */ - -#include "src/core/tsi/alts/handshaker/handshaker.pb.h" -/* @@protoc_insertion_point(includes) */ -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - - - -const pb_field_t grpc_gcp_Endpoint_fields[4] = { - PB_FIELD( 1, STRING , OPTIONAL, CALLBACK, FIRST, grpc_gcp_Endpoint, ip_address, ip_address, 0), - PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_gcp_Endpoint, port, ip_address, 0), - PB_FIELD( 3, UENUM , OPTIONAL, STATIC , OTHER, grpc_gcp_Endpoint, protocol, port, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_gcp_Identity_fields[3] = { - PB_FIELD( 1, STRING , OPTIONAL, CALLBACK, FIRST, grpc_gcp_Identity, service_account, service_account, 0), - PB_FIELD( 2, STRING , OPTIONAL, CALLBACK, OTHER, grpc_gcp_Identity, hostname, service_account, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_gcp_StartClientHandshakeReq_fields[10] = { - PB_FIELD( 1, UENUM , OPTIONAL, STATIC , FIRST, grpc_gcp_StartClientHandshakeReq, handshake_security_protocol, handshake_security_protocol, 0), - PB_FIELD( 2, STRING , REPEATED, CALLBACK, OTHER, grpc_gcp_StartClientHandshakeReq, application_protocols, handshake_security_protocol, 0), - PB_FIELD( 3, STRING , REPEATED, CALLBACK, OTHER, grpc_gcp_StartClientHandshakeReq, record_protocols, application_protocols, 0), - PB_FIELD( 4, MESSAGE , REPEATED, CALLBACK, OTHER, grpc_gcp_StartClientHandshakeReq, target_identities, record_protocols, &grpc_gcp_Identity_fields), - PB_FIELD( 5, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_gcp_StartClientHandshakeReq, local_identity, target_identities, &grpc_gcp_Identity_fields), - PB_FIELD( 6, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_gcp_StartClientHandshakeReq, local_endpoint, local_identity, &grpc_gcp_Endpoint_fields), - PB_FIELD( 7, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_gcp_StartClientHandshakeReq, remote_endpoint, local_endpoint, &grpc_gcp_Endpoint_fields), - PB_FIELD( 8, STRING , OPTIONAL, CALLBACK, OTHER, grpc_gcp_StartClientHandshakeReq, target_name, remote_endpoint, 0), - PB_FIELD( 9, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_gcp_StartClientHandshakeReq, rpc_versions, target_name, &grpc_gcp_RpcProtocolVersions_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_gcp_ServerHandshakeParameters_fields[3] = { - PB_FIELD( 1, STRING , REPEATED, CALLBACK, FIRST, grpc_gcp_ServerHandshakeParameters, record_protocols, record_protocols, 0), - PB_FIELD( 2, MESSAGE , REPEATED, CALLBACK, OTHER, grpc_gcp_ServerHandshakeParameters, local_identities, record_protocols, &grpc_gcp_Identity_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_gcp_StartServerHandshakeReq_fields[7] = { - PB_FIELD( 1, STRING , REPEATED, CALLBACK, FIRST, grpc_gcp_StartServerHandshakeReq, application_protocols, application_protocols, 0), - PB_FIELD( 2, MESSAGE , REPEATED, STATIC , OTHER, grpc_gcp_StartServerHandshakeReq, handshake_parameters, application_protocols, &grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_fields), - PB_FIELD( 3, BYTES , OPTIONAL, CALLBACK, OTHER, grpc_gcp_StartServerHandshakeReq, in_bytes, handshake_parameters, 0), - PB_FIELD( 4, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_gcp_StartServerHandshakeReq, local_endpoint, in_bytes, &grpc_gcp_Endpoint_fields), - PB_FIELD( 5, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_gcp_StartServerHandshakeReq, remote_endpoint, local_endpoint, &grpc_gcp_Endpoint_fields), - PB_FIELD( 6, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_gcp_StartServerHandshakeReq, rpc_versions, remote_endpoint, &grpc_gcp_RpcProtocolVersions_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_fields[3] = { - PB_FIELD( 1, INT32 , OPTIONAL, STATIC , FIRST, grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry, key, key, 0), - PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry, value, key, &grpc_gcp_ServerHandshakeParameters_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_gcp_NextHandshakeMessageReq_fields[2] = { - PB_FIELD( 1, BYTES , OPTIONAL, CALLBACK, FIRST, grpc_gcp_NextHandshakeMessageReq, in_bytes, in_bytes, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_gcp_HandshakerReq_fields[4] = { - PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_gcp_HandshakerReq, client_start, client_start, &grpc_gcp_StartClientHandshakeReq_fields), - PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_gcp_HandshakerReq, server_start, client_start, &grpc_gcp_StartServerHandshakeReq_fields), - PB_FIELD( 3, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_gcp_HandshakerReq, next, server_start, &grpc_gcp_NextHandshakeMessageReq_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_gcp_HandshakerResult_fields[8] = { - PB_FIELD( 1, STRING , OPTIONAL, CALLBACK, FIRST, grpc_gcp_HandshakerResult, application_protocol, application_protocol, 0), - PB_FIELD( 2, STRING , OPTIONAL, CALLBACK, OTHER, grpc_gcp_HandshakerResult, record_protocol, application_protocol, 0), - PB_FIELD( 3, BYTES , OPTIONAL, CALLBACK, OTHER, grpc_gcp_HandshakerResult, key_data, record_protocol, 0), - PB_FIELD( 4, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_gcp_HandshakerResult, peer_identity, key_data, &grpc_gcp_Identity_fields), - PB_FIELD( 5, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_gcp_HandshakerResult, local_identity, peer_identity, &grpc_gcp_Identity_fields), - PB_FIELD( 6, BOOL , OPTIONAL, STATIC , OTHER, grpc_gcp_HandshakerResult, keep_channel_open, local_identity, 0), - PB_FIELD( 7, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_gcp_HandshakerResult, peer_rpc_versions, keep_channel_open, &grpc_gcp_RpcProtocolVersions_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_gcp_HandshakerStatus_fields[3] = { - PB_FIELD( 1, UINT32 , OPTIONAL, STATIC , FIRST, grpc_gcp_HandshakerStatus, code, code, 0), - PB_FIELD( 2, STRING , OPTIONAL, CALLBACK, OTHER, grpc_gcp_HandshakerStatus, details, code, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_gcp_HandshakerResp_fields[5] = { - PB_FIELD( 1, BYTES , OPTIONAL, CALLBACK, FIRST, grpc_gcp_HandshakerResp, out_frames, out_frames, 0), - PB_FIELD( 2, UINT32 , OPTIONAL, STATIC , OTHER, grpc_gcp_HandshakerResp, bytes_consumed, out_frames, 0), - PB_FIELD( 3, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_gcp_HandshakerResp, result, bytes_consumed, &grpc_gcp_HandshakerResult_fields), - PB_FIELD( 4, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_gcp_HandshakerResp, status, result, &grpc_gcp_HandshakerStatus_fields), - PB_LAST_FIELD -}; - - -/* Check that field information fits in pb_field_t */ -#if !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_32BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in 8 or 16 bit - * field descriptors. - */ -PB_STATIC_ASSERT((pb_membersize(grpc_gcp_StartClientHandshakeReq, target_identities) < 65536 && pb_membersize(grpc_gcp_StartClientHandshakeReq, local_identity) < 65536 && pb_membersize(grpc_gcp_StartClientHandshakeReq, local_endpoint) < 65536 && pb_membersize(grpc_gcp_StartClientHandshakeReq, remote_endpoint) < 65536 && pb_membersize(grpc_gcp_StartClientHandshakeReq, rpc_versions) < 65536 && pb_membersize(grpc_gcp_ServerHandshakeParameters, local_identities) < 65536 && pb_membersize(grpc_gcp_StartServerHandshakeReq, handshake_parameters[0]) < 65536 && pb_membersize(grpc_gcp_StartServerHandshakeReq, local_endpoint) < 65536 && pb_membersize(grpc_gcp_StartServerHandshakeReq, remote_endpoint) < 65536 && pb_membersize(grpc_gcp_StartServerHandshakeReq, rpc_versions) < 65536 && pb_membersize(grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry, value) < 65536 && pb_membersize(grpc_gcp_HandshakerReq, client_start) < 65536 && pb_membersize(grpc_gcp_HandshakerReq, server_start) < 65536 && pb_membersize(grpc_gcp_HandshakerReq, next) < 65536 && pb_membersize(grpc_gcp_HandshakerResult, peer_identity) < 65536 && pb_membersize(grpc_gcp_HandshakerResult, local_identity) < 65536 && pb_membersize(grpc_gcp_HandshakerResult, peer_rpc_versions) < 65536 && pb_membersize(grpc_gcp_HandshakerResp, result) < 65536 && pb_membersize(grpc_gcp_HandshakerResp, status) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_gcp_Endpoint_grpc_gcp_Identity_grpc_gcp_StartClientHandshakeReq_grpc_gcp_ServerHandshakeParameters_grpc_gcp_StartServerHandshakeReq_grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_grpc_gcp_NextHandshakeMessageReq_grpc_gcp_HandshakerReq_grpc_gcp_HandshakerResult_grpc_gcp_HandshakerStatus_grpc_gcp_HandshakerResp) -#endif - -#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_16BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in the default - * 8 bit descriptors. - */ -PB_STATIC_ASSERT((pb_membersize(grpc_gcp_StartClientHandshakeReq, target_identities) < 256 && pb_membersize(grpc_gcp_StartClientHandshakeReq, local_identity) < 256 && pb_membersize(grpc_gcp_StartClientHandshakeReq, local_endpoint) < 256 && pb_membersize(grpc_gcp_StartClientHandshakeReq, remote_endpoint) < 256 && pb_membersize(grpc_gcp_StartClientHandshakeReq, rpc_versions) < 256 && pb_membersize(grpc_gcp_ServerHandshakeParameters, local_identities) < 256 && pb_membersize(grpc_gcp_StartServerHandshakeReq, handshake_parameters[0]) < 256 && pb_membersize(grpc_gcp_StartServerHandshakeReq, local_endpoint) < 256 && pb_membersize(grpc_gcp_StartServerHandshakeReq, remote_endpoint) < 256 && pb_membersize(grpc_gcp_StartServerHandshakeReq, rpc_versions) < 256 && pb_membersize(grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry, value) < 256 && pb_membersize(grpc_gcp_HandshakerReq, client_start) < 256 && pb_membersize(grpc_gcp_HandshakerReq, server_start) < 256 && pb_membersize(grpc_gcp_HandshakerReq, next) < 256 && pb_membersize(grpc_gcp_HandshakerResult, peer_identity) < 256 && pb_membersize(grpc_gcp_HandshakerResult, local_identity) < 256 && pb_membersize(grpc_gcp_HandshakerResult, peer_rpc_versions) < 256 && pb_membersize(grpc_gcp_HandshakerResp, result) < 256 && pb_membersize(grpc_gcp_HandshakerResp, status) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_gcp_Endpoint_grpc_gcp_Identity_grpc_gcp_StartClientHandshakeReq_grpc_gcp_ServerHandshakeParameters_grpc_gcp_StartServerHandshakeReq_grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_grpc_gcp_NextHandshakeMessageReq_grpc_gcp_HandshakerReq_grpc_gcp_HandshakerResult_grpc_gcp_HandshakerStatus_grpc_gcp_HandshakerResp) -#endif - - -/* @@protoc_insertion_point(eof) */ diff --git a/src/core/tsi/alts/handshaker/handshaker.pb.h b/src/core/tsi/alts/handshaker/handshaker.pb.h deleted file mode 100644 index 5ee42a3c69f..00000000000 --- a/src/core/tsi/alts/handshaker/handshaker.pb.h +++ /dev/null @@ -1,254 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.7-dev */ - -#ifndef PB_GRPC_GCP_HANDSHAKER_PB_H_INCLUDED -#define PB_GRPC_GCP_HANDSHAKER_PB_H_INCLUDED -#include "pb.h" -#include "src/core/tsi/alts/handshaker/transport_security_common.pb.h" -/* @@protoc_insertion_point(includes) */ -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Enum definitions */ -typedef enum _grpc_gcp_HandshakeProtocol { - grpc_gcp_HandshakeProtocol_HANDSHAKE_PROTOCOL_UNSPECIFIED = 0, - grpc_gcp_HandshakeProtocol_TLS = 1, - grpc_gcp_HandshakeProtocol_ALTS = 2 -} grpc_gcp_HandshakeProtocol; -#define _grpc_gcp_HandshakeProtocol_MIN grpc_gcp_HandshakeProtocol_HANDSHAKE_PROTOCOL_UNSPECIFIED -#define _grpc_gcp_HandshakeProtocol_MAX grpc_gcp_HandshakeProtocol_ALTS -#define _grpc_gcp_HandshakeProtocol_ARRAYSIZE ((grpc_gcp_HandshakeProtocol)(grpc_gcp_HandshakeProtocol_ALTS+1)) - -typedef enum _grpc_gcp_NetworkProtocol { - grpc_gcp_NetworkProtocol_NETWORK_PROTOCOL_UNSPECIFIED = 0, - grpc_gcp_NetworkProtocol_TCP = 1, - grpc_gcp_NetworkProtocol_UDP = 2 -} grpc_gcp_NetworkProtocol; -#define _grpc_gcp_NetworkProtocol_MIN grpc_gcp_NetworkProtocol_NETWORK_PROTOCOL_UNSPECIFIED -#define _grpc_gcp_NetworkProtocol_MAX grpc_gcp_NetworkProtocol_UDP -#define _grpc_gcp_NetworkProtocol_ARRAYSIZE ((grpc_gcp_NetworkProtocol)(grpc_gcp_NetworkProtocol_UDP+1)) - -/* Struct definitions */ -typedef struct _grpc_gcp_Identity { - pb_callback_t service_account; - pb_callback_t hostname; -/* @@protoc_insertion_point(struct:grpc_gcp_Identity) */ -} grpc_gcp_Identity; - -typedef struct _grpc_gcp_NextHandshakeMessageReq { - pb_callback_t in_bytes; -/* @@protoc_insertion_point(struct:grpc_gcp_NextHandshakeMessageReq) */ -} grpc_gcp_NextHandshakeMessageReq; - -typedef struct _grpc_gcp_ServerHandshakeParameters { - pb_callback_t record_protocols; - pb_callback_t local_identities; -/* @@protoc_insertion_point(struct:grpc_gcp_ServerHandshakeParameters) */ -} grpc_gcp_ServerHandshakeParameters; - -typedef struct _grpc_gcp_Endpoint { - pb_callback_t ip_address; - bool has_port; - int32_t port; - bool has_protocol; - grpc_gcp_NetworkProtocol protocol; -/* @@protoc_insertion_point(struct:grpc_gcp_Endpoint) */ -} grpc_gcp_Endpoint; - -typedef struct _grpc_gcp_HandshakerResult { - pb_callback_t application_protocol; - pb_callback_t record_protocol; - pb_callback_t key_data; - bool has_peer_identity; - grpc_gcp_Identity peer_identity; - bool has_local_identity; - grpc_gcp_Identity local_identity; - bool has_keep_channel_open; - bool keep_channel_open; - bool has_peer_rpc_versions; - grpc_gcp_RpcProtocolVersions peer_rpc_versions; -/* @@protoc_insertion_point(struct:grpc_gcp_HandshakerResult) */ -} grpc_gcp_HandshakerResult; - -typedef struct _grpc_gcp_HandshakerStatus { - bool has_code; - uint32_t code; - pb_callback_t details; -/* @@protoc_insertion_point(struct:grpc_gcp_HandshakerStatus) */ -} grpc_gcp_HandshakerStatus; - -typedef struct _grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry { - bool has_key; - int32_t key; - bool has_value; - grpc_gcp_ServerHandshakeParameters value; -/* @@protoc_insertion_point(struct:grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry) */ -} grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry; - -typedef struct _grpc_gcp_HandshakerResp { - pb_callback_t out_frames; - bool has_bytes_consumed; - uint32_t bytes_consumed; - bool has_result; - grpc_gcp_HandshakerResult result; - bool has_status; - grpc_gcp_HandshakerStatus status; -/* @@protoc_insertion_point(struct:grpc_gcp_HandshakerResp) */ -} grpc_gcp_HandshakerResp; - -typedef struct _grpc_gcp_StartClientHandshakeReq { - bool has_handshake_security_protocol; - grpc_gcp_HandshakeProtocol handshake_security_protocol; - pb_callback_t application_protocols; - pb_callback_t record_protocols; - pb_callback_t target_identities; - bool has_local_identity; - grpc_gcp_Identity local_identity; - bool has_local_endpoint; - grpc_gcp_Endpoint local_endpoint; - bool has_remote_endpoint; - grpc_gcp_Endpoint remote_endpoint; - pb_callback_t target_name; - bool has_rpc_versions; - grpc_gcp_RpcProtocolVersions rpc_versions; -/* @@protoc_insertion_point(struct:grpc_gcp_StartClientHandshakeReq) */ -} grpc_gcp_StartClientHandshakeReq; - -typedef struct _grpc_gcp_StartServerHandshakeReq { - pb_callback_t application_protocols; - pb_size_t handshake_parameters_count; - grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry handshake_parameters[3]; - pb_callback_t in_bytes; - bool has_local_endpoint; - grpc_gcp_Endpoint local_endpoint; - bool has_remote_endpoint; - grpc_gcp_Endpoint remote_endpoint; - bool has_rpc_versions; - grpc_gcp_RpcProtocolVersions rpc_versions; -/* @@protoc_insertion_point(struct:grpc_gcp_StartServerHandshakeReq) */ -} grpc_gcp_StartServerHandshakeReq; - -typedef struct _grpc_gcp_HandshakerReq { - bool has_client_start; - grpc_gcp_StartClientHandshakeReq client_start; - bool has_server_start; - grpc_gcp_StartServerHandshakeReq server_start; - bool has_next; - grpc_gcp_NextHandshakeMessageReq next; -/* @@protoc_insertion_point(struct:grpc_gcp_HandshakerReq) */ -} grpc_gcp_HandshakerReq; - -/* Default values for struct fields */ - -/* Initializer values for message structs */ -#define grpc_gcp_Endpoint_init_default {{{NULL}, NULL}, false, 0, false, (grpc_gcp_NetworkProtocol)0} -#define grpc_gcp_Identity_init_default {{{NULL}, NULL}, {{NULL}, NULL}} -#define grpc_gcp_StartClientHandshakeReq_init_default {false, (grpc_gcp_HandshakeProtocol)0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, false, grpc_gcp_Identity_init_default, false, grpc_gcp_Endpoint_init_default, false, grpc_gcp_Endpoint_init_default, {{NULL}, NULL}, false, grpc_gcp_RpcProtocolVersions_init_default} -#define grpc_gcp_ServerHandshakeParameters_init_default {{{NULL}, NULL}, {{NULL}, NULL}} -#define grpc_gcp_StartServerHandshakeReq_init_default {{{NULL}, NULL}, 0, {grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_init_default, grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_init_default, grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_init_default}, {{NULL}, NULL}, false, grpc_gcp_Endpoint_init_default, false, grpc_gcp_Endpoint_init_default, false, grpc_gcp_RpcProtocolVersions_init_default} -#define grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_init_default {false, 0, false, grpc_gcp_ServerHandshakeParameters_init_default} -#define grpc_gcp_NextHandshakeMessageReq_init_default {{{NULL}, NULL}} -#define grpc_gcp_HandshakerReq_init_default {false, grpc_gcp_StartClientHandshakeReq_init_default, false, grpc_gcp_StartServerHandshakeReq_init_default, false, grpc_gcp_NextHandshakeMessageReq_init_default} -#define grpc_gcp_HandshakerResult_init_default {{{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, false, grpc_gcp_Identity_init_default, false, grpc_gcp_Identity_init_default, false, 0, false, grpc_gcp_RpcProtocolVersions_init_default} -#define grpc_gcp_HandshakerStatus_init_default {false, 0, {{NULL}, NULL}} -#define grpc_gcp_HandshakerResp_init_default {{{NULL}, NULL}, false, 0, false, grpc_gcp_HandshakerResult_init_default, false, grpc_gcp_HandshakerStatus_init_default} -#define grpc_gcp_Endpoint_init_zero {{{NULL}, NULL}, false, 0, false, (grpc_gcp_NetworkProtocol)0} -#define grpc_gcp_Identity_init_zero {{{NULL}, NULL}, {{NULL}, NULL}} -#define grpc_gcp_StartClientHandshakeReq_init_zero {false, (grpc_gcp_HandshakeProtocol)0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, false, grpc_gcp_Identity_init_zero, false, grpc_gcp_Endpoint_init_zero, false, grpc_gcp_Endpoint_init_zero, {{NULL}, NULL}, false, grpc_gcp_RpcProtocolVersions_init_zero} -#define grpc_gcp_ServerHandshakeParameters_init_zero {{{NULL}, NULL}, {{NULL}, NULL}} -#define grpc_gcp_StartServerHandshakeReq_init_zero {{{NULL}, NULL}, 0, {grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_init_zero, grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_init_zero, grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_init_zero}, {{NULL}, NULL}, false, grpc_gcp_Endpoint_init_zero, false, grpc_gcp_Endpoint_init_zero, false, grpc_gcp_RpcProtocolVersions_init_zero} -#define grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_init_zero {false, 0, false, grpc_gcp_ServerHandshakeParameters_init_zero} -#define grpc_gcp_NextHandshakeMessageReq_init_zero {{{NULL}, NULL}} -#define grpc_gcp_HandshakerReq_init_zero {false, grpc_gcp_StartClientHandshakeReq_init_zero, false, grpc_gcp_StartServerHandshakeReq_init_zero, false, grpc_gcp_NextHandshakeMessageReq_init_zero} -#define grpc_gcp_HandshakerResult_init_zero {{{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, false, grpc_gcp_Identity_init_zero, false, grpc_gcp_Identity_init_zero, false, 0, false, grpc_gcp_RpcProtocolVersions_init_zero} -#define grpc_gcp_HandshakerStatus_init_zero {false, 0, {{NULL}, NULL}} -#define grpc_gcp_HandshakerResp_init_zero {{{NULL}, NULL}, false, 0, false, grpc_gcp_HandshakerResult_init_zero, false, grpc_gcp_HandshakerStatus_init_zero} - -/* Field tags (for use in manual encoding/decoding) */ -#define grpc_gcp_Identity_service_account_tag 1 -#define grpc_gcp_Identity_hostname_tag 2 -#define grpc_gcp_NextHandshakeMessageReq_in_bytes_tag 1 -#define grpc_gcp_ServerHandshakeParameters_record_protocols_tag 1 -#define grpc_gcp_ServerHandshakeParameters_local_identities_tag 2 -#define grpc_gcp_Endpoint_ip_address_tag 1 -#define grpc_gcp_Endpoint_port_tag 2 -#define grpc_gcp_Endpoint_protocol_tag 3 -#define grpc_gcp_HandshakerResult_application_protocol_tag 1 -#define grpc_gcp_HandshakerResult_record_protocol_tag 2 -#define grpc_gcp_HandshakerResult_key_data_tag 3 -#define grpc_gcp_HandshakerResult_peer_identity_tag 4 -#define grpc_gcp_HandshakerResult_local_identity_tag 5 -#define grpc_gcp_HandshakerResult_keep_channel_open_tag 6 -#define grpc_gcp_HandshakerResult_peer_rpc_versions_tag 7 -#define grpc_gcp_HandshakerStatus_code_tag 1 -#define grpc_gcp_HandshakerStatus_details_tag 2 -#define grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_key_tag 1 -#define grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_value_tag 2 -#define grpc_gcp_HandshakerResp_out_frames_tag 1 -#define grpc_gcp_HandshakerResp_bytes_consumed_tag 2 -#define grpc_gcp_HandshakerResp_result_tag 3 -#define grpc_gcp_HandshakerResp_status_tag 4 -#define grpc_gcp_StartClientHandshakeReq_handshake_security_protocol_tag 1 -#define grpc_gcp_StartClientHandshakeReq_application_protocols_tag 2 -#define grpc_gcp_StartClientHandshakeReq_record_protocols_tag 3 -#define grpc_gcp_StartClientHandshakeReq_target_identities_tag 4 -#define grpc_gcp_StartClientHandshakeReq_local_identity_tag 5 -#define grpc_gcp_StartClientHandshakeReq_local_endpoint_tag 6 -#define grpc_gcp_StartClientHandshakeReq_remote_endpoint_tag 7 -#define grpc_gcp_StartClientHandshakeReq_target_name_tag 8 -#define grpc_gcp_StartClientHandshakeReq_rpc_versions_tag 9 -#define grpc_gcp_StartServerHandshakeReq_application_protocols_tag 1 -#define grpc_gcp_StartServerHandshakeReq_handshake_parameters_tag 2 -#define grpc_gcp_StartServerHandshakeReq_in_bytes_tag 3 -#define grpc_gcp_StartServerHandshakeReq_local_endpoint_tag 4 -#define grpc_gcp_StartServerHandshakeReq_remote_endpoint_tag 5 -#define grpc_gcp_StartServerHandshakeReq_rpc_versions_tag 6 -#define grpc_gcp_HandshakerReq_client_start_tag 1 -#define grpc_gcp_HandshakerReq_server_start_tag 2 -#define grpc_gcp_HandshakerReq_next_tag 3 - -/* Struct field encoding specification for nanopb */ -extern const pb_field_t grpc_gcp_Endpoint_fields[4]; -extern const pb_field_t grpc_gcp_Identity_fields[3]; -extern const pb_field_t grpc_gcp_StartClientHandshakeReq_fields[10]; -extern const pb_field_t grpc_gcp_ServerHandshakeParameters_fields[3]; -extern const pb_field_t grpc_gcp_StartServerHandshakeReq_fields[7]; -extern const pb_field_t grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_fields[3]; -extern const pb_field_t grpc_gcp_NextHandshakeMessageReq_fields[2]; -extern const pb_field_t grpc_gcp_HandshakerReq_fields[4]; -extern const pb_field_t grpc_gcp_HandshakerResult_fields[8]; -extern const pb_field_t grpc_gcp_HandshakerStatus_fields[3]; -extern const pb_field_t grpc_gcp_HandshakerResp_fields[5]; - -/* Maximum encoded size of messages (where known) */ -/* grpc_gcp_Endpoint_size depends on runtime parameters */ -/* grpc_gcp_Identity_size depends on runtime parameters */ -/* grpc_gcp_StartClientHandshakeReq_size depends on runtime parameters */ -/* grpc_gcp_ServerHandshakeParameters_size depends on runtime parameters */ -/* grpc_gcp_StartServerHandshakeReq_size depends on runtime parameters */ -#define grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_size (17 + grpc_gcp_ServerHandshakeParameters_size) -/* grpc_gcp_NextHandshakeMessageReq_size depends on runtime parameters */ -#define grpc_gcp_HandshakerReq_size (18 + grpc_gcp_StartClientHandshakeReq_size + grpc_gcp_StartServerHandshakeReq_size + grpc_gcp_NextHandshakeMessageReq_size) -/* grpc_gcp_HandshakerResult_size depends on runtime parameters */ -/* grpc_gcp_HandshakerStatus_size depends on runtime parameters */ -/* grpc_gcp_HandshakerResp_size depends on runtime parameters */ - -/* Message IDs (where set with "msgid" option) */ -#ifdef PB_MSGID - -#define HANDSHAKER_MESSAGES \ - - -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif -/* @@protoc_insertion_point(eof) */ - -#endif diff --git a/src/core/tsi/alts/handshaker/transport_security_common.pb.c b/src/core/tsi/alts/handshaker/transport_security_common.pb.c deleted file mode 100644 index 326b1b10ab7..00000000000 --- a/src/core/tsi/alts/handshaker/transport_security_common.pb.c +++ /dev/null @@ -1,49 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.7-dev */ - -#include "src/core/tsi/alts/handshaker/transport_security_common.pb.h" -/* @@protoc_insertion_point(includes) */ -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - - - -const pb_field_t grpc_gcp_RpcProtocolVersions_fields[3] = { - PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_gcp_RpcProtocolVersions, max_rpc_version, max_rpc_version, &grpc_gcp_RpcProtocolVersions_Version_fields), - PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_gcp_RpcProtocolVersions, min_rpc_version, max_rpc_version, &grpc_gcp_RpcProtocolVersions_Version_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_gcp_RpcProtocolVersions_Version_fields[3] = { - PB_FIELD( 1, UINT32 , OPTIONAL, STATIC , FIRST, grpc_gcp_RpcProtocolVersions_Version, major, major, 0), - PB_FIELD( 2, UINT32 , OPTIONAL, STATIC , OTHER, grpc_gcp_RpcProtocolVersions_Version, minor, major, 0), - PB_LAST_FIELD -}; - - -/* Check that field information fits in pb_field_t */ -#if !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_32BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in 8 or 16 bit - * field descriptors. - */ -PB_STATIC_ASSERT((pb_membersize(grpc_gcp_RpcProtocolVersions, max_rpc_version) < 65536 && pb_membersize(grpc_gcp_RpcProtocolVersions, min_rpc_version) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_gcp_RpcProtocolVersions_grpc_gcp_RpcProtocolVersions_Version) -#endif - -#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_16BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in the default - * 8 bit descriptors. - */ -PB_STATIC_ASSERT((pb_membersize(grpc_gcp_RpcProtocolVersions, max_rpc_version) < 256 && pb_membersize(grpc_gcp_RpcProtocolVersions, min_rpc_version) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_gcp_RpcProtocolVersions_grpc_gcp_RpcProtocolVersions_Version) -#endif - - -/* @@protoc_insertion_point(eof) */ diff --git a/src/core/tsi/alts/handshaker/transport_security_common.pb.h b/src/core/tsi/alts/handshaker/transport_security_common.pb.h deleted file mode 100644 index 87d9abf149f..00000000000 --- a/src/core/tsi/alts/handshaker/transport_security_common.pb.h +++ /dev/null @@ -1,78 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.7-dev */ - -#ifndef PB_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PB_H_INCLUDED -#define PB_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PB_H_INCLUDED -#include "pb.h" -/* @@protoc_insertion_point(includes) */ -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Enum definitions */ -typedef enum _grpc_gcp_SecurityLevel { - grpc_gcp_SecurityLevel_SECURITY_NONE = 0, - grpc_gcp_SecurityLevel_INTEGRITY_ONLY = 1, - grpc_gcp_SecurityLevel_INTEGRITY_AND_PRIVACY = 2 -} grpc_gcp_SecurityLevel; -#define _grpc_gcp_SecurityLevel_MIN grpc_gcp_SecurityLevel_SECURITY_NONE -#define _grpc_gcp_SecurityLevel_MAX grpc_gcp_SecurityLevel_INTEGRITY_AND_PRIVACY -#define _grpc_gcp_SecurityLevel_ARRAYSIZE ((grpc_gcp_SecurityLevel)(grpc_gcp_SecurityLevel_INTEGRITY_AND_PRIVACY+1)) - -/* Struct definitions */ -typedef struct _grpc_gcp_RpcProtocolVersions_Version { - bool has_major; - uint32_t major; - bool has_minor; - uint32_t minor; -/* @@protoc_insertion_point(struct:grpc_gcp_RpcProtocolVersions_Version) */ -} grpc_gcp_RpcProtocolVersions_Version; - -typedef struct _grpc_gcp_RpcProtocolVersions { - bool has_max_rpc_version; - grpc_gcp_RpcProtocolVersions_Version max_rpc_version; - bool has_min_rpc_version; - grpc_gcp_RpcProtocolVersions_Version min_rpc_version; -/* @@protoc_insertion_point(struct:grpc_gcp_RpcProtocolVersions) */ -} grpc_gcp_RpcProtocolVersions; - -/* Default values for struct fields */ - -/* Initializer values for message structs */ -#define grpc_gcp_RpcProtocolVersions_init_default {false, grpc_gcp_RpcProtocolVersions_Version_init_default, false, grpc_gcp_RpcProtocolVersions_Version_init_default} -#define grpc_gcp_RpcProtocolVersions_Version_init_default {false, 0, false, 0} -#define grpc_gcp_RpcProtocolVersions_init_zero {false, grpc_gcp_RpcProtocolVersions_Version_init_zero, false, grpc_gcp_RpcProtocolVersions_Version_init_zero} -#define grpc_gcp_RpcProtocolVersions_Version_init_zero {false, 0, false, 0} - -/* Field tags (for use in manual encoding/decoding) */ -#define grpc_gcp_RpcProtocolVersions_Version_major_tag 1 -#define grpc_gcp_RpcProtocolVersions_Version_minor_tag 2 -#define grpc_gcp_RpcProtocolVersions_max_rpc_version_tag 1 -#define grpc_gcp_RpcProtocolVersions_min_rpc_version_tag 2 - -/* Struct field encoding specification for nanopb */ -extern const pb_field_t grpc_gcp_RpcProtocolVersions_fields[3]; -extern const pb_field_t grpc_gcp_RpcProtocolVersions_Version_fields[3]; - -/* Maximum encoded size of messages (where known) */ -#define grpc_gcp_RpcProtocolVersions_size 28 -#define grpc_gcp_RpcProtocolVersions_Version_size 12 - -/* Message IDs (where set with "msgid" option) */ -#ifdef PB_MSGID - -#define TRANSPORT_SECURITY_COMMON_MESSAGES \ - - -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif -/* @@protoc_insertion_point(eof) */ - -#endif diff --git a/src/core/tsi/alts/handshaker/transport_security_common_api.cc b/src/core/tsi/alts/handshaker/transport_security_common_api.cc index 6c518c1ff31..c7b9fafd935 100644 --- a/src/core/tsi/alts/handshaker/transport_security_common_api.cc +++ b/src/core/tsi/alts/handshaker/transport_security_common_api.cc @@ -29,9 +29,6 @@ bool grpc_gcp_rpc_protocol_versions_set_max( "grpc_gcp_rpc_protocol_versions_set_max()."); return false; } - versions->has_max_rpc_version = true; - versions->max_rpc_version.has_major = true; - versions->max_rpc_version.has_minor = true; versions->max_rpc_version.major = max_major; versions->max_rpc_version.minor = max_minor; return true; @@ -46,63 +43,45 @@ bool grpc_gcp_rpc_protocol_versions_set_min( "grpc_gcp_rpc_protocol_versions_set_min()."); return false; } - versions->has_min_rpc_version = true; - versions->min_rpc_version.has_major = true; - versions->min_rpc_version.has_minor = true; versions->min_rpc_version.major = min_major; versions->min_rpc_version.minor = min_minor; return true; } -size_t grpc_gcp_rpc_protocol_versions_encode_length( - const grpc_gcp_rpc_protocol_versions* versions) { - if (versions == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to " - "grpc_gcp_rpc_protocol_versions_encode_length()."); - return 0; - } - pb_ostream_t size_stream; - memset(&size_stream, 0, sizeof(pb_ostream_t)); - if (!pb_encode(&size_stream, grpc_gcp_RpcProtocolVersions_fields, versions)) { - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&size_stream)); - return 0; - } - return size_stream.bytes_written; -} - -bool grpc_gcp_rpc_protocol_versions_encode_to_raw_bytes( - const grpc_gcp_rpc_protocol_versions* versions, uint8_t* bytes, - size_t bytes_length) { - if (versions == nullptr || bytes == nullptr || bytes_length == 0) { +bool grpc_gcp_rpc_protocol_versions_encode( + const grpc_gcp_rpc_protocol_versions* versions, grpc_slice* slice) { + if (versions == nullptr || slice == nullptr) { gpr_log(GPR_ERROR, "Invalid nullptr arguments to " - "grpc_gcp_rpc_protocol_versions_encode_to_raw_bytes()."); - return false; - } - pb_ostream_t output_stream = pb_ostream_from_buffer(bytes, bytes_length); - if (!pb_encode(&output_stream, grpc_gcp_RpcProtocolVersions_fields, - versions)) { - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&output_stream)); + "grpc_gcp_rpc_protocol_versions_encode()."); return false; } - return true; + upb::Arena arena; + grpc_gcp_RpcProtocolVersions* versions_msg = + grpc_gcp_RpcProtocolVersions_new(arena.ptr()); + grpc_gcp_RpcProtocolVersions_assign_from_struct(versions_msg, arena.ptr(), + versions); + return grpc_gcp_rpc_protocol_versions_encode(versions_msg, arena.ptr(), + slice); } bool grpc_gcp_rpc_protocol_versions_encode( - const grpc_gcp_rpc_protocol_versions* versions, grpc_slice* slice) { - if (versions == nullptr || slice == nullptr) { + const grpc_gcp_RpcProtocolVersions* versions, upb_arena* arena, + grpc_slice* slice) { + if (versions == nullptr || arena == nullptr || slice == nullptr) { gpr_log(GPR_ERROR, "Invalid nullptr arguments to " "grpc_gcp_rpc_protocol_versions_encode()."); return false; } - size_t encoded_length = - grpc_gcp_rpc_protocol_versions_encode_length(versions); - if (encoded_length == 0) return false; - *slice = grpc_slice_malloc(encoded_length); - return grpc_gcp_rpc_protocol_versions_encode_to_raw_bytes( - versions, GRPC_SLICE_START_PTR(*slice), encoded_length); + size_t buf_length; + char* buf = + grpc_gcp_RpcProtocolVersions_serialize(versions, arena, &buf_length); + if (buf == nullptr) { + return false; + } + *slice = grpc_slice_from_copied_buffer(buf, buf_length); + return true; } bool grpc_gcp_rpc_protocol_versions_decode( @@ -113,16 +92,63 @@ bool grpc_gcp_rpc_protocol_versions_decode( "grpc_gcp_rpc_protocol_versions_decode()."); return false; } - pb_istream_t stream = - pb_istream_from_buffer(const_cast(GRPC_SLICE_START_PTR(slice)), - GRPC_SLICE_LENGTH(slice)); - if (!pb_decode(&stream, grpc_gcp_RpcProtocolVersions_fields, versions)) { - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&stream)); + upb::Arena arena; + grpc_gcp_RpcProtocolVersions* versions_msg = + grpc_gcp_RpcProtocolVersions_parse( + reinterpret_cast(GRPC_SLICE_START_PTR(slice)), + GRPC_SLICE_LENGTH(slice), arena.ptr()); + if (versions_msg == nullptr) { + gpr_log(GPR_ERROR, "cannot deserialize RpcProtocolVersions message"); return false; } + grpc_gcp_rpc_protocol_versions_assign_from_upb(versions, versions_msg); return true; } +void grpc_gcp_rpc_protocol_versions_assign_from_upb( + grpc_gcp_rpc_protocol_versions* versions, + const grpc_gcp_RpcProtocolVersions* value) { + const grpc_gcp_RpcProtocolVersions_Version* max_version_msg = + grpc_gcp_RpcProtocolVersions_max_rpc_version(value); + if (max_version_msg != nullptr) { + versions->max_rpc_version.major = + grpc_gcp_RpcProtocolVersions_Version_major(max_version_msg); + versions->max_rpc_version.minor = + grpc_gcp_RpcProtocolVersions_Version_minor(max_version_msg); + } else { + versions->max_rpc_version.major = 0; + versions->max_rpc_version.minor = 0; + } + const grpc_gcp_RpcProtocolVersions_Version* min_version_msg = + grpc_gcp_RpcProtocolVersions_min_rpc_version(value); + if (min_version_msg != nullptr) { + versions->min_rpc_version.major = + grpc_gcp_RpcProtocolVersions_Version_major(min_version_msg); + versions->min_rpc_version.minor = + grpc_gcp_RpcProtocolVersions_Version_minor(min_version_msg); + } else { + versions->min_rpc_version.major = 0; + versions->min_rpc_version.minor = 0; + } +} + +void grpc_gcp_RpcProtocolVersions_assign_from_struct( + grpc_gcp_RpcProtocolVersions* versions, upb_arena* arena, + const grpc_gcp_rpc_protocol_versions* value) { + grpc_gcp_RpcProtocolVersions_Version* max_version_msg = + grpc_gcp_RpcProtocolVersions_mutable_max_rpc_version(versions, arena); + grpc_gcp_RpcProtocolVersions_Version_set_major(max_version_msg, + value->max_rpc_version.major); + grpc_gcp_RpcProtocolVersions_Version_set_minor(max_version_msg, + value->max_rpc_version.minor); + grpc_gcp_RpcProtocolVersions_Version* min_version_msg = + grpc_gcp_RpcProtocolVersions_mutable_min_rpc_version(versions, arena); + grpc_gcp_RpcProtocolVersions_Version_set_major(min_version_msg, + value->min_rpc_version.major); + grpc_gcp_RpcProtocolVersions_Version_set_minor(min_version_msg, + value->min_rpc_version.minor); +} + bool grpc_gcp_rpc_protocol_versions_copy( const grpc_gcp_rpc_protocol_versions* src, grpc_gcp_rpc_protocol_versions* dst) { diff --git a/src/core/tsi/alts/handshaker/transport_security_common_api.h b/src/core/tsi/alts/handshaker/transport_security_common_api.h index 27942c8ae4c..75739e4fe76 100644 --- a/src/core/tsi/alts/handshaker/transport_security_common_api.h +++ b/src/core/tsi/alts/handshaker/transport_security_common_api.h @@ -21,20 +21,24 @@ #include -#include "pb_decode.h" -#include "pb_encode.h" - #include #include #include #include -#include "src/core/tsi/alts/handshaker/transport_security_common.pb.h" +#include "src/proto/grpc/gcp/transport_security_common.upb.h" -typedef grpc_gcp_RpcProtocolVersions grpc_gcp_rpc_protocol_versions; +// C struct coresponding to protobuf message RpcProtocolVersions.Version +typedef struct _grpc_gcp_RpcProtocolVersions_Version { + uint32_t major; + uint32_t minor; +} grpc_gcp_rpc_protocol_versions_version; -typedef grpc_gcp_RpcProtocolVersions_Version - grpc_gcp_rpc_protocol_versions_version; +// C struct coresponding to protobuf message RpcProtocolVersions +typedef struct _grpc_gcp_RpcProtocolVersions { + grpc_gcp_rpc_protocol_versions_version max_rpc_version; + grpc_gcp_rpc_protocol_versions_version min_rpc_version; +} grpc_gcp_rpc_protocol_versions; /** * This method sets the value for max_rpc_versions field of rpc protocol @@ -65,41 +69,30 @@ bool grpc_gcp_rpc_protocol_versions_set_min( uint32_t min_minor); /** - * This method computes serialized byte length of rpc protocol versions. - * - * - versions: an rpc protocol versions instance. - * - * The method returns serialized byte length. It returns 0 on failure. - */ -size_t grpc_gcp_rpc_protocol_versions_encode_length( - const grpc_gcp_rpc_protocol_versions* versions); - -/** - * This method serializes rpc protocol versions and writes the result to - * the memory buffer provided by the caller. Caller is responsible for - * allocating sufficient memory to store the serialized data. + * This method serializes an rpc protocol version and returns serialized rpc + * versions in grpc slice. * * - versions: an rpc protocol versions instance. - * - bytes: bytes buffer where the result will be written to. - * - bytes_length: length of the bytes buffer. + * - slice: grpc slice where the serialized result will be written. * * The method returns true on success and false otherwise. */ -bool grpc_gcp_rpc_protocol_versions_encode_to_raw_bytes( - const grpc_gcp_rpc_protocol_versions* versions, uint8_t* bytes, - size_t bytes_length); +bool grpc_gcp_rpc_protocol_versions_encode( + const grpc_gcp_rpc_protocol_versions* versions, grpc_slice* slice); /** * This method serializes an rpc protocol version and returns serialized rpc * versions in grpc slice. * * - versions: an rpc protocol versions instance. + * - arena: upb arena. * - slice: grpc slice where the serialized result will be written. * * The method returns true on success and false otherwise. */ bool grpc_gcp_rpc_protocol_versions_encode( - const grpc_gcp_rpc_protocol_versions* versions, grpc_slice* slice); + const grpc_gcp_RpcProtocolVersions* versions, upb_arena* arena, + grpc_slice* slice); /** * This method de-serializes input in grpc slice form and stores the result @@ -114,6 +107,21 @@ bool grpc_gcp_rpc_protocol_versions_encode( bool grpc_gcp_rpc_protocol_versions_decode( const grpc_slice& slice, grpc_gcp_rpc_protocol_versions* versions); +/** + * Assigns value of upb RpcProtocolVersions to grpc_gcp_rpc_protocol_versions. + */ +void grpc_gcp_rpc_protocol_versions_assign_from_upb( + grpc_gcp_rpc_protocol_versions* versions, + const grpc_gcp_RpcProtocolVersions* value); + +/** + * Assigns value of struct grpc_gcp_rpc_protocol_versions to + * RpcProtocolVersions. + */ +void grpc_gcp_RpcProtocolVersions_assign_from_struct( + grpc_gcp_RpcProtocolVersions* versions, upb_arena* arena, + const grpc_gcp_rpc_protocol_versions* value); + /** * This method performs a deep copy operation on rpc protocol versions * instance. diff --git a/src/core/tsi/ssl_transport_security.cc b/src/core/tsi/ssl_transport_security.cc index d3c8982c847..32a96b23f29 100644 --- a/src/core/tsi/ssl_transport_security.cc +++ b/src/core/tsi/ssl_transport_security.cc @@ -350,11 +350,19 @@ static tsi_result add_subject_alt_names_properties_to_peer( for (i = 0; i < subject_alt_name_count; i++) { GENERAL_NAME* subject_alt_name = sk_GENERAL_NAME_value(subject_alt_names, TSI_SIZE_AS_SIZE(i)); - /* Filter out the non-dns entries names. */ - if (subject_alt_name->type == GEN_DNS) { + if (subject_alt_name->type == GEN_DNS || + subject_alt_name->type == GEN_EMAIL || + subject_alt_name->type == GEN_URI) { unsigned char* name = nullptr; int name_size; - name_size = ASN1_STRING_to_UTF8(&name, subject_alt_name->d.dNSName); + if (subject_alt_name->type == GEN_DNS) { + name_size = ASN1_STRING_to_UTF8(&name, subject_alt_name->d.dNSName); + } else if (subject_alt_name->type == GEN_EMAIL) { + name_size = ASN1_STRING_to_UTF8(&name, subject_alt_name->d.rfc822Name); + } else { + name_size = ASN1_STRING_to_UTF8( + &name, subject_alt_name->d.uniformResourceIdentifier); + } if (name_size < 0) { gpr_log(GPR_ERROR, "Could not get utf8 from asn1 string."); result = TSI_INTERNAL_ERROR; @@ -703,8 +711,8 @@ static tsi_result populate_ssl_context( } /* Extracts the CN and the SANs from an X509 cert as a peer object. */ -static tsi_result extract_x509_subject_names_from_pem_cert(const char* pem_cert, - tsi_peer* peer) { +tsi_result tsi_ssl_extract_x509_subject_names_from_pem_cert( + const char* pem_cert, tsi_peer* peer) { tsi_result result = TSI_OK; X509* cert = nullptr; BIO* pem; @@ -1882,7 +1890,7 @@ tsi_result tsi_create_ssl_server_handshaker_factory_with_options( } /* TODO(jboeuf): Add revocation verification. */ - result = extract_x509_subject_names_from_pem_cert( + result = tsi_ssl_extract_x509_subject_names_from_pem_cert( options->pem_key_cert_pairs[i].cert_chain, &impl->ssl_context_x509_subject_names[i]); if (result != TSI_OK) break; diff --git a/src/core/tsi/ssl_transport_security.h b/src/core/tsi/ssl_transport_security.h index 0203141e56e..04f038ac3b4 100644 --- a/src/core/tsi/ssl_transport_security.h +++ b/src/core/tsi/ssl_transport_security.h @@ -332,4 +332,8 @@ const tsi_ssl_handshaker_factory_vtable* tsi_ssl_handshaker_factory_swap_vtable( tsi_ssl_handshaker_factory* factory, tsi_ssl_handshaker_factory_vtable* new_vtable); +/* Exposed for testing only. */ +tsi_result tsi_ssl_extract_x509_subject_names_from_pem_cert( + const char* pem_cert, tsi_peer* peer); + #endif /* GRPC_CORE_TSI_SSL_TRANSPORT_SECURITY_H */ diff --git a/src/core/tsi/test_creds/BUILD b/src/core/tsi/test_creds/BUILD index 732f6d91b26..b83c87de723 100644 --- a/src/core/tsi/test_creds/BUILD +++ b/src/core/tsi/test_creds/BUILD @@ -26,4 +26,6 @@ exports_files([ "badserver.pem", "badclient.key", "badclient.pem", + "multi-domain.key", + "multi-domain.pem", ]) diff --git a/src/core/tsi/test_creds/multi-domain.key b/src/core/tsi/test_creds/multi-domain.key new file mode 100644 index 00000000000..74e8122e186 --- /dev/null +++ b/src/core/tsi/test_creds/multi-domain.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAtCJ7xmvXxypNx7d6vV9YWZ3SHtm7+OrnDP9LBokGvpkIUloJ +q6IJxVQPTepJWM7JfXGtWgkdfmUCZjswlQmvbCJSYA8+Y76Sm9M6sf26RsMayxXU +ozWdw227frCpQt2ybor7qOLBBbQ30XbsdxPIwlrJst9Shleey93g56EDkhZWQQMN +8cciakv9zUz6GwRu3XtK4KGtWb3VpsOhf8WAoVQ05o4Cevz3LrY7NcZj2IvIna5V ++E5QxQnRXpd5gNzyE1rbzN3pXmHk2SShGI7sEqgo9HOfu7EufwsfmaCXbuCNGhlS +4YfJvuqZ7ElijUbMnYu3eGKWfjymfp/7qHu87wIDAQABAoIBAQCtgU2BaJy1XN0A +Uo1p3G2IHEioqIazEuesEDaeu9uAOHzYfZs082W/6OC45sLxRHS1XIph38fF19tA +xyBbXbHXURPRLL2ma4hhiUrO6JrEz+Z92LAw6FLmS0q+k8DlBA97BGm0WX0cVmMx +YgAQDkFgWvxOS2b8uWbd7QBVezSqPzN8iV2GNmnEA7FIphqqJbkgEBOxbwJig5Ll +WJ51Q8nWWVZS1AY2kJjf2ndFJgrB3Zbuib0nnmjsG4esB5AS9Fyjadmc+ilU7ceX +y+AdccV2cO0f9k8SBPWHUrRuiuMTcwoQ/r2HN9THaho1QBWPRPjzvXetKLTzRdK0 ++yzEI9x5AoGBAO+CYFKWwt8ylrqQzuGPVYu32RUaVgUtZVsWoF5vzK35WYFCfA+S +qIO+wPs06py79Ytgk/ff5QCz7DRepdlrmyq5ZqZ0xD858H8qzNByySZI0DSJU1wr +7Uw/5vf/+6/1/dmgPrT7HjZyGuvqq1XieBcjonQ5RYooEcjCcCnz9+z9AoGBAMCJ +kApBhTOVBquiXiqEsrbrT7s8u2KbqN9L7E2o5MnfG7sIhrFbY0Bjvdsut1omfBxd +XpTWnyR+OLd6xSpBB5fEBKD21dotwgNmJm+wTAER8ZpohlTLv8gQRHclkFg5chyY +2LJKfssiaXvocKMq3CwM7XAnbI8OTDnwxSqAfCtbAoGBAI7RGGzG90auXNC83pAD +r0gUBb8eqCKIMkMBl/kYA13OLP/1zBJhKlj82wgwQqHZNo64tSL+gAhOQU/tDEo8 +bxcn3LzvLcJh4zWBKQY3HBjXHEfnhyyUCPkJtck1/DetoIQvmJTElPx0R/dbRHV/ +CIsLtahGKmA6inhC8S0jDDhlAoGAX5svglg8q3uB33J17gkMsVYxtlkW94UyGweZ +ZIrMaQ23uG0obSNjKpMcsJ0HAOYBVRhsId5dEgL3aOy2wR+fhJYack9/q6JzJ7ru +tSFG7HUbkr/6jFrMdazWQo/NmHGWH2sql4X0ZixFUvj+DZf30ovsz3dUKclAwriz +P0Kj5ecCgYBbn1REy6+5x6lLO2SIymharMTPSG23GBiwPTSpyMD5WbzqKEQVSSJX +eIaaTPz68HOmgvBZUE7Svbz/OqhDEgZxZG9o7Pr4tsdAUzAt/LNkYA8BOjTnrx7W +ANPvr6b2UHBn26SitdwC5emdsGZIPBGS0XDzznvNwxl2+t14iteEbg== +-----END RSA PRIVATE KEY----- diff --git a/src/core/tsi/test_creds/multi-domain.pem b/src/core/tsi/test_creds/multi-domain.pem new file mode 100644 index 00000000000..cf28b4a6cfa --- /dev/null +++ b/src/core/tsi/test_creds/multi-domain.pem @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIID5DCCAsygAwIBAgIUMmNBVcGnMw2sMASWhdn5IvFktoYwDQYJKoZIhvcNAQEL +BQAwSjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQHDAJTRjEPMA0G +A1UECwwGR29vZ2xlMRAwDgYDVQQDDAd4cGlnb3JzMB4XDTE5MDgwNzIxMDY0NVoX +DTIwMDgwNjIxMDY0NVowSjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYD +VQQHDAJTRjEPMA0GA1UECwwGR29vZ2xlMRAwDgYDVQQDDAd4cGlnb3JzMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtCJ7xmvXxypNx7d6vV9YWZ3SHtm7 ++OrnDP9LBokGvpkIUloJq6IJxVQPTepJWM7JfXGtWgkdfmUCZjswlQmvbCJSYA8+ +Y76Sm9M6sf26RsMayxXUozWdw227frCpQt2ybor7qOLBBbQ30XbsdxPIwlrJst9S +hleey93g56EDkhZWQQMN8cciakv9zUz6GwRu3XtK4KGtWb3VpsOhf8WAoVQ05o4C +evz3LrY7NcZj2IvIna5V+E5QxQnRXpd5gNzyE1rbzN3pXmHk2SShGI7sEqgo9HOf +u7EufwsfmaCXbuCNGhlS4YfJvuqZ7ElijUbMnYu3eGKWfjymfp/7qHu87wIDAQAB +o4HBMIG+MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgXgMIGjBgNVHREEgZswgZiCE2Zv +by50ZXN0LmRvbWFpbi5jb22CE2Jhci50ZXN0LmRvbWFpbi5jb22BE2Zvb0B0ZXN0 +LmRvbWFpbi5jb22BE2JhckB0ZXN0LmRvbWFpbi5jb22GIGh0dHBzOi8vZm9vLnRl +c3QuZG9tYWluLmNvbS90ZXN0hiBodHRwczovL2Jhci50ZXN0LmRvbWFpbi5jb20v +dGVzdDANBgkqhkiG9w0BAQsFAAOCAQEAIu99zFdybv5OoLNYeyhZsiGjHJQ/ECYr +dp4XeRftwO5lvLUbxDz4nfs7dedDYqk+amfgJsVg9zDykeAslvjmuWHJ1IgACAqm +SlR43gwWt1YMXH7NJ8unAxF3OwGDMdIA5WJfYo2XFz4o55wWCiUbxCpWJYu8hwz6 +6IRmn6hWWsxlflWmgaV5hYKL8bLF13Ku9gZbNFFJw6knyqw+x4b1LwsnKeZGvS7E +EvGVyhMylPVFc0ZZy0TZvk3UOR9TbIMXiztQIWrw30izwPNElvUTzSkAbAg+h6+8 +G7xSZYDr6l81M0a3S2VU75yjMCHKP5/wE9hsfTr/NpWN7w5w5PmqdA== +-----END CERTIFICATE----- diff --git a/src/cpp/Protobuf-C++.podspec b/src/cpp/Protobuf-C++.podspec new file mode 100644 index 00000000000..f6a488dc350 --- /dev/null +++ b/src/cpp/Protobuf-C++.podspec @@ -0,0 +1,42 @@ +Pod::Spec.new do |s| + s.name = 'Protobuf-C++' + s.version = '3.8.0' + s.summary = 'Protocol Buffers v3 runtime library for C++.' + s.homepage = 'https://github.com/google/protobuf' + s.license = '3-Clause BSD License' + s.authors = { 'The Protocol Buffers contributors' => 'protobuf@googlegroups.com' } + s.cocoapods_version = '>= 1.0' + + s.source = { :git => 'https://github.com/google/protobuf.git', + :tag => "v#{s.version}" } + + s.source_files = 'src/google/protobuf/*.{h,cc,inc}', + 'src/google/protobuf/stubs/*.{h,cc}', + 'src/google/protobuf/io/*.{h,cc}', + 'src/google/protobuf/util/*.{h,cc}', + 'src/google/protobuf/util/internal/*.{h,cc}' + + # Excluding all the tests in the directories above + s.exclude_files = 'src/google/**/*_test.{h,cc,inc}', + 'src/google/**/*_unittest.{h,cc}', + 'src/google/protobuf/test_util*.{h,cc}', + 'src/google/protobuf/map_lite_test_util.{h,cc}', + 'src/google/protobuf/map_test_util*.{h,cc,inc}' + + s.header_mappings_dir = 'src' + + s.ios.deployment_target = '7.0' + s.osx.deployment_target = '10.9' + s.tvos.deployment_target = '9.0' + s.watchos.deployment_target = '2.0' + + s.pod_target_xcconfig = { + # Do not let src/google/protobuf/stubs/time.h override system API + 'USE_HEADERMAP' => 'NO', + 'ALWAYS_SEARCH_USER_PATHS' => 'NO', + + # Configure tool is not being used for Xcode. When building, assume pthread is supported. + 'GCC_PREPROCESSOR_DEFINITIONS' => '"$(inherited)" "HAVE_PTHREAD=1"', + } + +end diff --git a/src/cpp/common/version_cc.cc b/src/cpp/common/version_cc.cc index 7fb7823c9f2..71ddc6e5d71 100644 --- a/src/cpp/common/version_cc.cc +++ b/src/cpp/common/version_cc.cc @@ -22,5 +22,5 @@ #include namespace grpc { -grpc::string Version() { return "1.23.0-dev"; } +grpc::string Version() { return "1.24.0-dev"; } } // namespace grpc diff --git a/src/cpp/ext/filters/census/client_filter.cc b/src/cpp/ext/filters/census/client_filter.cc index 940d42d1000..45a883c45b8 100644 --- a/src/cpp/ext/filters/census/client_filter.cc +++ b/src/cpp/ext/filters/census/client_filter.cc @@ -94,7 +94,8 @@ void CensusClientCallData::StartTransportStreamOpBatch( op->send_initial_metadata()->batch(), &tracing_bin_, grpc_mdelem_from_slices( GRPC_MDSTR_GRPC_TRACE_BIN, - grpc_slice_from_copied_buffer(tracing_buf_, tracing_len)))); + grpc_core::UnmanagedMemorySlice(tracing_buf_, tracing_len)), + GRPC_BATCH_GRPC_TRACE_BIN)); } grpc_slice tags = grpc_empty_slice(); // TODO: Add in tagging serialization. @@ -104,7 +105,8 @@ void CensusClientCallData::StartTransportStreamOpBatch( "census grpc_filter", grpc_metadata_batch_add_tail( op->send_initial_metadata()->batch(), &stats_bin_, - grpc_mdelem_from_slices(GRPC_MDSTR_GRPC_TAGS_BIN, tags))); + grpc_mdelem_from_slices(GRPC_MDSTR_GRPC_TAGS_BIN, tags), + GRPC_BATCH_GRPC_TAGS_BIN)); } } diff --git a/src/cpp/ext/filters/census/server_filter.cc b/src/cpp/ext/filters/census/server_filter.cc index b5f3d5a13a7..09ceb9f1da8 100644 --- a/src/cpp/ext/filters/census/server_filter.cc +++ b/src/cpp/ext/filters/census/server_filter.cc @@ -50,12 +50,12 @@ void FilterInitialMetadata(grpc_metadata_batch* b, if (b->idx.named.grpc_trace_bin != nullptr) { sml->tracing_slice = grpc_slice_ref_internal(GRPC_MDVALUE(b->idx.named.grpc_trace_bin->md)); - grpc_metadata_batch_remove(b, b->idx.named.grpc_trace_bin); + grpc_metadata_batch_remove(b, GRPC_BATCH_GRPC_TRACE_BIN); } if (b->idx.named.grpc_tags_bin != nullptr) { sml->census_proto = grpc_slice_ref_internal(GRPC_MDVALUE(b->idx.named.grpc_tags_bin->md)); - grpc_metadata_batch_remove(b, b->idx.named.grpc_tags_bin); + grpc_metadata_batch_remove(b, GRPC_BATCH_GRPC_TAGS_BIN); } } @@ -155,7 +155,8 @@ void CensusServerCallData::StartTransportStreamOpBatch( op->send_trailing_metadata()->batch(), &census_bin_, grpc_mdelem_from_slices( GRPC_MDSTR_GRPC_SERVER_STATS_BIN, - grpc_slice_from_copied_buffer(stats_buf_, len)))); + grpc_core::UnmanagedMemorySlice(stats_buf_, len)), + GRPC_BATCH_GRPC_SERVER_STATS_BIN)); } } // Call next op. diff --git a/src/cpp/server/health/default_health_check_service.cc b/src/cpp/server/health/default_health_check_service.cc index 01bc51aa213..c6fd4c20fff 100644 --- a/src/cpp/server/health/default_health_check_service.cc +++ b/src/cpp/server/health/default_health_check_service.cc @@ -24,10 +24,10 @@ #include #include -#include "pb_decode.h" -#include "pb_encode.h" -#include "src/core/ext/filters/client_channel/health/health.pb.h" #include "src/cpp/server/health/default_health_check_service.h" +#include "src/proto/grpc/health/v1/health.upb.h" + +#define MAX_SERVICE_NAME_LENGTH 200 namespace grpc { @@ -204,8 +204,6 @@ bool DefaultHealthCheckService::HealthCheckServiceImpl::DecodeRequest( if (!request.Dump(&slices).ok()) return false; uint8_t* request_bytes = nullptr; size_t request_size = 0; - grpc_health_v1_HealthCheckRequest request_struct; - request_struct.has_service = false; if (slices.size() == 1) { request_bytes = const_cast(slices[0].begin()); request_size = slices[0].size(); @@ -217,37 +215,43 @@ bool DefaultHealthCheckService::HealthCheckServiceImpl::DecodeRequest( copy_to += slices[i].size(); } } - pb_istream_t istream = pb_istream_from_buffer(request_bytes, request_size); - bool decode_status = pb_decode( - &istream, grpc_health_v1_HealthCheckRequest_fields, &request_struct); + upb::Arena arena; + grpc_health_v1_HealthCheckRequest* request_struct = + grpc_health_v1_HealthCheckRequest_parse( + reinterpret_cast(request_bytes), request_size, arena.ptr()); if (slices.size() > 1) { gpr_free(request_bytes); } - if (!decode_status) return false; - *service_name = request_struct.has_service ? request_struct.service : ""; + if (request_struct == nullptr) { + return false; + } + upb_strview service = + grpc_health_v1_HealthCheckRequest_service(request_struct); + if (service.size > MAX_SERVICE_NAME_LENGTH) { + return false; + } + service_name->assign(service.data, service.size); return true; } bool DefaultHealthCheckService::HealthCheckServiceImpl::EncodeResponse( ServingStatus status, ByteBuffer* response) { - grpc_health_v1_HealthCheckResponse response_struct; - response_struct.has_status = true; - response_struct.status = + upb::Arena arena; + grpc_health_v1_HealthCheckResponse* response_struct = + grpc_health_v1_HealthCheckResponse_new(arena.ptr()); + grpc_health_v1_HealthCheckResponse_set_status( + response_struct, status == NOT_FOUND - ? grpc_health_v1_HealthCheckResponse_ServingStatus_SERVICE_UNKNOWN - : status == SERVING - ? grpc_health_v1_HealthCheckResponse_ServingStatus_SERVING - : grpc_health_v1_HealthCheckResponse_ServingStatus_NOT_SERVING; - pb_ostream_t ostream; - memset(&ostream, 0, sizeof(ostream)); - pb_encode(&ostream, grpc_health_v1_HealthCheckResponse_fields, - &response_struct); - grpc_slice response_slice = grpc_slice_malloc(ostream.bytes_written); - ostream = pb_ostream_from_buffer(GRPC_SLICE_START_PTR(response_slice), - GRPC_SLICE_LENGTH(response_slice)); - bool encode_status = pb_encode( - &ostream, grpc_health_v1_HealthCheckResponse_fields, &response_struct); - if (!encode_status) return false; + ? grpc_health_v1_HealthCheckResponse_SERVICE_UNKNOWN + : status == SERVING ? grpc_health_v1_HealthCheckResponse_SERVING + : grpc_health_v1_HealthCheckResponse_NOT_SERVING); + size_t buf_length; + char* buf = grpc_health_v1_HealthCheckResponse_serialize( + response_struct, arena.ptr(), &buf_length); + if (buf == nullptr) { + return false; + } + grpc_slice response_slice = grpc_slice_from_copied_buffer(buf, buf_length); Slice encoded_response(response_slice, Slice::STEAL_REF); ByteBuffer response_buffer(&encoded_response, 1); response->Swap(&response_buffer); diff --git a/src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs b/src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs index d859075c3bd..e6c973431d7 100644 --- a/src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs +++ b/src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs @@ -61,7 +61,7 @@ namespace Grpc.Auth return new AsyncAuthInterceptor((context, metadata) => { metadata.Add(CreateBearerTokenHeader(accessToken)); - return TaskUtils.CompletedTask; + return GetCompletedTask(); }); } @@ -69,5 +69,17 @@ namespace Grpc.Auth { return new Metadata.Entry(AuthorizationHeader, Schema + " " + accessToken); } + + /// + /// Framework independent equivalent of Task.CompletedTask. + /// + private static Task GetCompletedTask() + { +#if NETSTANDARD1_5 || NETSTANDARD2_0 + return Task.CompletedTask; +#else + return Task.FromResult(null); // for .NET45, emulate the functionality +#endif + } } } diff --git a/src/csharp/Grpc.Auth/Grpc.Auth.csproj b/src/csharp/Grpc.Auth/Grpc.Auth.csproj index 298b721409e..1e559c19872 100755 --- a/src/csharp/Grpc.Auth/Grpc.Auth.csproj +++ b/src/csharp/Grpc.Auth/Grpc.Auth.csproj @@ -27,7 +27,7 @@ - + None diff --git a/src/csharp/Grpc.Core.Api/AsyncStreamReaderExtensions.cs b/src/csharp/Grpc.Core.Api/AsyncStreamReaderExtensions.cs new file mode 100644 index 00000000000..a1f895723ed --- /dev/null +++ b/src/csharp/Grpc.Core.Api/AsyncStreamReaderExtensions.cs @@ -0,0 +1,50 @@ +#region Copyright notice and license + +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#endregion + +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace Grpc.Core +{ + /// + /// Extension methods for . + /// + public static class AsyncStreamReaderExtensions + { + /// + /// Advances the stream reader to the next element in the sequence, returning the result asynchronously. + /// + /// The message type. + /// The stream reader. + /// + /// Task containing the result of the operation: true if the reader was successfully advanced + /// to the next element; false if the reader has passed the end of the sequence. + /// + public static Task MoveNext(this IAsyncStreamReader streamReader) + where T : class + { + if (streamReader == null) + { + throw new ArgumentNullException(nameof(streamReader)); + } + + return streamReader.MoveNext(CancellationToken.None); + } + } +} diff --git a/src/csharp/Grpc.Core.Api/CallCredentials.cs b/src/csharp/Grpc.Core.Api/CallCredentials.cs index 6344a881070..3b150a211c2 100644 --- a/src/csharp/Grpc.Core.Api/CallCredentials.cs +++ b/src/csharp/Grpc.Core.Api/CallCredentials.cs @@ -51,8 +51,8 @@ namespace Grpc.Core } /// - /// Populates this call credential instances. - /// You never need to invoke this, part of internal implementation. + /// Populates call credentials configurator with this instance's configuration. + /// End users never need to invoke this method as it is part of internal implementation. /// public abstract void InternalPopulateConfiguration(CallCredentialsConfiguratorBase configurator, object state); diff --git a/src/csharp/Grpc.Core.Api/ChannelBase.cs b/src/csharp/Grpc.Core.Api/ChannelBase.cs new file mode 100644 index 00000000000..54546300e81 --- /dev/null +++ b/src/csharp/Grpc.Core.Api/ChannelBase.cs @@ -0,0 +1,52 @@ +#region Copyright notice and license + +// Copyright 2019 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#endregion + +using System; +using Grpc.Core.Utils; + +namespace Grpc.Core +{ + /// + /// Base class for gRPC channel. Channels are an abstraction of long-lived connections to remote servers. + /// + public abstract class ChannelBase + { + private readonly string target; + + /// + /// Initializes a new instance of class that connects to a specific host. + /// + /// Target of the channel. + protected ChannelBase(string target) + { + this.target = GrpcPreconditions.CheckNotNull(target, nameof(target)); + } + + /// The original target used to create the channel. + public string Target + { + get { return this.target; } + } + + /// + /// Create a new for the channel. + /// + /// A new . + public abstract CallInvoker CreateCallInvoker(); + } +} diff --git a/src/csharp/Grpc.Core.Api/ChannelCredentials.cs b/src/csharp/Grpc.Core.Api/ChannelCredentials.cs new file mode 100644 index 00000000000..23ede0a512e --- /dev/null +++ b/src/csharp/Grpc.Core.Api/ChannelCredentials.cs @@ -0,0 +1,113 @@ +#region Copyright notice and license + +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#endregion + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +using Grpc.Core.Internal; +using Grpc.Core.Utils; + +namespace Grpc.Core +{ + /// + /// Client-side channel credentials. Used for creation of a secure channel. + /// + public abstract class ChannelCredentials + { + static readonly ChannelCredentials InsecureInstance = new InsecureCredentialsImpl(); + + /// + /// Creates a new instance of channel credentials + /// + public ChannelCredentials() + { + } + + /// + /// Returns instance of credentials that provides no security and + /// will result in creating an unsecure channel with no encryption whatsoever. + /// + public static ChannelCredentials Insecure + { + get + { + return InsecureInstance; + } + } + + /// + /// Creates a new instance of ChannelCredentials class by composing + /// given channel credentials with call credentials. + /// + /// Channel credentials. + /// Call credentials. + /// The new composite ChannelCredentials + public static ChannelCredentials Create(ChannelCredentials channelCredentials, CallCredentials callCredentials) + { + return new CompositeChannelCredentials(channelCredentials, callCredentials); + } + + /// + /// Populates channel credentials configurator with this instance's configuration. + /// End users never need to invoke this method as it is part of internal implementation. + /// + public abstract void InternalPopulateConfiguration(ChannelCredentialsConfiguratorBase configurator, object state); + + /// + /// Returns true if this credential type allows being composed by CompositeCredentials. + /// + internal virtual bool IsComposable => false; + + private sealed class InsecureCredentialsImpl : ChannelCredentials + { + public override void InternalPopulateConfiguration(ChannelCredentialsConfiguratorBase configurator, object state) + { + configurator.SetInsecureCredentials(state); + } + } + + /// + /// Credentials that allow composing one object and + /// one or more objects into a single . + /// + private sealed class CompositeChannelCredentials : ChannelCredentials + { + readonly ChannelCredentials channelCredentials; + readonly CallCredentials callCredentials; + + /// + /// Initializes a new instance of CompositeChannelCredentials class. + /// The resulting credentials object will be composite of all the credentials specified as parameters. + /// + /// channelCredentials to compose + /// channelCredentials to compose + public CompositeChannelCredentials(ChannelCredentials channelCredentials, CallCredentials callCredentials) + { + this.channelCredentials = GrpcPreconditions.CheckNotNull(channelCredentials); + this.callCredentials = GrpcPreconditions.CheckNotNull(callCredentials); + GrpcPreconditions.CheckArgument(channelCredentials.IsComposable, "Supplied channel credentials do not allow composition."); + } + + public override void InternalPopulateConfiguration(ChannelCredentialsConfiguratorBase configurator, object state) + { + configurator.SetCompositeCredentials(state, channelCredentials, callCredentials); + } + } + } +} diff --git a/src/csharp/Grpc.Core.Api/ChannelCredentialsConfiguratorBase.cs b/src/csharp/Grpc.Core.Api/ChannelCredentialsConfiguratorBase.cs new file mode 100644 index 00000000000..5c779bc66b4 --- /dev/null +++ b/src/csharp/Grpc.Core.Api/ChannelCredentialsConfiguratorBase.cs @@ -0,0 +1,44 @@ +#region Copyright notice and license + +// Copyright 2019 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#endregion + +using System.Collections.Generic; + +namespace Grpc.Core +{ + /// + /// Base class for objects that can consume configuration from CallCredentials objects. + /// Note: experimental API that can change or be removed without any prior notice. + /// + public abstract class ChannelCredentialsConfiguratorBase + { + /// + /// Configures the credentials to use insecure credentials. + /// + public abstract void SetInsecureCredentials(object state); + + /// + /// Configures the credentials to use SslCredentials. + /// + public abstract void SetSslCredentials(object state, string rootCertificates, KeyCertificatePair keyCertificatePair, VerifyPeerCallback verifyPeerCallback); + + /// + /// Configures the credentials to use composite channel credentials (a composite of channel credentials and call credentials). + /// + public abstract void SetCompositeCredentials(object state, ChannelCredentials channelCredentials, CallCredentials callCredentials); + } +} diff --git a/src/csharp/Grpc.Core/ClientBase.cs b/src/csharp/Grpc.Core.Api/ClientBase.cs similarity index 98% rename from src/csharp/Grpc.Core/ClientBase.cs rename to src/csharp/Grpc.Core.Api/ClientBase.cs index 05edce7467d..243c35e20c1 100644 --- a/src/csharp/Grpc.Core/ClientBase.cs +++ b/src/csharp/Grpc.Core.Api/ClientBase.cs @@ -51,7 +51,7 @@ namespace Grpc.Core /// Initializes a new instance of ClientBase class. /// /// The channel to use for remote call invocation. - public ClientBase(Channel channel) : base(channel) + public ClientBase(ChannelBase channel) : base(channel) { } @@ -113,7 +113,7 @@ namespace Grpc.Core /// Initializes a new instance of ClientBase class. /// /// The channel to use for remote call invocation. - public ClientBase(Channel channel) : this(new DefaultCallInvoker(channel)) + public ClientBase(ChannelBase channel) : this(channel.CreateCallInvoker()) { } diff --git a/src/csharp/Grpc.Core.Api/Grpc.Core.Api.csproj b/src/csharp/Grpc.Core.Api/Grpc.Core.Api.csproj index a0d41a260da..ae6bea8bd16 100755 --- a/src/csharp/Grpc.Core.Api/Grpc.Core.Api.csproj +++ b/src/csharp/Grpc.Core.Api/Grpc.Core.Api.csproj @@ -23,7 +23,6 @@ - diff --git a/src/csharp/Grpc.Core.Api/IAsyncStreamReader.cs b/src/csharp/Grpc.Core.Api/IAsyncStreamReader.cs index 3751d549e39..7ad4f2687b8 100644 --- a/src/csharp/Grpc.Core.Api/IAsyncStreamReader.cs +++ b/src/csharp/Grpc.Core.Api/IAsyncStreamReader.cs @@ -1,4 +1,4 @@ -#region Copyright notice and license +#region Copyright notice and license // Copyright 2015 gRPC authors. // @@ -16,10 +16,7 @@ #endregion -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Threading; using System.Threading.Tasks; namespace Grpc.Core @@ -50,7 +47,20 @@ namespace Grpc.Core /// /// /// The message type. - public interface IAsyncStreamReader : IAsyncEnumerator + public interface IAsyncStreamReader { + /// + /// Gets the current element in the iteration. + /// + T Current { get; } + + /// + /// Advances the reader to the next element in the sequence, returning the result asynchronously. + /// + /// Cancellation token that can be used to cancel the operation. + /// + /// Task containing the result of the operation: true if the reader was successfully advanced + /// to the next element; false if the reader has passed the end of the sequence. + Task MoveNext(CancellationToken cancellationToken); } } diff --git a/src/csharp/Grpc.Core.Api/Internal/UnimplementedCallInvoker.cs b/src/csharp/Grpc.Core.Api/Internal/UnimplementedCallInvoker.cs new file mode 100644 index 00000000000..c7be74ecf30 --- /dev/null +++ b/src/csharp/Grpc.Core.Api/Internal/UnimplementedCallInvoker.cs @@ -0,0 +1,60 @@ +#region Copyright notice and license + +// Copyright 2015-2016 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#endregion + +using System; +using System.Threading.Tasks; +using Grpc.Core; +using Grpc.Core.Utils; + +namespace Grpc.Core.Internal +{ + /// + /// Call invoker that throws NotImplementedException for all requests. + /// + internal class UnimplementedCallInvoker : CallInvoker + { + public UnimplementedCallInvoker() + { + } + + public override TResponse BlockingUnaryCall(Method method, string host, CallOptions options, TRequest request) + { + throw new NotImplementedException(); + } + + public override AsyncUnaryCall AsyncUnaryCall(Method method, string host, CallOptions options, TRequest request) + { + throw new NotImplementedException(); + } + + public override AsyncServerStreamingCall AsyncServerStreamingCall(Method method, string host, CallOptions options, TRequest request) + { + throw new NotImplementedException(); + } + + public override AsyncClientStreamingCall AsyncClientStreamingCall(Method method, string host, CallOptions options) + { + throw new NotImplementedException(); + } + + public override AsyncDuplexStreamingCall AsyncDuplexStreamingCall(Method method, string host, CallOptions options) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/csharp/Grpc.Core/KeyCertificatePair.cs b/src/csharp/Grpc.Core.Api/KeyCertificatePair.cs similarity index 100% rename from src/csharp/Grpc.Core/KeyCertificatePair.cs rename to src/csharp/Grpc.Core.Api/KeyCertificatePair.cs diff --git a/src/csharp/Grpc.Core.Api/LiteClientBase.cs b/src/csharp/Grpc.Core.Api/LiteClientBase.cs index c3215f016a0..132f10a912f 100644 --- a/src/csharp/Grpc.Core.Api/LiteClientBase.cs +++ b/src/csharp/Grpc.Core.Api/LiteClientBase.cs @@ -17,6 +17,7 @@ #endregion using System; +using Grpc.Core.Internal; using Grpc.Core.Utils; namespace Grpc.Core @@ -58,40 +59,5 @@ namespace Grpc.Core { get { return this.callInvoker; } } - - /// - /// Call invoker that throws NotImplementedException for all requests. - /// - private class UnimplementedCallInvoker : CallInvoker - { - public UnimplementedCallInvoker() - { - } - - public override TResponse BlockingUnaryCall(Method method, string host, CallOptions options, TRequest request) - { - throw new NotImplementedException(); - } - - public override AsyncUnaryCall AsyncUnaryCall(Method method, string host, CallOptions options, TRequest request) - { - throw new NotImplementedException(); - } - - public override AsyncServerStreamingCall AsyncServerStreamingCall(Method method, string host, CallOptions options, TRequest request) - { - throw new NotImplementedException(); - } - - public override AsyncClientStreamingCall AsyncClientStreamingCall(Method method, string host, CallOptions options) - { - throw new NotImplementedException(); - } - - public override AsyncDuplexStreamingCall AsyncDuplexStreamingCall(Method method, string host, CallOptions options) - { - throw new NotImplementedException(); - } - } } } diff --git a/src/csharp/Grpc.Core.Api/SslCredentials.cs b/src/csharp/Grpc.Core.Api/SslCredentials.cs new file mode 100644 index 00000000000..21db7cdfb66 --- /dev/null +++ b/src/csharp/Grpc.Core.Api/SslCredentials.cs @@ -0,0 +1,122 @@ +#region Copyright notice and license + +// Copyright 2019 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#endregion + +namespace Grpc.Core +{ + /// + /// Callback invoked with the expected targetHost and the peer's certificate. + /// If false is returned by this callback then it is treated as a + /// verification failure and the attempted connection will fail. + /// Invocation of the callback is blocking, so any + /// implementation should be light-weight. + /// Note that the callback can potentially be invoked multiple times, + /// concurrently from different threads (e.g. when multiple connections + /// are being created for the same credentials). + /// + /// The associated with the callback + /// true if verification succeeded, false otherwise. + /// Note: experimental API that can change or be removed without any prior notice. + public delegate bool VerifyPeerCallback(VerifyPeerContext context); + + /// + /// Client-side SSL credentials. + /// + public sealed class SslCredentials : ChannelCredentials + { + readonly string rootCertificates; + readonly KeyCertificatePair keyCertificatePair; + readonly VerifyPeerCallback verifyPeerCallback; + + /// + /// Creates client-side SSL credentials loaded from + /// disk file pointed to by the GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment variable. + /// If that fails, gets the roots certificates from a well known place on disk. + /// + public SslCredentials() : this(null, null, null) + { + } + + /// + /// Creates client-side SSL credentials from + /// a string containing PEM encoded root certificates. + /// + public SslCredentials(string rootCertificates) : this(rootCertificates, null, null) + { + } + + /// + /// Creates client-side SSL credentials. + /// + /// string containing PEM encoded server root certificates. + /// a key certificate pair. + public SslCredentials(string rootCertificates, KeyCertificatePair keyCertificatePair) : + this(rootCertificates, keyCertificatePair, null) + { + } + + /// + /// Creates client-side SSL credentials. + /// + /// string containing PEM encoded server root certificates. + /// a key certificate pair. + /// a callback to verify peer's target name and certificate. + /// Note: experimental API that can change or be removed without any prior notice. + public SslCredentials(string rootCertificates, KeyCertificatePair keyCertificatePair, VerifyPeerCallback verifyPeerCallback) + { + this.rootCertificates = rootCertificates; + this.keyCertificatePair = keyCertificatePair; + this.verifyPeerCallback = verifyPeerCallback; + } + + /// + /// PEM encoding of the server root certificates. + /// + public string RootCertificates + { + get + { + return this.rootCertificates; + } + } + + /// + /// Client side key and certificate pair. + /// If null, client will not use key and certificate pair. + /// + public KeyCertificatePair KeyCertificatePair + { + get + { + return this.keyCertificatePair; + } + } + + /// + /// Populates channel credentials configurator with this instance's configuration. + /// End users never need to invoke this method as it is part of internal implementation. + /// + public override void InternalPopulateConfiguration(ChannelCredentialsConfiguratorBase configurator, object state) + { + configurator.SetSslCredentials(state, rootCertificates, keyCertificatePair, verifyPeerCallback); + } + + internal override bool IsComposable => true; + } + + +} diff --git a/src/csharp/Grpc.Core/VerifyPeerContext.cs b/src/csharp/Grpc.Core.Api/VerifyPeerContext.cs similarity index 100% rename from src/csharp/Grpc.Core/VerifyPeerContext.cs rename to src/csharp/Grpc.Core.Api/VerifyPeerContext.cs diff --git a/src/csharp/Grpc.Core.Api/VersionInfo.cs b/src/csharp/Grpc.Core.Api/VersionInfo.cs index 6469aeb3f4b..f732af32ec3 100644 --- a/src/csharp/Grpc.Core.Api/VersionInfo.cs +++ b/src/csharp/Grpc.Core.Api/VersionInfo.cs @@ -28,16 +28,16 @@ namespace Grpc.Core /// /// Current AssemblyVersion attribute of gRPC C# assemblies /// - public const string CurrentAssemblyVersion = "1.0.0.0"; + public const string CurrentAssemblyVersion = "2.0.0.0"; /// /// Current AssemblyFileVersion of gRPC C# assemblies /// - public const string CurrentAssemblyFileVersion = "1.23.0.0"; + public const string CurrentAssemblyFileVersion = "2.24.0.0"; /// /// Current version of gRPC C# /// - public const string CurrentVersion = "1.23.0-dev"; + public const string CurrentVersion = "2.24.0-dev"; } } diff --git a/src/csharp/Grpc.Core.Tests/ChannelCredentialsTest.cs b/src/csharp/Grpc.Core.Tests/ChannelCredentialsTest.cs index 843d88bfb6a..57acfc0bab5 100644 --- a/src/csharp/Grpc.Core.Tests/ChannelCredentialsTest.cs +++ b/src/csharp/Grpc.Core.Tests/ChannelCredentialsTest.cs @@ -48,28 +48,9 @@ namespace Grpc.Core.Tests { // always returning the same native object is critical for subchannel sharing to work with secure channels var creds = new SslCredentials(); - var nativeCreds1 = creds.GetNativeCredentials(); - var nativeCreds2 = creds.GetNativeCredentials(); + var nativeCreds1 = creds.ToNativeCredentials(); + var nativeCreds2 = creds.ToNativeCredentials(); Assert.AreSame(nativeCreds1, nativeCreds2); } - - [Test] - public void ChannelCredentials_CreateExceptionIsCached() - { - var creds = new ChannelCredentialsWithCreateNativeThrows(); - var ex1 = Assert.Throws(typeof(Exception), () => creds.GetNativeCredentials()); - var ex2 = Assert.Throws(typeof(Exception), () => creds.GetNativeCredentials()); - Assert.AreSame(ex1, ex2); - } - - internal class ChannelCredentialsWithCreateNativeThrows : ChannelCredentials - { - internal override bool IsComposable => false; - - internal override ChannelCredentialsSafeHandle CreateNativeCredentials() - { - throw new Exception("Creation of native credentials has failed on purpose."); - } - } } } diff --git a/src/csharp/Grpc.Core.Tests/FakeCredentials.cs b/src/csharp/Grpc.Core.Tests/FakeCredentials.cs index 59587b9a510..e38e0e136cc 100644 --- a/src/csharp/Grpc.Core.Tests/FakeCredentials.cs +++ b/src/csharp/Grpc.Core.Tests/FakeCredentials.cs @@ -34,9 +34,9 @@ namespace Grpc.Core.Tests get { return composable; } } - internal override ChannelCredentialsSafeHandle CreateNativeCredentials() + public override void InternalPopulateConfiguration(ChannelCredentialsConfiguratorBase configurator, object state) { - return null; + // not invoking configuration on purpose } } diff --git a/src/csharp/Grpc.Core/Channel.cs b/src/csharp/Grpc.Core/Channel.cs index 97f79b0fb4f..8d1fb921ff4 100644 --- a/src/csharp/Grpc.Core/Channel.cs +++ b/src/csharp/Grpc.Core/Channel.cs @@ -30,7 +30,7 @@ namespace Grpc.Core /// More client objects can reuse the same channel. Creating a channel is an expensive operation compared to invoking /// a remote call so in general you should reuse a single channel for as many calls as possible. /// - public class Channel + public class Channel : ChannelBase { static readonly ILogger Logger = GrpcEnvironment.Logger.ForType(); @@ -38,7 +38,6 @@ namespace Grpc.Core readonly AtomicCounter activeCallCounter = new AtomicCounter(); readonly CancellationTokenSource shutdownTokenSource = new CancellationTokenSource(); - readonly string target; readonly GrpcEnvironment environment; readonly CompletionQueueSafeHandle completionQueue; readonly ChannelSafeHandle handle; @@ -64,9 +63,8 @@ namespace Grpc.Core /// Target of the channel. /// Credentials to secure the channel. /// Channel options. - public Channel(string target, ChannelCredentials credentials, IEnumerable options) + public Channel(string target, ChannelCredentials credentials, IEnumerable options) : base(target) { - this.target = GrpcPreconditions.CheckNotNull(target, "target"); this.options = CreateOptionsDictionary(options); EnsureUserAgentChannelOption(this.options); this.environment = GrpcEnvironment.AddRef(); @@ -74,7 +72,7 @@ namespace Grpc.Core this.completionQueue = this.environment.PickCompletionQueue(); using (var nativeChannelArgs = ChannelOptions.CreateChannelArgs(this.options.Values)) { - var nativeCredentials = credentials.GetNativeCredentials(); + var nativeCredentials = credentials.ToNativeCredentials(); if (nativeCredentials != null) { this.handle = ChannelSafeHandle.CreateSecure(nativeCredentials, target, nativeChannelArgs); @@ -179,15 +177,6 @@ namespace Grpc.Core } } - /// The original target used to create the channel. - public string Target - { - get - { - return this.target; - } - } - /// /// Returns a token that gets cancelled once ShutdownAsync is invoked. /// @@ -257,6 +246,15 @@ namespace Grpc.Core await GrpcEnvironment.ReleaseAsync().ConfigureAwait(false); } + /// + /// Create a new for the channel. + /// + /// A new . + public override CallInvoker CreateCallInvoker() + { + return new DefaultCallInvoker(this); + } + internal ChannelSafeHandle Handle { get diff --git a/src/csharp/Grpc.Core/ChannelCredentials.cs b/src/csharp/Grpc.Core/ChannelCredentials.cs deleted file mode 100644 index dcbe9f3599b..00000000000 --- a/src/csharp/Grpc.Core/ChannelCredentials.cs +++ /dev/null @@ -1,293 +0,0 @@ -#region Copyright notice and license - -// Copyright 2015 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#endregion - -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Threading.Tasks; - -using Grpc.Core.Internal; -using Grpc.Core.Logging; -using Grpc.Core.Utils; - -namespace Grpc.Core -{ - /// - /// Client-side channel credentials. Used for creation of a secure channel. - /// - public abstract class ChannelCredentials - { - static readonly ChannelCredentials InsecureInstance = new InsecureCredentialsImpl(); - readonly Lazy cachedNativeCredentials; - - /// - /// Creates a new instance of channel credentials - /// - public ChannelCredentials() - { - // Native credentials object need to be kept alive once initialized for subchannel sharing to work correctly - // with secure connections. See https://github.com/grpc/grpc/issues/15207. - // We rely on finalizer to clean up the native portion of ChannelCredentialsSafeHandle after the ChannelCredentials - // instance becomes unused. - this.cachedNativeCredentials = new Lazy(() => CreateNativeCredentials()); - } - - /// - /// Returns instance of credentials that provides no security and - /// will result in creating an unsecure channel with no encryption whatsoever. - /// - public static ChannelCredentials Insecure - { - get - { - return InsecureInstance; - } - } - - /// - /// Creates a new instance of ChannelCredentials class by composing - /// given channel credentials with call credentials. - /// - /// Channel credentials. - /// Call credentials. - /// The new composite ChannelCredentials - public static ChannelCredentials Create(ChannelCredentials channelCredentials, CallCredentials callCredentials) - { - return new CompositeChannelCredentials(channelCredentials, callCredentials); - } - - /// - /// Gets native object for the credentials, creating one if it already doesn't exist. May return null if insecure channel - /// should be created. Caller must not call Dispose() on the returned native credentials as their lifetime - /// is managed by this class (and instances of native credentials are cached). - /// - /// The native credentials. - internal ChannelCredentialsSafeHandle GetNativeCredentials() - { - return cachedNativeCredentials.Value; - } - - /// - /// Creates a new native object for the credentials. May return null if insecure channel - /// should be created. For internal use only, use instead. - /// - /// The native credentials. - internal abstract ChannelCredentialsSafeHandle CreateNativeCredentials(); - - /// - /// Returns true if this credential type allows being composed by CompositeCredentials. - /// - internal virtual bool IsComposable - { - get { return false; } - } - - private sealed class InsecureCredentialsImpl : ChannelCredentials - { - internal override ChannelCredentialsSafeHandle CreateNativeCredentials() - { - return null; - } - } - } - - /// - /// Callback invoked with the expected targetHost and the peer's certificate. - /// If false is returned by this callback then it is treated as a - /// verification failure and the attempted connection will fail. - /// Invocation of the callback is blocking, so any - /// implementation should be light-weight. - /// Note that the callback can potentially be invoked multiple times, - /// concurrently from different threads (e.g. when multiple connections - /// are being created for the same credentials). - /// - /// The associated with the callback - /// true if verification succeeded, false otherwise. - /// Note: experimental API that can change or be removed without any prior notice. - public delegate bool VerifyPeerCallback(VerifyPeerContext context); - - /// - /// Client-side SSL credentials. - /// - public sealed class SslCredentials : ChannelCredentials - { - static readonly ILogger Logger = GrpcEnvironment.Logger.ForType(); - - readonly string rootCertificates; - readonly KeyCertificatePair keyCertificatePair; - readonly VerifyPeerCallback verifyPeerCallback; - - /// - /// Creates client-side SSL credentials loaded from - /// disk file pointed to by the GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment variable. - /// If that fails, gets the roots certificates from a well known place on disk. - /// - public SslCredentials() : this(null, null, null) - { - } - - /// - /// Creates client-side SSL credentials from - /// a string containing PEM encoded root certificates. - /// - public SslCredentials(string rootCertificates) : this(rootCertificates, null, null) - { - } - - /// - /// Creates client-side SSL credentials. - /// - /// string containing PEM encoded server root certificates. - /// a key certificate pair. - public SslCredentials(string rootCertificates, KeyCertificatePair keyCertificatePair) : - this(rootCertificates, keyCertificatePair, null) - { - } - - /// - /// Creates client-side SSL credentials. - /// - /// string containing PEM encoded server root certificates. - /// a key certificate pair. - /// a callback to verify peer's target name and certificate. - /// Note: experimental API that can change or be removed without any prior notice. - public SslCredentials(string rootCertificates, KeyCertificatePair keyCertificatePair, VerifyPeerCallback verifyPeerCallback) - { - this.rootCertificates = rootCertificates; - this.keyCertificatePair = keyCertificatePair; - this.verifyPeerCallback = verifyPeerCallback; - } - - /// - /// PEM encoding of the server root certificates. - /// - public string RootCertificates - { - get - { - return this.rootCertificates; - } - } - - /// - /// Client side key and certificate pair. - /// If null, client will not use key and certificate pair. - /// - public KeyCertificatePair KeyCertificatePair - { - get - { - return this.keyCertificatePair; - } - } - - // Composing composite makes no sense. - internal override bool IsComposable - { - get { return true; } - } - - internal override ChannelCredentialsSafeHandle CreateNativeCredentials() - { - IntPtr verifyPeerCallbackTag = IntPtr.Zero; - if (verifyPeerCallback != null) - { - verifyPeerCallbackTag = new VerifyPeerCallbackRegistration(verifyPeerCallback).CallbackRegistration.Tag; - } - return ChannelCredentialsSafeHandle.CreateSslCredentials(rootCertificates, keyCertificatePair, verifyPeerCallbackTag); - } - - private class VerifyPeerCallbackRegistration - { - readonly VerifyPeerCallback verifyPeerCallback; - readonly NativeCallbackRegistration callbackRegistration; - - public VerifyPeerCallbackRegistration(VerifyPeerCallback verifyPeerCallback) - { - this.verifyPeerCallback = verifyPeerCallback; - this.callbackRegistration = NativeCallbackDispatcher.RegisterCallback(HandleUniversalCallback); - } - - public NativeCallbackRegistration CallbackRegistration => callbackRegistration; - - private int HandleUniversalCallback(IntPtr arg0, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5) - { - return VerifyPeerCallbackHandler(arg0, arg1, arg2 != IntPtr.Zero); - } - - private int VerifyPeerCallbackHandler(IntPtr targetName, IntPtr peerPem, bool isDestroy) - { - if (isDestroy) - { - this.callbackRegistration.Dispose(); - return 0; - } - - try - { - var context = new VerifyPeerContext(Marshal.PtrToStringAnsi(targetName), Marshal.PtrToStringAnsi(peerPem)); - - return this.verifyPeerCallback(context) ? 0 : 1; - } - catch (Exception e) - { - // eat the exception, we must not throw when inside callback from native code. - Logger.Error(e, "Exception occurred while invoking verify peer callback handler."); - // Return validation failure in case of exception. - return 1; - } - } - } - } - - /// - /// Credentials that allow composing one object and - /// one or more objects into a single . - /// - internal sealed class CompositeChannelCredentials : ChannelCredentials - { - readonly ChannelCredentials channelCredentials; - readonly CallCredentials callCredentials; - - /// - /// Initializes a new instance of CompositeChannelCredentials class. - /// The resulting credentials object will be composite of all the credentials specified as parameters. - /// - /// channelCredentials to compose - /// channelCredentials to compose - public CompositeChannelCredentials(ChannelCredentials channelCredentials, CallCredentials callCredentials) - { - this.channelCredentials = GrpcPreconditions.CheckNotNull(channelCredentials); - this.callCredentials = GrpcPreconditions.CheckNotNull(callCredentials); - GrpcPreconditions.CheckArgument(channelCredentials.IsComposable, "Supplied channel credentials do not allow composition."); - } - - internal override ChannelCredentialsSafeHandle CreateNativeCredentials() - { - using (var callCreds = callCredentials.ToNativeCredentials()) - { - var nativeComposite = ChannelCredentialsSafeHandle.CreateComposite(channelCredentials.GetNativeCredentials(), callCreds); - if (nativeComposite.IsInvalid) - { - throw new ArgumentException("Error creating native composite credentials. Likely, this is because you are trying to compose incompatible credentials."); - } - return nativeComposite; - } - } - } -} diff --git a/src/csharp/Grpc.Core/ForwardedTypes.cs b/src/csharp/Grpc.Core/ForwardedTypes.cs index fb99cfc018d..4394a7c907c 100644 --- a/src/csharp/Grpc.Core/ForwardedTypes.cs +++ b/src/csharp/Grpc.Core/ForwardedTypes.cs @@ -38,6 +38,9 @@ using Grpc.Core.Utils; [assembly:TypeForwardedToAttribute(typeof(CallInvoker))] [assembly:TypeForwardedToAttribute(typeof(CallInvokerExtensions))] [assembly:TypeForwardedToAttribute(typeof(CallOptions))] +[assembly:TypeForwardedToAttribute(typeof(ClientBase))] +[assembly:TypeForwardedToAttribute(typeof(ClientBase<>))] +[assembly:TypeForwardedToAttribute(typeof(ChannelCredentials))] [assembly:TypeForwardedToAttribute(typeof(ClientInterceptorContext<,>))] [assembly:TypeForwardedToAttribute(typeof(ContextPropagationOptions))] [assembly:TypeForwardedToAttribute(typeof(ContextPropagationToken))] @@ -48,6 +51,7 @@ using Grpc.Core.Utils; [assembly:TypeForwardedToAttribute(typeof(Interceptor))] [assembly:TypeForwardedToAttribute(typeof(InterceptingCallInvoker))] [assembly:TypeForwardedToAttribute(typeof(IServerStreamWriter<>))] +[assembly:TypeForwardedToAttribute(typeof(KeyCertificatePair))] [assembly:TypeForwardedToAttribute(typeof(Marshaller<>))] [assembly:TypeForwardedToAttribute(typeof(Marshallers))] [assembly:TypeForwardedToAttribute(typeof(Metadata))] @@ -63,8 +67,11 @@ using Grpc.Core.Utils; [assembly:TypeForwardedToAttribute(typeof(DuplexStreamingServerMethod<,>))] [assembly:TypeForwardedToAttribute(typeof(ServerServiceDefinition))] [assembly:TypeForwardedToAttribute(typeof(ServiceBinderBase))] +[assembly:TypeForwardedToAttribute(typeof(SslCredentials))] [assembly:TypeForwardedToAttribute(typeof(Status))] [assembly:TypeForwardedToAttribute(typeof(StatusCode))] +[assembly:TypeForwardedToAttribute(typeof(VerifyPeerCallback))] +[assembly:TypeForwardedToAttribute(typeof(VerifyPeerContext))] [assembly:TypeForwardedToAttribute(typeof(VersionInfo))] [assembly:TypeForwardedToAttribute(typeof(WriteOptions))] [assembly:TypeForwardedToAttribute(typeof(WriteFlags))] diff --git a/src/csharp/Grpc.Core/Grpc.Core.csproj b/src/csharp/Grpc.Core/Grpc.Core.csproj index b7c7851a34b..561c3edc9cc 100755 --- a/src/csharp/Grpc.Core/Grpc.Core.csproj +++ b/src/csharp/Grpc.Core/Grpc.Core.csproj @@ -1,4 +1,4 @@ - + @@ -98,7 +98,6 @@ - diff --git a/src/csharp/Grpc.Core/Internal/DefaultChannelCredentialsConfigurator.cs b/src/csharp/Grpc.Core/Internal/DefaultChannelCredentialsConfigurator.cs new file mode 100644 index 00000000000..c4c044cd577 --- /dev/null +++ b/src/csharp/Grpc.Core/Internal/DefaultChannelCredentialsConfigurator.cs @@ -0,0 +1,163 @@ +#region Copyright notice and license + +// Copyright 2019 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#endregion + +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using Grpc.Core.Utils; +using Grpc.Core.Logging; + +namespace Grpc.Core.Internal +{ + /// + /// Creates native call credential objects from instances of ChannelCredentials. + /// + internal class DefaultChannelCredentialsConfigurator : ChannelCredentialsConfiguratorBase + { + static readonly ILogger Logger = GrpcEnvironment.Logger.ForType(); + + // Native credentials object need to be kept alive once initialized for subchannel sharing to work correctly + // with secure connections. See https://github.com/grpc/grpc/issues/15207. + // We rely on finalizer to clean up the native portion of ChannelCredentialsSafeHandle after the ChannelCredentials + // instance becomes unused. + static readonly ConditionalWeakTable> CachedNativeCredentials = new ConditionalWeakTable>(); + static readonly object StaticLock = new object(); + + bool configured; + ChannelCredentialsSafeHandle nativeCredentials; + + public ChannelCredentialsSafeHandle NativeCredentials => nativeCredentials; + + public override void SetInsecureCredentials(object state) + { + GrpcPreconditions.CheckState(!configured); + // null corresponds to insecure credentials. + configured = true; + nativeCredentials = null; + } + + public override void SetSslCredentials(object state, string rootCertificates, KeyCertificatePair keyCertificatePair, VerifyPeerCallback verifyPeerCallback) + { + GrpcPreconditions.CheckState(!configured); + configured = true; + nativeCredentials = GetOrCreateNativeCredentials((ChannelCredentials) state, + () => CreateNativeSslCredentials(rootCertificates, keyCertificatePair, verifyPeerCallback)); + } + + public override void SetCompositeCredentials(object state, ChannelCredentials channelCredentials, CallCredentials callCredentials) + { + GrpcPreconditions.CheckState(!configured); + configured = true; + nativeCredentials = GetOrCreateNativeCredentials((ChannelCredentials) state, + () => CreateNativeCompositeCredentials(channelCredentials, callCredentials)); + } + + private ChannelCredentialsSafeHandle CreateNativeSslCredentials(string rootCertificates, KeyCertificatePair keyCertificatePair, VerifyPeerCallback verifyPeerCallback) + { + IntPtr verifyPeerCallbackTag = IntPtr.Zero; + if (verifyPeerCallback != null) + { + verifyPeerCallbackTag = new VerifyPeerCallbackRegistration(verifyPeerCallback).CallbackRegistration.Tag; + } + return ChannelCredentialsSafeHandle.CreateSslCredentials(rootCertificates, keyCertificatePair, verifyPeerCallbackTag); + } + + private ChannelCredentialsSafeHandle CreateNativeCompositeCredentials(ChannelCredentials channelCredentials, CallCredentials callCredentials) + { + using (var callCreds = callCredentials.ToNativeCredentials()) + { + var nativeComposite = ChannelCredentialsSafeHandle.CreateComposite(channelCredentials.ToNativeCredentials(), callCreds); + if (nativeComposite.IsInvalid) + { + throw new ArgumentException("Error creating native composite credentials. Likely, this is because you are trying to compose incompatible credentials."); + } + return nativeComposite; + } + } + + private ChannelCredentialsSafeHandle GetOrCreateNativeCredentials(ChannelCredentials key, Func nativeCredentialsFactory) + { + Lazy lazyValue; + lock (StaticLock) { + if (!CachedNativeCredentials.TryGetValue(key, out lazyValue)) + { + lazyValue = new Lazy(nativeCredentialsFactory); + CachedNativeCredentials.Add(key, lazyValue); + } + } + return lazyValue.Value; + } + + private class VerifyPeerCallbackRegistration + { + readonly VerifyPeerCallback verifyPeerCallback; + readonly NativeCallbackRegistration callbackRegistration; + + public VerifyPeerCallbackRegistration(VerifyPeerCallback verifyPeerCallback) + { + this.verifyPeerCallback = verifyPeerCallback; + this.callbackRegistration = NativeCallbackDispatcher.RegisterCallback(HandleUniversalCallback); + } + + public NativeCallbackRegistration CallbackRegistration => callbackRegistration; + + private int HandleUniversalCallback(IntPtr arg0, IntPtr arg1, IntPtr arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5) + { + return VerifyPeerCallbackHandler(arg0, arg1, arg2 != IntPtr.Zero); + } + + private int VerifyPeerCallbackHandler(IntPtr targetName, IntPtr peerPem, bool isDestroy) + { + if (isDestroy) + { + this.callbackRegistration.Dispose(); + return 0; + } + + try + { + var context = new VerifyPeerContext(Marshal.PtrToStringAnsi(targetName), Marshal.PtrToStringAnsi(peerPem)); + + return this.verifyPeerCallback(context) ? 0 : 1; + } + catch (Exception e) + { + // eat the exception, we must not throw when inside callback from native code. + Logger.Error(e, "Exception occurred while invoking verify peer callback handler."); + // Return validation failure in case of exception. + return 1; + } + } + } + } + + internal static class ChannelCredentialsExtensions + { + /// + /// Creates native object for the credentials. + /// + /// The native credentials. + public static ChannelCredentialsSafeHandle ToNativeCredentials(this ChannelCredentials credentials) + { + var configurator = new DefaultChannelCredentialsConfigurator(); + credentials.InternalPopulateConfiguration(configurator, credentials); + return configurator.NativeCredentials; + } + } +} diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs index fab64354411..5186d2f6dae 100644 --- a/src/csharp/Grpc.Examples/MathGrpc.cs +++ b/src/csharp/Grpc.Examples/MathGrpc.cs @@ -130,7 +130,7 @@ namespace Math { { /// Creates a new client for Math /// The channel to use to make remote calls. - public MathClient(grpc::Channel channel) : base(channel) + public MathClient(grpc::ChannelBase channel) : base(channel) { } /// Creates a new client for Math that uses a custom CallInvoker. diff --git a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj index 223c9985ecd..05f7320ad57 100755 --- a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj +++ b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj @@ -1,4 +1,4 @@ - + @@ -10,6 +10,7 @@ + diff --git a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj index 7e8a8a7de87..391aee81cbc 100755 --- a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj +++ b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj @@ -1,4 +1,4 @@ - + @@ -26,7 +26,7 @@ - + None diff --git a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs index 7137b907274..d5051f3b05a 100644 --- a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs +++ b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs @@ -102,7 +102,7 @@ namespace Grpc.Health.V1 { { /// Creates a new client for Health /// The channel to use to make remote calls. - public HealthClient(grpc::Channel channel) : base(channel) + public HealthClient(grpc::ChannelBase channel) : base(channel) { } /// Creates a new client for Health that uses a custom CallInvoker. diff --git a/src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs b/src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs index 5b37b144f2a..4a608be318c 100644 --- a/src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/BenchmarkServiceGrpc.cs @@ -148,7 +148,7 @@ namespace Grpc.Testing { { /// Creates a new client for BenchmarkService /// The channel to use to make remote calls. - public BenchmarkServiceClient(grpc::Channel channel) : base(channel) + public BenchmarkServiceClient(grpc::ChannelBase channel) : base(channel) { } /// Creates a new client for BenchmarkService that uses a custom CallInvoker. diff --git a/src/csharp/Grpc.IntegrationTesting/EmptyServiceGrpc.cs b/src/csharp/Grpc.IntegrationTesting/EmptyServiceGrpc.cs index 50c6e159206..30fd6dec542 100644 --- a/src/csharp/Grpc.IntegrationTesting/EmptyServiceGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/EmptyServiceGrpc.cs @@ -49,7 +49,7 @@ namespace Grpc.Testing { { /// Creates a new client for EmptyService /// The channel to use to make remote calls. - public EmptyServiceClient(grpc::Channel channel) : base(channel) + public EmptyServiceClient(grpc::ChannelBase channel) : base(channel) { } /// Creates a new client for EmptyService that uses a custom CallInvoker. diff --git a/src/csharp/Grpc.IntegrationTesting/Messages.cs b/src/csharp/Grpc.IntegrationTesting/Messages.cs index 3b6c0010222..5c5042b75b6 100644 --- a/src/csharp/Grpc.IntegrationTesting/Messages.cs +++ b/src/csharp/Grpc.IntegrationTesting/Messages.cs @@ -28,41 +28,42 @@ namespace Grpc.Testing { "LnRlc3RpbmciGgoJQm9vbFZhbHVlEg0KBXZhbHVlGAEgASgIIkAKB1BheWxv", "YWQSJwoEdHlwZRgBIAEoDjIZLmdycGMudGVzdGluZy5QYXlsb2FkVHlwZRIM", "CgRib2R5GAIgASgMIisKCkVjaG9TdGF0dXMSDAoEY29kZRgBIAEoBRIPCgdt", - "ZXNzYWdlGAIgASgJIs4CCg1TaW1wbGVSZXF1ZXN0EjAKDXJlc3BvbnNlX3R5", + "ZXNzYWdlGAIgASgJIuYCCg1TaW1wbGVSZXF1ZXN0EjAKDXJlc3BvbnNlX3R5", "cGUYASABKA4yGS5ncnBjLnRlc3RpbmcuUGF5bG9hZFR5cGUSFQoNcmVzcG9u", "c2Vfc2l6ZRgCIAEoBRImCgdwYXlsb2FkGAMgASgLMhUuZ3JwYy50ZXN0aW5n", "LlBheWxvYWQSFQoNZmlsbF91c2VybmFtZRgEIAEoCBIYChBmaWxsX29hdXRo", "X3Njb3BlGAUgASgIEjQKE3Jlc3BvbnNlX2NvbXByZXNzZWQYBiABKAsyFy5n", "cnBjLnRlc3RpbmcuQm9vbFZhbHVlEjEKD3Jlc3BvbnNlX3N0YXR1cxgHIAEo", "CzIYLmdycGMudGVzdGluZy5FY2hvU3RhdHVzEjIKEWV4cGVjdF9jb21wcmVz", - "c2VkGAggASgLMhcuZ3JwYy50ZXN0aW5nLkJvb2xWYWx1ZSJfCg5TaW1wbGVS", - "ZXNwb25zZRImCgdwYXlsb2FkGAEgASgLMhUuZ3JwYy50ZXN0aW5nLlBheWxv", - "YWQSEAoIdXNlcm5hbWUYAiABKAkSEwoLb2F1dGhfc2NvcGUYAyABKAkidwoZ", - "U3RyZWFtaW5nSW5wdXRDYWxsUmVxdWVzdBImCgdwYXlsb2FkGAEgASgLMhUu", - "Z3JwYy50ZXN0aW5nLlBheWxvYWQSMgoRZXhwZWN0X2NvbXByZXNzZWQYAiAB", - "KAsyFy5ncnBjLnRlc3RpbmcuQm9vbFZhbHVlIj0KGlN0cmVhbWluZ0lucHV0", - "Q2FsbFJlc3BvbnNlEh8KF2FnZ3JlZ2F0ZWRfcGF5bG9hZF9zaXplGAEgASgF", - "ImQKElJlc3BvbnNlUGFyYW1ldGVycxIMCgRzaXplGAEgASgFEhMKC2ludGVy", - "dmFsX3VzGAIgASgFEisKCmNvbXByZXNzZWQYAyABKAsyFy5ncnBjLnRlc3Rp", - "bmcuQm9vbFZhbHVlIugBChpTdHJlYW1pbmdPdXRwdXRDYWxsUmVxdWVzdBIw", - "Cg1yZXNwb25zZV90eXBlGAEgASgOMhkuZ3JwYy50ZXN0aW5nLlBheWxvYWRU", - "eXBlEj0KE3Jlc3BvbnNlX3BhcmFtZXRlcnMYAiADKAsyIC5ncnBjLnRlc3Rp", - "bmcuUmVzcG9uc2VQYXJhbWV0ZXJzEiYKB3BheWxvYWQYAyABKAsyFS5ncnBj", - "LnRlc3RpbmcuUGF5bG9hZBIxCg9yZXNwb25zZV9zdGF0dXMYByABKAsyGC5n", - "cnBjLnRlc3RpbmcuRWNob1N0YXR1cyJFChtTdHJlYW1pbmdPdXRwdXRDYWxs", - "UmVzcG9uc2USJgoHcGF5bG9hZBgBIAEoCzIVLmdycGMudGVzdGluZy5QYXls", - "b2FkIjMKD1JlY29ubmVjdFBhcmFtcxIgChhtYXhfcmVjb25uZWN0X2JhY2tv", - "ZmZfbXMYASABKAUiMwoNUmVjb25uZWN0SW5mbxIOCgZwYXNzZWQYASABKAgS", - "EgoKYmFja29mZl9tcxgCIAMoBSofCgtQYXlsb2FkVHlwZRIQCgxDT01QUkVT", - "U0FCTEUQAGIGcHJvdG8z")); + "c2VkGAggASgLMhcuZ3JwYy50ZXN0aW5nLkJvb2xWYWx1ZRIWCg5maWxsX3Nl", + "cnZlcl9pZBgJIAEoCCJyCg5TaW1wbGVSZXNwb25zZRImCgdwYXlsb2FkGAEg", + "ASgLMhUuZ3JwYy50ZXN0aW5nLlBheWxvYWQSEAoIdXNlcm5hbWUYAiABKAkS", + "EwoLb2F1dGhfc2NvcGUYAyABKAkSEQoJc2VydmVyX2lkGAQgASgJIncKGVN0", + "cmVhbWluZ0lucHV0Q2FsbFJlcXVlc3QSJgoHcGF5bG9hZBgBIAEoCzIVLmdy", + "cGMudGVzdGluZy5QYXlsb2FkEjIKEWV4cGVjdF9jb21wcmVzc2VkGAIgASgL", + "MhcuZ3JwYy50ZXN0aW5nLkJvb2xWYWx1ZSI9ChpTdHJlYW1pbmdJbnB1dENh", + "bGxSZXNwb25zZRIfChdhZ2dyZWdhdGVkX3BheWxvYWRfc2l6ZRgBIAEoBSJk", + "ChJSZXNwb25zZVBhcmFtZXRlcnMSDAoEc2l6ZRgBIAEoBRITCgtpbnRlcnZh", + "bF91cxgCIAEoBRIrCgpjb21wcmVzc2VkGAMgASgLMhcuZ3JwYy50ZXN0aW5n", + "LkJvb2xWYWx1ZSLoAQoaU3RyZWFtaW5nT3V0cHV0Q2FsbFJlcXVlc3QSMAoN", + "cmVzcG9uc2VfdHlwZRgBIAEoDjIZLmdycGMudGVzdGluZy5QYXlsb2FkVHlw", + "ZRI9ChNyZXNwb25zZV9wYXJhbWV0ZXJzGAIgAygLMiAuZ3JwYy50ZXN0aW5n", + "LlJlc3BvbnNlUGFyYW1ldGVycxImCgdwYXlsb2FkGAMgASgLMhUuZ3JwYy50", + "ZXN0aW5nLlBheWxvYWQSMQoPcmVzcG9uc2Vfc3RhdHVzGAcgASgLMhguZ3Jw", + "Yy50ZXN0aW5nLkVjaG9TdGF0dXMiRQobU3RyZWFtaW5nT3V0cHV0Q2FsbFJl", + "c3BvbnNlEiYKB3BheWxvYWQYASABKAsyFS5ncnBjLnRlc3RpbmcuUGF5bG9h", + "ZCIzCg9SZWNvbm5lY3RQYXJhbXMSIAoYbWF4X3JlY29ubmVjdF9iYWNrb2Zm", + "X21zGAEgASgFIjMKDVJlY29ubmVjdEluZm8SDgoGcGFzc2VkGAEgASgIEhIK", + "CmJhY2tvZmZfbXMYAiADKAUqHwoLUGF5bG9hZFR5cGUSEAoMQ09NUFJFU1NB", + "QkxFEABiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Grpc.Testing.PayloadType), }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.BoolValue), global::Grpc.Testing.BoolValue.Parser, new[]{ "Value" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Payload), global::Grpc.Testing.Payload.Parser, new[]{ "Type", "Body" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.EchoStatus), global::Grpc.Testing.EchoStatus.Parser, new[]{ "Code", "Message" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SimpleRequest), global::Grpc.Testing.SimpleRequest.Parser, new[]{ "ResponseType", "ResponseSize", "Payload", "FillUsername", "FillOauthScope", "ResponseCompressed", "ResponseStatus", "ExpectCompressed" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SimpleResponse), global::Grpc.Testing.SimpleResponse.Parser, new[]{ "Payload", "Username", "OauthScope" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SimpleRequest), global::Grpc.Testing.SimpleRequest.Parser, new[]{ "ResponseType", "ResponseSize", "Payload", "FillUsername", "FillOauthScope", "ResponseCompressed", "ResponseStatus", "ExpectCompressed", "FillServerId" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SimpleResponse), global::Grpc.Testing.SimpleResponse.Parser, new[]{ "Payload", "Username", "OauthScope", "ServerId" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.StreamingInputCallRequest), global::Grpc.Testing.StreamingInputCallRequest.Parser, new[]{ "Payload", "ExpectCompressed" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.StreamingInputCallResponse), global::Grpc.Testing.StreamingInputCallResponse.Parser, new[]{ "AggregatedPayloadSize" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ResponseParameters), global::Grpc.Testing.ResponseParameters.Parser, new[]{ "Size", "IntervalUs", "Compressed" }, null, null, null), @@ -589,6 +590,7 @@ namespace Grpc.Testing { responseCompressed_ = other.responseCompressed_ != null ? other.responseCompressed_.Clone() : null; responseStatus_ = other.responseStatus_ != null ? other.responseStatus_.Clone() : null; expectCompressed_ = other.expectCompressed_ != null ? other.expectCompressed_.Clone() : null; + fillServerId_ = other.fillServerId_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -713,6 +715,20 @@ namespace Grpc.Testing { } } + /// Field number for the "fill_server_id" field. + public const int FillServerIdFieldNumber = 9; + private bool fillServerId_; + /// + /// Whether SimpleResponse should include server_id. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool FillServerId { + get { return fillServerId_; } + set { + fillServerId_ = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as SimpleRequest); @@ -734,6 +750,7 @@ namespace Grpc.Testing { if (!object.Equals(ResponseCompressed, other.ResponseCompressed)) return false; if (!object.Equals(ResponseStatus, other.ResponseStatus)) return false; if (!object.Equals(ExpectCompressed, other.ExpectCompressed)) return false; + if (FillServerId != other.FillServerId) return false; return Equals(_unknownFields, other._unknownFields); } @@ -748,6 +765,7 @@ namespace Grpc.Testing { if (responseCompressed_ != null) hash ^= ResponseCompressed.GetHashCode(); if (responseStatus_ != null) hash ^= ResponseStatus.GetHashCode(); if (expectCompressed_ != null) hash ^= ExpectCompressed.GetHashCode(); + if (FillServerId != false) hash ^= FillServerId.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -793,6 +811,10 @@ namespace Grpc.Testing { output.WriteRawTag(66); output.WriteMessage(ExpectCompressed); } + if (FillServerId != false) { + output.WriteRawTag(72); + output.WriteBool(FillServerId); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -825,6 +847,9 @@ namespace Grpc.Testing { if (expectCompressed_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExpectCompressed); } + if (FillServerId != false) { + size += 1 + 1; + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -872,6 +897,9 @@ namespace Grpc.Testing { } ExpectCompressed.MergeFrom(other.ExpectCompressed); } + if (other.FillServerId != false) { + FillServerId = other.FillServerId; + } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -927,6 +955,10 @@ namespace Grpc.Testing { input.ReadMessage(ExpectCompressed); break; } + case 72: { + FillServerId = input.ReadBool(); + break; + } } } } @@ -964,6 +996,7 @@ namespace Grpc.Testing { payload_ = other.payload_ != null ? other.payload_.Clone() : null; username_ = other.username_; oauthScope_ = other.oauthScope_; + serverId_ = other.serverId_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -1015,6 +1048,21 @@ namespace Grpc.Testing { } } + /// Field number for the "server_id" field. + public const int ServerIdFieldNumber = 4; + private string serverId_ = ""; + /// + /// Server ID. This must be unique among different server instances, + /// but the same across all RPC's made to a particular server instance. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ServerId { + get { return serverId_; } + set { + serverId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as SimpleResponse); @@ -1031,6 +1079,7 @@ namespace Grpc.Testing { if (!object.Equals(Payload, other.Payload)) return false; if (Username != other.Username) return false; if (OauthScope != other.OauthScope) return false; + if (ServerId != other.ServerId) return false; return Equals(_unknownFields, other._unknownFields); } @@ -1040,6 +1089,7 @@ namespace Grpc.Testing { if (payload_ != null) hash ^= Payload.GetHashCode(); if (Username.Length != 0) hash ^= Username.GetHashCode(); if (OauthScope.Length != 0) hash ^= OauthScope.GetHashCode(); + if (ServerId.Length != 0) hash ^= ServerId.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -1065,6 +1115,10 @@ namespace Grpc.Testing { output.WriteRawTag(26); output.WriteString(OauthScope); } + if (ServerId.Length != 0) { + output.WriteRawTag(34); + output.WriteString(ServerId); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -1082,6 +1136,9 @@ namespace Grpc.Testing { if (OauthScope.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(OauthScope); } + if (ServerId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ServerId); + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -1105,6 +1162,9 @@ namespace Grpc.Testing { if (other.OauthScope.Length != 0) { OauthScope = other.OauthScope; } + if (other.ServerId.Length != 0) { + ServerId = other.ServerId; + } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -1131,6 +1191,10 @@ namespace Grpc.Testing { OauthScope = input.ReadString(); break; } + case 34: { + ServerId = input.ReadString(); + break; + } } } } diff --git a/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs b/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs index 9b11e990d2d..fbc3690d2ac 100644 --- a/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs @@ -92,7 +92,7 @@ namespace Grpc.Testing { { /// Creates a new client for MetricsService /// The channel to use to make remote calls. - public MetricsServiceClient(grpc::Channel channel) : base(channel) + public MetricsServiceClient(grpc::ChannelBase channel) : base(channel) { } /// Creates a new client for MetricsService that uses a custom CallInvoker. diff --git a/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs b/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs index 1a505ebc764..e35c7c39fd5 100644 --- a/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/ReportQpsScenarioServiceGrpc.cs @@ -67,7 +67,7 @@ namespace Grpc.Testing { { /// Creates a new client for ReportQpsScenarioService /// The channel to use to make remote calls. - public ReportQpsScenarioServiceClient(grpc::Channel channel) : base(channel) + public ReportQpsScenarioServiceClient(grpc::ChannelBase channel) : base(channel) { } /// Creates a new client for ReportQpsScenarioService that uses a custom CallInvoker. diff --git a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs index e7b93094c65..f358a6d175c 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs @@ -216,7 +216,7 @@ namespace Grpc.Testing { { /// Creates a new client for TestService /// The channel to use to make remote calls. - public TestServiceClient(grpc::Channel channel) : base(channel) + public TestServiceClient(grpc::ChannelBase channel) : base(channel) { } /// Creates a new client for TestService that uses a custom CallInvoker. @@ -602,7 +602,7 @@ namespace Grpc.Testing { { /// Creates a new client for UnimplementedService /// The channel to use to make remote calls. - public UnimplementedServiceClient(grpc::Channel channel) : base(channel) + public UnimplementedServiceClient(grpc::ChannelBase channel) : base(channel) { } /// Creates a new client for UnimplementedService that uses a custom CallInvoker. @@ -741,7 +741,7 @@ namespace Grpc.Testing { { /// Creates a new client for ReconnectService /// The channel to use to make remote calls. - public ReconnectServiceClient(grpc::Channel channel) : base(channel) + public ReconnectServiceClient(grpc::ChannelBase channel) : base(channel) { } /// Creates a new client for ReconnectService that uses a custom CallInvoker. diff --git a/src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs b/src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs index 14c26f99a6b..66378081626 100644 --- a/src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/WorkerServiceGrpc.cs @@ -138,7 +138,7 @@ namespace Grpc.Testing { { /// Creates a new client for WorkerService /// The channel to use to make remote calls. - public WorkerServiceClient(grpc::Channel channel) : base(channel) + public WorkerServiceClient(grpc::ChannelBase channel) : base(channel) { } /// Creates a new client for WorkerService that uses a custom CallInvoker. diff --git a/src/csharp/Grpc.Microbenchmarks/AtomicCounterBenchmark.cs b/src/csharp/Grpc.Microbenchmarks/AtomicCounterBenchmark.cs new file mode 100644 index 00000000000..03984f40728 --- /dev/null +++ b/src/csharp/Grpc.Microbenchmarks/AtomicCounterBenchmark.cs @@ -0,0 +1,52 @@ +#region Copyright notice and license + +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#endregion + +using System; +using System.Runtime.InteropServices; +using BenchmarkDotNet.Attributes; +using Grpc.Core.Internal; + +namespace Grpc.Microbenchmarks +{ + public class AtomicCounterBenchmark : CommonThreadedBase + { + protected override bool NeedsEnvironment => false; + + // An example of testing scalability of a method that scales perfectly. + // This method provides a baseline for how well can CommonThreadedBase + // measure scalability. + const int Iterations = 20 * 1000 * 1000; // High number to make the overhead of RunConcurrent negligible. + [Benchmark(OperationsPerInvoke = Iterations)] + + public void SharedAtomicCounterIncrement() + { + RunConcurrent(() => { RunBody(); }); + } + + readonly AtomicCounter sharedCounter = new AtomicCounter(); + + private int RunBody() + { + for (int i = 0; i < Iterations; i++) + { + sharedCounter.Increment(); + } + return (int) sharedCounter.Count; + } + } +} diff --git a/src/csharp/Grpc.Microbenchmarks/CommonThreadedBase.cs b/src/csharp/Grpc.Microbenchmarks/CommonThreadedBase.cs index c6bdf471b8a..c42c6481ffb 100644 --- a/src/csharp/Grpc.Microbenchmarks/CommonThreadedBase.cs +++ b/src/csharp/Grpc.Microbenchmarks/CommonThreadedBase.cs @@ -17,6 +17,8 @@ #endregion using System; +using System.Collections.Concurrent; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using BenchmarkDotNet.Attributes; @@ -35,22 +37,42 @@ namespace Grpc.Microbenchmarks { protected virtual bool NeedsEnvironment => true; - [Params(1, 2, 4, 8, 12)] + [Params(1, 2, 4, 6)] public int ThreadCount { get; set; } protected GrpcEnvironment Environment { get; private set; } + private List workers; + + private List> dispatchQueues; + [GlobalSetup] public virtual void Setup() { - ThreadPool.GetMinThreads(out var workers, out var iocp); - if (workers <= ThreadCount) ThreadPool.SetMinThreads(ThreadCount + 1, iocp); + dispatchQueues = new List>(); + workers = new List(); + for (int i = 0; i < ThreadCount; i++) + { + var dispatchQueue = new BlockingCollection(); + var thread = new Thread(new ThreadStart(() => WorkerThreadBody(dispatchQueue))); + thread.Name = string.Format("threaded benchmark worker {0}", i); + thread.Start(); + workers.Add(thread); + dispatchQueues.Add(dispatchQueue); + } + if (NeedsEnvironment) Environment = GrpcEnvironment.AddRef(); } [GlobalCleanup] public virtual void Cleanup() { + for (int i = 0; i < ThreadCount; i++) + { + dispatchQueues[i].Add(null); // null action request termination of the worker thread. + workers[i].Join(); + } + if (Environment != null) { Environment = null; @@ -58,9 +80,50 @@ namespace Grpc.Microbenchmarks } } + /// + /// Runs the operation in parallel (once on each worker thread). + /// This method tries to incur as little + /// overhead as possible, but there is some inherent overhead + /// that is hard to avoid (thread hop etc.). Therefore it is strongly + /// recommended that the benchmarked operation runs long enough to + /// make this overhead negligible. + /// protected void RunConcurrent(Action operation) { - Parallel.For(0, ThreadCount, _ => operation()); + var workItemTasks = new Task[ThreadCount]; + for (int i = 0; i < ThreadCount; i++) + { + var tcs = new TaskCompletionSource(); + var workItem = new Action(() => + { + try + { + operation(); + tcs.SetResult(null); + } + catch (Exception e) + { + tcs.SetException(e); + } + }); + workItemTasks[i] = tcs.Task; + dispatchQueues[i].Add(workItem); + } + Task.WaitAll(workItemTasks); + } + + private void WorkerThreadBody(BlockingCollection dispatchQueue) + { + while(true) + { + var workItem = dispatchQueue.Take(); + if (workItem == null) + { + // stop the worker if null action was provided + break; + } + workItem(); + } } } } diff --git a/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs b/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs index e4cd7eeb1f6..9426882b54b 100644 --- a/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs +++ b/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs @@ -27,12 +27,13 @@ namespace Grpc.Microbenchmarks [Params(false, true)] public bool UseSharedRegistry { get; set; } - const int Iterations = 1000000; // High number to make the overhead of RunConcurrent negligible. + const int Iterations = 5 * 1000 * 1000; // High number to make the overhead of RunConcurrent negligible. [Benchmark(OperationsPerInvoke = Iterations)] public void RegisterExtract() { - RunConcurrent(() => { - CompletionRegistry sharedRegistry = UseSharedRegistry ? new CompletionRegistry(Environment, () => BatchContextSafeHandle.Create(), () => RequestCallContextSafeHandle.Create()) : null; + CompletionRegistry sharedRegistry = UseSharedRegistry ? new CompletionRegistry(Environment, () => BatchContextSafeHandle.Create(), () => RequestCallContextSafeHandle.Create()) : null; + RunConcurrent(() => + { RunBody(sharedRegistry); }); } diff --git a/src/csharp/Grpc.Microbenchmarks/PInvokeByteArrayBenchmark.cs b/src/csharp/Grpc.Microbenchmarks/PInvokeByteArrayBenchmark.cs index de4e635580f..1ede7453db6 100644 --- a/src/csharp/Grpc.Microbenchmarks/PInvokeByteArrayBenchmark.cs +++ b/src/csharp/Grpc.Microbenchmarks/PInvokeByteArrayBenchmark.cs @@ -32,7 +32,7 @@ namespace Grpc.Microbenchmarks [Params(0)] public int PayloadSize { get; set; } - const int Iterations = 1000000; // High number to make the overhead of RunConcurrent negligible. + const int Iterations = 5 * 1000 * 1000; // High number to make the overhead of RunConcurrent negligible. [Benchmark(OperationsPerInvoke = Iterations)] public void AllocFree() { diff --git a/src/csharp/Grpc.Microbenchmarks/ScalabityExampleBenchmark.cs b/src/csharp/Grpc.Microbenchmarks/ScalabityExampleBenchmark.cs new file mode 100644 index 00000000000..1ef117c83e7 --- /dev/null +++ b/src/csharp/Grpc.Microbenchmarks/ScalabityExampleBenchmark.cs @@ -0,0 +1,56 @@ +#region Copyright notice and license + +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#endregion + +using System; +using System.Runtime.InteropServices; +using BenchmarkDotNet.Attributes; +using Grpc.Core.Internal; + +namespace Grpc.Microbenchmarks +{ + public class ScalabilityExampleBenchmark : CommonThreadedBase + { + protected override bool NeedsEnvironment => false; + + // An example of testing scalability of a method that scales perfectly. + // This method provides a baseline for how well can CommonThreadedBase + // measure scalability. + const int Iterations = 50 * 1000 * 1000; // High number to make the overhead of RunConcurrent negligible. + [Benchmark(OperationsPerInvoke = Iterations)] + public void PerfectScalingExample() + { + RunConcurrent(() => { RunBody(); }); + } + + private int RunBody() + { + int result = 0; + for (int i = 0; i < Iterations; i++) + { + // perform some operation that is completely independent from + // other threads and therefore should scale perfectly if given + // a dedicated thread. + for (int j = 0; j < 100; j++) + { + result = result ^ i ^ j ; + } + } + return result; + } + } +} diff --git a/src/csharp/Grpc.Microbenchmarks/SendMessageBenchmark.cs b/src/csharp/Grpc.Microbenchmarks/SendMessageBenchmark.cs index d9554db00db..8496813efb0 100644 --- a/src/csharp/Grpc.Microbenchmarks/SendMessageBenchmark.cs +++ b/src/csharp/Grpc.Microbenchmarks/SendMessageBenchmark.cs @@ -36,7 +36,7 @@ namespace Grpc.Microbenchmarks [Params(0)] public int PayloadSize { get; set; } - const int Iterations = 1000000; // High number to make the overhead of RunConcurrent negligible. + const int Iterations = 5 * 1000 * 1000; // High number to make the overhead of RunConcurrent negligible. [Benchmark(OperationsPerInvoke = Iterations)] public void SendMessage() { diff --git a/src/csharp/Grpc.Microbenchmarks/UnaryCallOverheadBenchmark.cs b/src/csharp/Grpc.Microbenchmarks/UnaryCallOverheadBenchmark.cs index 4953806f6f4..8448f03dd62 100644 --- a/src/csharp/Grpc.Microbenchmarks/UnaryCallOverheadBenchmark.cs +++ b/src/csharp/Grpc.Microbenchmarks/UnaryCallOverheadBenchmark.cs @@ -33,14 +33,28 @@ namespace Grpc.Microbenchmarks public class UnaryCallOverheadBenchmark { private static readonly Task CompletedString = Task.FromResult(""); - private static readonly byte[] EmptyBlob = new byte[0]; - private static readonly Marshaller EmptyMarshaller = new Marshaller(_ => EmptyBlob, _ => ""); - private static readonly Method PingMethod = new Method(MethodType.Unary, nameof(PingBenchmark), "Ping", EmptyMarshaller, EmptyMarshaller); + private static readonly Marshaller IdentityMarshaller = new Marshaller(msg => msg, payload => payload); + private static readonly Method PingMethod = new Method(MethodType.Unary, nameof(PingBenchmark), "Ping", IdentityMarshaller, IdentityMarshaller); + + private int payloadSize; + private byte[] payload; + + // size of payload that is sent as request and received as response. + [Params(0, 1, 10, 100, 1000)] + public int PayloadSize + { + get { return payloadSize; } + set + { + payloadSize = value; + payload = new byte[value]; + } + } [Benchmark] - public string SyncUnaryCallOverhead() + public byte[] SyncUnaryCallOverhead() { - return client.Ping("", new CallOptions()); + return client.Ping(payload, new CallOptions()); } Channel channel; @@ -81,7 +95,7 @@ namespace Grpc.Microbenchmarks { public PingClient(CallInvoker callInvoker) : base(callInvoker) { } - public string Ping(string request, CallOptions options) + public byte[] Ping(byte[] request, CallOptions options) { return CallInvoker.BlockingUnaryCall(PingMethod, null, options, request); } diff --git a/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj b/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj index ef9d2a1c570..e19020808f7 100755 --- a/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj +++ b/src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj @@ -1,4 +1,4 @@ - + @@ -10,6 +10,7 @@ + diff --git a/src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs b/src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs index 76f8cfadcfd..b77f245667c 100644 --- a/src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs +++ b/src/csharp/Grpc.Reflection.Tests/ReflectionClientServerTest.cs @@ -1,4 +1,4 @@ -#region Copyright notice and license +#region Copyright notice and license // Copyright 2015 gRPC authors. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/csharp/Grpc.Reflection/Grpc.Reflection.csproj b/src/csharp/Grpc.Reflection/Grpc.Reflection.csproj index cf08e58ed65..4dbc8d69390 100755 --- a/src/csharp/Grpc.Reflection/Grpc.Reflection.csproj +++ b/src/csharp/Grpc.Reflection/Grpc.Reflection.csproj @@ -26,7 +26,7 @@ - + None diff --git a/src/csharp/Grpc.Reflection/ReflectionGrpc.cs b/src/csharp/Grpc.Reflection/ReflectionGrpc.cs index f97b3143a69..fa482eba494 100644 --- a/src/csharp/Grpc.Reflection/ReflectionGrpc.cs +++ b/src/csharp/Grpc.Reflection/ReflectionGrpc.cs @@ -69,7 +69,7 @@ namespace Grpc.Reflection.V1Alpha { { /// Creates a new client for ServerReflection /// The channel to use to make remote calls. - public ServerReflectionClient(grpc::Channel channel) : base(channel) + public ServerReflectionClient(grpc::ChannelBase channel) : base(channel) { } /// Creates a new client for ServerReflection that uses a custom CallInvoker. diff --git a/src/csharp/build/dependencies.props b/src/csharp/build/dependencies.props index a91b5e19414..d45d3b1b0eb 100644 --- a/src/csharp/build/dependencies.props +++ b/src/csharp/build/dependencies.props @@ -1,7 +1,7 @@ - 1.23.0-dev + 2.24.0-dev 3.8.0 diff --git a/src/csharp/build_unitypackage.bat b/src/csharp/build_unitypackage.bat index 06552e8464b..9fade5c1dd0 100644 --- a/src/csharp/build_unitypackage.bat +++ b/src/csharp/build_unitypackage.bat @@ -13,7 +13,7 @@ @rem limitations under the License. @rem Current package versions -set VERSION=1.23.0-dev +set VERSION=2.24.0-dev @rem Adjust the location of nuget.exe set NUGET=C:\nuget\nuget.exe @@ -64,7 +64,6 @@ copy /Y nativelibs\csharp_ext_macos_ios\libgrpc.a unitypackage\unitypackage_skel @rem add gRPC dependencies @rem TODO(jtattermusch): also include XMLdoc -copy /Y Grpc.Core\bin\Release\net45\System.Interactive.Async.dll unitypackage\unitypackage_skeleton\Plugins\System.Interactive.Async\lib\net45\System.Interactive.Async.dll || goto :error copy /Y Grpc.Core\bin\Release\net45\System.Runtime.CompilerServices.Unsafe.dll unitypackage\unitypackage_skeleton\Plugins\System.Runtime.CompilerServices.Unsafe\lib\net45\System.Runtime.CompilerServices.Unsafe.dll || goto :error copy /Y Grpc.Core\bin\Release\net45\System.Buffers.dll unitypackage\unitypackage_skeleton\Plugins\System.Buffers\lib\net45\System.Buffers.dll || goto :error copy /Y Grpc.Core\bin\Release\net45\System.Memory.dll unitypackage\unitypackage_skeleton\Plugins\System.Memory\lib\net45\System.Memory.dll || goto :error diff --git a/src/csharp/unitypackage/unitypackage_skeleton/Plugins/System.Interactive.Async.meta b/src/csharp/unitypackage/unitypackage_skeleton/Plugins/System.Interactive.Async.meta deleted file mode 100644 index 6f1b910534d..00000000000 --- a/src/csharp/unitypackage/unitypackage_skeleton/Plugins/System.Interactive.Async.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: b2ba2199282e9c641bc2e611f1e776a0 -folderAsset: yes -timeCreated: 1531219385 -licenseType: Free -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/csharp/unitypackage/unitypackage_skeleton/Plugins/System.Interactive.Async/lib.meta b/src/csharp/unitypackage/unitypackage_skeleton/Plugins/System.Interactive.Async/lib.meta deleted file mode 100644 index d7ae012a397..00000000000 --- a/src/csharp/unitypackage/unitypackage_skeleton/Plugins/System.Interactive.Async/lib.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: bd5ddd2522dc301488ffe002106fe0ab -folderAsset: yes -timeCreated: 1531219385 -licenseType: Free -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/csharp/unitypackage/unitypackage_skeleton/Plugins/System.Interactive.Async/lib/net45.meta b/src/csharp/unitypackage/unitypackage_skeleton/Plugins/System.Interactive.Async/lib/net45.meta deleted file mode 100644 index 9b1748d3e76..00000000000 --- a/src/csharp/unitypackage/unitypackage_skeleton/Plugins/System.Interactive.Async/lib/net45.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: a68443518bcd1d44ba88a871dcab0c83 -folderAsset: yes -timeCreated: 1531219385 -licenseType: Free -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/csharp/unitypackage/unitypackage_skeleton/Plugins/System.Interactive.Async/lib/net45/System.Interactive.Async.dll.meta b/src/csharp/unitypackage/unitypackage_skeleton/Plugins/System.Interactive.Async/lib/net45/System.Interactive.Async.dll.meta deleted file mode 100644 index bb910fe9229..00000000000 --- a/src/csharp/unitypackage/unitypackage_skeleton/Plugins/System.Interactive.Async/lib/net45/System.Interactive.Async.dll.meta +++ /dev/null @@ -1,32 +0,0 @@ -fileFormatVersion: 2 -guid: 4c05e46cbf00c68408f5ddc1eef9ae3b -timeCreated: 1531219386 -licenseType: Free -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/csharp/unitypackage/unitypackage_skeleton/Plugins/System.Interactive.Async/lib/net45/System.Interactive.Async.xml.meta b/src/csharp/unitypackage/unitypackage_skeleton/Plugins/System.Interactive.Async/lib/net45/System.Interactive.Async.xml.meta deleted file mode 100644 index 53f91502bd6..00000000000 --- a/src/csharp/unitypackage/unitypackage_skeleton/Plugins/System.Interactive.Async/lib/net45/System.Interactive.Async.xml.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 6fc38864f2d3dde46b3833c62c91a008 -timeCreated: 1531219386 -licenseType: Free -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec new file mode 100644 index 00000000000..67faaeb2567 --- /dev/null +++ b/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec @@ -0,0 +1,117 @@ +# This file has been automatically generated from a template file. +# Please make modifications to +# `templates/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec.template` +# instead. This file can be regenerated from the template by running +# `tools/buildgen/generate_projects.sh`. + +# CocoaPods podspec for the gRPC Proto Compiler Plugin +# +# Copyright 2019, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Pod::Spec.new do |s| + # This pod is only a utility that will be used by other pods _at install time_ (not at compile + # time). Other pods can access it in their `prepare_command` script, under /. + # Because CocoaPods installs pods in alphabetical order, beginning this pod's name with an + # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed + # before them. + s.name = '!ProtoCompiler-gRPCCppPlugin' + v = '1.24.0-dev' + s.version = v + s.summary = 'The gRPC ProtoC plugin generates C++ files from .proto services.' + s.description = <<-DESC + This podspec only downloads the gRPC protoc plugin so that local pods generating protos can use + it in their invocation of protoc, as part of their prepare_command. + DESC + s.homepage = 'https://grpc.io' + s.license = { + :type => 'Apache License, Version 2.0', + :text => <<-LICENSE + Copyright 2019, Google Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + LICENSE + } + s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' } + + repo = 'grpc/grpc' + file = "grpc_cpp_plugin-#{v}-macos-x86_64.zip" + s.source = { + :http => "https://github.com/#{repo}/releases/download/v#{v}/#{file}", + # TODO(jcanizales): Add sha1 or sha256 + # :sha1 => '??', + } + + repo_root = '../..' + bazel = "#{repo_root}/tools/bazel" + plugin = 'grpc_cpp_plugin' + + s.preserve_paths = plugin + + # Restrict the protoc version to the one supported by this plugin. + s.dependency '!ProtoCompiler', '3.8.0' + # For the Protobuf dependency not to complain: + s.ios.deployment_target = '7.0' + s.osx.deployment_target = '10.9' + s.tvos.deployment_target = '10.0' + s.watchos.deployment_target = '2.0' + + # This is only for local development of the plugin: If the Podfile brings this pod from a local + # directory using `:path`, CocoaPods won't download the zip file and so the plugin won't be + # present in this pod's directory. We use that knowledge to check for the existence of the file + # and, if absent, compile the plugin from the local sources. + s.prepare_command = <<-CMD + #{bazel} build //src/compiler:grpc_cpp_plugin + CMD +end diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index 939078def22..f65086b6df5 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCPlugin' - v = '1.23.0-dev' + v = '1.24.0-dev' s.version = v s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.' s.description = <<-DESC @@ -96,6 +96,7 @@ Pod::Spec.new do |s| } repo_root = '../..' + bazel = "#{repo_root}/tools/bazel" plugin = 'grpc_objective_c_plugin' s.preserve_paths = plugin @@ -106,6 +107,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.9' s.tvos.deployment_target = '10.0' + s.watchos.deployment_target = '4.0' # Restrict the gRPC runtime version to the one supported by this plugin. s.dependency 'gRPC-ProtoRPC', v @@ -114,15 +116,6 @@ Pod::Spec.new do |s| # present in this pod's directory. We use that knowledge to check for the existence of the file # and, if absent, compile the plugin from the local sources. s.prepare_command = <<-CMD - if [ ! -f #{plugin} ]; then - cd #{repo_root} - # This will build the plugin and put it in #{repo_root}/bins/opt. - # - # TODO(jcanizales): I reckon make will try to use locally-installed libprotoc (headers and - # library binary) if found, which _we do not want_. Find a way for this to always use the - # sources in the repo. - make #{plugin} - cd - - fi + #{bazel} build //src/compiler:grpc_objective_c_plugin CMD end diff --git a/src/objective-c/!ProtoCompiler.podspec b/src/objective-c/!ProtoCompiler.podspec index d8ce4d8e89d..9d036ac0b5b 100644 --- a/src/objective-c/!ProtoCompiler.podspec +++ b/src/objective-c/!ProtoCompiler.podspec @@ -113,26 +113,16 @@ Pod::Spec.new do |s| s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.9' s.tvos.deployment_target = '10.0' + s.watchos.deployment_target = '4.0' # This is only for local development of protoc: If the Podfile brings this pod from a local # directory using `:path`, CocoaPods won't download the zip file and so the compiler won't be # present in this pod's directory. We use that knowledge to check for the existence of the file # and, if absent, build it from the local sources. repo_root = '../..' - plugin = 'grpc_objective_c_plugin' + bazel = "#{repo_root}/tools/bazel" + s.prepare_command = <<-CMD - if [ ! -f bin/protoc ]; then - cd #{repo_root} - # This will build protoc from the Protobuf submodule of gRPC, and put it in - # #{repo_root}/bins/opt/protobuf. - # - # TODO(jcanizales): Make won't build protoc from sources if one's locally installed, which - # _we do not want_. Find a way for this to always build from source. - make #{plugin} - cd - - else - mv bin/protoc . - mv include/google . - fi + #{bazel} build @com_google_protobuf//:protoc CMD end diff --git a/src/objective-c/BUILD b/src/objective-c/BUILD new file mode 100644 index 00000000000..3a71086f0f6 --- /dev/null +++ b/src/objective-c/BUILD @@ -0,0 +1,133 @@ +# gRPC Bazel BUILD file. +# +# Copyright 2019 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # Apache v2 + +package(default_visibility = ["//visibility:public"]) + +load("//bazel:grpc_build_system.bzl", "grpc_objc_library", "grpc_objc_use_cronet_config") + +exports_files(["LICENSE"]) + +grpc_objc_use_cronet_config() + +grpc_objc_library( + name = "rx_library", + srcs = glob([ + "RxLibrary/*.m", + "RxLibrary/transformations/*.m", + ]), + hdrs = glob([ + "RxLibrary/*.h", + "RxLibrary/transformations/*.h", + ]), + includes = ["."], + deps = [":rx_library_private"], +) + +grpc_objc_library( + name = "rx_library_private", + srcs = glob([ + "RxLibrary/private/*.m", + ]), + textual_hdrs = glob([ + "RxLibrary/private/*.h", + ]), + visibility = ["//visibility:private"], +) + +grpc_objc_library( + name = "grpc_objc_client", + srcs = glob( + [ + "GRPCClient/*.m", + "GRPCClient/private/*.m", + ], + exclude = ["GRPCClient/GRPCCall+GID.m"], + ), + hdrs = glob( + [ + "GRPCClient/*.h", + "GRPCClient/internal/*.h", + ], + exclude = ["GRPCClient/GRPCCall+GID.h"], + ), + data = ["//:gRPCCertificates"], + includes = ["."], + textual_hdrs = glob([ + "GRPCClient/private/*.h", + ]), + deps = [ + ":rx_library", + "//:grpc_objc", + ], +) + +grpc_objc_library( + name = "proto_objc_rpc", + srcs = glob( + ["ProtoRPC/*.m"], + ), + hdrs = glob( + ["ProtoRPC/*.h"], + ), + # Different from Cocoapods, do not import as if @com_google_protobuf//:protobuf_objc is a framework, + # use the real paths of @com_google_protobuf//:protobuf_objc instead + defines = ["GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=0"], + deps = [ + ":grpc_objc_client", + ":rx_library", + "@com_google_protobuf//:protobuf_objc", + ], +) + +grpc_objc_library( + name = "grpc_objc_client_internal_testing", + srcs = glob( + [ + "GRPCClient/*.m", + "GRPCClient/private/*.m", + "GRPCClient/internal_testing/*.m", + "ProtoRPC/*.m", + ], + exclude = ["GRPCClient/GRPCCall+GID.m"], + ), + hdrs = glob( + [ + "GRPCClient/*.h", + "GRPCClient/internal/*.h", + "GRPCClient/internal_testing/*.h", + "ProtoRPC/*.h", + ], + exclude = ["GRPCClient/GRPCCall+GID.h"], + ), + includes = ["."], + data = ["//:gRPCCertificates"], + defines = [ + "GRPC_TEST_OBJC=1", + "GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=0", + ], + textual_hdrs = glob( + [ + "GRPCClient/private/*.h", + ], + ), + deps = [ + ":rx_library", + "//:grpc_objc", + "@com_google_protobuf//:protobuf_objc", + ], +) diff --git a/src/objective-c/BoringSSL-GRPC.podspec b/src/objective-c/BoringSSL-GRPC.podspec index 2ec146e7ebe..f0d9750d6d1 100644 --- a/src/objective-c/BoringSSL-GRPC.podspec +++ b/src/objective-c/BoringSSL-GRPC.podspec @@ -82,6 +82,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.7' s.tvos.deployment_target = '10.0' + s.watchos.deployment_target = '4.0' name = 'openssl_grpc' diff --git a/src/objective-c/GRPCClient/GRPCCall+Tests.m b/src/objective-c/GRPCClient/GRPCCall+Tests.m index ac3b6a658f9..20f5cba4178 100644 --- a/src/objective-c/GRPCClient/GRPCCall+Tests.m +++ b/src/objective-c/GRPCClient/GRPCCall+Tests.m @@ -27,8 +27,14 @@ + (void)useTestCertsPath:(NSString *)certsPath testName:(NSString *)testName forHost:(NSString *)host { - if (!host || !certsPath || !testName) { - [NSException raise:NSInvalidArgumentException format:@"host, path and name must be provided."]; + if (!host) { + [NSException raise:NSInvalidArgumentException format:@"host must be provided."]; + } + if (!certsPath) { + [NSException raise:NSInvalidArgumentException format:@"certpath be provided."]; + } + if (!testName) { + [NSException raise:NSInvalidArgumentException format:@"testname must be provided."]; } NSError *error = nil; NSString *certs = diff --git a/src/objective-c/GRPCClient/private/GRPCOpBatchLog.h b/src/objective-c/GRPCClient/private/GRPCOpBatchLog.h index 700d19a206b..1235a5e8d05 100644 --- a/src/objective-c/GRPCClient/private/GRPCOpBatchLog.h +++ b/src/objective-c/GRPCClient/private/GRPCOpBatchLog.h @@ -17,6 +17,7 @@ */ #ifdef GRPC_TEST_OBJC +#import /** * Logs the op batches of a client. Used for testing. diff --git a/src/objective-c/GRPCClient/private/version.h b/src/objective-c/GRPCClient/private/version.h index 3b248db0148..fc6982c55d6 100644 --- a/src/objective-c/GRPCClient/private/version.h +++ b/src/objective-c/GRPCClient/private/version.h @@ -22,4 +22,4 @@ // instead. This file can be regenerated from the template by running // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.23.0-dev" +#define GRPC_OBJC_VERSION_STRING @"1.24.0-dev" diff --git a/src/objective-c/examples/BUILD b/src/objective-c/examples/BUILD new file mode 100644 index 00000000000..4d838b17ba0 --- /dev/null +++ b/src/objective-c/examples/BUILD @@ -0,0 +1,172 @@ +# gRPC Bazel BUILD file. +# +# Copyright 2019 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # 3-clause BSD + +package(default_visibility = ["//visibility:public"]) + +load( + "//src/objective-c:grpc_objc_internal_library.bzl", + "grpc_objc_examples_library", + "local_objc_grpc_library", + "proto_library_objc_wrapper", +) +load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application") +load("@build_bazel_rules_apple//apple:tvos.bzl", "tvos_application") +load("@build_bazel_rules_apple//apple:watchos.bzl", "watchos_application", "watchos_extension") + +proto_library_objc_wrapper( + name = "messages_proto", + srcs = ["RemoteTestClient/messages.proto"], +) + +proto_library_objc_wrapper( + name = "test_proto", + srcs = ["RemoteTestClient/test.proto"], + deps = [":messages_proto"], + use_well_known_protos = True, +) + +# use objc_grpc_library in bazel:objc_grpc_library.bzl when developing outside the repo +local_objc_grpc_library( + name = "RemoteTest", + srcs = ["RemoteTestClient/test.proto"], + use_well_known_protos = True, + deps = [ + "//src/objective-c/examples:test_proto", + ], +) + +# Proof that without this works without srcs +local_objc_grpc_library( + name = "test_objc", + use_well_known_protos = True, + deps = [ + "//src/objective-c/examples:test_proto", + ], +) + +grpc_objc_examples_library( + name = "Sample-lib", + srcs = glob(["Sample/Sample/**/*.m"]), + hdrs = glob(["Sample/Sample/**/*.h"]), + data = glob([ + "Sample/Sample/Base.lproj/**", + "Sample/Sample/Images.xcassets/**", + ]), +) + +ios_application( + name = "Sample", + bundle_id = "io.grpc.Sample", + minimum_os_version = "8.0", + infoplists = ["Sample/Sample/Info.plist"], + families = [ + "iphone", + "ipad", + ], + deps = ["Sample-lib"], + visibility = ["//visibility:public"], +) + +grpc_objc_examples_library( + name = "InterceptorSample-lib", + srcs = glob(["InterceptorSample/InterceptorSample/**/*.m"]), + hdrs = glob(["InterceptorSample/InterceptorSample/**/*.h"]), + data = glob([ + "InterceptorSample/InterceptorSample/Base.lproj/**", + "InterceptorSample/InterceptorSample/Images.xcassets/**", + ]), +) + +ios_application( + name = "InterceptorSample", + bundle_id = "io.grpc.InterceptorSample", + minimum_os_version = "9.0", # Safe Area Layout Guide used + infoplists = ["InterceptorSample/InterceptorSample/Info.plist"], + families = [ + "iphone", + "ipad", + ], + deps = ["InterceptorSample-lib"], +) + +grpc_objc_examples_library( + name = "tvOS-sample-lib", + srcs = glob(["tvOS-sample/tvOS-sample/**/*.m"]), + hdrs = glob(["tvOS-sample/tvOS-sample/**/*.h"]), + data = glob([ + "tvOS-sample/tvOS-sample/Base.lproj/**", + "tvOS-sample/tvOS-sample/Images.xcassets/**", + ]), +) + +# c-ares does not support tvOS CPU architecture with Bazel yet +tvos_application( + name = "tvOS-sample", + bundle_id = "io.grpc.tvOS-sample", + minimum_os_version = "10.0", + infoplists = ["tvOS-sample/tvOS-sample/Info.plist"], + deps = [":tvOS-sample-lib"], +) + +grpc_objc_examples_library( + name = "watchOS-sample-iOS-lib", + srcs = glob(["watchOS-sample/watchOS-sample/**/*.m"]), + hdrs = glob(["watchOS-sample/watchOS-sample/**/*.h"]), + data = glob([ + "watchOS-sample/watchOS-sample/Base.lproj/**", + "watchOS-sample/watchOS-sample/Images.xcassets/**", + ]), +) + +grpc_objc_examples_library( + name = "watchOS-sample-extension-lib", + srcs = glob(["watchOS-sample/WatchKit-Extention/**/*.m"]), + hdrs = glob(["watchOS-sample/WatchKit-Extension/**/*.h"]), + sdk_frameworks = [ + "WatchConnectivity", + "WatchKit", + ], +) + +ios_application( + name = "watchOS-sample", + bundle_id = "io.grpc.watchOS-sample", + minimum_os_version = "9.0", # Safe Area Layout Guide used + families = ["iphone"], + infoplists = ["watchOS-sample/watchOS-sample/Info.plist"], + deps = [":watchOS-sample-iOS-lib"], + watch_application = "watchOS-sample-watchApp", +) + +# c-ares does not support watchOS CPU architecture with Bazel yet +watchos_application( + name = "watchOS-sample-watchApp", + bundle_id = "io.grpc.watchOS-sample.watchkitapp", + minimum_os_version = "4.0", + storyboards = ["watchOS-sample/WatchKit-App/Base.lproj/Interface.storyboard"], + infoplists = ["watchOS-sample/WatchKit-App/Info.plist"], + extension = ":watchOS-sample-extension", +) + +watchos_extension( + name = "watchOS-sample-extension", + bundle_id = "io.grpc.watchOS-sample.watchkitapp.watchkitextension", + minimum_os_version = "4.0", + infoplists = ["watchOS-sample/WatchKit-Extension/Info.plist"], + deps = [":watchOS-sample-extension-lib"], +) diff --git a/src/objective-c/examples/InterceptorSample/InterceptorSample/Info.plist b/src/objective-c/examples/InterceptorSample/InterceptorSample/Info.plist index 16be3b68112..e5d82108923 100644 --- a/src/objective-c/examples/InterceptorSample/InterceptorSample/Info.plist +++ b/src/objective-c/examples/InterceptorSample/InterceptorSample/Info.plist @@ -3,7 +3,7 @@ CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) + en_US CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier diff --git a/src/objective-c/examples/InterceptorSample/InterceptorSample/ViewController.m b/src/objective-c/examples/InterceptorSample/InterceptorSample/ViewController.m index 9da6dedbf9e..ac6ce6752d9 100644 --- a/src/objective-c/examples/InterceptorSample/InterceptorSample/ViewController.m +++ b/src/objective-c/examples/InterceptorSample/InterceptorSample/ViewController.m @@ -19,8 +19,13 @@ #import "ViewController.h" #import +#if USE_FRAMEWORKS #import #import +#else +#import "src/objective-c/examples/RemoteTestClient/Messages.pbobjc.h" +#import "src/objective-c/examples/RemoteTestClient/Test.pbrpc.h" +#endif #import "CacheInterceptor.h" diff --git a/src/objective-c/examples/InterceptorSample/Podfile b/src/objective-c/examples/InterceptorSample/Podfile index b20813d32aa..0252451eff9 100644 --- a/src/objective-c/examples/InterceptorSample/Podfile +++ b/src/objective-c/examples/InterceptorSample/Podfile @@ -2,6 +2,11 @@ platform :ios, '8.0' install! 'cocoapods', :deterministic_uuids => false +# Default to use framework, so that providing no 'FRAMEWORK' env parameter works consistently +# for all Samples, specifically because Swift only supports framework. +# Only effective for examples/ +use_frameworks! if ENV['FRAMEWORKS'] != 'NO' + ROOT_DIR = '../../../..' target 'InterceptorSample' do diff --git a/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec b/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec index cd9464c453e..ca45fd063bd 100644 --- a/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec +++ b/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec @@ -9,36 +9,55 @@ Pod::Spec.new do |s| s.ios.deployment_target = '7.1' s.osx.deployment_target = '10.9' + s.tvos.deployment_target = '10.0' + s.watchos.deployment_target = '4.0' # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients. s.dependency "!ProtoCompiler-gRPCPlugin" repo_root = '../../../..' - bin_dir = "#{repo_root}/bins/$CONFIG" + bazel_exec_root = "#{repo_root}/bazel-out/darwin-fastbuild/bin" - protoc = "#{bin_dir}/protobuf/protoc" + protoc = "#{bazel_exec_root}/external/com_google_protobuf/protoc" well_known_types_dir = "#{repo_root}/third_party/protobuf/src" - plugin = "#{bin_dir}/grpc_objective_c_plugin" - - s.prepare_command = <<-CMD - #{protoc} \ - --plugin=protoc-gen-grpc=#{plugin} \ - --objc_out=. \ - --grpc_out=. \ - -I . \ - -I #{well_known_types_dir} \ - *.proto - CMD + plugin = "#{bazel_exec_root}/src/compiler/grpc_objective_c_plugin" + + # Since we switched to importing full path, -I needs to be set to the directory + # from which the imported file can be found, which is the grpc's root here + if ENV['FRAMEWORKS'] != 'NO' then + s.user_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'USE_FRAMEWORKS=1' } + s.prepare_command = <<-CMD + # Cannot find file if using *.proto. Maybe files' paths must match the -I flags + #{protoc} \ + --plugin=protoc-gen-grpc=#{plugin} \ + --objc_out=. \ + --grpc_out=generate_for_named_framework=#{s.name}:. \ + --objc_opt=generate_for_named_framework=#{s.name} \ + -I #{repo_root} \ + -I #{well_known_types_dir} \ + #{repo_root}/src/objective-c/examples/RemoteTestClient/*.proto + CMD + else + s.prepare_command = <<-CMD + #{protoc} \ + --plugin=protoc-gen-grpc=#{plugin} \ + --objc_out=. \ + --grpc_out=. \ + -I #{repo_root} \ + -I #{well_known_types_dir} \ + #{repo_root}/src/objective-c/examples/RemoteTestClient/*.proto + CMD + end s.subspec 'Messages' do |ms| - ms.source_files = '*.pbobjc.{h,m}' + ms.source_files = 'src/objective-c/examples/RemoteTestClient/*.pbobjc.{h,m}' ms.header_mappings_dir = '.' ms.requires_arc = false ms.dependency 'Protobuf' end s.subspec 'Services' do |ss| - ss.source_files = '*.pbrpc.{h,m}' + ss.source_files = 'src/objective-c/examples/RemoteTestClient/*.pbrpc.{h,m}' ss.header_mappings_dir = '.' ss.requires_arc = true ss.dependency 'gRPC-ProtoRPC' @@ -51,4 +70,5 @@ Pod::Spec.new do |s| # This is needed by all pods that depend on gRPC-RxLibrary: 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES', } + end diff --git a/src/objective-c/examples/RemoteTestClient/test.proto b/src/objective-c/examples/RemoteTestClient/test.proto index c5696043630..8c91f7d9f2e 100644 --- a/src/objective-c/examples/RemoteTestClient/test.proto +++ b/src/objective-c/examples/RemoteTestClient/test.proto @@ -17,7 +17,7 @@ syntax = "proto3"; import "google/protobuf/empty.proto"; -import "messages.proto"; +import "src/objective-c/examples/RemoteTestClient/messages.proto"; package grpc.testing; diff --git a/src/objective-c/examples/Sample/Podfile b/src/objective-c/examples/Sample/Podfile index bebd55bd628..e7ee700cb17 100644 --- a/src/objective-c/examples/Sample/Podfile +++ b/src/objective-c/examples/Sample/Podfile @@ -3,7 +3,10 @@ platform :ios, '8.0' install! 'cocoapods', :deterministic_uuids => false -use_frameworks! if ENV['FRAMEWORKS'] == 'YES' +# Default to use framework, so that providing no 'FRAMEWORK' env parameter works consistently +# for all Samples, specifically because Swift only supports framework. +# Only effective for examples/ +use_frameworks! if ENV['FRAMEWORKS'] != 'NO' # Location of gRPC's repo root relative to this file. GRPC_LOCAL_SRC = '../../../..' diff --git a/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj b/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj index cdd1c6c8f7e..2c8156de1e3 100644 --- a/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj +++ b/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj @@ -327,7 +327,7 @@ INFOPLIST_FILE = Sample/Info.plist; LD_GENERATE_MAP_FILE = YES; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "org.grpc.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = io.grpc.Sample; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -340,7 +340,7 @@ INFOPLIST_FILE = Sample/Info.plist; LD_GENERATE_MAP_FILE = YES; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "org.grpc.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = io.grpc.Sample; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; diff --git a/src/objective-c/examples/Sample/Sample/Info.plist b/src/objective-c/examples/Sample/Sample/Info.plist index 2cdf09dc2fc..943e942ae83 100644 --- a/src/objective-c/examples/Sample/Sample/Info.plist +++ b/src/objective-c/examples/Sample/Sample/Info.plist @@ -3,7 +3,7 @@ CFBundleDevelopmentRegion - en + en_US CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier diff --git a/src/objective-c/examples/Sample/Sample/ViewController.m b/src/objective-c/examples/Sample/Sample/ViewController.m index 9bcb002027b..e4f3712d72d 100644 --- a/src/objective-c/examples/Sample/Sample/ViewController.m +++ b/src/objective-c/examples/Sample/Sample/ViewController.m @@ -20,8 +20,13 @@ #import #import +#if USE_FRAMEWORKS #import #import +#else +#import "src/objective-c/examples/RemoteTestClient/Messages.pbobjc.h" +#import "src/objective-c/examples/RemoteTestClient/Test.pbrpc.h" +#endif #import #import diff --git a/src/objective-c/examples/tvOS-sample/Podfile b/src/objective-c/examples/tvOS-sample/Podfile new file mode 100644 index 00000000000..79427b98b90 --- /dev/null +++ b/src/objective-c/examples/tvOS-sample/Podfile @@ -0,0 +1,33 @@ +platform :tvos, '10.0' + +install! 'cocoapods', :deterministic_uuids => false + +use_frameworks! if ENV['FRAMEWORKS'] != 'NO' + +ROOT_DIR = '../../../..' + +target 'tvOS-sample' do + pod 'gRPC-ProtoRPC', :path => ROOT_DIR + pod 'gRPC', :path => ROOT_DIR + pod 'gRPC-Core', :path => ROOT_DIR + pod 'gRPC-RxLibrary', :path => ROOT_DIR + pod 'RemoteTest', :path => "../RemoteTestClient" + pod '!ProtoCompiler-gRPCPlugin', :path => "#{ROOT_DIR}/src/objective-c" +end + +pre_install do |installer| + grpc_core_spec = installer.pod_targets.find{|t| t.name.start_with?('gRPC-Core')}.root_spec + + src_root = "$(PODS_TARGET_SRCROOT)" + grpc_core_spec.pod_target_xcconfig = { + 'GRPC_SRC_ROOT' => src_root, + 'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(GRPC_SRC_ROOT)/include"', + 'USER_HEADER_SEARCH_PATHS' => '"$(GRPC_SRC_ROOT)"', + # If we don't set these two settings, `include/grpc/support/time.h` and + # `src/core/lib/gpr/string.h` shadow the system `` and ``, breaking the + # build. + 'USE_HEADERMAP' => 'NO', + 'ALWAYS_SEARCH_USER_PATHS' => 'NO', + } +end + diff --git a/src/objective-c/examples/tvOS-sample/tvOS-sample.xcodeproj/project.pbxproj b/src/objective-c/examples/tvOS-sample/tvOS-sample.xcodeproj/project.pbxproj new file mode 100644 index 00000000000..be6863f9f3f --- /dev/null +++ b/src/objective-c/examples/tvOS-sample/tvOS-sample.xcodeproj/project.pbxproj @@ -0,0 +1,419 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + 02EBA696CC670AE7C839A074 /* libPods-tvOS-sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E06AA8437E1C07D35F65494 /* libPods-tvOS-sample.a */; }; + AB065AFB22F3A66000418B42 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AB065AFA22F3A66000418B42 /* AppDelegate.m */; }; + AB065AFE22F3A66000418B42 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB065AFD22F3A66000418B42 /* ViewController.m */; }; + AB065B0122F3A66000418B42 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AB065AFF22F3A66000418B42 /* Main.storyboard */; }; + AB065B0622F3A66000418B42 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AB065B0522F3A66000418B42 /* main.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 48F25040998C073D575D8368 /* Pods-tvOS-sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-tvOS-sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-tvOS-sample/Pods-tvOS-sample.debug.xcconfig"; sourceTree = ""; }; + 4E06AA8437E1C07D35F65494 /* libPods-tvOS-sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-tvOS-sample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 6DEA6A97511C324413DA4309 /* Pods-tvOS-sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-tvOS-sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-tvOS-sample/Pods-tvOS-sample.release.xcconfig"; sourceTree = ""; }; + AB065AF622F3A66000418B42 /* tvOS-sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "tvOS-sample.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + AB065AF922F3A66000418B42 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + AB065AFA22F3A66000418B42 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + AB065AFC22F3A66000418B42 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + AB065AFD22F3A66000418B42 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + AB065B0022F3A66000418B42 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + AB065B0422F3A66000418B42 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + AB065B0522F3A66000418B42 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + AB065AF322F3A66000418B42 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 02EBA696CC670AE7C839A074 /* libPods-tvOS-sample.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0BEC1FEC387B8EE89F6F099A /* Frameworks */ = { + isa = PBXGroup; + children = ( + 4E06AA8437E1C07D35F65494 /* libPods-tvOS-sample.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + 3FED17B5BF1125421CC89007 /* Pods */ = { + isa = PBXGroup; + children = ( + 48F25040998C073D575D8368 /* Pods-tvOS-sample.debug.xcconfig */, + 6DEA6A97511C324413DA4309 /* Pods-tvOS-sample.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + AB065AED22F3A66000418B42 = { + isa = PBXGroup; + children = ( + AB065AF822F3A66000418B42 /* tvOS-sample */, + AB065AF722F3A66000418B42 /* Products */, + 3FED17B5BF1125421CC89007 /* Pods */, + 0BEC1FEC387B8EE89F6F099A /* Frameworks */, + ); + sourceTree = ""; + }; + AB065AF722F3A66000418B42 /* Products */ = { + isa = PBXGroup; + children = ( + AB065AF622F3A66000418B42 /* tvOS-sample.app */, + ); + name = Products; + sourceTree = ""; + }; + AB065AF822F3A66000418B42 /* tvOS-sample */ = { + isa = PBXGroup; + children = ( + AB065AF922F3A66000418B42 /* AppDelegate.h */, + AB065AFA22F3A66000418B42 /* AppDelegate.m */, + AB065AFC22F3A66000418B42 /* ViewController.h */, + AB065AFD22F3A66000418B42 /* ViewController.m */, + AB065AFF22F3A66000418B42 /* Main.storyboard */, + AB065B0422F3A66000418B42 /* Info.plist */, + AB065B0522F3A66000418B42 /* main.m */, + ); + path = "tvOS-sample"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + AB065AF522F3A66000418B42 /* tvOS-sample */ = { + isa = PBXNativeTarget; + buildConfigurationList = AB065B0922F3A66000418B42 /* Build configuration list for PBXNativeTarget "tvOS-sample" */; + buildPhases = ( + 2C94076AB2C1F2771A45E0FF /* [CP] Check Pods Manifest.lock */, + AB065AF222F3A66000418B42 /* Sources */, + AB065AF322F3A66000418B42 /* Frameworks */, + AB065AF422F3A66000418B42 /* Resources */, + 000AD98AD507990B4381492E /* [CP] Embed Pods Frameworks */, + EC4FC44DCB7C66394A17FCF9 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "tvOS-sample"; + productName = "tvOS-sample"; + productReference = AB065AF622F3A66000418B42 /* tvOS-sample.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + AB065AEE22F3A66000418B42 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0920; + ORGANIZATIONNAME = "Tony Lu"; + TargetAttributes = { + AB065AF522F3A66000418B42 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = AB065AF122F3A66000418B42 /* Build configuration list for PBXProject "tvOS-sample" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = AB065AED22F3A66000418B42; + productRefGroup = AB065AF722F3A66000418B42 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + AB065AF522F3A66000418B42 /* tvOS-sample */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + AB065AF422F3A66000418B42 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AB065B0122F3A66000418B42 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 000AD98AD507990B4381492E /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-tvOS-sample/Pods-tvOS-sample-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/BoringSSL-GRPC/openssl_grpc.framework", + "${BUILT_PRODUCTS_DIR}/Protobuf/Protobuf.framework", + "${BUILT_PRODUCTS_DIR}/RemoteTest/RemoteTest.framework", + "${BUILT_PRODUCTS_DIR}/gRPC/GRPCClient.framework", + "${BUILT_PRODUCTS_DIR}/gRPC-Core/grpc.framework", + "${BUILT_PRODUCTS_DIR}/gRPC-ProtoRPC/ProtoRPC.framework", + "${BUILT_PRODUCTS_DIR}/gRPC-RxLibrary/RxLibrary.framework", + "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl_grpc.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Protobuf.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RemoteTest.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GRPCClient.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/grpc.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ProtoRPC.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxLibrary.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-tvOS-sample/Pods-tvOS-sample-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 2C94076AB2C1F2771A45E0FF /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-tvOS-sample-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + EC4FC44DCB7C66394A17FCF9 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-tvOS-sample/Pods-tvOS-sample-resources.sh", + $PODS_CONFIGURATION_BUILD_DIR/gRPC/gRPCCertificates.bundle, + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-tvOS-sample/Pods-tvOS-sample-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + AB065AF222F3A66000418B42 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AB065AFE22F3A66000418B42 /* ViewController.m in Sources */, + AB065B0622F3A66000418B42 /* main.m in Sources */, + AB065AFB22F3A66000418B42 /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + AB065AFF22F3A66000418B42 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + AB065B0022F3A66000418B42 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + AB065B0722F3A66000418B42 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = appletvos; + TVOS_DEPLOYMENT_TARGET = 11.2; + }; + name = Debug; + }; + AB065B0822F3A66000418B42 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = appletvos; + TVOS_DEPLOYMENT_TARGET = 11.2; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + AB065B0A22F3A66000418B42 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 48F25040998C073D575D8368 /* Pods-tvOS-sample.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = "tvOS-sample/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "io.grpc.tvOS-sample"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 10.0; + }; + name = Debug; + }; + AB065B0B22F3A66000418B42 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 6DEA6A97511C324413DA4309 /* Pods-tvOS-sample.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = "tvOS-sample/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "io.grpc.tvOS-sample"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 10.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + AB065AF122F3A66000418B42 /* Build configuration list for PBXProject "tvOS-sample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AB065B0722F3A66000418B42 /* Debug */, + AB065B0822F3A66000418B42 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + AB065B0922F3A66000418B42 /* Build configuration list for PBXNativeTarget "tvOS-sample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AB065B0A22F3A66000418B42 /* Debug */, + AB065B0B22F3A66000418B42 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = AB065AEE22F3A66000418B42 /* Project object */; +} diff --git a/src/objective-c/examples/tvOS-sample/tvOS-sample.xcodeproj/xcshareddata/xcschemes/tvOS-sample.xcscheme b/src/objective-c/examples/tvOS-sample/tvOS-sample.xcodeproj/xcshareddata/xcschemes/tvOS-sample.xcscheme new file mode 100644 index 00000000000..1223d0933b4 --- /dev/null +++ b/src/objective-c/examples/tvOS-sample/tvOS-sample.xcodeproj/xcshareddata/xcschemes/tvOS-sample.xcscheme @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/objective-c/examples/tvOS-sample/tvOS-sample/AppDelegate.h b/src/objective-c/examples/tvOS-sample/tvOS-sample/AppDelegate.h new file mode 100644 index 00000000000..183abcf4ec8 --- /dev/null +++ b/src/objective-c/examples/tvOS-sample/tvOS-sample/AppDelegate.h @@ -0,0 +1,25 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import + +@interface AppDelegate : UIResponder + +@property(strong, nonatomic) UIWindow* window; + +@end diff --git a/src/objective-c/examples/tvOS-sample/tvOS-sample/AppDelegate.m b/src/objective-c/examples/tvOS-sample/tvOS-sample/AppDelegate.m new file mode 100644 index 00000000000..4a76f4c488c --- /dev/null +++ b/src/objective-c/examples/tvOS-sample/tvOS-sample/AppDelegate.m @@ -0,0 +1,27 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +@end diff --git a/src/objective-c/examples/tvOS-sample/tvOS-sample/Base.lproj/Main.storyboard b/src/objective-c/examples/tvOS-sample/tvOS-sample/Base.lproj/Main.storyboard new file mode 100644 index 00000000000..0f2fc518164 --- /dev/null +++ b/src/objective-c/examples/tvOS-sample/tvOS-sample/Base.lproj/Main.storyboard @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/objective-c/examples/tvOS-sample/tvOS-sample/Info.plist b/src/objective-c/examples/tvOS-sample/tvOS-sample/Info.plist new file mode 100644 index 00000000000..33fbde9c63c --- /dev/null +++ b/src/objective-c/examples/tvOS-sample/tvOS-sample/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + en_US + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + arm64 + + UIUserInterfaceStyle + Automatic + + diff --git a/src/objective-c/examples/tvOS-sample/tvOS-sample/ViewController.h b/src/objective-c/examples/tvOS-sample/tvOS-sample/ViewController.h new file mode 100644 index 00000000000..0aa0b2a73a7 --- /dev/null +++ b/src/objective-c/examples/tvOS-sample/tvOS-sample/ViewController.h @@ -0,0 +1,23 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import + +@interface ViewController : UIViewController + +@end diff --git a/src/objective-c/examples/tvOS-sample/tvOS-sample/ViewController.m b/src/objective-c/examples/tvOS-sample/tvOS-sample/ViewController.m new file mode 100644 index 00000000000..c94ee8c2569 --- /dev/null +++ b/src/objective-c/examples/tvOS-sample/tvOS-sample/ViewController.m @@ -0,0 +1,64 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import "ViewController.h" + +#if USE_FRAMEWORKS +#import +#import +#else +#import "src/objective-c/examples/RemoteTestClient/Messages.pbobjc.h" +#import "src/objective-c/examples/RemoteTestClient/Test.pbrpc.h" +#endif + +@interface ViewController () + +@end + +@implementation ViewController { + GRPCCallOptions *_options; + RMTTestService *_service; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init]; + _options = options; + + _service = [[RMTTestService alloc] initWithHost:@"grpc-test.sandbox.googleapis.com" + callOptions:_options]; +} + +- (IBAction)makeCall:(id)sender { + RMTSimpleRequest *request = [RMTSimpleRequest message]; + request.responseSize = 100; + GRPCUnaryProtoCall *call = + [_service unaryCallWithMessage:request responseHandler:self callOptions:nil]; + [call start]; +} + +- (void)didReceiveProtoMessage:(GPBMessage *)message { + NSLog(@"%@", [message data]); +} + +- (dispatch_queue_t)dispatchQueue { + return dispatch_get_main_queue(); +} + +@end diff --git a/src/objective-c/examples/tvOS-sample/tvOS-sample/main.m b/src/objective-c/examples/tvOS-sample/tvOS-sample/main.m new file mode 100644 index 00000000000..2797c6f17f2 --- /dev/null +++ b/src/objective-c/examples/tvOS-sample/tvOS-sample/main.m @@ -0,0 +1,26 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import +#import "AppDelegate.h" + +int main(int argc, char* argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/src/objective-c/examples/watchOS-sample/Podfile b/src/objective-c/examples/watchOS-sample/Podfile new file mode 100644 index 00000000000..59d30ab86c0 --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/Podfile @@ -0,0 +1,43 @@ +install! 'cocoapods', :deterministic_uuids => false + +use_frameworks! if ENV['FRAMEWORKS'] != 'NO' + +ROOT_DIR = '../../../..' + +def grpc_deps + pod 'gRPC-ProtoRPC', :path => ROOT_DIR + pod 'gRPC', :path => ROOT_DIR + pod 'gRPC-Core', :path => ROOT_DIR + pod 'gRPC-RxLibrary', :path => ROOT_DIR + pod 'RemoteTest', :path => "../RemoteTestClient" + pod '!ProtoCompiler-gRPCPlugin', :path => "#{ROOT_DIR}/src/objective-c" + pod 'BoringSSL-GRPC', :podspec => "#{ROOT_DIR}/src/objective-c" + pod '!ProtoCompiler', :path => "#{ROOT_DIR}/src/objective-c" +end + +target 'watchOS-sample' do +platform :ios, '8.0' + grpc_deps +end + +target 'watchOS-sample WatchKit Extension' do +platform :watchos, '4.0' + grpc_deps +end + +pre_install do |installer| + grpc_core_spec = installer.pod_targets.find{|t| t.name.start_with?('gRPC-Core')}.root_spec + + src_root = "$(PODS_TARGET_SRCROOT)" + grpc_core_spec.pod_target_xcconfig = { + 'GRPC_SRC_ROOT' => src_root, + 'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(GRPC_SRC_ROOT)/include"', + 'USER_HEADER_SEARCH_PATHS' => '"$(GRPC_SRC_ROOT)"', + # If we don't set these two settings, `include/grpc/support/time.h` and + # `src/core/lib/gpr/string.h` shadow the system `` and ``, breaking the + # build. + 'USE_HEADERMAP' => 'NO', + 'ALWAYS_SEARCH_USER_PATHS' => 'NO', + } +end + diff --git a/src/objective-c/examples/watchOS-sample/WatchKit-App/Assets.xcassets/AppIcon.appiconset/Contents.json b/src/objective-c/examples/watchOS-sample/WatchKit-App/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000000..6c0f2b4204b --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/WatchKit-App/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,81 @@ +{ + "images" : [ + { + "size" : "24x24", + "idiom" : "watch", + "scale" : "2x", + "role" : "notificationCenter", + "subtype" : "38mm" + }, + { + "size" : "27.5x27.5", + "idiom" : "watch", + "scale" : "2x", + "role" : "notificationCenter", + "subtype" : "42mm" + }, + { + "size" : "29x29", + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "watch", + "scale" : "2x", + "role" : "appLauncher", + "subtype" : "38mm" + }, + { + "size" : "44x44", + "idiom" : "watch", + "scale" : "2x", + "role" : "appLauncher", + "subtype" : "40mm" + }, + { + "size" : "50x50", + "idiom" : "watch", + "scale" : "2x", + "role" : "appLauncher", + "subtype" : "44mm" + }, + { + "size" : "86x86", + "idiom" : "watch", + "scale" : "2x", + "role" : "quickLook", + "subtype" : "38mm" + }, + { + "size" : "98x98", + "idiom" : "watch", + "scale" : "2x", + "role" : "quickLook", + "subtype" : "42mm" + }, + { + "size" : "108x108", + "idiom" : "watch", + "scale" : "2x", + "role" : "quickLook", + "subtype" : "44mm" + }, + { + "idiom" : "watch-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/src/objective-c/examples/watchOS-sample/WatchKit-App/Base.lproj/Interface.storyboard b/src/objective-c/examples/watchOS-sample/WatchKit-App/Base.lproj/Interface.storyboard new file mode 100644 index 00000000000..b261f45f206 --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/WatchKit-App/Base.lproj/Interface.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/objective-c/examples/watchOS-sample/WatchKit-App/Info.plist b/src/objective-c/examples/watchOS-sample/WatchKit-App/Info.plist new file mode 100644 index 00000000000..72c83c2794f --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/WatchKit-App/Info.plist @@ -0,0 +1,33 @@ + + + + + CFBundleDevelopmentRegion + en_US + CFBundleDisplayName + WatchKit-App + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + + WKCompanionAppBundleIdentifier + io.grpc.watchOS-sample + WKWatchKitApp + + + diff --git a/src/objective-c/examples/watchOS-sample/WatchKit-Extension/ExtensionDelegate.h b/src/objective-c/examples/watchOS-sample/WatchKit-Extension/ExtensionDelegate.h new file mode 100644 index 00000000000..fbf67335f7d --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/WatchKit-Extension/ExtensionDelegate.h @@ -0,0 +1,23 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import + +@interface ExtensionDelegate : NSObject + +@end diff --git a/src/objective-c/examples/watchOS-sample/WatchKit-Extension/ExtensionDelegate.m b/src/objective-c/examples/watchOS-sample/WatchKit-Extension/ExtensionDelegate.m new file mode 100644 index 00000000000..b64d60256de --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/WatchKit-Extension/ExtensionDelegate.m @@ -0,0 +1,23 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import "ExtensionDelegate.h" + +@implementation ExtensionDelegate + +@end diff --git a/src/objective-c/examples/watchOS-sample/WatchKit-Extension/Info.plist b/src/objective-c/examples/watchOS-sample/WatchKit-Extension/Info.plist new file mode 100644 index 00000000000..8d8373ba3e5 --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/WatchKit-Extension/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + en_US + CFBundleDisplayName + watchOS-sample WatchKit Extension + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + XPC! + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + NSExtension + + NSExtensionAttributes + + WKAppBundleIdentifier + io.grpc.watchOS-sample.watchkitapp + + NSExtensionPointIdentifier + com.apple.watchkit + + WKExtensionDelegateClassName + ExtensionDelegate + + diff --git a/src/objective-c/examples/watchOS-sample/WatchKit-Extension/InterfaceController.h b/src/objective-c/examples/watchOS-sample/WatchKit-Extension/InterfaceController.h new file mode 100644 index 00000000000..edcc75d5530 --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/WatchKit-Extension/InterfaceController.h @@ -0,0 +1,24 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import +#import + +@interface InterfaceController : WKInterfaceController + +@end diff --git a/src/objective-c/examples/watchOS-sample/WatchKit-Extension/InterfaceController.m b/src/objective-c/examples/watchOS-sample/WatchKit-Extension/InterfaceController.m new file mode 100644 index 00000000000..3e97767cf0c --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/WatchKit-Extension/InterfaceController.m @@ -0,0 +1,65 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#import "InterfaceController.h" + +#if USE_FRAMEWORKS +#import +#import +#else +#import "src/objective-c/examples/RemoteTestClient/Messages.pbobjc.h" +#import "src/objective-c/examples/RemoteTestClient/Test.pbrpc.h" +#endif + +@interface InterfaceController () + +@end + +@implementation InterfaceController { + GRPCCallOptions *_options; + RMTTestService *_service; +} + +- (void)awakeWithContext:(id)context { + [super awakeWithContext:context]; + + // Configure interface objects here. + + GRPCMutableCallOptions *options = [[GRPCMutableCallOptions alloc] init]; + _options = options; + + _service = [[RMTTestService alloc] initWithHost:@"grpc-test.sandbox.googleapis.com" + callOptions:_options]; +} + +- (IBAction)makeCall { + RMTSimpleRequest *request = [RMTSimpleRequest message]; + request.responseSize = 100; + GRPCUnaryProtoCall *call = + [_service unaryCallWithMessage:request responseHandler:self callOptions:nil]; + [call start]; +} + +- (void)didReceiveProtoMessage:(GPBMessage *)message { + NSLog(@"%@", [message data]); +} + +- (dispatch_queue_t)dispatchQueue { + return dispatch_get_main_queue(); +} + +@end diff --git a/src/objective-c/examples/watchOS-sample/watchOS-sample.xcodeproj/project.pbxproj b/src/objective-c/examples/watchOS-sample/watchOS-sample.xcodeproj/project.pbxproj new file mode 100644 index 00000000000..8042b5c4a0d --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/watchOS-sample.xcodeproj/project.pbxproj @@ -0,0 +1,787 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + 6DC02D8E4E24CB3EAAA9C0F7 /* libPods-watchOS-sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D836D6D1793B03D9D9A05E4 /* libPods-watchOS-sample.a */; }; + AB35433822F3A88000C1B2E9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AB35433722F3A88000C1B2E9 /* AppDelegate.m */; }; + AB35433B22F3A88000C1B2E9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB35433A22F3A88000C1B2E9 /* ViewController.m */; }; + AB35433E22F3A88000C1B2E9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AB35433C22F3A88000C1B2E9 /* Main.storyboard */; }; + AB35434022F3A88000C1B2E9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AB35433F22F3A88000C1B2E9 /* Assets.xcassets */; }; + AB35434322F3A88000C1B2E9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AB35434122F3A88000C1B2E9 /* LaunchScreen.storyboard */; }; + AB35434622F3A88000C1B2E9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AB35434522F3A88000C1B2E9 /* main.m */; }; + AB35434A22F3A88000C1B2E9 /* watchOS-sample WatchKit App.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = AB35434922F3A88000C1B2E9 /* watchOS-sample WatchKit App.app */; }; + AB35435022F3A88000C1B2E9 /* Interface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AB35434E22F3A88000C1B2E9 /* Interface.storyboard */; }; + AB35435222F3A88000C1B2E9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AB35435122F3A88000C1B2E9 /* Assets.xcassets */; }; + AB35435922F3A88000C1B2E9 /* watchOS-sample WatchKit Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = AB35435822F3A88000C1B2E9 /* watchOS-sample WatchKit Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + AB35435F22F3A88000C1B2E9 /* InterfaceController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB35435E22F3A88000C1B2E9 /* InterfaceController.m */; }; + AB35436222F3A88000C1B2E9 /* ExtensionDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AB35436122F3A88000C1B2E9 /* ExtensionDelegate.m */; }; + FF523208A6A52E881C6C4CA2 /* libPods-watchOS-sample WatchKit Extension.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C68E1F9D1CE4435317B0009 /* libPods-watchOS-sample WatchKit Extension.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + AB35434B22F3A88000C1B2E9 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = AB35432B22F3A88000C1B2E9 /* Project object */; + proxyType = 1; + remoteGlobalIDString = AB35434822F3A88000C1B2E9; + remoteInfo = "watchOS-sample WatchKit App"; + }; + AB35435A22F3A88000C1B2E9 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = AB35432B22F3A88000C1B2E9 /* Project object */; + proxyType = 1; + remoteGlobalIDString = AB35435722F3A88000C1B2E9; + remoteInfo = "watchOS-sample WatchKit Extension"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + AB35436B22F3A88000C1B2E9 /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + AB35435922F3A88000C1B2E9 /* watchOS-sample WatchKit Extension.appex in Embed App Extensions */, + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; + AB35436F22F3A88000C1B2E9 /* Embed Watch Content */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(CONTENTS_FOLDER_PATH)/Watch"; + dstSubfolderSpec = 16; + files = ( + AB35434A22F3A88000C1B2E9 /* watchOS-sample WatchKit App.app in Embed Watch Content */, + ); + name = "Embed Watch Content"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 0980DE37FA805E61D7665FC3 /* Pods-watchOS-sample WatchKit Extension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-watchOS-sample WatchKit Extension.release.xcconfig"; path = "Pods/Target Support Files/Pods-watchOS-sample WatchKit Extension/Pods-watchOS-sample WatchKit Extension.release.xcconfig"; sourceTree = ""; }; + 0E281AAFDD87686AFF4DA811 /* Pods-watchOS-sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-watchOS-sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-watchOS-sample/Pods-watchOS-sample.release.xcconfig"; sourceTree = ""; }; + 2D836D6D1793B03D9D9A05E4 /* libPods-watchOS-sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-watchOS-sample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 4C68E1F9D1CE4435317B0009 /* libPods-watchOS-sample WatchKit Extension.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-watchOS-sample WatchKit Extension.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 9760150292F726236301FFB4 /* Pods-watchOS-sample WatchKit Extension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-watchOS-sample WatchKit Extension.debug.xcconfig"; path = "Pods/Target Support Files/Pods-watchOS-sample WatchKit Extension/Pods-watchOS-sample WatchKit Extension.debug.xcconfig"; sourceTree = ""; }; + AB35433322F3A88000C1B2E9 /* watchOS-sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "watchOS-sample.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + AB35433622F3A88000C1B2E9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + AB35433722F3A88000C1B2E9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + AB35433922F3A88000C1B2E9 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + AB35433A22F3A88000C1B2E9 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + AB35433D22F3A88000C1B2E9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + AB35433F22F3A88000C1B2E9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + AB35434222F3A88000C1B2E9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + AB35434422F3A88000C1B2E9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + AB35434522F3A88000C1B2E9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + AB35434922F3A88000C1B2E9 /* watchOS-sample WatchKit App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "watchOS-sample WatchKit App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + AB35434F22F3A88000C1B2E9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Interface.storyboard; sourceTree = ""; }; + AB35435122F3A88000C1B2E9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + AB35435322F3A88000C1B2E9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + AB35435822F3A88000C1B2E9 /* watchOS-sample WatchKit Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "watchOS-sample WatchKit Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; + AB35435D22F3A88000C1B2E9 /* InterfaceController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InterfaceController.h; sourceTree = ""; }; + AB35435E22F3A88000C1B2E9 /* InterfaceController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InterfaceController.m; sourceTree = ""; }; + AB35436022F3A88000C1B2E9 /* ExtensionDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExtensionDelegate.h; sourceTree = ""; }; + AB35436122F3A88000C1B2E9 /* ExtensionDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExtensionDelegate.m; sourceTree = ""; }; + AB35436522F3A88000C1B2E9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B04FF36D5367E20E26B17EE8 /* Pods-watchOS-sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-watchOS-sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-watchOS-sample/Pods-watchOS-sample.debug.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 23B5B63423F9068CAAF8C6A8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AB35433022F3A88000C1B2E9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6DC02D8E4E24CB3EAAA9C0F7 /* libPods-watchOS-sample.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AB35435522F3A88000C1B2E9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FF523208A6A52E881C6C4CA2 /* libPods-watchOS-sample WatchKit Extension.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 38A0EA6120D821E9244482B4 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 2D836D6D1793B03D9D9A05E4 /* libPods-watchOS-sample.a */, + 4C68E1F9D1CE4435317B0009 /* libPods-watchOS-sample WatchKit Extension.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + 93EDCC6DB32E10D3C92C69E5 /* Pods */ = { + isa = PBXGroup; + children = ( + B04FF36D5367E20E26B17EE8 /* Pods-watchOS-sample.debug.xcconfig */, + 0E281AAFDD87686AFF4DA811 /* Pods-watchOS-sample.release.xcconfig */, + 9760150292F726236301FFB4 /* Pods-watchOS-sample WatchKit Extension.debug.xcconfig */, + 0980DE37FA805E61D7665FC3 /* Pods-watchOS-sample WatchKit Extension.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + AB35432A22F3A88000C1B2E9 = { + isa = PBXGroup; + children = ( + AB35433522F3A88000C1B2E9 /* watchOS-sample */, + AB35434D22F3A88000C1B2E9 /* WatchKit-App */, + AB35435C22F3A88000C1B2E9 /* WatchKit-Extension */, + AB35433422F3A88000C1B2E9 /* Products */, + 93EDCC6DB32E10D3C92C69E5 /* Pods */, + 38A0EA6120D821E9244482B4 /* Frameworks */, + ); + sourceTree = ""; + }; + AB35433422F3A88000C1B2E9 /* Products */ = { + isa = PBXGroup; + children = ( + AB35433322F3A88000C1B2E9 /* watchOS-sample.app */, + AB35434922F3A88000C1B2E9 /* watchOS-sample WatchKit App.app */, + AB35435822F3A88000C1B2E9 /* watchOS-sample WatchKit Extension.appex */, + ); + name = Products; + sourceTree = ""; + }; + AB35433522F3A88000C1B2E9 /* watchOS-sample */ = { + isa = PBXGroup; + children = ( + AB35433622F3A88000C1B2E9 /* AppDelegate.h */, + AB35433722F3A88000C1B2E9 /* AppDelegate.m */, + AB35433922F3A88000C1B2E9 /* ViewController.h */, + AB35433A22F3A88000C1B2E9 /* ViewController.m */, + AB35433C22F3A88000C1B2E9 /* Main.storyboard */, + AB35433F22F3A88000C1B2E9 /* Assets.xcassets */, + AB35434122F3A88000C1B2E9 /* LaunchScreen.storyboard */, + AB35434422F3A88000C1B2E9 /* Info.plist */, + AB35434522F3A88000C1B2E9 /* main.m */, + ); + path = "watchOS-sample"; + sourceTree = ""; + }; + AB35434D22F3A88000C1B2E9 /* WatchKit-App */ = { + isa = PBXGroup; + children = ( + AB35434E22F3A88000C1B2E9 /* Interface.storyboard */, + AB35435122F3A88000C1B2E9 /* Assets.xcassets */, + AB35435322F3A88000C1B2E9 /* Info.plist */, + ); + path = "WatchKit-App"; + sourceTree = ""; + }; + AB35435C22F3A88000C1B2E9 /* WatchKit-Extension */ = { + isa = PBXGroup; + children = ( + AB35435D22F3A88000C1B2E9 /* InterfaceController.h */, + AB35435E22F3A88000C1B2E9 /* InterfaceController.m */, + AB35436022F3A88000C1B2E9 /* ExtensionDelegate.h */, + AB35436122F3A88000C1B2E9 /* ExtensionDelegate.m */, + AB35436522F3A88000C1B2E9 /* Info.plist */, + ); + path = "WatchKit-Extension"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + AB35433222F3A88000C1B2E9 /* watchOS-sample */ = { + isa = PBXNativeTarget; + buildConfigurationList = AB35437022F3A88000C1B2E9 /* Build configuration list for PBXNativeTarget "watchOS-sample" */; + buildPhases = ( + 7CBBF7FBEB5B8AB30A349E22 /* [CP] Check Pods Manifest.lock */, + AB35432F22F3A88000C1B2E9 /* Sources */, + AB35433022F3A88000C1B2E9 /* Frameworks */, + AB35433122F3A88000C1B2E9 /* Resources */, + AB35436F22F3A88000C1B2E9 /* Embed Watch Content */, + 5644E359E6C67CF9FD7B659D /* [CP] Embed Pods Frameworks */, + 42609F71FF3FEF23C402967B /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + AB35434C22F3A88000C1B2E9 /* PBXTargetDependency */, + ); + name = "watchOS-sample"; + productName = "watchOS-sample"; + productReference = AB35433322F3A88000C1B2E9 /* watchOS-sample.app */; + productType = "com.apple.product-type.application"; + }; + AB35434822F3A88000C1B2E9 /* watchOS-sample WatchKit App */ = { + isa = PBXNativeTarget; + buildConfigurationList = AB35436C22F3A88000C1B2E9 /* Build configuration list for PBXNativeTarget "watchOS-sample WatchKit App" */; + buildPhases = ( + AB35434722F3A88000C1B2E9 /* Resources */, + AB35436B22F3A88000C1B2E9 /* Embed App Extensions */, + 23B5B63423F9068CAAF8C6A8 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + AB35435B22F3A88000C1B2E9 /* PBXTargetDependency */, + ); + name = "watchOS-sample WatchKit App"; + productName = "watchOS-sample WatchKit App"; + productReference = AB35434922F3A88000C1B2E9 /* watchOS-sample WatchKit App.app */; + productType = "com.apple.product-type.application.watchapp2"; + }; + AB35435722F3A88000C1B2E9 /* watchOS-sample WatchKit Extension */ = { + isa = PBXNativeTarget; + buildConfigurationList = AB35436822F3A88000C1B2E9 /* Build configuration list for PBXNativeTarget "watchOS-sample WatchKit Extension" */; + buildPhases = ( + C80BFB1E1525B018E6C87AF0 /* [CP] Check Pods Manifest.lock */, + AB35435422F3A88000C1B2E9 /* Sources */, + AB35435522F3A88000C1B2E9 /* Frameworks */, + AB35435622F3A88000C1B2E9 /* Resources */, + E0C622F545CB8A6103793708 /* [CP] Embed Pods Frameworks */, + D202361DA337959ACDB8D358 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "watchOS-sample WatchKit Extension"; + productName = "watchOS-sample WatchKit Extension"; + productReference = AB35435822F3A88000C1B2E9 /* watchOS-sample WatchKit Extension.appex */; + productType = "com.apple.product-type.watchkit2-extension"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + AB35432B22F3A88000C1B2E9 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0920; + ORGANIZATIONNAME = "Tony Lu"; + TargetAttributes = { + AB35433222F3A88000C1B2E9 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; + AB35434822F3A88000C1B2E9 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; + AB35435722F3A88000C1B2E9 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = AB35432E22F3A88000C1B2E9 /* Build configuration list for PBXProject "watchOS-sample" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = AB35432A22F3A88000C1B2E9; + productRefGroup = AB35433422F3A88000C1B2E9 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + AB35433222F3A88000C1B2E9 /* watchOS-sample */, + AB35434822F3A88000C1B2E9 /* watchOS-sample WatchKit App */, + AB35435722F3A88000C1B2E9 /* watchOS-sample WatchKit Extension */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + AB35433122F3A88000C1B2E9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AB35434322F3A88000C1B2E9 /* LaunchScreen.storyboard in Resources */, + AB35434022F3A88000C1B2E9 /* Assets.xcassets in Resources */, + AB35433E22F3A88000C1B2E9 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AB35434722F3A88000C1B2E9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AB35435222F3A88000C1B2E9 /* Assets.xcassets in Resources */, + AB35435022F3A88000C1B2E9 /* Interface.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AB35435622F3A88000C1B2E9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 42609F71FF3FEF23C402967B /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-watchOS-sample/Pods-watchOS-sample-resources.sh", + "$PODS_CONFIGURATION_BUILD_DIR/gRPC-iOS/gRPCCertificates.bundle", + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-watchOS-sample/Pods-watchOS-sample-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 5644E359E6C67CF9FD7B659D /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-watchOS-sample/Pods-watchOS-sample-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/BoringSSL-GRPC-iOS/openssl_grpc.framework", + "${BUILT_PRODUCTS_DIR}/Protobuf-iOS/Protobuf.framework", + "${BUILT_PRODUCTS_DIR}/RemoteTest-iOS/RemoteTest.framework", + "${BUILT_PRODUCTS_DIR}/gRPC-iOS/GRPCClient.framework", + "${BUILT_PRODUCTS_DIR}/gRPC-Core-iOS/grpc.framework", + "${BUILT_PRODUCTS_DIR}/gRPC-ProtoRPC-iOS/ProtoRPC.framework", + "${BUILT_PRODUCTS_DIR}/gRPC-RxLibrary-iOS/RxLibrary.framework", + "${BUILT_PRODUCTS_DIR}/nanopb-iOS/nanopb.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl_grpc.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Protobuf.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RemoteTest.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GRPCClient.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/grpc.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ProtoRPC.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxLibrary.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-watchOS-sample/Pods-watchOS-sample-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 7CBBF7FBEB5B8AB30A349E22 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-watchOS-sample-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + C80BFB1E1525B018E6C87AF0 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-watchOS-sample WatchKit Extension-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + D202361DA337959ACDB8D358 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-watchOS-sample WatchKit Extension/Pods-watchOS-sample WatchKit Extension-resources.sh", + "$PODS_CONFIGURATION_BUILD_DIR/gRPC-watchOS/gRPCCertificates.bundle", + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-watchOS-sample WatchKit Extension/Pods-watchOS-sample WatchKit Extension-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + E0C622F545CB8A6103793708 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-watchOS-sample WatchKit Extension/Pods-watchOS-sample WatchKit Extension-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/BoringSSL-GRPC-watchOS/openssl_grpc.framework", + "${BUILT_PRODUCTS_DIR}/Protobuf-watchOS/Protobuf.framework", + "${BUILT_PRODUCTS_DIR}/RemoteTest-watchOS/RemoteTest.framework", + "${BUILT_PRODUCTS_DIR}/gRPC-watchOS/GRPCClient.framework", + "${BUILT_PRODUCTS_DIR}/gRPC-Core-watchOS/grpc.framework", + "${BUILT_PRODUCTS_DIR}/gRPC-ProtoRPC-watchOS/ProtoRPC.framework", + "${BUILT_PRODUCTS_DIR}/gRPC-RxLibrary-watchOS/RxLibrary.framework", + "${BUILT_PRODUCTS_DIR}/nanopb-watchOS/nanopb.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl_grpc.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Protobuf.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RemoteTest.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GRPCClient.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/grpc.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ProtoRPC.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxLibrary.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-watchOS-sample WatchKit Extension/Pods-watchOS-sample WatchKit Extension-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + AB35432F22F3A88000C1B2E9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AB35433B22F3A88000C1B2E9 /* ViewController.m in Sources */, + AB35434622F3A88000C1B2E9 /* main.m in Sources */, + AB35433822F3A88000C1B2E9 /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AB35435422F3A88000C1B2E9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AB35436222F3A88000C1B2E9 /* ExtensionDelegate.m in Sources */, + AB35435F22F3A88000C1B2E9 /* InterfaceController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + AB35434C22F3A88000C1B2E9 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = AB35434822F3A88000C1B2E9 /* watchOS-sample WatchKit App */; + targetProxy = AB35434B22F3A88000C1B2E9 /* PBXContainerItemProxy */; + }; + AB35435B22F3A88000C1B2E9 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = AB35435722F3A88000C1B2E9 /* watchOS-sample WatchKit Extension */; + targetProxy = AB35435A22F3A88000C1B2E9 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + AB35433C22F3A88000C1B2E9 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + AB35433D22F3A88000C1B2E9 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + AB35434122F3A88000C1B2E9 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + AB35434222F3A88000C1B2E9 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; + AB35434E22F3A88000C1B2E9 /* Interface.storyboard */ = { + isa = PBXVariantGroup; + children = ( + AB35434F22F3A88000C1B2E9 /* Base */, + ); + name = Interface.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + AB35436622F3A88000C1B2E9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + AB35436722F3A88000C1B2E9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + AB35436922F3A88000C1B2E9 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9760150292F726236301FFB4 /* Pods-watchOS-sample WatchKit Extension.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 6T98ZJNPG5; + INFOPLIST_FILE = "$(SRCROOT)/WatchKit-Extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "io.grpc.watchOS-sample.watchkitapp.watchkitextension"; + PRODUCT_NAME = "${TARGET_NAME}"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 4.0; + }; + name = Debug; + }; + AB35436A22F3A88000C1B2E9 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 0980DE37FA805E61D7665FC3 /* Pods-watchOS-sample WatchKit Extension.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 6T98ZJNPG5; + INFOPLIST_FILE = "$(SRCROOT)/WatchKit-Extension/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "io.grpc.watchOS-sample.watchkitapp.watchkitextension"; + PRODUCT_NAME = "${TARGET_NAME}"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 4.0; + }; + name = Release; + }; + AB35436D22F3A88000C1B2E9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 6T98ZJNPG5; + IBSC_MODULE = watchOS_sample_WatchKit_Extension; + INFOPLIST_FILE = "$(SRCROOT)/WatchKit-App/Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "io.grpc.watchOS-sample.watchkitapp"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 4.0; + }; + name = Debug; + }; + AB35436E22F3A88000C1B2E9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 6T98ZJNPG5; + IBSC_MODULE = watchOS_sample_WatchKit_Extension; + INFOPLIST_FILE = "$(SRCROOT)/WatchKit-App/Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "io.grpc.watchOS-sample.watchkitapp"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 4.0; + }; + name = Release; + }; + AB35437122F3A88000C1B2E9 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B04FF36D5367E20E26B17EE8 /* Pods-watchOS-sample.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 6T98ZJNPG5; + INFOPLIST_FILE = "watchOS-sample/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "io.grpc.watchOS-sample"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + AB35437222F3A88000C1B2E9 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 0E281AAFDD87686AFF4DA811 /* Pods-watchOS-sample.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 6T98ZJNPG5; + INFOPLIST_FILE = "watchOS-sample/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "io.grpc.watchOS-sample"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + AB35432E22F3A88000C1B2E9 /* Build configuration list for PBXProject "watchOS-sample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AB35436622F3A88000C1B2E9 /* Debug */, + AB35436722F3A88000C1B2E9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + AB35436822F3A88000C1B2E9 /* Build configuration list for PBXNativeTarget "watchOS-sample WatchKit Extension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AB35436922F3A88000C1B2E9 /* Debug */, + AB35436A22F3A88000C1B2E9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + AB35436C22F3A88000C1B2E9 /* Build configuration list for PBXNativeTarget "watchOS-sample WatchKit App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AB35436D22F3A88000C1B2E9 /* Debug */, + AB35436E22F3A88000C1B2E9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + AB35437022F3A88000C1B2E9 /* Build configuration list for PBXNativeTarget "watchOS-sample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AB35437122F3A88000C1B2E9 /* Debug */, + AB35437222F3A88000C1B2E9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = AB35432B22F3A88000C1B2E9 /* Project object */; +} diff --git a/src/objective-c/examples/watchOS-sample/watchOS-sample.xcodeproj/xcshareddata/xcschemes/watchOS-sample-WatchKit-App.xcscheme b/src/objective-c/examples/watchOS-sample/watchOS-sample.xcodeproj/xcshareddata/xcschemes/watchOS-sample-WatchKit-App.xcscheme new file mode 100644 index 00000000000..20a5f02ba8f --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/watchOS-sample.xcodeproj/xcshareddata/xcschemes/watchOS-sample-WatchKit-App.xcscheme @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/objective-c/examples/watchOS-sample/watchOS-sample/AppDelegate.h b/src/objective-c/examples/watchOS-sample/watchOS-sample/AppDelegate.h new file mode 100644 index 00000000000..183abcf4ec8 --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/watchOS-sample/AppDelegate.h @@ -0,0 +1,25 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import + +@interface AppDelegate : UIResponder + +@property(strong, nonatomic) UIWindow* window; + +@end diff --git a/src/objective-c/examples/watchOS-sample/watchOS-sample/AppDelegate.m b/src/objective-c/examples/watchOS-sample/watchOS-sample/AppDelegate.m new file mode 100644 index 00000000000..4a76f4c488c --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/watchOS-sample/AppDelegate.m @@ -0,0 +1,27 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +@end diff --git a/src/objective-c/examples/watchOS-sample/watchOS-sample/Assets.xcassets/AppIcon.appiconset/Contents.json b/src/objective-c/examples/watchOS-sample/watchOS-sample/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000000..1d060ed2882 --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/watchOS-sample/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,93 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/src/objective-c/examples/watchOS-sample/watchOS-sample/Base.lproj/LaunchScreen.storyboard b/src/objective-c/examples/watchOS-sample/watchOS-sample/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000000..f83f6fd5810 --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/watchOS-sample/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/objective-c/examples/watchOS-sample/watchOS-sample/Base.lproj/Main.storyboard b/src/objective-c/examples/watchOS-sample/watchOS-sample/Base.lproj/Main.storyboard new file mode 100644 index 00000000000..06af18034ab --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/watchOS-sample/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/objective-c/examples/watchOS-sample/watchOS-sample/Info.plist b/src/objective-c/examples/watchOS-sample/watchOS-sample/Info.plist new file mode 100644 index 00000000000..e5d82108923 --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/watchOS-sample/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + en_US + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/src/objective-c/examples/watchOS-sample/watchOS-sample/ViewController.h b/src/objective-c/examples/watchOS-sample/watchOS-sample/ViewController.h new file mode 100644 index 00000000000..0aa0b2a73a7 --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/watchOS-sample/ViewController.h @@ -0,0 +1,23 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import + +@interface ViewController : UIViewController + +@end diff --git a/src/objective-c/examples/watchOS-sample/watchOS-sample/ViewController.m b/src/objective-c/examples/watchOS-sample/watchOS-sample/ViewController.m new file mode 100644 index 00000000000..4bc98912bf9 --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/watchOS-sample/ViewController.m @@ -0,0 +1,27 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +@end diff --git a/src/objective-c/examples/watchOS-sample/watchOS-sample/main.m b/src/objective-c/examples/watchOS-sample/watchOS-sample/main.m new file mode 100644 index 00000000000..2797c6f17f2 --- /dev/null +++ b/src/objective-c/examples/watchOS-sample/watchOS-sample/main.m @@ -0,0 +1,26 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import +#import "AppDelegate.h" + +int main(int argc, char* argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/src/objective-c/grpc_objc_internal_library.bzl b/src/objective-c/grpc_objc_internal_library.bzl new file mode 100644 index 00000000000..c90293d827d --- /dev/null +++ b/src/objective-c/grpc_objc_internal_library.bzl @@ -0,0 +1,172 @@ +# Copyright 2019 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# This is for the gRPC build system. This isn't intended to be used outsite of +# the BUILD file for gRPC. It contains the mapping for the template system we +# use to generate other platform's build system files. +# +# Please consider that there should be a high bar for additions and changes to +# this file. +# Each rule listed must be re-written for Google's internal build system, and +# each change must be ported from one to the other. +# + +load( + "//bazel:generate_objc.bzl", + "generate_objc", + "generate_objc_hdrs", + "generate_objc_srcs", + "generate_objc_non_arc_srcs" +) + +def proto_library_objc_wrapper( + name, + srcs, + deps = [], + use_well_known_protos = False): + """proto_library for adding dependencies to google/protobuf protos + use_well_known_protos - ignored in open source version + """ + native.proto_library( + name = name, + srcs = srcs, + deps = deps, + ) + +def grpc_objc_examples_library( + name, + srcs = [], + hdrs = [], + textual_hdrs = [], + data = [], + deps = [], + defines = [], + sdk_frameworks = [], + includes = []): + """objc_library for testing, only works in //src/objective-c/exmaples + + Args: + name: name of target + hdrs: public headers + srcs: all source files (.m) + textual_hdrs: private headers + data: any other bundle resources + defines: preprocessors + sdk_frameworks: sdks + includes: added to search path, always [the path to objc directory] + deps: dependencies + """ + native.objc_library( + name = name, + srcs = srcs, + hdrs = hdrs, + textual_hdrs = textual_hdrs, + data = data, + defines = defines, + includes = includes, + sdk_frameworks = sdk_frameworks, + deps = deps + [":RemoteTest"], + ) + +def grpc_objc_testing_library( + name, + srcs = [], + hdrs = [], + textual_hdrs = [], + data = [], + deps = [], + defines = [], + includes = []): + """objc_library for testing, only works in //src/objective-c/tests + + Args: + name: name of target + hdrs: public headers + srcs: all source files (.m) + textual_hdrs: private headers + data: any other bundle resources + defines: preprocessors + includes: added to search path, always [the path to objc directory] + deps: dependencies + """ + + additional_deps = [ + ":RemoteTest", + "//src/objective-c:grpc_objc_client_internal_testing", + ] + + if not name == "TestConfigs": + additional_deps += [":TestConfigs"] + + native.objc_library( + name = name, + hdrs = hdrs, + srcs = srcs, + textual_hdrs = textual_hdrs, + data = data, + defines = defines, + includes = includes, + deps = deps + additional_deps, + ) + +def local_objc_grpc_library(name, deps, testing = True, srcs = [], use_well_known_protos = False, **kwargs): + """!!For local targets within the gRPC repository only!! Will not work outside of the repo + """ + objc_grpc_library_name = "_" + name + "_objc_grpc_library" + + generate_objc( + name = objc_grpc_library_name, + srcs = srcs, + deps = deps, + use_well_known_protos = use_well_known_protos, + **kwargs + ) + + generate_objc_hdrs( + name = objc_grpc_library_name + "_hdrs", + src = ":" + objc_grpc_library_name, + ) + + generate_objc_non_arc_srcs( + name = objc_grpc_library_name + "_non_arc_srcs", + src = ":" + objc_grpc_library_name, + ) + + arc_srcs = None + if len(srcs) > 0: + generate_objc_srcs( + name = objc_grpc_library_name + "_srcs", + src = ":" + objc_grpc_library_name, + ) + arc_srcs = [":" + objc_grpc_library_name + "_srcs"] + + library_deps = ["@com_google_protobuf//:protobuf_objc"] + if testing: + library_deps += ["//src/objective-c:grpc_objc_client_internal_testing"] + else: + library_deps += ["//src/objective-c:proto_objc_rpc"] + + native.objc_library( + name = name, + hdrs = [":" + objc_grpc_library_name + "_hdrs"], + non_arc_srcs = [":" + objc_grpc_library_name + "_non_arc_srcs"], + srcs = arc_srcs, + defines = [ + "GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=0", + "GPB_GRPC_FORWARD_DECLARE_MESSAGE_PROTO=0", + ], + includes = ["_generated_protos"], + deps = library_deps, + ) diff --git a/src/objective-c/manual_tests/ViewController.m b/src/objective-c/manual_tests/ViewController.m index 50a729e4d6a..30181c9d67e 100644 --- a/src/objective-c/manual_tests/ViewController.m +++ b/src/objective-c/manual_tests/ViewController.m @@ -20,8 +20,8 @@ #import #import -#import -#import +#import "src/objective-c/tests/RemoteTestClient/Messages.pbobjc.h" +#import "src/objective-c/tests/RemoteTestClient/Test.pbrpc.h" NSString *const kRemoteHost = @"grpc-test.sandbox.googleapis.com"; const int32_t kMessageSize = 100; diff --git a/src/objective-c/tests/BUILD b/src/objective-c/tests/BUILD new file mode 100644 index 00000000000..d34807f017f --- /dev/null +++ b/src/objective-c/tests/BUILD @@ -0,0 +1,238 @@ +# gRPC Bazel BUILD file. +# +# Copyright 2019 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # Apache v2 + +package(default_visibility = ["//visibility:public"]) + +load( + "//src/objective-c:grpc_objc_internal_library.bzl", + "grpc_objc_testing_library", + "local_objc_grpc_library", + "proto_library_objc_wrapper", +) +load("@build_bazel_rules_apple//apple:resources.bzl", "apple_resource_bundle") +load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application", "ios_unit_test") +load("@build_bazel_rules_apple//apple:macos.bzl", "macos_unit_test") +load("@build_bazel_rules_apple//apple:tvos.bzl", "tvos_application", "tvos_unit_test") + +exports_files(["LICENSE"]) + +proto_library_objc_wrapper( + name = "messages_proto", + srcs = ["RemoteTestClient/messages.proto"], +) + +proto_library_objc_wrapper( + name = "test_proto", + srcs = ["RemoteTestClient/test.proto"], + deps = [":messages_proto"], + use_well_known_protos = True, +) + +local_objc_grpc_library( + name = "RemoteTest", + srcs = ["RemoteTestClient/test.proto"], + use_well_known_protos = True, + testing = True, + deps = [":test_proto"], +) + +apple_resource_bundle( + name = "TestCertificates", + resources = ["TestCertificates.bundle/test-certificates.pem"], +) + +# TestConfigs is added to each grpc_objc_testing_library's deps +grpc_objc_testing_library( + name = "TestConfigs", + hdrs = ["version.h"], + data = [":TestCertificates"], + defines = [ + "DEBUG=1", + "PB_FIELD_32BIT=1", + "PB_NO_PACKED_STRUCTS=1", + "PB_ENABLE_MALLOC=1", + "HOST_PORT_LOCALSSL=localhost:5051", + "HOST_PORT_LOCAL=localhost:5050", + "HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com", + ], +) + +objc_library( + name = "host-lib", + srcs = glob(["Hosts/ios-host/*.m"]), + hdrs = glob(["Hosts/ios-host/*.h"]), +) + +ios_application( + name = "ios-host", + bundle_id = "grpc.objc.tests.ios-host", + infoplists = ["Hosts/ios-host/Info.plist"], + minimum_os_version = "9.0", + families = [ + "iphone", + "ipad", + ], + deps = ["host-lib"], +) + +tvos_application( + name = "tvos-host", + bundle_id = "grpc.objc.tests.tvos-host", + infoplists = ["Hosts/ios-host/Info.plist"], + minimum_os_version = "10.0", + deps = ["host-lib"], +) + +grpc_objc_testing_library( + name = "CronetConfig", + srcs = ["ConfigureCronet.m"], + hdrs = ["ConfigureCronet.h"], +) + +grpc_objc_testing_library( + name = "InteropTests-lib", + hdrs = ["InteropTests/InteropTests.h"], + srcs = ["InteropTests/InteropTests.m"], + deps = [ + ":InteropTestsBlockCallbacks-lib", + ":CronetConfig", + ], +) + +grpc_objc_testing_library( + name = "InteropTestsRemote-lib", + srcs = ["InteropTests/InteropTestsRemote.m"], + deps = [":InteropTests-lib"], +) + +grpc_objc_testing_library( + name = "InteropTestsBlockCallbacks-lib", + hdrs = ["InteropTests/InteropTestsBlockCallbacks.h"], + srcs = ["InteropTests/InteropTestsBlockCallbacks.m"], +) + +grpc_objc_testing_library( + name = "InteropTestsLocalSSL-lib", + srcs = ["InteropTests/InteropTestsLocalSSL.m"], + deps = [":InteropTests-lib"], +) + +grpc_objc_testing_library( + name = "InteropTestsLocalCleartext-lib", + srcs = ["InteropTests/InteropTestsLocalCleartext.m"], + deps = [":InteropTests-lib"], +) + +grpc_objc_testing_library( + name = "InteropTestsMultipleChannels-lib", + srcs = ["InteropTests/InteropTestsMultipleChannels.m"], + deps = [":InteropTests-lib"], +) + +grpc_objc_testing_library( + name = "RxLibraryUnitTests-lib", + srcs = ["UnitTests/RxLibraryUnitTests.m"], +) + +grpc_objc_testing_library( + name = "GRPCClientTests-lib", + srcs = ["UnitTests/GRPCClientTests.m"], +) + +grpc_objc_testing_library( + name = "APIv2Tests-lib", + srcs = ["UnitTests/APIv2Tests.m"], +) + +grpc_objc_testing_library( + name = "ChannelPoolTest-lib", + srcs = ["UnitTests/ChannelPoolTest.m"], +) + +grpc_objc_testing_library( + name = "ChannelTests-lib", + srcs = ["UnitTests/ChannelTests.m"], +) + +grpc_objc_testing_library( + name = "NSErrorUnitTests-lib", + srcs = ["UnitTests/NSErrorUnitTests.m"], +) + +grpc_objc_testing_library( + name = "MacStressTests-lib", + srcs = glob([ + "MacTests/*.m", + ]), + hdrs = ["MacTests/StressTests.h"], +) + +ios_unit_test( + name = "UnitTests", + minimum_os_version = "8.0", + deps = [ + ":RxLibraryUnitTests-lib", + ":GRPCClientTests-lib", + ":APIv2Tests-lib", + ":ChannelPoolTest-lib", + ":ChannelTests-lib", + ":NSErrorUnitTests-lib", + ], + test_host = ":ios-host", +) + +ios_unit_test( + name = "InteropTests", + minimum_os_version = "8.0", + deps = [ + ":InteropTestsRemote-lib", + ":InteropTestsLocalSSL-lib", + ":InteropTestsLocalCleartext-lib", + # ":InteropTestsMulitpleChannels-lib", # needs Cronet + ], + test_host = ":ios-host", +) + +macos_unit_test( + name = "MacTests", + minimum_os_version = "10.9", + deps = [ + ":APIv2Tests-lib", + ":RxLibraryUnitTests-lib", + ":NSErrorUnitTests-lib", + ":InteropTestsRemote-lib", + ":InteropTestsLocalSSL-lib", + ":InteropTestsLocalCleartext-lib", + ":MacStressTests-lib", + ] +) + +# bazel run tvos_unit_test is not yet supported by xctestrunner +tvos_unit_test( + name = "TvTests", + minimum_os_version = "10.0", + deps = [ + ":APIv2Tests-lib", + ":RxLibraryUnitTests-lib", + ":NSErrorUnitTests-lib", + ":InteropTestsRemote-lib", + ":InteropTestsLocalSSL-lib", + ":InteropTestsLocalCleartext-lib", + ], + test_host = ":tvos-host", +) diff --git a/src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m b/src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m index 3c77fe2f2c3..34c93878765 100644 --- a/src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m +++ b/src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m @@ -24,8 +24,6 @@ #import #import -#import "src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.h" - NSString *host = @"grpc-test.sandbox.googleapis.com"; @interface ViewController : UIViewController @@ -34,10 +32,6 @@ NSString *host = @"grpc-test.sandbox.googleapis.com"; @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; - -#ifndef GRPC_CFSTREAM - [GRPCConnectivityMonitor registerObserver:self selector:@selector(reachabilityChanged:)]; -#endif } - (void)reachabilityChanged:(NSNotification *)note { diff --git a/src/objective-c/tests/Hosts/ios-host/AppDelegate.h b/src/objective-c/tests/Hosts/ios-host/AppDelegate.h new file mode 100644 index 00000000000..183abcf4ec8 --- /dev/null +++ b/src/objective-c/tests/Hosts/ios-host/AppDelegate.h @@ -0,0 +1,25 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import + +@interface AppDelegate : UIResponder + +@property(strong, nonatomic) UIWindow* window; + +@end diff --git a/src/objective-c/tests/Hosts/ios-host/AppDelegate.m b/src/objective-c/tests/Hosts/ios-host/AppDelegate.m new file mode 100644 index 00000000000..4a76f4c488c --- /dev/null +++ b/src/objective-c/tests/Hosts/ios-host/AppDelegate.m @@ -0,0 +1,27 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +@end diff --git a/src/objective-c/tests/Hosts/ios-host/Info.plist b/src/objective-c/tests/Hosts/ios-host/Info.plist new file mode 100644 index 00000000000..e5baf19b85c --- /dev/null +++ b/src/objective-c/tests/Hosts/ios-host/Info.plist @@ -0,0 +1,41 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/src/objective-c/tests/Hosts/ios-host/main.m b/src/objective-c/tests/Hosts/ios-host/main.m new file mode 100644 index 00000000000..2797c6f17f2 --- /dev/null +++ b/src/objective-c/tests/Hosts/ios-host/main.m @@ -0,0 +1,26 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import +#import "AppDelegate.h" + +int main(int argc, char* argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/src/objective-c/tests/InteropTests/InteropTests.h b/src/objective-c/tests/InteropTests/InteropTests.h index cffa90ac497..28fcbff9695 100644 --- a/src/objective-c/tests/InteropTests/InteropTests.h +++ b/src/objective-c/tests/InteropTests/InteropTests.h @@ -27,6 +27,12 @@ * This is an abstract class that needs to be subclassed. See |+host|. */ @interface InteropTests : XCTestCase +/** + * The test suite to run, checking if the current XCTestCase instance is the base class. + * If so, run no tests (disabled). Otherwise, proceed to normal execution. + */ +@property(class, readonly) XCTestSuite *defaultTestSuite; + /** * Host to send the RPCs to. The base implementation returns nil, which would make all tests to * fail. diff --git a/src/objective-c/tests/InteropTests/InteropTests.m b/src/objective-c/tests/InteropTests/InteropTests.m index 3260e918f2f..a8f7db7ee93 100644 --- a/src/objective-c/tests/InteropTests/InteropTests.m +++ b/src/objective-c/tests/InteropTests/InteropTests.m @@ -30,13 +30,13 @@ #import #import #import -#import -#import -#import #import #import #import #import +#import "src/objective-c/tests/RemoteTestClient/Messages.pbobjc.h" +#import "src/objective-c/tests/RemoteTestClient/Test.pbobjc.h" +#import "src/objective-c/tests/RemoteTestClient/Test.pbrpc.h" #import "../ConfigureCronet.h" #import "InteropTestsBlockCallbacks.h" @@ -406,6 +406,14 @@ static dispatch_once_t initGlobalInterceptorFactory; RMTTestService *_service; } ++ (XCTestSuite *)defaultTestSuite { + if (self == [InteropTests class]) { + return [XCTestSuite testSuiteWithName:@"InteropTestsEmptySuite"]; + } else { + return super.defaultTestSuite; + } +} + + (NSString *)host { return nil; } diff --git a/src/objective-c/tests/InteropTests/InteropTestsMultipleChannels.m b/src/objective-c/tests/InteropTests/InteropTestsMultipleChannels.m index 14ba2871aa2..98893a466bd 100644 --- a/src/objective-c/tests/InteropTests/InteropTestsMultipleChannels.m +++ b/src/objective-c/tests/InteropTests/InteropTestsMultipleChannels.m @@ -21,10 +21,10 @@ #ifdef GRPC_COMPILE_WITH_CRONET #import #endif -#import -#import -#import #import +#import "src/objective-c/tests/RemoteTestClient/Messages.pbobjc.h" +#import "src/objective-c/tests/RemoteTestClient/Test.pbobjc.h" +#import "src/objective-c/tests/RemoteTestClient/Test.pbrpc.h" #import "../ConfigureCronet.h" #import "InteropTestsBlockCallbacks.h" @@ -86,7 +86,6 @@ dispatch_once_t initCronet; self.continueAfterFailure = NO; _remoteService = [RMTTestService serviceWithHost:kRemoteSSLHost callOptions:nil]; - configureCronet(); // Default stack with remote host diff --git a/src/objective-c/tests/MacTests/StressTests.h b/src/objective-c/tests/MacTests/StressTests.h index 8bee0e66274..2608a710845 100644 --- a/src/objective-c/tests/MacTests/StressTests.h +++ b/src/objective-c/tests/MacTests/StressTests.h @@ -21,6 +21,12 @@ #import @interface StressTests : XCTestCase +/** + * The test suite to run, checking if the current XCTestCase instance is the base class. + * If so, run no tests (disabled). Otherwise, proceed to normal execution. + */ +@property(class, readonly) XCTestSuite *defaultTestSuite; + /** * Host to send the RPCs to. The base implementation returns nil, which would make all tests to * fail. diff --git a/src/objective-c/tests/MacTests/StressTests.m b/src/objective-c/tests/MacTests/StressTests.m index 3c6ecd52610..622c80ea91a 100644 --- a/src/objective-c/tests/MacTests/StressTests.m +++ b/src/objective-c/tests/MacTests/StressTests.m @@ -21,13 +21,13 @@ #import #import #import -#import -#import -#import #import #import #import #import +#import "src/objective-c/tests/RemoteTestClient/Messages.pbobjc.h" +#import "src/objective-c/tests/RemoteTestClient/Test.pbobjc.h" +#import "src/objective-c/tests/RemoteTestClient/Test.pbrpc.h" #define TEST_TIMEOUT 32 @@ -89,6 +89,14 @@ extern const char *kCFStreamVarName; RMTTestService *_service; } ++ (XCTestSuite *)defaultTestSuite { + if (self == [StressTests class]) { + return [XCTestSuite testSuiteWithName:@"StressTestsEmptySuite"]; + } else { + return super.defaultTestSuite; + } +} + + (NSString *)host { return nil; } diff --git a/src/objective-c/tests/Podfile b/src/objective-c/tests/Podfile index 60d2a98fba2..c2297aa00fd 100644 --- a/src/objective-c/tests/Podfile +++ b/src/objective-c/tests/Podfile @@ -5,15 +5,14 @@ install! 'cocoapods', :deterministic_uuids => false # Location of gRPC's repo root relative to this file. GRPC_LOCAL_SRC = '../../..' -target 'MacTests' do - platform :osx, '10.13' +def grpc_deps pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf", :inhibit_warnings => true - + pod '!ProtoCompiler', :path => "#{GRPC_LOCAL_SRC}/src/objective-c" pod '!ProtoCompiler-gRPCPlugin', :path => "#{GRPC_LOCAL_SRC}/src/objective-c" - + pod 'BoringSSL-GRPC', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c", :inhibit_warnings => true - + pod 'gRPC', :path => GRPC_LOCAL_SRC pod 'gRPC-Core', :path => GRPC_LOCAL_SRC pod 'gRPC-RxLibrary', :path => GRPC_LOCAL_SRC @@ -21,20 +20,19 @@ target 'MacTests' do pod 'RemoteTest', :path => "RemoteTestClient", :inhibit_warnings => true end -target 'UnitTests' do - platform :ios, '8.0' - pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf", :inhibit_warnings => true - - pod '!ProtoCompiler', :path => "#{GRPC_LOCAL_SRC}/src/objective-c" - pod '!ProtoCompiler-gRPCPlugin', :path => "#{GRPC_LOCAL_SRC}/src/objective-c" +target 'TvTests' do + platform :tvos, '10.0' + grpc_deps +end - pod 'BoringSSL-GRPC', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c", :inhibit_warnings => true +target 'MacTests' do + platform :osx, '10.13' + grpc_deps +end - pod 'gRPC', :path => GRPC_LOCAL_SRC - pod 'gRPC-Core', :path => GRPC_LOCAL_SRC - pod 'gRPC-RxLibrary', :path => GRPC_LOCAL_SRC - pod 'gRPC-ProtoRPC', :path => GRPC_LOCAL_SRC, :inhibit_warnings => true - pod 'RemoteTest', :path => "RemoteTestClient", :inhibit_warnings => true +target 'UnitTests' do + platform :ios, '8.0' + grpc_deps end %w( @@ -43,18 +41,7 @@ end ).each do |target_name| target target_name do platform :ios, '8.0' - pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf", :inhibit_warnings => true - - pod '!ProtoCompiler', :path => "#{GRPC_LOCAL_SRC}/src/objective-c" - pod '!ProtoCompiler-gRPCPlugin', :path => "#{GRPC_LOCAL_SRC}/src/objective-c" - - pod 'BoringSSL-GRPC', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c", :inhibit_warnings => true - - pod 'gRPC', :path => GRPC_LOCAL_SRC - pod 'gRPC-Core', :path => GRPC_LOCAL_SRC - pod 'gRPC-RxLibrary', :path => GRPC_LOCAL_SRC - pod 'gRPC-ProtoRPC', :path => GRPC_LOCAL_SRC, :inhibit_warnings => true - pod 'RemoteTest', :path => "RemoteTestClient", :inhibit_warnings => true + grpc_deps pod 'gRPC-Core/Cronet-Implementation', :path => GRPC_LOCAL_SRC pod 'CronetFramework', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c" @@ -116,7 +103,7 @@ post_install do |installer| # the test target 'InteropTestsRemoteWithCronet' # Activate GRPCCall+InternalTests functions for the dedicated build configuration 'Test', which will # be used by all test targets using it. - if /gRPC-(mac|i)OS/.match(target.name) + if /gRPC-(mac|i|tv)OS/.match(target.name) target.build_configurations.each do |config| if config.name == 'Cronet' config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_COMPILE_WITH_CRONET=1 GRPC_TEST_OBJC=1' @@ -127,7 +114,7 @@ post_install do |installer| end # Enable NSAssert on gRPC - if /(gRPC|ProtoRPC|RxLibrary)-(mac|i)OS/.match(target.name) + if /(gRPC|ProtoRPC|RxLibrary)-(mac|i|tv)OS/.match(target.name) target.build_configurations.each do |config| if config.name != 'Release' config.build_settings['ENABLE_NS_ASSERTIONS'] = 'YES' diff --git a/src/objective-c/tests/RemoteTestClient/RemoteTest.podspec b/src/objective-c/tests/RemoteTestClient/RemoteTest.podspec index 93b56d56059..4a35328f73f 100644 --- a/src/objective-c/tests/RemoteTestClient/RemoteTest.podspec +++ b/src/objective-c/tests/RemoteTestClient/RemoteTest.podspec @@ -9,50 +9,38 @@ Pod::Spec.new do |s| s.ios.deployment_target = '7.1' s.osx.deployment_target = '10.9' + s.tvos.deployment_target = '10.0' + s.watchos.deployment_target = '4.0' # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients. s.dependency "!ProtoCompiler-gRPCPlugin" repo_root = '../../../..' - config = ENV['CONFIG'] || 'opt' - bin_dir = "#{repo_root}/bins/#{config}" + bazel_exec_root = "#{repo_root}/bazel-out/darwin-fastbuild/bin" - protoc = "#{bin_dir}/protobuf/protoc" + protoc = "#{bazel_exec_root}/external/com_google_protobuf/protoc" well_known_types_dir = "#{repo_root}/third_party/protobuf/src" - plugin = "#{bin_dir}/grpc_objective_c_plugin" + plugin = "#{bazel_exec_root}/src/compiler/grpc_objective_c_plugin" s.prepare_command = <<-CMD - if [ -f #{protoc} ]; then - #{protoc} \ - --plugin=protoc-gen-grpc=#{plugin} \ - --objc_out=. \ - --grpc_out=. \ - -I . \ - -I #{well_known_types_dir} \ - *.proto - else - # protoc was not found bin_dir, use installed version instead - (>&2 echo "\nWARNING: Using installed version of protoc. It might be incompatible with gRPC") - - protoc \ - --plugin=protoc-gen-grpc=#{plugin} \ - --objc_out=. \ - --grpc_out=. \ - -I . \ - -I #{well_known_types_dir} \ - *.proto - fi + #{protoc} \ + --plugin=protoc-gen-grpc=#{plugin} \ + --objc_out=. \ + --grpc_out=. \ + -I #{repo_root} \ + -I #{well_known_types_dir} \ + #{repo_root}/src/objective-c/tests/RemoteTestClient/*.proto CMD s.subspec "Messages" do |ms| - ms.source_files = "*.pbobjc.{h,m}" + ms.source_files = "src/objective-c/tests/RemoteTestClient/*.pbobjc.{h,m}" ms.header_mappings_dir = "." ms.requires_arc = false ms.dependency "Protobuf" end s.subspec "Services" do |ss| - ss.source_files = "*.pbrpc.{h,m}" + ss.source_files = "src/objective-c/tests/RemoteTestClient/*.pbrpc.{h,m}" ss.header_mappings_dir = "." ss.requires_arc = true ss.dependency "gRPC-ProtoRPC" diff --git a/src/objective-c/tests/RemoteTestClient/test.proto b/src/objective-c/tests/RemoteTestClient/test.proto index c5696043630..6931600edc0 100644 --- a/src/objective-c/tests/RemoteTestClient/test.proto +++ b/src/objective-c/tests/RemoteTestClient/test.proto @@ -17,7 +17,7 @@ syntax = "proto3"; import "google/protobuf/empty.proto"; -import "messages.proto"; +import "src/objective-c/tests/RemoteTestClient/messages.proto"; package grpc.testing; diff --git a/src/objective-c/tests/Tests.xcodeproj/project.pbxproj b/src/objective-c/tests/Tests.xcodeproj/project.pbxproj index 737d52b547d..a54dca59b9c 100644 --- a/src/objective-c/tests/Tests.xcodeproj/project.pbxproj +++ b/src/objective-c/tests/Tests.xcodeproj/project.pbxproj @@ -37,16 +37,27 @@ 65EB19E418B39A8374D407BB /* libPods-CronetTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B1511C20E16A8422B58D61A /* libPods-CronetTests.a */; }; 903163C7FE885838580AEC7A /* libPods-InteropTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D457AD9797664CFA191C3280 /* libPods-InteropTests.a */; }; 953CD2942A3A6D6CE695BE87 /* libPods-MacTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 276873A05AC5479B60DF6079 /* libPods-MacTests.a */; }; + ABA946DC22FF62FC00577AEF /* TestCertificates.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 63E240CF1B6C63DC005F3B0E /* TestCertificates.bundle */; }; + ABCB3EE422F23BEF00F0FECE /* InteropTestsRemote.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E7F488822778B04006656AD /* InteropTestsRemote.m */; }; + ABCB3EE522F23BEF00F0FECE /* InteropTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E7F488222778A88006656AD /* InteropTests.m */; }; + ABCB3EE622F23BEF00F0FECE /* InteropTestsLocalSSL.m in Sources */ = {isa = PBXBuildFile; fileRef = 63E240CD1B6C4E2B005F3B0E /* InteropTestsLocalSSL.m */; }; + ABCB3EE722F23BEF00F0FECE /* InteropTestsLocalCleartext.m in Sources */ = {isa = PBXBuildFile; fileRef = 63715F551B780C020029CB0B /* InteropTestsLocalCleartext.m */; }; + ABCB3EE822F23BEF00F0FECE /* InteropTestsBlockCallbacks.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E3F14832278B461007C6D90 /* InteropTestsBlockCallbacks.m */; }; + ABCB3EE922F23BF500F0FECE /* RxLibraryUnitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E7F488A22778B5D006656AD /* RxLibraryUnitTests.m */; }; + ABCB3EEA22F23BF500F0FECE /* APIv2Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E7F487F227782C1006656AD /* APIv2Tests.m */; }; + ABCB3EEB22F23BF500F0FECE /* NSErrorUnitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E0282E8215AA697007AC99D /* NSErrorUnitTests.m */; }; B071230B22669EED004B64A1 /* StressTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B071230A22669EED004B64A1 /* StressTests.m */; }; B0BB3F08225E7ABA008DA580 /* NSErrorUnitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E0282E8215AA697007AC99D /* NSErrorUnitTests.m */; }; B0BB3F0A225EA511008DA580 /* TestCertificates.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 63E240CF1B6C63DC005F3B0E /* TestCertificates.bundle */; }; B0D39B9A2266F3CB00A4078D /* StressTestsSSL.m in Sources */ = {isa = PBXBuildFile; fileRef = B0D39B992266F3CB00A4078D /* StressTestsSSL.m */; }; B0D39B9C2266FF9800A4078D /* StressTestsCleartext.m in Sources */ = {isa = PBXBuildFile; fileRef = B0D39B9B2266FF9800A4078D /* StressTestsCleartext.m */; }; CCF5C0719EF608276AE16374 /* libPods-UnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22A3EBB488699C8CEA19707B /* libPods-UnitTests.a */; }; + F4E21D69D650D61FE8F02696 /* libPods-TvTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A0A5455106001F60357A4B6 /* libPods-TvTests.a */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 02192CF1FF9534E3D18C65FC /* Pods-CronetUnitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CronetUnitTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CronetUnitTests/Pods-CronetUnitTests.release.xcconfig"; sourceTree = ""; }; + 038286E5BBEC3F03D4701CCC /* Pods-TvTests.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TvTests.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-TvTests/Pods-TvTests.cronet.xcconfig"; sourceTree = ""; }; 070266E2626EB997B54880A3 /* Pods-InteropTests.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTests.test.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTests/Pods-InteropTests.test.xcconfig"; sourceTree = ""; }; 07D10A965323BEA7FE59A74B /* Pods-RxLibraryUnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RxLibraryUnitTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RxLibraryUnitTests/Pods-RxLibraryUnitTests.debug.xcconfig"; sourceTree = ""; }; 0A4F89D9C90E9C30990218F0 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; @@ -67,6 +78,7 @@ 22A3EBB488699C8CEA19707B /* libPods-UnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-UnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 2650FEF00956E7924772F9D9 /* Pods-InteropTestsMultipleChannels.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsMultipleChannels.release.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsMultipleChannels/Pods-InteropTestsMultipleChannels.release.xcconfig"; sourceTree = ""; }; 276873A05AC5479B60DF6079 /* libPods-MacTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-MacTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 2A0A5455106001F60357A4B6 /* libPods-TvTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-TvTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 2B89F3037963E6EDDD48D8C3 /* Pods-InteropTestsRemoteWithCronet.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteWithCronet.test.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteWithCronet/Pods-InteropTestsRemoteWithCronet.test.xcconfig"; sourceTree = ""; }; 303F4A17EB1650FC44603D17 /* Pods-InteropTestsRemoteCFStream.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteCFStream.release.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteCFStream/Pods-InteropTestsRemoteCFStream.release.xcconfig"; sourceTree = ""; }; 32748C4078AEB05F8F954361 /* Pods-InteropTestsRemoteCFStream.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteCFStream.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteCFStream/Pods-InteropTestsRemoteCFStream.debug.xcconfig"; sourceTree = ""; }; @@ -78,6 +90,7 @@ 3CADF86203B9D03EA96C359D /* Pods-InteropTestsMultipleChannels.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsMultipleChannels.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsMultipleChannels/Pods-InteropTestsMultipleChannels.debug.xcconfig"; sourceTree = ""; }; 3EB55EF291706E3DDE23C3B7 /* Pods-InteropTestsLocalSSLCFStream.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalSSLCFStream.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalSSLCFStream/Pods-InteropTestsLocalSSLCFStream.debug.xcconfig"; sourceTree = ""; }; 3F27B2E744482771EB93C394 /* Pods-InteropTestsRemoteWithCronet.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteWithCronet.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteWithCronet/Pods-InteropTestsRemoteWithCronet.cronet.xcconfig"; sourceTree = ""; }; + 4151F1CACF6F364277DA312F /* Pods-TvTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TvTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TvTests/Pods-TvTests.debug.xcconfig"; sourceTree = ""; }; 41AA59529240A6BBBD3DB904 /* Pods-InteropTestsLocalSSLCFStream.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalSSLCFStream.test.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalSSLCFStream/Pods-InteropTestsLocalSSLCFStream.test.xcconfig"; sourceTree = ""; }; 48F1841C9A920626995DC28C /* libPods-ChannelTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ChannelTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 4A1A42B2E941CCD453489E5B /* Pods-InteropTestsRemoteCFStream.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteCFStream.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteCFStream/Pods-InteropTestsRemoteCFStream.cronet.xcconfig"; sourceTree = ""; }; @@ -126,6 +139,7 @@ 7A2E97E3F469CC2A758D77DE /* Pods-InteropTestsLocalSSL.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalSSL.release.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalSSL/Pods-InteropTestsLocalSSL.release.xcconfig"; sourceTree = ""; }; 7BA53C6D224288D5870FE6F3 /* Pods-InteropTestsLocalCleartextCFStream.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalCleartextCFStream.release.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalCleartextCFStream/Pods-InteropTestsLocalCleartextCFStream.release.xcconfig"; sourceTree = ""; }; 7F4F42EBAF311E9F84FCA32E /* Pods-CronetTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CronetTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CronetTests/Pods-CronetTests.release.xcconfig"; sourceTree = ""; }; + 8809F3EB70C19F2CFA1F4CA6 /* Pods-TvTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TvTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-TvTests/Pods-TvTests.release.xcconfig"; sourceTree = ""; }; 8B498B05C6DA0818B2FA91D4 /* Pods-InteropTestsLocalCleartextCFStream.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalCleartextCFStream.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalCleartextCFStream/Pods-InteropTestsLocalCleartextCFStream.cronet.xcconfig"; sourceTree = ""; }; 8C233E85C3EB45B3CAE52EDF /* Pods-APIv2Tests.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIv2Tests.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-APIv2Tests/Pods-APIv2Tests.cronet.xcconfig"; sourceTree = ""; }; 90E63AD3C4A1E3E6BC745096 /* Pods-ChannelTests.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ChannelTests.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-ChannelTests/Pods-ChannelTests.cronet.xcconfig"; sourceTree = ""; }; @@ -134,9 +148,12 @@ 9E9444C764F0FFF64A7EB58E /* libPods-InteropTestsRemoteWithCronet.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InteropTestsRemoteWithCronet.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A25967A0D40ED14B3287AD81 /* Pods-InteropTestsCallOptions.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsCallOptions.test.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsCallOptions/Pods-InteropTestsCallOptions.test.xcconfig"; sourceTree = ""; }; A2DCF2570BE515B62CB924CA /* Pods-UnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UnitTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-UnitTests/Pods-UnitTests.debug.xcconfig"; sourceTree = ""; }; + A52BDBDE1F6643E6FD1F3CBA /* Pods-TvTests.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TvTests.test.xcconfig"; path = "Pods/Target Support Files/Pods-TvTests/Pods-TvTests.test.xcconfig"; sourceTree = ""; }; A58BE6DF1C62D1739EBB2C78 /* libPods-RxLibraryUnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RxLibraryUnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; A6F832FCEFA6F6881E620F12 /* Pods-InteropTestsRemote.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemote.test.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemote/Pods-InteropTestsRemote.test.xcconfig"; sourceTree = ""; }; AA7CB64B4DD9915AE7C03163 /* Pods-InteropTestsLocalCleartext.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalCleartext.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalCleartext/Pods-InteropTestsLocalCleartext.cronet.xcconfig"; sourceTree = ""; }; + ABCB3EDA22F23B9700F0FECE /* TvTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TvTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + ABCB3EDE22F23B9700F0FECE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; AC414EF7A6BF76ED02B6E480 /* Pods-InteropTestsRemoteWithCronet.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteWithCronet.release.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteWithCronet/Pods-InteropTestsRemoteWithCronet.release.xcconfig"; sourceTree = ""; }; AF3FC2CFFE7B0961823BC740 /* libPods-InteropTestsCallOptions.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InteropTestsCallOptions.a"; sourceTree = BUILT_PRODUCTS_DIR; }; B071230A22669EED004B64A1 /* StressTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StressTests.m; sourceTree = ""; }; @@ -204,6 +221,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + ABCB3ED722F23B9700F0FECE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F4E21D69D650D61FE8F02696 /* libPods-TvTests.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; B0BB3EF4225E795F008DA580 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -240,6 +265,7 @@ 276873A05AC5479B60DF6079 /* libPods-MacTests.a */, D457AD9797664CFA191C3280 /* libPods-InteropTests.a */, 1B1511C20E16A8422B58D61A /* libPods-CronetTests.a */, + 2A0A5455106001F60357A4B6 /* libPods-TvTests.a */, ); name = Frameworks; sourceTree = ""; @@ -325,6 +351,10 @@ 5AB9A82F289D548D6B8816F9 /* Pods-CronetTests.test.xcconfig */, 20F6A3D59D0EE091E2D43953 /* Pods-CronetTests.cronet.xcconfig */, 7F4F42EBAF311E9F84FCA32E /* Pods-CronetTests.release.xcconfig */, + 4151F1CACF6F364277DA312F /* Pods-TvTests.debug.xcconfig */, + A52BDBDE1F6643E6FD1F3CBA /* Pods-TvTests.test.xcconfig */, + 038286E5BBEC3F03D4701CCC /* Pods-TvTests.cronet.xcconfig */, + 8809F3EB70C19F2CFA1F4CA6 /* Pods-TvTests.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -376,6 +406,7 @@ 5E0282E7215AA697007AC99D /* UnitTests */, B0BB3EF8225E795F008DA580 /* MacTests */, 5E7F485A22775B15006656AD /* CronetTests */, + ABCB3EDB22F23B9700F0FECE /* TvTests */, 635697C81B14FC11007A7283 /* Products */, 51E4650F34F854F41FF053B3 /* Pods */, 136D535E19727099B941D7B1 /* Frameworks */, @@ -389,6 +420,7 @@ B0BB3EF7225E795F008DA580 /* MacTests.xctest */, 5EA476F42272816A000F72FC /* InteropTests.xctest */, 5E7F485922775B15006656AD /* CronetTests.xctest */, + ABCB3EDA22F23B9700F0FECE /* TvTests.xctest */, ); name = Products; sourceTree = ""; @@ -412,6 +444,14 @@ name = "Supporting Files"; sourceTree = ""; }; + ABCB3EDB22F23B9700F0FECE /* TvTests */ = { + isa = PBXGroup; + children = ( + ABCB3EDE22F23B9700F0FECE /* Info.plist */, + ); + path = TvTests; + sourceTree = ""; + }; B0BB3EF8225E795F008DA580 /* MacTests */ = { isa = PBXGroup; children = ( @@ -486,6 +526,25 @@ productReference = 5EA476F42272816A000F72FC /* InteropTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + ABCB3ED922F23B9700F0FECE /* TvTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = ABCB3EE322F23B9700F0FECE /* Build configuration list for PBXNativeTarget "TvTests" */; + buildPhases = ( + 03423EFD6B98B0F3DD4C2E0D /* [CP] Check Pods Manifest.lock */, + ABCB3ED622F23B9700F0FECE /* Sources */, + ABCB3ED722F23B9700F0FECE /* Frameworks */, + ABCB3ED822F23B9700F0FECE /* Resources */, + 88CEEDBB95DA992ABDDE8B7E /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TvTests; + productName = TvTests; + productReference = ABCB3EDA22F23B9700F0FECE /* TvTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; B0BB3EF6225E795F008DA580 /* MacTests */ = { isa = PBXNativeTarget; buildConfigurationList = B0BB3EFC225E795F008DA580 /* Build configuration list for PBXNativeTarget "MacTests" */; @@ -526,6 +585,11 @@ CreatedOnToolsVersion = 10.1; ProvisioningStyle = Automatic; }; + ABCB3ED922F23B9700F0FECE = { + CreatedOnToolsVersion = 9.2; + DevelopmentTeam = 6T98ZJNPG5; + ProvisioningStyle = Automatic; + }; B0BB3EF6225E795F008DA580 = { CreatedOnToolsVersion = 10.1; ProvisioningStyle = Automatic; @@ -549,6 +613,7 @@ B0BB3EF6225E795F008DA580 /* MacTests */, 5EA476F32272816A000F72FC /* InteropTests */, 5E7F485822775B15006656AD /* CronetTests */, + ABCB3ED922F23B9700F0FECE /* TvTests */, ); }; /* End PBXProject section */ @@ -576,6 +641,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + ABCB3ED822F23B9700F0FECE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ABA946DC22FF62FC00577AEF /* TestCertificates.bundle in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; B0BB3EF5225E795F008DA580 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -587,6 +660,24 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 03423EFD6B98B0F3DD4C2E0D /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-TvTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 0FEFD5FC6B323AC95549AE4A /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -646,15 +737,11 @@ buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( "${PODS_PODFILE_DIR_PATH}/Podfile.lock", "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); outputPaths = ( "$(DERIVED_FILE_DIR)/Pods-InteropTests-checkManifestLockResult.txt", ); @@ -681,6 +768,24 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MacTests/Pods-MacTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; + 88CEEDBB95DA992ABDDE8B7E /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-TvTests/Pods-TvTests-resources.sh", + "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-tvOS/gRPCCertificates.bundle", + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TvTests/Pods-TvTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; 9AD0B5E94F2AA5962EA6AA36 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -704,15 +809,11 @@ buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( "${PODS_PODFILE_DIR_PATH}/Podfile.lock", "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); outputPaths = ( "$(DERIVED_FILE_DIR)/Pods-CronetTests-checkManifestLockResult.txt", ); @@ -744,15 +845,11 @@ buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( "${PODS_PODFILE_DIR_PATH}/Podfile.lock", "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); outputPaths = ( "$(DERIVED_FILE_DIR)/Pods-MacTests-checkManifestLockResult.txt", ); @@ -822,6 +919,21 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + ABCB3ED622F23B9700F0FECE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ABCB3EEA22F23BF500F0FECE /* APIv2Tests.m in Sources */, + ABCB3EE822F23BEF00F0FECE /* InteropTestsBlockCallbacks.m in Sources */, + ABCB3EE422F23BEF00F0FECE /* InteropTestsRemote.m in Sources */, + ABCB3EEB22F23BF500F0FECE /* NSErrorUnitTests.m in Sources */, + ABCB3EE522F23BEF00F0FECE /* InteropTests.m in Sources */, + ABCB3EE722F23BEF00F0FECE /* InteropTestsLocalCleartext.m in Sources */, + ABCB3EE622F23BEF00F0FECE /* InteropTestsLocalSSL.m in Sources */, + ABCB3EE922F23BF500F0FECE /* RxLibraryUnitTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; B0BB3EF3225E795F008DA580 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1422,6 +1534,128 @@ }; name = Release; }; + ABCB3EDF22F23B9700F0FECE /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4151F1CACF6F364277DA312F /* Pods-TvTests.debug.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 6T98ZJNPG5; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = TvTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.google.TvTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 10.0; + }; + name = Debug; + }; + ABCB3EE022F23B9700F0FECE /* Test */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A52BDBDE1F6643E6FD1F3CBA /* Pods-TvTests.test.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 6T98ZJNPG5; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = TvTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.google.TvTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 10.0; + }; + name = Test; + }; + ABCB3EE122F23B9700F0FECE /* Cronet */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 038286E5BBEC3F03D4701CCC /* Pods-TvTests.cronet.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 6T98ZJNPG5; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = TvTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.google.TvTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 10.0; + }; + name = Cronet; + }; + ABCB3EE222F23B9700F0FECE /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 8809F3EB70C19F2CFA1F4CA6 /* Pods-TvTests.release.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 6T98ZJNPG5; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = TvTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.google.TvTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 10.0; + }; + name = Release; + }; B0BB3EFD225E795F008DA580 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = E3ACD4D5902745976D9C2229 /* Pods-MacTests.debug.xcconfig */; @@ -1617,6 +1851,17 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + ABCB3EE322F23B9700F0FECE /* Build configuration list for PBXNativeTarget "TvTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + ABCB3EDF22F23B9700F0FECE /* Debug */, + ABCB3EE022F23B9700F0FECE /* Test */, + ABCB3EE122F23B9700F0FECE /* Cronet */, + ABCB3EE222F23B9700F0FECE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; B0BB3EFC225E795F008DA580 /* Build configuration list for PBXNativeTarget "MacTests" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/TvTests.xcscheme b/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/TvTests.xcscheme new file mode 100644 index 00000000000..cc6823528b5 --- /dev/null +++ b/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/TvTests.xcscheme @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/objective-c/tests/TvTests/Info.plist b/src/objective-c/tests/TvTests/Info.plist new file mode 100644 index 00000000000..6c40a6cd0c4 --- /dev/null +++ b/src/objective-c/tests/TvTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/src/objective-c/tests/UnitTests/APIv2Tests.m b/src/objective-c/tests/UnitTests/APIv2Tests.m index db293750ca3..86d4e8b3619 100644 --- a/src/objective-c/tests/UnitTests/APIv2Tests.m +++ b/src/objective-c/tests/UnitTests/APIv2Tests.m @@ -18,8 +18,8 @@ #import #import -#import #import +#import "src/objective-c/tests/RemoteTestClient/Messages.pbobjc.h" #include #include diff --git a/src/objective-c/tests/UnitTests/GRPCClientTests.m b/src/objective-c/tests/UnitTests/GRPCClientTests.m index bcd87c17b78..3d144c33b06 100644 --- a/src/objective-c/tests/UnitTests/GRPCClientTests.m +++ b/src/objective-c/tests/UnitTests/GRPCClientTests.m @@ -26,10 +26,10 @@ #import #import #import -#import #import #import #import +#import "src/objective-c/tests/RemoteTestClient/Messages.pbobjc.h" #include diff --git a/src/objective-c/tests/build_one_example.sh b/src/objective-c/tests/build_one_example.sh index 084147f1d46..caa048e258b 100755 --- a/src/objective-c/tests/build_one_example.sh +++ b/src/objective-c/tests/build_one_example.sh @@ -31,14 +31,26 @@ cd $EXAMPLE_PATH # clean the directory rm -rf Pods -rm -rf $SCHEME.xcworkspace +rm -rf *.xcworkspace rm -f Podfile.lock pod install set -o pipefail XCODEBUILD_FILTER='(^CompileC |^Ld |^.*clang |^ *cd |^ *export |^Libtool |^.*libtool |^CpHeader |^ *builtin-copy )' -xcodebuild \ +if [ "$SCHEME" == "tvOS-sample" ]; then + xcodebuild \ + build \ + -workspace *.xcworkspace \ + -scheme $SCHEME \ + -destination generic/platform=tvOS \ + -derivedDataPath Build/Build \ + CODE_SIGN_IDENTITY="" \ + CODE_SIGNING_REQUIRED=NO \ + | egrep -v "$XCODEBUILD_FILTER" \ + | egrep -v "^$" - +else + xcodebuild \ build \ -workspace *.xcworkspace \ -scheme $SCHEME \ @@ -48,3 +60,5 @@ xcodebuild \ CODE_SIGNING_REQUIRED=NO \ | egrep -v "$XCODEBUILD_FILTER" \ | egrep -v "^$" - +fi + diff --git a/src/objective-c/tests/build_one_example_bazel.sh b/src/objective-c/tests/build_one_example_bazel.sh new file mode 100755 index 00000000000..b547ac157f0 --- /dev/null +++ b/src/objective-c/tests/build_one_example_bazel.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Copyright 2019 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Don't run this script standalone. Instead, run from the repository root: +# ./tools/run_tests/run_tests.py -l objc + +set -ev + +# Params: +# EXAMPLE_PATH - directory of the example +# SCHEME - scheme of the example, used by xcodebuild + +# CocoaPods requires the terminal to be using UTF-8 encoding. +export LANG=en_US.UTF-8 + +cd `dirname $0`/../../.. + +cd $EXAMPLE_PATH/.. + +if [ "$SCHEME" == "watchOS-sample-WatchKit-App" ]; then + SCHEME="watchOS-sample watchOS-sample-watchApp" +fi +../../../tools/bazel build $SCHEME diff --git a/src/objective-c/tests/run_one_test.sh b/src/objective-c/tests/run_one_test.sh index b74107e4a66..ad122ff3c09 100755 --- a/src/objective-c/tests/run_one_test.sh +++ b/src/objective-c/tests/run_one_test.sh @@ -20,12 +20,16 @@ set -ev cd $(dirname $0) -BINDIR=../../../bins/$CONFIG +BAZEL=../../../tools/bazel -[ -f $BINDIR/interop_server ] || { - echo >&2 "Can't find the test server. Make sure run_tests.py is making" \ - "interop_server before calling this script." - exit 1 +INTEROP=../../../bazel-out/darwin-fastbuild/bin/test/cpp/interop/interop_server + +[ -d Tests.xcworkspace ] || { + ./build_tests.sh +} + +[ -f $INTEROP ] || { + BAZEL build //test/cpp/interop:interop_server } [ -z "$(ps aux |egrep 'port_server\.py.*-p\s32766')" ] && { @@ -36,8 +40,8 @@ BINDIR=../../../bins/$CONFIG PLAIN_PORT=$(curl localhost:32766/get) TLS_PORT=$(curl localhost:32766/get) -$BINDIR/interop_server --port=$PLAIN_PORT --max_send_message_size=8388608 & -$BINDIR/interop_server --port=$TLS_PORT --max_send_message_size=8388608 --use_tls & +$INTEROP --port=$PLAIN_PORT --max_send_message_size=8388608 & +$INTEROP --port=$TLS_PORT --max_send_message_size=8388608 --use_tls & trap 'kill -9 `jobs -p` ; echo "EXIT TIME: $(date)"' EXIT @@ -51,6 +55,8 @@ elif [ $PLATFORM == ios ]; then DESTINATION='name=iPhone 8' elif [ $PLATFORM == macos ]; then DESTINATION='platform=macOS' +elif [ $PLATFORM == tvos ]; then +DESTINATION='platform=tvOS Simulator,name=Apple TV' fi xcodebuild \ diff --git a/src/objective-c/tests/run_one_test_bazel.sh b/src/objective-c/tests/run_one_test_bazel.sh new file mode 100755 index 00000000000..09da7bfbd59 --- /dev/null +++ b/src/objective-c/tests/run_one_test_bazel.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# Copyright 2019 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Don't run this script standalone. Instead, run from the repository root: +# ./tools/run_tests/run_tests.py -l objc + +# TODO(tonyzhehaolu): +# For future use when Xcode is upgraded and tvos_unit_test is fully functional + +set -ev + +cd $(dirname $0) + +BAZEL=../../../tools/bazel + +INTEROP=../../../bazel-out/darwin-fastbuild/bin/test/cpp/interop/interop_server + +[ -d Tests.xcworkspace ] || { + ./build_tests.sh +} + +[ -f $INTEROP ] || { + BAZEL build //test/cpp/interop:interop_server +} + +[ -z "$(ps aux |egrep 'port_server\.py.*-p\s32766')" ] && { + echo >&2 "Can't find the port server. Start port server with tools/run_tests/start_port_server.py." + exit 1 +} + +PLAIN_PORT=$(curl localhost:32766/get) +TLS_PORT=$(curl localhost:32766/get) + +$INTEROP --port=$PLAIN_PORT --max_send_message_size=8388608 & +$INTEROP --port=$TLS_PORT --max_send_message_size=8388608 --use_tls & + +trap 'kill -9 `jobs -p` ; echo "EXIT TIME: $(date)"' EXIT + +../../../tools/bazel run $SCHEME diff --git a/src/objective-c/tests/run_plugin_tests.sh b/src/objective-c/tests/run_plugin_tests.sh index bcab3bb9cff..760103eb7cd 100755 --- a/src/objective-c/tests/run_plugin_tests.sh +++ b/src/objective-c/tests/run_plugin_tests.sh @@ -22,9 +22,15 @@ cd $(dirname $0) # Run the tests server. -BINDIR=../../../bins/$CONFIG -PROTOC=$BINDIR/protobuf/protoc -PLUGIN=$BINDIR/grpc_objective_c_plugin +ROOT_DIR=../../.. +BAZEL=$ROOT_DIR/tools/bazel +BAZEL_EXEC_ROOT=$ROOT_DIR/bazel-out/darwin-fastbuild/bin +PROTOC=$BAZEL_EXEC_ROOT/external/com_google_protobuf/protoc +PLUGIN=$BAZEL_EXEC_ROOT/src/compiler/grpc_objective_c_plugin + +[ -f $PROTOC ] && [ -f $PLUGIN ] || { + BAZEL build @com_google_protobuf//:protoc //src/compiler:grpc_objective_c_plugin +} rm -rf PluginTest/*pb* diff --git a/src/objective-c/tests/run_tests.sh b/src/objective-c/tests/run_tests.sh deleted file mode 100755 index 24185c561ec..00000000000 --- a/src/objective-c/tests/run_tests.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/bash -# Copyright 2015 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Don't run this script standalone. Instead, run from the repository root: -# ./tools/run_tests/run_tests.py -l objc - -set -ev - -cd $(dirname $0) - -# Run the tests server. - -BINDIR=../../../bins/$CONFIG - -[ -f $BINDIR/interop_server ] || { - echo >&2 "Can't find the test server. Make sure run_tests.py is making" \ - "interop_server before calling this script." - exit 1 -} -$BINDIR/interop_server --port=5050 --max_send_message_size=8388608 & -$BINDIR/interop_server --port=5051 --max_send_message_size=8388608 --use_tls & -# Kill them when this script exits. -trap 'kill -9 `jobs -p` ; echo "EXIT TIME: $(date)"' EXIT - -set -o pipefail - -# xcodebuild is very verbose. We filter its output and tell Bash to fail if any -# element of the pipe fails. -# TODO(jcanizales): Use xctool instead? Issue #2540. -XCODEBUILD_FILTER='(^CompileC |^Ld |^ *[^ ]*clang |^ *cd |^ *export |^Libtool |^ *[^ ]*libtool |^CpHeader |^ *builtin-copy )' - -echo "TIME: $(date)" - -xcodebuild \ - -workspace Tests.xcworkspace \ - -scheme InteropTests \ - -destination name="iPhone 8" \ - HOST_PORT_LOCALSSL=localhost:5051 \ - HOST_PORT_LOCAL=localhost:5050 \ - HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com \ - test \ - | egrep -v "$XCODEBUILD_FILTER" \ - | egrep -v '^$' \ - | egrep -v "(GPBDictionary|GPBArray)" - - -echo "TIME: $(date)" -xcodebuild \ - -workspace Tests.xcworkspace \ - -scheme UnitTests \ - -destination name="iPhone 8" \ - HOST_PORT_LOCALSSL=localhost:5051 \ - HOST_PORT_LOCAL=localhost:5050 \ - HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com \ - test \ - | egrep -v "$XCODEBUILD_FILTER" \ - | egrep -v '^$' \ - | egrep -v "(GPBDictionary|GPBArray)" - - -echo "TIME: $(date)" -xcodebuild \ - -workspace Tests.xcworkspace \ - -scheme CronetTests \ - -destination name="iPhone 8" \ - HOST_PORT_LOCALSSL=localhost:5051 \ - HOST_PORT_LOCAL=localhost:5050 \ - HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com \ - test \ - | egrep -v "$XCODEBUILD_FILTER" \ - | egrep -v '^$' \ - | egrep -v "(GPBDictionary|GPBArray)" - - -echo "TIME: $(date)" -xcodebuild \ - -workspace Tests.xcworkspace \ - -scheme MacTests \ - -destination platform=macOS \ - HOST_PORT_LOCALSSL=localhost:5051 \ - HOST_PORT_LOCAL=localhost:5050 \ - HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com \ - test \ - | egrep -v "$XCODEBUILD_FILTER" \ - | egrep -v '^$' \ - | egrep -v "(GPBDictionary|GPBArray)" - - -exit 0 diff --git a/src/objective-c/tests/version.h b/src/objective-c/tests/version.h index 231ba1a9a9f..9182189f4c8 100644 --- a/src/objective-c/tests/version.h +++ b/src/objective-c/tests/version.h @@ -22,5 +22,5 @@ // instead. This file can be regenerated from the template by running // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.23.0-dev" -#define GRPC_C_VERSION_STRING @"7.0.0" +#define GRPC_OBJC_VERSION_STRING @"1.24.0-dev" +#define GRPC_C_VERSION_STRING @"8.0.0" diff --git a/src/php/README.md b/src/php/README.md index dde6152cfce..0b8727ca864 100644 --- a/src/php/README.md +++ b/src/php/README.md @@ -174,6 +174,16 @@ v1.4.0 | 3.3.0 v1.6.0 | 3.4.0 v1.8.0 | 3.5.0 v1.12.0 | 3.5.2 +v1.13.1 | 3.5.2 +v1.14.2 | 3.5.2 +v1.15.1 | 3.6.1 +v1.16.1 | 3.6.1 +v1.17.2 | 3.6.1 +v1.18.0 | 3.6.1 +v1.19.1 | 3.6.1 +v1.20.1 | 3.7.0 +v1.21.3 | 3.7.0 +v1.22.0 | 3.8.0 If `protoc` hasn't been installed, you can download the `protoc` binaries from [the protocol buffers Github repository](https://github.com/google/protobuf/releases). diff --git a/src/php/composer.json b/src/php/composer.json index e29c9c33fde..6da1fd77d65 100644 --- a/src/php/composer.json +++ b/src/php/composer.json @@ -2,7 +2,7 @@ "name": "grpc/grpc-dev", "description": "gRPC library for PHP - for Developement use only", "license": "Apache-2.0", - "version": "1.23.0", + "version": "1.24.0", "require": { "php": ">=5.5.0", "google/protobuf": "^v3.3.0" diff --git a/src/php/ext/grpc/version.h b/src/php/ext/grpc/version.h index bb707f50a9f..000508dd3f8 100644 --- a/src/php/ext/grpc/version.h +++ b/src/php/ext/grpc/version.h @@ -20,6 +20,6 @@ #ifndef VERSION_H #define VERSION_H -#define PHP_GRPC_VERSION "1.23.0dev" +#define PHP_GRPC_VERSION "1.24.0dev" #endif /* VERSION_H */ diff --git a/src/proto/gen_build_yaml.py b/src/proto/gen_build_yaml.py index 1a935b56d89..fc1b5f7986e 100755 --- a/src/proto/gen_build_yaml.py +++ b/src/proto/gen_build_yaml.py @@ -15,6 +15,7 @@ """Generates the appropriate build.json data for all the proto files.""" +from __future__ import print_function import yaml import collections import os @@ -36,6 +37,10 @@ def update_deps(key, proto_filename, deps, deps_external, is_trans, visited): deps_external[key] = [] deps_external[key].append(imp_proto[:-6]) continue + # In case that the path is changed by copybara, + # revert the change to avoid file error. + if imp_proto.startswith('third_party/grpc'): + imp_proto = imp_proto[17:] if key not in deps: deps[key] = [] deps[key].append(imp_proto[:-6]) if is_trans: @@ -66,7 +71,7 @@ def main(): 'proto_transitive_external_deps': deps_external_trans } - print yaml.dump(json) + print(yaml.dump(json)) if __name__ == '__main__': main() diff --git a/src/proto/grpc/channelz/BUILD b/src/proto/grpc/channelz/BUILD index 1d80ec23af1..cfc8531de1b 100644 --- a/src/proto/grpc/channelz/BUILD +++ b/src/proto/grpc/channelz/BUILD @@ -28,6 +28,12 @@ grpc_proto_library( proto_library( name = "channelz_proto_descriptors", srcs = ["channelz.proto"], + deps = [ + "@com_google_protobuf//:any_proto", + "@com_google_protobuf//:duration_proto", + "@com_google_protobuf//:timestamp_proto", + "@com_google_protobuf//:wrappers_proto", + ], ) filegroup( diff --git a/src/proto/grpc/lb/v2/BUILD b/src/proto/grpc/lb/v2/BUILD new file mode 100644 index 00000000000..e47f170e14b --- /dev/null +++ b/src/proto/grpc/lb/v2/BUILD @@ -0,0 +1,41 @@ +# Copyright 2017 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # Apache v2 + +load("//bazel:grpc_build_system.bzl", "grpc_package", "grpc_proto_library") + +grpc_package( + name = "lb", + visibility = "public", +) + +grpc_proto_library( + name = "eds_for_test_proto", + srcs = [ + "eds_for_test.proto", + ], + has_services = True, + well_known_protos = True, +) + +grpc_proto_library( + name = "lrs_for_test_proto", + srcs = [ + "lrs_for_test.proto", + ], + has_services = True, + well_known_protos = True, + deps = ["eds_for_test_proto"], +) diff --git a/src/proto/grpc/lb/v2/eds_for_test.proto b/src/proto/grpc/lb/v2/eds_for_test.proto new file mode 100644 index 00000000000..3126095c92d --- /dev/null +++ b/src/proto/grpc/lb/v2/eds_for_test.proto @@ -0,0 +1,553 @@ +// Copyright 2019 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file contains the xds protocol and its dependency. It can't be used by +// the gRPC library; otherwise there can be duplicate definition problems if +// users depend on both gRPC and Envoy. It can only be used by gRPC tests. +// +// TODO(juanlishen): It's a workaround and should be removed once we have a +// clean solution to use protobuf and external proto files. + +syntax = "proto3"; + +package envoy.api.v2; + +import "google/protobuf/any.proto"; + +message UInt32Value { + // The uint32 value. + uint32 value = 1; +} + +message Status { + // The status code, which should be an enum value of [google.rpc.Code][]. + int32 code = 1; + + // A developer-facing error message, which should be in English. Any + // user-facing error message should be localized and sent in the + // [google.rpc.Status.details][] field, or localized by the client. + string message = 2; + + // A list of messages that carry the error details. There is a common set of + // message types for APIs to use. + repeated google.protobuf.Any details = 3; +} + +// `Struct` represents a structured data value, consisting of fields +// which map to dynamically typed values. In some languages, `Struct` +// might be supported by a native representation. For example, in +// scripting languages like JS a struct is represented as an +// object. The details of that representation are described together +// with the proto support for the language. +// +// The JSON representation for `Struct` is JSON object. +message Struct { + // Unordered map of dynamically typed values. + map fields = 1; +} + +// `Value` represents a dynamically typed value which can be either +// null, a number, a string, a boolean, a recursive struct value, or a +// list of values. A producer of value is expected to set one of that +// variants, absence of any variant indicates an error. +// +// The JSON representation for `Value` is JSON value. +message Value { + // The kind of value. + oneof kind { + // Represents a null value. + NullValue null_value = 1; + // Represents a double value. + double number_value = 2; + // Represents a string value. + string string_value = 3; + // Represents a boolean value. + bool bool_value = 4; + // Represents a structured value. + Struct struct_value = 5; + // Represents a repeated `Value`. + ListValue list_value = 6; + } +} + +// `NullValue` is a singleton enumeration to represent the null value for the +// `Value` type union. +// +// The JSON representation for `NullValue` is JSON `null`. +enum NullValue { + // Null value. + NULL_VALUE = 0; +} + +// `ListValue` is a wrapper around a repeated field of values. +// +// The JSON representation for `ListValue` is JSON array. +message ListValue { + // Repeated field of dynamically typed values. + repeated Value values = 1; +} + +/////////////////////////////////////////////////////////////////////////////// + +// Identifies location of where either Envoy runs or where upstream hosts run. +message Locality { + // Region this :ref:`zone ` belongs to. + string region = 1; + + // Defines the local service zone where Envoy is running. Though optional, it + // should be set if discovery service routing is used and the discovery + // service exposes :ref:`zone data `, + // either in this message or via :option:`--service-zone`. The meaning of zone + // is context dependent, e.g. `Availability Zone (AZ) + // `_ + // on AWS, `Zone `_ on + // GCP, etc. + string zone = 2; + + // When used for locality of upstream hosts, this field further splits zone + // into smaller chunks of sub-zones so they can be load balanced + // independently. + string sub_zone = 3; +} + +// Identifies a specific Envoy instance. The node identifier is presented to the +// management server, which may use this identifier to distinguish per Envoy +// configuration for serving. +message Node { + // An opaque node identifier for the Envoy node. This also provides the local + // service node name. It should be set if any of the following features are + // used: :ref:`statsd `, :ref:`CDS + // `, and :ref:`HTTP tracing + // `, either in this message or via + // :option:`--service-node`. + string id = 1; + + // Defines the local service cluster name where Envoy is running. Though + // optional, it should be set if any of the following features are used: + // :ref:`statsd `, :ref:`health check cluster + // verification `, + // :ref:`runtime override directory `, + // :ref:`user agent addition + // `, + // :ref:`HTTP global rate limiting `, + // :ref:`CDS `, and :ref:`HTTP tracing + // `, either in this message or via + // :option:`--service-cluster`. + string cluster = 2; + + // Opaque metadata extending the node identifier. Envoy will pass this + // directly to the management server. + Struct metadata = 3; + + // Locality specifying where the Envoy instance is running. + Locality locality = 4; + + // This is motivated by informing a management server during canary which + // version of Envoy is being tested in a heterogeneous fleet. This will be set + // by Envoy in management server RPCs. + string build_version = 5; +} + +/////////////////////////////////////////////////////////////////////////////// + +// A DiscoveryRequest requests a set of versioned resources of the same type for +// a given Envoy node on some API. +message DiscoveryRequest { + // The version_info provided in the request messages will be the version_info + // received with the most recent successfully processed response or empty on + // the first request. It is expected that no new request is sent after a + // response is received until the Envoy instance is ready to ACK/NACK the new + // configuration. ACK/NACK takes place by returning the new API config version + // as applied or the previous API config version respectively. Each type_url + // (see below) has an independent version associated with it. + string version_info = 1; + + // The node making the request. + Node node = 2; + + // List of resources to subscribe to, e.g. list of cluster names or a route + // configuration name. If this is empty, all resources for the API are + // returned. LDS/CDS expect empty resource_names, since this is global + // discovery for the Envoy instance. The LDS and CDS responses will then imply + // a number of resources that need to be fetched via EDS/RDS, which will be + // explicitly enumerated in resource_names. + repeated string resource_names = 3; + + // Type of the resource that is being requested, e.g. + // "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". This is implicit + // in requests made via singleton xDS APIs such as CDS, LDS, etc. but is + // required for ADS. + string type_url = 4; + + // nonce corresponding to DiscoveryResponse being ACK/NACKed. See above + // discussion on version_info and the DiscoveryResponse nonce comment. This + // may be empty if no nonce is available, e.g. at startup or for non-stream + // xDS implementations. + string response_nonce = 5; + + // This is populated when the previous :ref:`DiscoveryResponse ` + // failed to update configuration. The *message* field in *error_details* provides the Envoy + // internal exception related to the failure. It is only intended for consumption during manual + // debugging, the string provided is not guaranteed to be stable across Envoy versions. + Status error_detail = 6; +} + +message DiscoveryResponse { + // The version of the response data. + string version_info = 1; + + // The response resources. These resources are typed and depend on the API being called. + repeated google.protobuf.Any resources = 2; + + // [#not-implemented-hide:] + // Canary is used to support two Envoy command line flags: + // + // * --terminate-on-canary-transition-failure. When set, Envoy is able to + // terminate if it detects that configuration is stuck at canary. Consider + // this example sequence of updates: + // - Management server applies a canary config successfully. + // - Management server rolls back to a production config. + // - Envoy rejects the new production config. + // Since there is no sensible way to continue receiving configuration + // updates, Envoy will then terminate and apply production config from a + // clean slate. + // * --dry-run-canary. When set, a canary response will never be applied, only + // validated via a dry run. + bool canary = 3; + + // Type URL for resources. This must be consistent with the type_url in the + // Any messages for resources if resources is non-empty. This effectively + // identifies the xDS API when muxing over ADS. + string type_url = 4; + + // For gRPC based subscriptions, the nonce provides a way to explicitly ack a + // specific DiscoveryResponse in a following DiscoveryRequest. Additional + // messages may have been sent by Envoy to the management server for the + // previous version on the stream prior to this DiscoveryResponse, that were + // unprocessed at response send time. The nonce allows the management server + // to ignore any further DiscoveryRequests for the previous version until a + // DiscoveryRequest bearing the nonce. The nonce is optional and is not + // required for non-stream based xDS implementations. + string nonce = 5; +} + +/////////////////////////////////////////////////////////////////////////////// + +message Pipe { + // Unix Domain Socket path. On Linux, paths starting with '@' will use the + // abstract namespace. The starting '@' is replaced by a null byte by Envoy. + // Paths starting with '@' will result in an error in environments other than + // Linux. + string path = 1; +} + +message SocketAddress { + enum Protocol { + TCP = 0; + // [#not-implemented-hide:] + UDP = 1; + } + Protocol protocol = 1; + // The address for this socket. :ref:`Listeners ` will bind + // to the address. An empty address is not allowed. Specify ``0.0.0.0`` or ``::`` + // to bind to any address. [#comment:TODO(zuercher) reinstate when implemented: + // It is possible to distinguish a Listener address via the prefix/suffix matching + // in :ref:`FilterChainMatch `.] When used + // within an upstream :ref:`BindConfig `, the address + // controls the source address of outbound connections. For :ref:`clusters + // `, the cluster type determines whether the + // address must be an IP (*STATIC* or *EDS* clusters) or a hostname resolved by DNS + // (*STRICT_DNS* or *LOGICAL_DNS* clusters). Address resolution can be customized + // via :ref:`resolver_name `. + string address = 2; + oneof port_specifier { + uint32 port_value = 3; + // This is only valid if :ref:`resolver_name + // ` is specified below and the + // named resolver is capable of named port resolution. + string named_port = 4; + } + // The name of the resolver. This must have been registered with Envoy. If this is + // empty, a context dependent default applies. If address is a hostname this + // should be set for resolution other than DNS. If the address is a concrete + // IP address, no resolution will occur. + string resolver_name = 5; + + // When binding to an IPv6 address above, this enables `IPv4 compatibity + // `_. Binding to ``::`` will + // allow both IPv4 and IPv6 connections, with peer IPv4 addresses mapped into + // IPv6 space as ``::FFFF:``. + bool ipv4_compat = 6; +} + +// Addresses specify either a logical or physical address and port, which are +// used to tell Envoy where to bind/listen, connect to upstream and find +// management servers. +message Address { + oneof address { + + SocketAddress socket_address = 1; + Pipe pipe = 2; + } +} + +/////////////////////////////////////////////////////////////////////////////// + +message Metadata { + // Key is the reverse DNS filter name, e.g. com.acme.widget. The envoy.* + // namespace is reserved for Envoy's built-in filters. + map filter_metadata = 1; +} + +/////////////////////////////////////////////////////////////////////////////// + +// Endpoint health status. +enum HealthStatus { + // The health status is not known. This is interpreted by Envoy as *HEALTHY*. + UNKNOWN = 0; + + // Healthy. + HEALTHY = 1; + + // Unhealthy. + UNHEALTHY = 2; + + // Connection draining in progress. E.g., + // ``_ + // or + // ``_. + // This is interpreted by Envoy as *UNHEALTHY*. + DRAINING = 3; + + // Health check timed out. This is part of HDS and is interpreted by Envoy as + // *UNHEALTHY*. + TIMEOUT = 4; +} + +/////////////////////////////////////////////////////////////////////////////// + +// Upstream host identifier. +message Endpoint { + // The upstream host address. + // + // .. attention:: + // + // The form of host address depends on the given cluster type. For STATIC or EDS, + // it is expected to be a direct IP address (or something resolvable by the + // specified :ref:`resolver ` + // in the Address). For LOGICAL or STRICT DNS, it is expected to be hostname, + // and will be resolved via DNS. + Address address = 1; + + // The optional health check configuration. + message HealthCheckConfig { + // Optional alternative health check port value. + // + // By default the health check address port of an upstream host is the same + // as the host's serving address port. This provides an alternative health + // check port. Setting this with a non-zero value allows an upstream host + // to have different health check address port. + uint32 port_value = 1; + } + + // The optional health check configuration is used as configuration for the + // health checker to contact the health checked host. + // + // .. attention:: + // + // This takes into effect only for upstream clusters with + // :ref:`active health checking ` enabled. + HealthCheckConfig health_check_config = 2; +} + +// An Endpoint that Envoy can route traffic to. +message LbEndpoint { + // Upstream host identifier + Endpoint endpoint = 1; + + // Optional health status when known and supplied by EDS server. + HealthStatus health_status = 2; + + // The endpoint metadata specifies values that may be used by the load + // balancer to select endpoints in a cluster for a given request. The filter + // name should be specified as *envoy.lb*. An example boolean key-value pair + // is *canary*, providing the optional canary status of the upstream host. + // This may be matched against in a route's + // :ref:`RouteAction ` metadata_match field + // to subset the endpoints considered in cluster load balancing. + Metadata metadata = 3; + + // The optional load balancing weight of the upstream host, in the range 1 - + // 128. Envoy uses the load balancing weight in some of the built in load + // balancers. The load balancing weight for an endpoint is divided by the sum + // of the weights of all endpoints in the endpoint's locality to produce a + // percentage of traffic for the endpoint. This percentage is then further + // weighted by the endpoint's locality's load balancing weight from + // LocalityLbEndpoints. If unspecified, each host is presumed to have equal + // weight in a locality. + // + // .. attention:: + // + // The limit of 128 is somewhat arbitrary, but is applied due to performance + // concerns with the current implementation and can be removed when + // `this issue `_ is fixed. + UInt32Value load_balancing_weight = 4; +} + +// A group of endpoints belonging to a Locality. +// One can have multiple LocalityLbEndpoints for a locality, but this is +// generally only done if the different groups need to have different load +// balancing weights or different priorities. +message LocalityLbEndpoints { + // Identifies location of where the upstream hosts run. + Locality locality = 1; + + // The group of endpoints belonging to the locality specified. + repeated LbEndpoint lb_endpoints = 2; + + // Optional: Per priority/region/zone/sub_zone weight - range 1-128. The load + // balancing weight for a locality is divided by the sum of the weights of all + // localities at the same priority level to produce the effective percentage + // of traffic for the locality. + // + // Locality weights are only considered when :ref:`locality weighted load + // balancing ` is + // configured. These weights are ignored otherwise. If no weights are + // specificed when locality weighted load balancing is enabled, the cluster is + // assumed to have a weight of 1. + // + // .. attention:: + // + // The limit of 128 is somewhat arbitrary, but is applied due to performance + // concerns with the current implementation and can be removed when + // `this issue `_ is fixed. + UInt32Value load_balancing_weight = 3; + + // Optional: the priority for this LocalityLbEndpoints. If unspecified this will + // default to the highest priority (0). + // + // Under usual circumstances, Envoy will only select endpoints for the highest + // priority (0). In the event all endpoints for a particular priority are + // unavailable/unhealthy, Envoy will fail over to selecting endpoints for the + // next highest priority group. + // + // Priorities should range from 0 (highest) to N (lowest) without skipping. + uint32 priority = 5; +} + +/////////////////////////////////////////////////////////////////////////////// + +message FractionalPercent { + // Specifies the numerator. Defaults to 0. + uint32 numerator = 1; + + // Fraction percentages support several fixed denominator values. + enum DenominatorType { + // 100. + // + // **Example**: 1/100 = 1%. + HUNDRED = 0; + + // 10,000. + // + // **Example**: 1/10000 = 0.01%. + TEN_THOUSAND = 1; + + // 1,000,000. + // + // **Example**: 1/1000000 = 0.0001%. + MILLION = 2; + } + + // Specifies the denominator. If the denominator specified is less than the numerator, the final + // fractional percentage is capped at 1 (100%). + DenominatorType denominator = 2; +} + +/////////////////////////////////////////////////////////////////////////////// + +// [#protodoc-title: EDS] +// Endpoint discovery :ref:`architecture overview ` +service EndpointDiscoveryService { + // The resource_names field in DiscoveryRequest specifies a list of clusters + // to subscribe to updates for. + rpc StreamEndpoints(stream DiscoveryRequest) returns (stream DiscoveryResponse) { + } +} + +// Each route from RDS will map to a single cluster or traffic split across +// clusters using weights expressed in the RDS WeightedCluster. +// +// With EDS, each cluster is treated independently from a LB perspective, with +// LB taking place between the Localities within a cluster and at a finer +// granularity between the hosts within a locality. For a given cluster, the +// effective weight of a host is its load_balancing_weight multiplied by the +// load_balancing_weight of its Locality. +message ClusterLoadAssignment { + // Name of the cluster. This will be the :ref:`service_name + // ` value if specified + // in the cluster :ref:`EdsClusterConfig + // `. + string cluster_name = 1; + + // List of endpoints to load balance to. + repeated LocalityLbEndpoints endpoints = 2; + + // Load balancing policy settings. + message Policy { + reserved 1; + + message DropOverload { + // Identifier for the policy specifying the drop. + string category = 1; + + // Percentage of traffic that should be dropped for the category. + FractionalPercent drop_percentage = 2; + } + // Action to trim the overall incoming traffic to protect the upstream + // hosts. This action allows protection in case the hosts are unable to + // recover from an outage, or unable to autoscale or unable to handle + // incoming traffic volume for any reason. + // + // At the client each category is applied one after the other to generate + // the 'actual' drop percentage on all outgoing traffic. For example: + // + // .. code-block:: json + // + // { "drop_overloads": [ + // { "category": "throttle", "drop_percentage": 60 } + // { "category": "lb", "drop_percentage": 50 } + // ]} + // + // The actual drop percentages applied to the traffic at the clients will be + // "throttle"_drop = 60% + // "lb"_drop = 20% // 50% of the remaining 'actual' load, which is 40%. + // actual_outgoing_load = 20% // remaining after applying all categories. + repeated DropOverload drop_overloads = 2; + + // Priority levels and localities are considered overprovisioned with this + // factor (in percentage). This means that we don't consider a priority + // level or locality unhealthy until the percentage of healthy hosts + // multiplied by the overprovisioning factor drops below 100. + // With the default value 140(1.4), Envoy doesn't consider a priority level + // or a locality unhealthy until their percentage of healthy hosts drops + // below 72%. + // Read more at :ref:`priority levels ` and + // :ref:`localities `. + UInt32Value overprovisioning_factor = 3; + } + + // Load balancing policy settings. + Policy policy = 4; +} diff --git a/src/proto/grpc/lb/v2/lrs_for_test.proto b/src/proto/grpc/lb/v2/lrs_for_test.proto new file mode 100644 index 00000000000..76c560a99cf --- /dev/null +++ b/src/proto/grpc/lb/v2/lrs_for_test.proto @@ -0,0 +1,180 @@ +// Copyright 2019 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file contains the eds protocol and its dependency. +// +// TODO(juanlishen): It's a workaround and should be removed once we have a +// clean solution to the circular dependency between the envoy data plane APIs +// and gRPC. We can't check in this file due to conflict with internal code. + +syntax = "proto3"; + +package envoy.service.load_stats.v2; + +import "google/protobuf/duration.proto"; +import "src/proto/grpc/lb/v2/eds_for_test.proto"; + +// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. +message EndpointLoadMetricStats { + // Name of the metric; may be empty. + string metric_name = 1; + + // Number of calls that finished and included this metric. + uint64 num_requests_finished_with_metric = 2; + + // Sum of metric values across all calls that finished with this metric for + // load_reporting_interval. + double total_metric_value = 3; +} + +message UpstreamLocalityStats { + // Name of zone, region and optionally endpoint group these metrics were + // collected from. Zone and region names could be empty if unknown. + envoy.api.v2.Locality locality = 1; + + // The total number of requests successfully completed by the endpoints in the + // locality. + uint64 total_successful_requests = 2; + + // The total number of unfinished requests + uint64 total_requests_in_progress = 3; + + // The total number of requests that failed due to errors at the endpoint, + // aggregated over all endpoints in the locality. + uint64 total_error_requests = 4; + + // The total number of requests that were issued by this Envoy since + // the last report. This information is aggregated over all the + // upstream endpoints in the locality. + uint64 total_issued_requests = 8; + + // Stats for multi-dimensional load balancing. + repeated EndpointLoadMetricStats load_metric_stats = 5; + +// // Endpoint granularity stats information for this locality. This information +// // is populated if the Server requests it by setting +// // :ref:`LoadStatsResponse.report_endpoint_granularity`. +// repeated UpstreamEndpointStats upstream_endpoint_stats = 7; + + // [#not-implemented-hide:] The priority of the endpoint group these metrics + // were collected from. + uint32 priority = 6; +} + +// Per cluster load stats. Envoy reports these stats a management server in a +// :ref:`LoadStatsRequest` +// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. +// Next ID: 7 +message ClusterStats { + // The name of the cluster. + string cluster_name = 1; + + // The eds_cluster_config service_name of the cluster. + // It's possible that two clusters send the same service_name to EDS, + // in that case, the management server is supposed to do aggregation on the load reports. + string cluster_service_name = 6; + + // Need at least one. + repeated UpstreamLocalityStats upstream_locality_stats = 2; + + // Cluster-level stats such as total_successful_requests may be computed by + // summing upstream_locality_stats. In addition, below there are additional + // cluster-wide stats. + // + // The total number of dropped requests. This covers requests + // deliberately dropped by the drop_overload policy and circuit breaking. + uint64 total_dropped_requests = 3; + + message DroppedRequests { + // Identifier for the policy specifying the drop. + string category = 1; + // Total number of deliberately dropped requests for the category. + uint64 dropped_count = 2; + } + // Information about deliberately dropped requests for each category specified + // in the DropOverload policy. + repeated DroppedRequests dropped_requests = 5; + + // Period over which the actual load report occurred. This will be guaranteed to include every + // request reported. Due to system load and delays between the *LoadStatsRequest* sent from Envoy + // and the *LoadStatsResponse* message sent from the management server, this may be longer than + // the requested load reporting interval in the *LoadStatsResponse*. + google.protobuf.Duration load_report_interval = 4; +} + +// [#protodoc-title: Load reporting service] + +service LoadReportingService { + // Advanced API to allow for multi-dimensional load balancing by remote + // server. For receiving LB assignments, the steps are: + // 1, The management server is configured with per cluster/zone/load metric + // capacity configuration. The capacity configuration definition is + // outside of the scope of this document. + // 2. Envoy issues a standard {Stream,Fetch}Endpoints request for the clusters + // to balance. + // + // Independently, Envoy will initiate a StreamLoadStats bidi stream with a + // management server: + // 1. Once a connection establishes, the management server publishes a + // LoadStatsResponse for all clusters it is interested in learning load + // stats about. + // 2. For each cluster, Envoy load balances incoming traffic to upstream hosts + // based on per-zone weights and/or per-instance weights (if specified) + // based on intra-zone LbPolicy. This information comes from the above + // {Stream,Fetch}Endpoints. + // 3. When upstream hosts reply, they optionally add header with ASCII representation of EndpointLoadMetricStats. + // 4. Envoy aggregates load reports over the period of time given to it in + // LoadStatsResponse.load_reporting_interval. This includes aggregation + // stats Envoy maintains by itself (total_requests, rpc_errors etc.) as + // well as load metrics from upstream hosts. + // 5. When the timer of load_reporting_interval expires, Envoy sends new + // LoadStatsRequest filled with load reports for each cluster. + // 6. The management server uses the load reports from all reported Envoys + // from around the world, computes global assignment and prepares traffic + // assignment destined for each zone Envoys are located in. Goto 2. + rpc StreamLoadStats(stream LoadStatsRequest) returns (stream LoadStatsResponse) { + } +} + +// A load report Envoy sends to the management server. +// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. +message LoadStatsRequest { + // Node identifier for Envoy instance. + envoy.api.v2.Node node = 1; + + // A list of load stats to report. + repeated ClusterStats cluster_stats = 2; +} + +// The management server sends envoy a LoadStatsResponse with all clusters it +// is interested in learning load stats about. +// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs. +message LoadStatsResponse { + // Clusters to report stats for. + repeated string clusters = 1; + + // The minimum interval of time to collect stats over. This is only a minimum for two reasons: + // 1. There may be some delay from when the timer fires until stats sampling occurs. + // 2. For clusters that were already feature in the previous *LoadStatsResponse*, any traffic + // that is observed in between the corresponding previous *LoadStatsRequest* and this + // *LoadStatsResponse* will also be accumulated and billed to the cluster. This avoids a period + // of inobservability that might otherwise exists between the messages. New clusters are not + // subject to this consideration. + google.protobuf.Duration load_reporting_interval = 2; + + // Set to *true* if the management server supports endpoint granularity + // report. + bool report_endpoint_granularity = 3; +} diff --git a/src/proto/grpc/testing/BUILD b/src/proto/grpc/testing/BUILD index 212f0f3cca7..8bea8ed7ca0 100644 --- a/src/proto/grpc/testing/BUILD +++ b/src/proto/grpc/testing/BUILD @@ -16,7 +16,7 @@ licenses(["notice"]) # Apache v2 load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package") load("@grpc_python_dependencies//:requirements.bzl", "requirement") -load("//bazel:python_rules.bzl", "py_proto_library") +load("//bazel:python_rules.bzl", "py_proto_library", "py_grpc_library") grpc_package( name = "testing", @@ -50,7 +50,6 @@ grpc_proto_library( grpc_proto_library( name = "echo_messages_proto", srcs = ["echo_messages.proto"], - has_services = False, ) grpc_proto_library( @@ -75,8 +74,14 @@ proto_library( ) py_proto_library( - name = "py_empty_proto", - deps = [":empty_proto_descriptor"], + name = "empty_py_pb2", + srcs = [":empty_proto_descriptor"], +) + +py_grpc_library( + name = "empty_py_pb2_grpc", + srcs = [":empty_proto_descriptor"], + deps = [":empty_py_pb2"], ) grpc_proto_library( @@ -92,7 +97,13 @@ proto_library( py_proto_library( name = "py_messages_proto", - deps = [":messages_proto_descriptor"], + srcs = [":messages_proto_descriptor"], +) + +py_grpc_library( + name = "messages_py_pb2_grpc", + srcs = [":messages_proto_descriptor"], + deps = [":py_messages_proto"], ) grpc_proto_library( @@ -133,7 +144,6 @@ grpc_proto_library( grpc_proto_library( name = "simple_messages_proto", srcs = ["simple_messages.proto"], - has_services = False, ) grpc_proto_library( @@ -196,7 +206,12 @@ proto_library( py_proto_library( name = "py_test_proto", - deps = [ - ":test_proto_descriptor", - ], + srcs = [":test_proto_descriptor"], ) + +py_grpc_library( + name = "test_py_pb2_grpc", + srcs = [":test_proto_descriptor"], + deps = [":py_test_proto"], +) + diff --git a/src/proto/grpc/testing/proto2/BUILD.bazel b/src/proto/grpc/testing/proto2/BUILD.bazel index e939c523a64..668d0a484ea 100644 --- a/src/proto/grpc/testing/proto2/BUILD.bazel +++ b/src/proto/grpc/testing/proto2/BUILD.bazel @@ -10,9 +10,7 @@ proto_library( py_proto_library( name = "empty2_proto", - deps = [ - ":empty2_proto_descriptor", - ], + srcs = [":empty2_proto_descriptor"], ) proto_library( @@ -25,8 +23,6 @@ proto_library( py_proto_library( name = "empty2_extensions_proto", - deps = [ - ":empty2_extensions_proto_descriptor", - ], + srcs = [":empty2_extensions_proto_descriptor"], ) diff --git a/src/python/grpcio/grpc/BUILD.bazel b/src/python/grpcio/grpc/BUILD.bazel index a2bedae4bea..1b5a018249a 100644 --- a/src/python/grpcio/grpc/BUILD.bazel +++ b/src/python/grpcio/grpc/BUILD.bazel @@ -1,5 +1,3 @@ -load("@grpc_python_dependencies//:requirements.bzl", "requirement") - package(default_visibility = ["//visibility:public"]) py_library( @@ -16,9 +14,9 @@ py_library( "//src/python/grpcio/grpc/_cython:cygrpc", "//src/python/grpcio/grpc/experimental", "//src/python/grpcio/grpc/framework", - requirement('six'), + "@six_archive//:six", ] + select({ - "//conditions:default": [requirement('enum34'),], + "//conditions:default": ["@enum34//:enum34",], "//:python3": [], }), data = [ diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py index a1df5fb161c..7dae90c89e8 100644 --- a/src/python/grpcio/grpc/__init__.py +++ b/src/python/grpcio/grpc/__init__.py @@ -1444,6 +1444,29 @@ class Server(six.with_metaclass(abc.ABCMeta)): """ raise NotImplementedError() + def wait_for_termination(self, timeout=None): + """Block current thread until the server stops. + + This is an EXPERIMENTAL API. + + The wait will not consume computational resources during blocking, and + it will block until one of the two following conditions are met: + + 1) The server is stopped or terminated; + 2) A timeout occurs if timeout is not `None`. + + The timeout argument works in the same way as `threading.Event.wait()`. + https://docs.python.org/3/library/threading.html#threading.Event.wait + + Args: + timeout: A floating point number specifying a timeout for the + operation in seconds. + + Returns: + A bool indicates if the operation times out. + """ + raise NotImplementedError() + ################################# Functions ################################ diff --git a/src/python/grpcio/grpc/_channel.py b/src/python/grpcio/grpc/_channel.py index 24f928ef69f..0bf8e03b5ce 100644 --- a/src/python/grpcio/grpc/_channel.py +++ b/src/python/grpcio/grpc/_channel.py @@ -13,6 +13,7 @@ # limitations under the License. """Invocation-side implementation of gRPC Python.""" +import functools import logging import sys import threading @@ -81,17 +82,6 @@ def _unknown_code_details(unknown_cygrpc_code, details): unknown_cygrpc_code, details) -def _wait_once_until(condition, until): - if until is None: - condition.wait() - else: - remaining = until - time.time() - if remaining < 0: - raise grpc.FutureTimeoutError() - else: - condition.wait(timeout=remaining) - - class _RPCState(object): def __init__(self, due, initial_metadata, trailing_metadata, code, details): @@ -178,12 +168,11 @@ def _event_handler(state, response_deserializer): #pylint: disable=too-many-statements def _consume_request_iterator(request_iterator, state, call, request_serializer, event_handler): - if cygrpc.is_fork_support_enabled(): - condition_wait_timeout = 1.0 - else: - condition_wait_timeout = None + """Consume a request iterator supplied by the user.""" def consume_request_iterator(): # pylint: disable=too-many-branches + # Iterate over the request iterator until it is exhausted or an error + # condition is encountered. while True: return_from_user_request_generator_invoked = False try: @@ -224,14 +213,19 @@ def _consume_request_iterator(request_iterator, state, call, request_serializer, state.due.add(cygrpc.OperationType.send_message) else: return - while True: - state.condition.wait(condition_wait_timeout) - cygrpc.block_if_fork_in_progress(state) - if state.code is None: - if cygrpc.OperationType.send_message not in state.due: - break - else: - return + + def _done(): + return (state.code is not None or + cygrpc.OperationType.send_message not in + state.due) + + _common.wait( + state.condition.wait, + _done, + spin_cb=functools.partial( + cygrpc.block_if_fork_in_progress, state)) + if state.code is not None: + return else: return with state.condition: @@ -281,13 +275,21 @@ class _Rendezvous(grpc.RpcError, grpc.Future, grpc.Call): # pylint: disable=too with self._state.condition: return self._state.code is not None + def _is_complete(self): + return self._state.code is not None + def result(self, timeout=None): - until = None if timeout is None else time.time() + timeout + """Returns the result of the computation or raises its exception. + + See grpc.Future.result for the full API contract. + """ with self._state.condition: - while True: - if self._state.code is None: - _wait_once_until(self._state.condition, until) - elif self._state.code is grpc.StatusCode.OK: + timed_out = _common.wait( + self._state.condition.wait, self._is_complete, timeout=timeout) + if timed_out: + raise grpc.FutureTimeoutError() + else: + if self._state.code is grpc.StatusCode.OK: return self._state.response elif self._state.cancelled: raise grpc.FutureCancelledError() @@ -295,12 +297,17 @@ class _Rendezvous(grpc.RpcError, grpc.Future, grpc.Call): # pylint: disable=too raise self def exception(self, timeout=None): - until = None if timeout is None else time.time() + timeout + """Return the exception raised by the computation. + + See grpc.Future.exception for the full API contract. + """ with self._state.condition: - while True: - if self._state.code is None: - _wait_once_until(self._state.condition, until) - elif self._state.code is grpc.StatusCode.OK: + timed_out = _common.wait( + self._state.condition.wait, self._is_complete, timeout=timeout) + if timed_out: + raise grpc.FutureTimeoutError() + else: + if self._state.code is grpc.StatusCode.OK: return None elif self._state.cancelled: raise grpc.FutureCancelledError() @@ -308,12 +315,17 @@ class _Rendezvous(grpc.RpcError, grpc.Future, grpc.Call): # pylint: disable=too return self def traceback(self, timeout=None): - until = None if timeout is None else time.time() + timeout + """Access the traceback of the exception raised by the computation. + + See grpc.future.traceback for the full API contract. + """ with self._state.condition: - while True: - if self._state.code is None: - _wait_once_until(self._state.condition, until) - elif self._state.code is grpc.StatusCode.OK: + timed_out = _common.wait( + self._state.condition.wait, self._is_complete, timeout=timeout) + if timed_out: + raise grpc.FutureTimeoutError() + else: + if self._state.code is grpc.StatusCode.OK: return None elif self._state.cancelled: raise grpc.FutureCancelledError() @@ -345,17 +357,23 @@ class _Rendezvous(grpc.RpcError, grpc.Future, grpc.Call): # pylint: disable=too raise StopIteration() else: raise self - while True: - self._state.condition.wait() - if self._state.response is not None: - response = self._state.response - self._state.response = None - return response - elif cygrpc.OperationType.receive_message not in self._state.due: - if self._state.code is grpc.StatusCode.OK: - raise StopIteration() - elif self._state.code is not None: - raise self + + def _response_ready(): + return ( + self._state.response is not None or + (cygrpc.OperationType.receive_message not in self._state.due + and self._state.code is not None)) + + _common.wait(self._state.condition.wait, _response_ready) + if self._state.response is not None: + response = self._state.response + self._state.response = None + return response + elif cygrpc.OperationType.receive_message not in self._state.due: + if self._state.code is grpc.StatusCode.OK: + raise StopIteration() + elif self._state.code is not None: + raise self def __iter__(self): return self @@ -386,32 +404,47 @@ class _Rendezvous(grpc.RpcError, grpc.Future, grpc.Call): # pylint: disable=too def initial_metadata(self): with self._state.condition: - while self._state.initial_metadata is None: - self._state.condition.wait() + + def _done(): + return self._state.initial_metadata is not None + + _common.wait(self._state.condition.wait, _done) return self._state.initial_metadata def trailing_metadata(self): with self._state.condition: - while self._state.trailing_metadata is None: - self._state.condition.wait() + + def _done(): + return self._state.trailing_metadata is not None + + _common.wait(self._state.condition.wait, _done) return self._state.trailing_metadata def code(self): with self._state.condition: - while self._state.code is None: - self._state.condition.wait() + + def _done(): + return self._state.code is not None + + _common.wait(self._state.condition.wait, _done) return self._state.code def details(self): with self._state.condition: - while self._state.details is None: - self._state.condition.wait() + + def _done(): + return self._state.details is not None + + _common.wait(self._state.condition.wait, _done) return _common.decode(self._state.details) def debug_error_string(self): with self._state.condition: - while self._state.debug_error_string is None: - self._state.condition.wait() + + def _done(): + return self._state.debug_error_string is not None + + _common.wait(self._state.condition.wait, _done) return _common.decode(self._state.debug_error_string) def _repr(self): diff --git a/src/python/grpcio/grpc/_common.py b/src/python/grpcio/grpc/_common.py index f69127e38ef..b4b24738e8f 100644 --- a/src/python/grpcio/grpc/_common.py +++ b/src/python/grpcio/grpc/_common.py @@ -15,6 +15,7 @@ import logging +import time import six import grpc @@ -60,6 +61,8 @@ STATUS_CODE_TO_CYGRPC_STATUS_CODE = { CYGRPC_STATUS_CODE_TO_STATUS_CODE) } +MAXIMUM_WAIT_TIMEOUT = 0.1 + def encode(s): if isinstance(s, bytes): @@ -96,3 +99,50 @@ def deserialize(serialized_message, deserializer): def fully_qualified_method(group, method): return '/{}/{}'.format(group, method) + + +def _wait_once(wait_fn, timeout, spin_cb): + wait_fn(timeout=timeout) + if spin_cb is not None: + spin_cb() + + +def wait(wait_fn, wait_complete_fn, timeout=None, spin_cb=None): + """Blocks waiting for an event without blocking the thread indefinitely. + + See https://github.com/grpc/grpc/issues/19464 for full context. CPython's + `threading.Event.wait` and `threading.Condition.wait` methods, if invoked + without a timeout kwarg, may block the calling thread indefinitely. If the + call is made from the main thread, this means that signal handlers may not + run for an arbitrarily long period of time. + + This wrapper calls the supplied wait function with an arbitrary short + timeout to ensure that no signal handler has to wait longer than + MAXIMUM_WAIT_TIMEOUT before executing. + + Args: + wait_fn: A callable acceptable a single float-valued kwarg named + `timeout`. This function is expected to be one of `threading.Event.wait` + or `threading.Condition.wait`. + wait_complete_fn: A callable taking no arguments and returning a bool. + When this function returns true, it indicates that waiting should cease. + timeout: An optional float-valued number of seconds after which the wait + should cease. + spin_cb: An optional Callable taking no arguments and returning nothing. + This callback will be called on each iteration of the spin. This may be + used for, e.g. work related to forking. + + Returns: + True if a timeout was supplied and it was reached. False otherwise. + """ + if timeout is None: + while not wait_complete_fn(): + _wait_once(wait_fn, MAXIMUM_WAIT_TIMEOUT, spin_cb) + else: + end = time.time() + timeout + while not wait_complete_fn(): + remaining = min(end - time.time(), MAXIMUM_WAIT_TIMEOUT) + if remaining < 0: + return True + _wait_once(wait_fn, remaining, spin_cb) + return False diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi index ca637094353..1799780fce4 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi @@ -146,12 +146,36 @@ cdef _cancel( cdef _next_call_event( _ChannelState channel_state, grpc_completion_queue *c_completion_queue, - on_success, deadline): - tag, event = _latent_event(c_completion_queue, deadline) - with channel_state.condition: - on_success(tag) - channel_state.condition.notify_all() - return event + on_success, on_failure, deadline): + """Block on the next event out of the completion queue. + + On success, `on_success` will be invoked with the tag taken from the CQ. + In the case of a failure due to an exception raised in a signal handler, + `on_failure` will be invoked with no arguments. Note that this situation + can only occur on the main thread. + + Args: + channel_state: The state for the channel on which the RPC is running. + c_completion_queue: The CQ which will be polled. + on_success: A callable object to be invoked upon successful receipt of a + tag from the CQ. + on_failure: A callable object to be invoked in case a Python exception is + raised from a signal handler during polling. + deadline: The point after which the RPC will time out. + """ + try: + tag, event = _latent_event(c_completion_queue, deadline) + # NOTE(rbellevi): This broad except enables us to clean up resources before + # propagating any exceptions raised by signal handlers to the application. + except: + if on_failure is not None: + on_failure() + raise + else: + with channel_state.condition: + on_success(tag) + channel_state.condition.notify_all() + return event # TODO(https://github.com/grpc/grpc/issues/14569): This could be a lot simpler. @@ -307,8 +331,14 @@ cdef class SegregatedCall: def on_success(tag): _process_segregated_call_tag( self._channel_state, self._call_state, self._c_completion_queue, tag) + def on_failure(): + self._call_state.due.clear() + grpc_call_unref(self._call_state.c_call) + self._call_state.c_call = NULL + self._channel_state.segregated_call_states.remove(self._call_state) + _destroy_c_completion_queue(self._c_completion_queue) return _next_call_event( - self._channel_state, self._c_completion_queue, on_success, None) + self._channel_state, self._c_completion_queue, on_success, on_failure, None) cdef SegregatedCall _segregated_call( @@ -461,8 +491,11 @@ cdef class Channel: queue_deadline = time.time() + 1.0 else: queue_deadline = None + # NOTE(gnossen): It is acceptable for on_failure to be None here because + # failure conditions can only ever happen on the main thread and this + # method is only ever invoked on the channel spin thread. return _next_call_event(self._state, self._state.c_call_completion_queue, - on_success, queue_deadline) + on_success, None, queue_deadline) def segregated_call( self, int flags, method, host, object deadline, object metadata, diff --git a/src/python/grpcio/grpc/_grpcio_metadata.py b/src/python/grpcio/grpc/_grpcio_metadata.py index d2f8be43f34..ff1b1a17d25 100644 --- a/src/python/grpcio/grpc/_grpcio_metadata.py +++ b/src/python/grpcio/grpc/_grpcio_metadata.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!! -__version__ = """1.23.0.dev0""" +__version__ = """1.24.0.dev0""" diff --git a/src/python/grpcio/grpc/_server.py b/src/python/grpcio/grpc/_server.py index 370c81100af..99255432eb4 100644 --- a/src/python/grpcio/grpc/_server.py +++ b/src/python/grpcio/grpc/_server.py @@ -50,6 +50,7 @@ _CANCELLED = 'cancelled' _EMPTY_FLAGS = 0 _DEALLOCATED_SERVER_CHECK_PERIOD_S = 1.0 +_INF_TIMEOUT = 1e9 def _serialized_request(request_event): @@ -764,7 +765,8 @@ class _ServerState(object): self.interceptor_pipeline = interceptor_pipeline self.thread_pool = thread_pool self.stage = _ServerStage.STOPPED - self.shutdown_events = None + self.termination_event = threading.Event() + self.shutdown_events = [self.termination_event] self.maximum_concurrent_rpcs = maximum_concurrent_rpcs self.active_rpc_count = 0 @@ -876,7 +878,6 @@ def _begin_shutdown_once(state): if state.stage is _ServerStage.STARTED: state.server.shutdown(state.completion_queue, _SHUTDOWN_TAG) state.stage = _ServerStage.GRACE - state.shutdown_events = [] state.due.add(_SHUTDOWN_TAG) @@ -959,6 +960,15 @@ class _Server(grpc.Server): def start(self): _start(self._state) + def wait_for_termination(self, timeout=None): + # NOTE(https://bugs.python.org/issue35935) + # Remove this workaround once threading.Event.wait() is working with + # CTRL+C across platforms. + return _common.wait( + self._state.termination_event.wait, + self._state.termination_event.is_set, + timeout=timeout) + def stop(self, grace): return _stop(self._state, grace) diff --git a/src/python/grpcio/grpc/experimental/BUILD.bazel b/src/python/grpcio/grpc/experimental/BUILD.bazel index 6598d02747b..cd8afe533b6 100644 --- a/src/python/grpcio/grpc/experimental/BUILD.bazel +++ b/src/python/grpcio/grpc/experimental/BUILD.bazel @@ -1,4 +1,3 @@ -load("@grpc_python_dependencies//:requirements.bzl", "requirement") package(default_visibility = ["//visibility:public"]) py_library( diff --git a/src/python/grpcio/grpc/framework/common/BUILD.bazel b/src/python/grpcio/grpc/framework/common/BUILD.bazel index 52fbb2b516c..c0d1486d537 100644 --- a/src/python/grpcio/grpc/framework/common/BUILD.bazel +++ b/src/python/grpcio/grpc/framework/common/BUILD.bazel @@ -1,4 +1,3 @@ -load("@grpc_python_dependencies//:requirements.bzl", "requirement") package(default_visibility = ["//visibility:public"]) py_library( @@ -14,7 +13,7 @@ py_library( name = "cardinality", srcs = ["cardinality.py"], deps = select({ - "//conditions:default": [requirement('enum34'),], + "//conditions:default": ["@enum34//:enum34",], "//:python3": [], }), ) @@ -23,7 +22,7 @@ py_library( name = "style", srcs = ["style.py"], deps = select({ - "//conditions:default": [requirement('enum34'),], + "//conditions:default": ["@enum34//:enum34",], "//:python3": [], }), ) diff --git a/src/python/grpcio/grpc/framework/foundation/BUILD.bazel b/src/python/grpcio/grpc/framework/foundation/BUILD.bazel index a447ecded49..b539fa46da7 100644 --- a/src/python/grpcio/grpc/framework/foundation/BUILD.bazel +++ b/src/python/grpcio/grpc/framework/foundation/BUILD.bazel @@ -1,4 +1,3 @@ -load("@grpc_python_dependencies//:requirements.bzl", "requirement") package(default_visibility = ["//visibility:public"]) py_library( @@ -23,9 +22,9 @@ py_library( name = "callable_util", srcs = ["callable_util.py"], deps = [ - requirement("six"), + "//external:six", ] + select({ - "//conditions:default": [requirement('enum34'),], + "//conditions:default": ["@enum34//:enum34",], "//:python3": [], }), ) @@ -34,7 +33,7 @@ py_library( name = "future", srcs = ["future.py"], deps = [ - requirement("six"), + "//external:six", ], ) @@ -42,7 +41,7 @@ py_library( name = "logging_pool", srcs = ["logging_pool.py"], deps = select({ - "//conditions:default": [requirement('futures'),], + "//conditions:default": ["@futures//:futures",], "//:python3": [], }), ) @@ -59,6 +58,6 @@ py_library( name = "stream", srcs = ["stream.py"], deps = [ - requirement("six"), + "//external:six", ], ) diff --git a/src/python/grpcio/grpc/framework/interfaces/base/BUILD.bazel b/src/python/grpcio/grpc/framework/interfaces/base/BUILD.bazel index 35cfe877f34..5d0c06950a8 100644 --- a/src/python/grpcio/grpc/framework/interfaces/base/BUILD.bazel +++ b/src/python/grpcio/grpc/framework/interfaces/base/BUILD.bazel @@ -1,4 +1,3 @@ -load("@grpc_python_dependencies//:requirements.bzl", "requirement") package(default_visibility = ["//visibility:public"]) py_library( @@ -15,9 +14,9 @@ py_library( srcs = ["base.py"], deps = [ "//src/python/grpcio/grpc/framework/foundation:abandonment", - requirement("six"), + "//external:six", ] + select({ - "//conditions:default": [requirement('enum34'),], + "//conditions:default": ["@enum34//:enum34",], "//:python3": [], }), ) @@ -26,7 +25,7 @@ py_library( name = "utilities", srcs = ["utilities.py"], deps = select({ - "//conditions:default": [requirement('enum34'),], + "//conditions:default": ["@enum34//:enum34",], "//:python3": [], }), ) diff --git a/src/python/grpcio/grpc/framework/interfaces/face/BUILD.bazel b/src/python/grpcio/grpc/framework/interfaces/face/BUILD.bazel index 83fadb6372e..3af1404eade 100644 --- a/src/python/grpcio/grpc/framework/interfaces/face/BUILD.bazel +++ b/src/python/grpcio/grpc/framework/interfaces/face/BUILD.bazel @@ -1,4 +1,3 @@ -load("@grpc_python_dependencies//:requirements.bzl", "requirement") package(default_visibility = ["//visibility:public"]) py_library( @@ -16,9 +15,9 @@ py_library( deps = [ "//src/python/grpcio/grpc/framework/foundation", "//src/python/grpcio/grpc/framework/common", - requirement("six"), + "//external:six", ] + select({ - "//conditions:default": [requirement('enum34'),], + "//conditions:default": ["@enum34//:enum34",], "//:python3": [], }), ) diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index aab3768b02e..607235556e3 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -306,16 +306,17 @@ CORE_SOURCE_FILES = [ 'src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc', 'src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc', - 'src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc', - 'src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc', 'src/core/tsi/alts/handshaker/alts_tsi_utils.cc', 'src/core/tsi/alts/handshaker/transport_security_common_api.cc', - 'src/core/tsi/alts/handshaker/altscontext.pb.c', - 'src/core/tsi/alts/handshaker/handshaker.pb.c', - 'src/core/tsi/alts/handshaker/transport_security_common.pb.c', - 'third_party/nanopb/pb_common.c', - 'third_party/nanopb/pb_decode.c', - 'third_party/nanopb/pb_encode.c', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c', + 'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c', + 'third_party/upb/upb/decode.c', + 'third_party/upb/upb/encode.c', + 'third_party/upb/upb/msg.c', + 'third_party/upb/upb/port.c', + 'third_party/upb/upb/table.c', + 'third_party/upb/upb/upb.c', 'src/core/tsi/transport_security.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create.cc', 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc', @@ -348,7 +349,7 @@ CORE_SOURCE_FILES = [ 'src/core/ext/filters/client_channel/subchannel.cc', 'src/core/ext/filters/client_channel/subchannel_pool_interface.cc', 'src/core/ext/filters/deadline/deadline_filter.cc', - 'src/core/ext/filters/client_channel/health/health.pb.c', + 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', 'src/core/tsi/fake_transport_security.cc', 'src/core/tsi/local_transport_security.cc', 'src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc', @@ -367,14 +368,42 @@ CORE_SOURCE_FILES = [ 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc', + 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c', + 'src/core/ext/upb-generated/google/api/annotations.upb.c', + 'src/core/ext/upb-generated/google/api/http.upb.c', + 'src/core/ext/upb-generated/google/protobuf/any.upb.c', + 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', + 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', + 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', + 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', + 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', + 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', + 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c', - 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c', 'src/core/ext/filters/client_channel/lb_policy/xds/xds.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc', + 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c', + 'src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c', + 'src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c', + 'src/core/ext/upb-generated/envoy/type/percent.upb.c', + 'src/core/ext/upb-generated/envoy/type/range.upb.c', + 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', + 'src/core/ext/upb-generated/validate/validate.upb.c', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', @@ -390,6 +419,7 @@ CORE_SOURCE_FILES = [ 'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc', 'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc', 'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc', + 'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc', 'src/core/ext/filters/census/grpc_context.cc', 'src/core/ext/filters/client_idle/client_idle_filter.cc', 'src/core/ext/filters/max_age/max_age_filter.cc', diff --git a/src/python/grpcio/grpc_version.py b/src/python/grpcio/grpc_version.py index 548d2810b5b..e0280abaa7c 100644 --- a/src/python/grpcio/grpc_version.py +++ b/src/python/grpcio/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!! -VERSION = '1.23.0.dev0' +VERSION = '1.24.0.dev0' diff --git a/src/python/grpcio_channelz/grpc_channelz/v1/BUILD.bazel b/src/python/grpcio_channelz/grpc_channelz/v1/BUILD.bazel index eccc166577d..c0a7e3d3026 100644 --- a/src/python/grpcio_channelz/grpc_channelz/v1/BUILD.bazel +++ b/src/python/grpcio_channelz/grpc_channelz/v1/BUILD.bazel @@ -1,17 +1,23 @@ -load("//bazel:python_rules.bzl", "py_proto_library") +load("//bazel:python_rules.bzl", "py_proto_library", "py_grpc_library") package(default_visibility = ["//visibility:public"]) py_proto_library( - name = "py_channelz_proto", - well_known_protos = True, - deps = ["//src/proto/grpc/channelz:channelz_proto_descriptors"], + name = "channelz_py_pb2", + srcs = ["//src/proto/grpc/channelz:channelz_proto_descriptors"], +) + +py_grpc_library( + name = "channelz_py_pb2_grpc", + srcs = ["//src/proto/grpc/channelz:channelz_proto_descriptors"], + deps = [":channelz_py_pb2"], ) py_library( name = "grpc_channelz", srcs = ["channelz.py",], deps = [ - ":py_channelz_proto", + ":channelz_py_pb2", + ":channelz_py_pb2_grpc", "//src/python/grpcio/grpc:grpcio", ], imports=["../../",], diff --git a/src/python/grpcio_channelz/grpc_channelz/v1/channelz.py b/src/python/grpcio_channelz/grpc_channelz/v1/channelz.py index 00eca311dc1..965797f89ec 100644 --- a/src/python/grpcio_channelz/grpc_channelz/v1/channelz.py +++ b/src/python/grpcio_channelz/grpc_channelz/v1/channelz.py @@ -16,8 +16,13 @@ import grpc from grpc._cython import cygrpc -import grpc_channelz.v1.channelz_pb2 as _channelz_pb2 -import grpc_channelz.v1.channelz_pb2_grpc as _channelz_pb2_grpc +# TODO(https://github.com/grpc/grpc/issues/19863): Remove. +try: + from src.python.grpcio_channelz.grpc_channelz.v1 import channelz_pb2 as _channelz_pb2 + from src.python.grpcio_channelz.grpc_channelz.v1 import channelz_pb2_grpc as _channelz_pb2_grpc +except ImportError: + import grpc_channelz.v1.channelz_pb2 as _channelz_pb2 + import grpc_channelz.v1.channelz_pb2_grpc as _channelz_pb2_grpc from google.protobuf import json_format diff --git a/src/python/grpcio_channelz/grpc_version.py b/src/python/grpcio_channelz/grpc_version.py index f7029fff484..93a448ecb64 100644 --- a/src/python/grpcio_channelz/grpc_version.py +++ b/src/python/grpcio_channelz/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/grpc_version.py.template`!!! -VERSION = '1.23.0.dev0' +VERSION = '1.24.0.dev0' diff --git a/src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel b/src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel index 9e4fff34581..0ee176f0506 100644 --- a/src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel +++ b/src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel @@ -1,16 +1,23 @@ -load("//bazel:python_rules.bzl", "py_proto_library") +load("//bazel:python_rules.bzl", "py_proto_library", "py_grpc_library") package(default_visibility = ["//visibility:public"]) py_proto_library( - name = "py_health_proto", - deps = ["//src/proto/grpc/health/v1:health_proto_descriptor",], + name = "health_py_pb2", + srcs = ["//src/proto/grpc/health/v1:health_proto_descriptor",], +) + +py_grpc_library( + name = "health_py_pb2_grpc", + srcs = ["//src/proto/grpc/health/v1:health_proto_descriptor",], + deps = [":health_py_pb2"], ) py_library( name = "grpc_health", srcs = ["health.py",], deps = [ - ":py_health_proto", + ":health_py_pb2", + ":health_py_pb2_grpc", "//src/python/grpcio/grpc:grpcio", ], imports=["../../",], diff --git a/src/python/grpcio_health_checking/grpc_health/v1/health.py b/src/python/grpcio_health_checking/grpc_health/v1/health.py index 15494fafdbc..a0d55570990 100644 --- a/src/python/grpcio_health_checking/grpc_health/v1/health.py +++ b/src/python/grpcio_health_checking/grpc_health/v1/health.py @@ -18,8 +18,13 @@ import threading import grpc -from grpc_health.v1 import health_pb2 as _health_pb2 -from grpc_health.v1 import health_pb2_grpc as _health_pb2_grpc +# TODO(https://github.com/grpc/grpc/issues/19863): Remove. +try: + from src.python.grpcio_health_checking.grpc_health.v1 import health_pb2 as _health_pb2 + from src.python.grpcio_health_checking.grpc_health.v1 import health_pb2_grpc as _health_pb2_grpc +except ImportError: + from grpc_health.v1 import health_pb2 as _health_pb2 + from grpc_health.v1 import health_pb2_grpc as _health_pb2_grpc SERVICE_NAME = _health_pb2.DESCRIPTOR.services_by_name['Health'].full_name diff --git a/src/python/grpcio_health_checking/grpc_version.py b/src/python/grpcio_health_checking/grpc_version.py index d66daa473ed..2a1aa0c9359 100644 --- a/src/python/grpcio_health_checking/grpc_version.py +++ b/src/python/grpcio_health_checking/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!! -VERSION = '1.23.0.dev0' +VERSION = '1.24.0.dev0' diff --git a/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel b/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel index 6aaa4dd3bdd..49bc517caf1 100644 --- a/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel +++ b/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel @@ -1,20 +1,27 @@ -load("//bazel:python_rules.bzl", "py_proto_library") +load("//bazel:python_rules.bzl", "py_proto_library", "py_grpc_library") load("@grpc_python_dependencies//:requirements.bzl", "requirement") package(default_visibility = ["//visibility:public"]) py_proto_library( - name = "py_reflection_proto", - deps = ["//src/proto/grpc/reflection/v1alpha:reflection_proto_descriptor",], + name = "reflection_py_pb2", + srcs = ["//src/proto/grpc/reflection/v1alpha:reflection_proto_descriptor",], +) + +py_grpc_library( + name = "reflection_py_pb2_grpc", + srcs = ["//src/proto/grpc/reflection/v1alpha:reflection_proto_descriptor",], + deps = ["reflection_py_pb2"], ) py_library( name = "grpc_reflection", srcs = ["reflection.py",], deps = [ - ":py_reflection_proto", + ":reflection_py_pb2", + ":reflection_py_pb2_grpc", "//src/python/grpcio/grpc:grpcio", - requirement('protobuf'), + "@com_google_protobuf//:protobuf_python", ], imports=["../../",], ) diff --git a/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py b/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py index 6df1a364269..61153d9d625 100644 --- a/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py +++ b/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py @@ -17,8 +17,15 @@ import grpc from google.protobuf import descriptor_pb2 from google.protobuf import descriptor_pool -from grpc_reflection.v1alpha import reflection_pb2 as _reflection_pb2 -from grpc_reflection.v1alpha import reflection_pb2_grpc as _reflection_pb2_grpc +# TODO(https://github.com/grpc/grpc/issues/19863): Remove. +try: + from src.python.grpcio_reflection.grpc_reflection.v1alpha \ + import reflection_pb2 as _reflection_pb2 + from src.python.grpcio_reflection.grpc_reflection.v1alpha \ + import reflection_pb2_grpc as _reflection_pb2_grpc +except ImportError: + from grpc_reflection.v1alpha import reflection_pb2 as _reflection_pb2 + from grpc_reflection.v1alpha import reflection_pb2_grpc as _reflection_pb2_grpc _POOL = descriptor_pool.Default() SERVICE_NAME = _reflection_pb2.DESCRIPTOR.services_by_name[ diff --git a/src/python/grpcio_reflection/grpc_version.py b/src/python/grpcio_reflection/grpc_version.py index 97213872a91..93c28ba9fac 100644 --- a/src/python/grpcio_reflection/grpc_version.py +++ b/src/python/grpcio_reflection/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!! -VERSION = '1.23.0.dev0' +VERSION = '1.24.0.dev0' diff --git a/src/python/grpcio_status/grpc_status/BUILD.bazel b/src/python/grpcio_status/grpc_status/BUILD.bazel index 223a077c3f2..a7d47c9f34e 100644 --- a/src/python/grpcio_status/grpc_status/BUILD.bazel +++ b/src/python/grpcio_status/grpc_status/BUILD.bazel @@ -7,7 +7,7 @@ py_library( srcs = ["rpc_status.py",], deps = [ "//src/python/grpcio/grpc:grpcio", - requirement('protobuf'), + "@com_google_protobuf//:protobuf_python", requirement('googleapis-common-protos'), ], imports=["../",], diff --git a/src/python/grpcio_status/grpc_version.py b/src/python/grpcio_status/grpc_version.py index 31921b4cc90..a2b5a814b52 100644 --- a/src/python/grpcio_status/grpc_version.py +++ b/src/python/grpcio_status/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_status/grpc_version.py.template`!!! -VERSION = '1.23.0.dev0' +VERSION = '1.24.0.dev0' diff --git a/src/python/grpcio_testing/grpc_version.py b/src/python/grpcio_testing/grpc_version.py index 5c8926cb6c8..937e57da02f 100644 --- a/src/python/grpcio_testing/grpc_version.py +++ b/src/python/grpcio_testing/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_testing/grpc_version.py.template`!!! -VERSION = '1.23.0.dev0' +VERSION = '1.24.0.dev0' diff --git a/src/python/grpcio_tests/commands.py b/src/python/grpcio_tests/commands.py index dc0795d4a12..166cea101a4 100644 --- a/src/python/grpcio_tests/commands.py +++ b/src/python/grpcio_tests/commands.py @@ -145,6 +145,8 @@ class TestGevent(setuptools.Command): 'unit._exit_test.ExitTest.test_in_flight_partial_unary_stream_call', 'unit._exit_test.ExitTest.test_in_flight_partial_stream_unary_call', 'unit._exit_test.ExitTest.test_in_flight_partial_stream_stream_call', + # TODO(https://github.com/grpc/grpc/issues/18980): Reenable. + 'unit._signal_handling_test.SignalHandlingTest', 'unit._metadata_flags_test', 'health_check._health_servicer_test.HealthServicerTest.test_cancelled_watch_removed_from_watch_list', # TODO(https://github.com/grpc/grpc/issues/17330) enable these three tests diff --git a/src/python/grpcio_tests/grpc_version.py b/src/python/grpcio_tests/grpc_version.py index a1fc87448a1..a1e43215b09 100644 --- a/src/python/grpcio_tests/grpc_version.py +++ b/src/python/grpcio_tests/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!! -VERSION = '1.23.0.dev0' +VERSION = '1.24.0.dev0' diff --git a/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py b/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py index 5265911a0be..f2357a4e4a3 100644 --- a/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py +++ b/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py @@ -18,9 +18,16 @@ import unittest from concurrent import futures import grpc -from grpc_channelz.v1 import channelz -from grpc_channelz.v1 import channelz_pb2 -from grpc_channelz.v1 import channelz_pb2_grpc + +# TODO(https://github.com/grpc/grpc/issues/19863): Remove. +try: + from src.python.grpcio_channelz.grpc_channelz.v1 import channelz + from src.python.grpcio_channelz.grpc_channelz.v1 import channelz_pb2 + from src.python.grpcio_channelz.grpc_channelz.v1 import channelz_pb2_grpc +except ImportError: + from grpc_channelz.v1 import channelz + from grpc_channelz.v1 import channelz_pb2 + from grpc_channelz.v1 import channelz_pb2_grpc from tests.unit import test_common from tests.unit.framework.common import test_constants diff --git a/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py b/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py index 7a332b8390f..428806c71b0 100644 --- a/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py +++ b/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py @@ -13,14 +13,22 @@ # limitations under the License. """Tests of grpc_health.v1.health.""" +import logging import threading import time import unittest import grpc -from grpc_health.v1 import health -from grpc_health.v1 import health_pb2 -from grpc_health.v1 import health_pb2_grpc + +# TODO(https://github.com/grpc/grpc/issues/19863): Remove. +try: + from src.python.grpcio_health_checking.grpc_health.v1 import health + from src.python.grpcio_health_checking.grpc_health.v1 import health_pb2 + from src.python.grpcio_health_checking.grpc_health.v1 import health_pb2_grpc +except ImportError: + from grpc_health.v1 import health + from grpc_health.v1 import health_pb2 + from grpc_health.v1 import health_pb2_grpc from tests.unit import test_common from tests.unit import thread_pool @@ -276,4 +284,5 @@ class HealthServicerBackwardsCompatibleWatchTest(BaseWatchTests.WatchTests): if __name__ == '__main__': + logging.basicConfig() unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/interop/BUILD.bazel b/src/python/grpcio_tests/tests/interop/BUILD.bazel index fd636556074..8ac3f7d52d5 100644 --- a/src/python/grpcio_tests/tests/interop/BUILD.bazel +++ b/src/python/grpcio_tests/tests/interop/BUILD.bazel @@ -31,9 +31,10 @@ py_library( deps = [ "//src/python/grpcio/grpc:grpcio", "//src/python/grpcio_tests/tests:bazel_namespace_package_hack", - "//src/proto/grpc/testing:py_empty_proto", + "//src/proto/grpc/testing:empty_py_pb2", "//src/proto/grpc/testing:py_messages_proto", "//src/proto/grpc/testing:py_test_proto", + "//src/proto/grpc/testing:test_py_pb2_grpc", requirement("google-auth"), requirement("requests"), requirement("urllib3"), @@ -59,7 +60,7 @@ py_library( srcs = ["service.py"], imports = ["../../"], deps = [ - "//src/proto/grpc/testing:py_empty_proto", + "//src/proto/grpc/testing:empty_py_pb2", "//src/proto/grpc/testing:py_messages_proto", "//src/proto/grpc/testing:py_test_proto", "//src/python/grpcio/grpc:grpcio", diff --git a/src/python/grpcio_tests/tests/interop/server.py b/src/python/grpcio_tests/tests/interop/server.py index 3611ffdbb2f..aaeee52ed87 100644 --- a/src/python/grpcio_tests/tests/interop/server.py +++ b/src/python/grpcio_tests/tests/interop/server.py @@ -16,7 +16,6 @@ import argparse from concurrent import futures import logging -import time import grpc from src.proto.grpc.testing import test_pb2_grpc @@ -25,7 +24,6 @@ from tests.interop import service from tests.interop import resources from tests.unit import test_common -_ONE_DAY_IN_SECONDS = 60 * 60 * 24 logging.basicConfig() _LOGGER = logging.getLogger(__name__) @@ -55,13 +53,8 @@ def serve(): server.start() _LOGGER.info('Server serving.') - try: - while True: - time.sleep(_ONE_DAY_IN_SECONDS) - except BaseException as e: - _LOGGER.info('Caught exception "%s"; stopping server...', e) - server.stop(None) - _LOGGER.info('Server stopped; exiting.') + server.wait_for_termination() + _LOGGER.info('Server stopped; exiting.') if __name__ == '__main__': diff --git a/src/python/grpcio_tests/tests/reflection/BUILD.bazel b/src/python/grpcio_tests/tests/reflection/BUILD.bazel index b635b721631..e9b56191df8 100644 --- a/src/python/grpcio_tests/tests/reflection/BUILD.bazel +++ b/src/python/grpcio_tests/tests/reflection/BUILD.bazel @@ -12,7 +12,7 @@ py_test( "//src/python/grpcio/grpc:grpcio", "//src/python/grpcio_reflection/grpc_reflection/v1alpha:grpc_reflection", "//src/python/grpcio_tests/tests/unit:test_common", - "//src/proto/grpc/testing:py_empty_proto", + "//src/proto/grpc/testing:empty_py_pb2", "//src/proto/grpc/testing/proto2:empty2_extensions_proto", "//src/proto/grpc/testing/proto2:empty2_proto", requirement('protobuf'), diff --git a/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py b/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py index 29bb292c913..e45f98abec6 100644 --- a/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py +++ b/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py @@ -16,9 +16,16 @@ import unittest import grpc -from grpc_reflection.v1alpha import reflection -from grpc_reflection.v1alpha import reflection_pb2 -from grpc_reflection.v1alpha import reflection_pb2_grpc + +# TODO(https://github.com/grpc/grpc/issues/19863): Remove. +try: + from src.python.grpcio_reflection.grpc_reflection.v1alpha import reflection + from src.python.grpcio_reflection.grpc_reflection.v1alpha import reflection_pb2 + from src.python.grpcio_reflection.grpc_reflection.v1alpha import reflection_pb2_grpc +except ImportError: + from grpc_reflection.v1alpha import reflection + from grpc_reflection.v1alpha import reflection_pb2 + from grpc_reflection.v1alpha import reflection_pb2_grpc from google.protobuf import descriptor_pool from google.protobuf import descriptor_pb2 diff --git a/src/python/grpcio_tests/tests/tests.json b/src/python/grpcio_tests/tests/tests.json index cc08d56248a..ab70943e5ed 100644 --- a/src/python/grpcio_tests/tests/tests.json +++ b/src/python/grpcio_tests/tests/tests.json @@ -66,7 +66,9 @@ "unit._server_ssl_cert_config_test.ServerSSLCertReloadTestWithClientAuth", "unit._server_ssl_cert_config_test.ServerSSLCertReloadTestWithoutClientAuth", "unit._server_test.ServerTest", + "unit._server_wait_for_termination_test.ServerWaitForTerminationTest", "unit._session_cache_test.SSLSessionCacheTest", + "unit._signal_handling_test.SignalHandlingTest", "unit._version_test.VersionTest", "unit.beta._beta_features_test.BetaFeaturesTest", "unit.beta._beta_features_test.ContextManagementAndLifecycleTest", diff --git a/src/python/grpcio_tests/tests/unit/BUILD.bazel b/src/python/grpcio_tests/tests/unit/BUILD.bazel index a161794f8be..aede11e325f 100644 --- a/src/python/grpcio_tests/tests/unit/BUILD.bazel +++ b/src/python/grpcio_tests/tests/unit/BUILD.bazel @@ -1,5 +1,3 @@ -load("@grpc_python_dependencies//:requirements.bzl", "requirement") - package(default_visibility = ["//visibility:public"]) GRPCIO_TESTS_UNIT = [ @@ -16,6 +14,7 @@ GRPCIO_TESTS_UNIT = [ "_credentials_test.py", "_dns_resolver_test.py", "_empty_message_test.py", + "_error_message_encoding_test.py", "_exit_test.py", "_interceptor_test.py", "_invalid_metadata_test.py", @@ -27,10 +26,12 @@ GRPCIO_TESTS_UNIT = [ # "_reconnect_test.py", "_resource_exhausted_test.py", "_rpc_test.py", + "_signal_handling_test.py", # TODO(ghostwriternr): To be added later. # "_server_ssl_cert_config_test.py", "_server_test.py", "_server_shutdown_test.py", + "_server_wait_for_termination_test.py", "_session_cache_test.py", ] @@ -39,6 +40,11 @@ py_library( srcs = ["_tcp_proxy.py"], ) +py_library( + name = "_signal_client", + srcs = ["_signal_client.py"], +) + py_library( name = "resources", srcs = ["resources.py"], @@ -87,9 +93,10 @@ py_library( ":_server_shutdown_scenarios", ":_from_grpc_import_star", ":_tcp_proxy", + ":_signal_client", "//src/python/grpcio_tests/tests/unit/framework/common", "//src/python/grpcio_tests/tests/testing", - requirement('six'), + "//external:six" ], imports=["../../",], data=[ diff --git a/src/python/grpcio_tests/tests/unit/_server_wait_for_termination_test.py b/src/python/grpcio_tests/tests/unit/_server_wait_for_termination_test.py new file mode 100644 index 00000000000..c5c1f6da38e --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/_server_wait_for_termination_test.py @@ -0,0 +1,92 @@ +# Copyright 2019 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from __future__ import division + +import datetime +from concurrent import futures +import unittest +import time +import threading +import six + +import grpc +from tests.unit.framework.common import test_constants + +_WAIT_FOR_BLOCKING = datetime.timedelta(seconds=1) + + +def _block_on_waiting(server, termination_event, timeout=None): + server.start() + server.wait_for_termination(timeout=timeout) + termination_event.set() + + +class ServerWaitForTerminationTest(unittest.TestCase): + + def test_unblock_by_invoking_stop(self): + termination_event = threading.Event() + server = grpc.server(futures.ThreadPoolExecutor()) + + wait_thread = threading.Thread( + target=_block_on_waiting, args=( + server, + termination_event, + )) + wait_thread.daemon = True + wait_thread.start() + time.sleep(_WAIT_FOR_BLOCKING.total_seconds()) + + server.stop(None) + termination_event.wait(timeout=test_constants.SHORT_TIMEOUT) + self.assertTrue(termination_event.is_set()) + + def test_unblock_by_del(self): + termination_event = threading.Event() + server = grpc.server(futures.ThreadPoolExecutor()) + + wait_thread = threading.Thread( + target=_block_on_waiting, args=( + server, + termination_event, + )) + wait_thread.daemon = True + wait_thread.start() + time.sleep(_WAIT_FOR_BLOCKING.total_seconds()) + + # Invoke manually here, in Python 2 it will be invoked by GC sometime. + server.__del__() + termination_event.wait(timeout=test_constants.SHORT_TIMEOUT) + self.assertTrue(termination_event.is_set()) + + def test_unblock_by_timeout(self): + termination_event = threading.Event() + server = grpc.server(futures.ThreadPoolExecutor()) + + wait_thread = threading.Thread( + target=_block_on_waiting, + args=( + server, + termination_event, + test_constants.SHORT_TIMEOUT / 2, + )) + wait_thread.daemon = True + wait_thread.start() + + termination_event.wait(timeout=test_constants.SHORT_TIMEOUT) + self.assertTrue(termination_event.is_set()) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/_signal_client.py b/src/python/grpcio_tests/tests/unit/_signal_client.py new file mode 100644 index 00000000000..075fe7f7177 --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/_signal_client.py @@ -0,0 +1,120 @@ +# Copyright 2019 the gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Client for testing responsiveness to signals.""" + +from __future__ import print_function + +import argparse +import functools +import logging +import signal +import sys + +import grpc + +SIGTERM_MESSAGE = "Handling sigterm!" + +UNARY_UNARY = "/test/Unary" +UNARY_STREAM = "/test/ServerStreaming" + +_MESSAGE = b'\x00\x00\x00' + +_ASSERTION_MESSAGE = "Control flow should never reach here." + +# NOTE(gnossen): We use a global variable here so that the signal handler can be +# installed before the RPC begins. If we do not do this, then we may receive the +# SIGINT before the signal handler is installed. I'm not happy with per-process +# global state, but the per-process global state that is signal handlers +# somewhat forces my hand. +per_process_rpc_future = None + + +def handle_sigint(unused_signum, unused_frame): + print(SIGTERM_MESSAGE) + if per_process_rpc_future is not None: + per_process_rpc_future.cancel() + sys.stderr.flush() + # This sys.exit(0) avoids an exception caused by the cancelled RPC. + sys.exit(0) + + +def main_unary(server_target): + """Initiate a unary RPC to be interrupted by a SIGINT.""" + global per_process_rpc_future # pylint: disable=global-statement + with grpc.insecure_channel(server_target) as channel: + multicallable = channel.unary_unary(UNARY_UNARY) + signal.signal(signal.SIGINT, handle_sigint) + per_process_rpc_future = multicallable.future( + _MESSAGE, wait_for_ready=True) + result = per_process_rpc_future.result() + assert False, _ASSERTION_MESSAGE + + +def main_streaming(server_target): + """Initiate a streaming RPC to be interrupted by a SIGINT.""" + global per_process_rpc_future # pylint: disable=global-statement + with grpc.insecure_channel(server_target) as channel: + signal.signal(signal.SIGINT, handle_sigint) + per_process_rpc_future = channel.unary_stream(UNARY_STREAM)( + _MESSAGE, wait_for_ready=True) + for result in per_process_rpc_future: + pass + assert False, _ASSERTION_MESSAGE + + +def main_unary_with_exception(server_target): + """Initiate a unary RPC with a signal handler that will raise.""" + channel = grpc.insecure_channel(server_target) + try: + channel.unary_unary(UNARY_UNARY)(_MESSAGE, wait_for_ready=True) + except KeyboardInterrupt: + sys.stderr.write("Running signal handler.\n") + sys.stderr.flush() + + # This call should not hang. + channel.close() + + +def main_streaming_with_exception(server_target): + """Initiate a streaming RPC with a signal handler that will raise.""" + channel = grpc.insecure_channel(server_target) + try: + for _ in channel.unary_stream(UNARY_STREAM)( + _MESSAGE, wait_for_ready=True): + pass + except KeyboardInterrupt: + sys.stderr.write("Running signal handler.\n") + sys.stderr.flush() + + # This call should not hang. + channel.close() + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Signal test client.') + parser.add_argument('server', help='Server target') + parser.add_argument('arity', help='Arity', choices=('unary', 'streaming')) + parser.add_argument( + '--exception', + help='Whether the signal throws an exception', + action='store_true') + args = parser.parse_args() + if args.arity == 'unary' and not args.exception: + main_unary(args.server) + elif args.arity == 'streaming' and not args.exception: + main_streaming(args.server) + elif args.arity == 'unary' and args.exception: + main_unary_with_exception(args.server) + else: + main_streaming_with_exception(args.server) diff --git a/src/python/grpcio_tests/tests/unit/_signal_handling_test.py b/src/python/grpcio_tests/tests/unit/_signal_handling_test.py new file mode 100644 index 00000000000..6f81e0b2d34 --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/_signal_handling_test.py @@ -0,0 +1,198 @@ +# Copyright 2019 the gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Test of responsiveness to signals.""" + +import logging +import os +import signal +import subprocess +import tempfile +import threading +import unittest +import sys + +import grpc + +from tests.unit import test_common +from tests.unit import _signal_client + +_CLIENT_PATH = None +if sys.executable is not None: + _CLIENT_PATH = os.path.abspath(os.path.realpath(_signal_client.__file__)) +else: + # NOTE(rbellevi): For compatibility with internal testing. + if len(sys.argv) != 2: + raise RuntimeError("Must supply path to executable client.") + client_name = sys.argv[1].split("/")[-1] + del sys.argv[1] # For compatibility with test runner. + _CLIENT_PATH = os.path.realpath( + os.path.join(os.path.dirname(os.path.abspath(__file__)), client_name)) + +_HOST = 'localhost' + + +class _GenericHandler(grpc.GenericRpcHandler): + + def __init__(self): + self._connected_clients_lock = threading.RLock() + self._connected_clients_event = threading.Event() + self._connected_clients = 0 + + self._unary_unary_handler = grpc.unary_unary_rpc_method_handler( + self._handle_unary_unary) + self._unary_stream_handler = grpc.unary_stream_rpc_method_handler( + self._handle_unary_stream) + + def _on_client_connect(self): + with self._connected_clients_lock: + self._connected_clients += 1 + self._connected_clients_event.set() + + def _on_client_disconnect(self): + with self._connected_clients_lock: + self._connected_clients -= 1 + if self._connected_clients == 0: + self._connected_clients_event.clear() + + def await_connected_client(self): + """Blocks until a client connects to the server.""" + self._connected_clients_event.wait() + + def _handle_unary_unary(self, request, servicer_context): + """Handles a unary RPC. + + Blocks until the client disconnects and then echoes. + """ + stop_event = threading.Event() + + def on_rpc_end(): + self._on_client_disconnect() + stop_event.set() + + servicer_context.add_callback(on_rpc_end) + self._on_client_connect() + stop_event.wait() + return request + + def _handle_unary_stream(self, request, servicer_context): + """Handles a server streaming RPC. + + Blocks until the client disconnects and then echoes. + """ + stop_event = threading.Event() + + def on_rpc_end(): + self._on_client_disconnect() + stop_event.set() + + servicer_context.add_callback(on_rpc_end) + self._on_client_connect() + stop_event.wait() + yield request + + def service(self, handler_call_details): + if handler_call_details.method == _signal_client.UNARY_UNARY: + return self._unary_unary_handler + elif handler_call_details.method == _signal_client.UNARY_STREAM: + return self._unary_stream_handler + else: + return None + + +def _read_stream(stream): + stream.seek(0) + return stream.read() + + +def _start_client(args, stdout, stderr): + invocation = None + if sys.executable is not None: + invocation = (sys.executable, _CLIENT_PATH) + tuple(args) + else: + invocation = (_CLIENT_PATH,) + tuple(args) + return subprocess.Popen(invocation, stdout=stdout, stderr=stderr) + + +class SignalHandlingTest(unittest.TestCase): + + def setUp(self): + self._server = test_common.test_server() + self._port = self._server.add_insecure_port('{}:0'.format(_HOST)) + self._handler = _GenericHandler() + self._server.add_generic_rpc_handlers((self._handler,)) + self._server.start() + + def tearDown(self): + self._server.stop(None) + + @unittest.skipIf(os.name == 'nt', 'SIGINT not supported on windows') + def testUnary(self): + """Tests that the server unary code path does not stall signal handlers.""" + server_target = '{}:{}'.format(_HOST, self._port) + with tempfile.TemporaryFile(mode='r') as client_stdout: + with tempfile.TemporaryFile(mode='r') as client_stderr: + client = _start_client((server_target, 'unary'), client_stdout, + client_stderr) + self._handler.await_connected_client() + client.send_signal(signal.SIGINT) + self.assertFalse(client.wait(), msg=_read_stream(client_stderr)) + client_stdout.seek(0) + self.assertIn(_signal_client.SIGTERM_MESSAGE, + client_stdout.read()) + + @unittest.skipIf(os.name == 'nt', 'SIGINT not supported on windows') + def testStreaming(self): + """Tests that the server streaming code path does not stall signal handlers.""" + server_target = '{}:{}'.format(_HOST, self._port) + with tempfile.TemporaryFile(mode='r') as client_stdout: + with tempfile.TemporaryFile(mode='r') as client_stderr: + client = _start_client((server_target, 'streaming'), + client_stdout, client_stderr) + self._handler.await_connected_client() + client.send_signal(signal.SIGINT) + self.assertFalse(client.wait(), msg=_read_stream(client_stderr)) + client_stdout.seek(0) + self.assertIn(_signal_client.SIGTERM_MESSAGE, + client_stdout.read()) + + @unittest.skipIf(os.name == 'nt', 'SIGINT not supported on windows') + def testUnaryWithException(self): + server_target = '{}:{}'.format(_HOST, self._port) + with tempfile.TemporaryFile(mode='r') as client_stdout: + with tempfile.TemporaryFile(mode='r') as client_stderr: + client = _start_client(('--exception', server_target, 'unary'), + client_stdout, client_stderr) + self._handler.await_connected_client() + client.send_signal(signal.SIGINT) + client.wait() + self.assertEqual(0, client.returncode) + + @unittest.skipIf(os.name == 'nt', 'SIGINT not supported on windows') + def testStreamingHandlerWithException(self): + server_target = '{}:{}'.format(_HOST, self._port) + with tempfile.TemporaryFile(mode='r') as client_stdout: + with tempfile.TemporaryFile(mode='r') as client_stderr: + client = _start_client( + ('--exception', server_target, 'streaming'), client_stdout, + client_stderr) + self._handler.await_connected_client() + client.send_signal(signal.SIGINT) + client.wait() + print(_read_stream(client_stderr)) + self.assertEqual(0, client.returncode) + + +if __name__ == '__main__': + logging.basicConfig() + unittest.main(verbosity=2) diff --git a/src/ruby/end2end/errors_load_before_grpc_lib.rb b/src/ruby/end2end/errors_load_before_grpc_lib.rb new file mode 100755 index 00000000000..56f7714fc7c --- /dev/null +++ b/src/ruby/end2end/errors_load_before_grpc_lib.rb @@ -0,0 +1,51 @@ +#!/usr/bin/env ruby + +# Copyright 2018 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +this_dir = File.expand_path(File.dirname(__FILE__)) +grpc_lib_dir = File.join(File.dirname(this_dir), 'lib') +$LOAD_PATH.unshift(grpc_lib_dir) unless $LOAD_PATH.include?(grpc_lib_dir) + +def check_to_status(error) + my_status = error.to_status + fail('GRPC BadStatus#to_status not expected to return nil') if my_status.nil? + fail('GRPC BadStatus#to_status code expected to be 2') unless my_status.code == 2 + fail('GRPC BadStatus#to_status details expected to be unknown') unless my_status.details == 'unknown' + fail('GRPC BadStatus#to_status metadata expected to be empty hash') unless my_status.metadata == {} + fail('GRPC library loaded after BadStatus#to_status') if GRPC::Core.const_defined?(:Channel) +end + +def check_to_rpc_status(error) + my_rpc_status = error.to_rpc_status + fail('GRPC BadStatus#to_rpc_status expected to return nil') unless my_rpc_status.nil? + fail('GRPC library loaded after BadStatus#to_rpc_status') if GRPC::Core.const_defined?(:Channel) +end + +def main + fail('GRPC constant loaded before expected') if Object.const_defined?(:GRPC) + require 'grpc/errors' + fail('GRPC constant not loaded when expected') unless Object.const_defined?(:GRPC) + fail('GRPC BadStatus not loaded after required') unless GRPC.const_defined?(:BadStatus) + fail('GRPC Core not loaded after required') unless GRPC.const_defined?(:Core) + fail('GRPC StatusCodes not loaded after required') unless GRPC::Core.const_defined?(:StatusCodes) + fail('GRPC library loaded before required') if GRPC::Core.const_defined?(:Channel) + error = GRPC::BadStatus.new 2, 'unknown' + check_to_status(error) + check_to_rpc_status(error) + require 'grpc' + fail('GRPC library not loaded after required') unless GRPC::Core.const_defined?(:Channel) +end + +main diff --git a/src/ruby/end2end/logger_load_before_grpc_lib.rb b/src/ruby/end2end/logger_load_before_grpc_lib.rb new file mode 100755 index 00000000000..76c37875040 --- /dev/null +++ b/src/ruby/end2end/logger_load_before_grpc_lib.rb @@ -0,0 +1,33 @@ +#!/usr/bin/env ruby + +# Copyright 2018 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +this_dir = File.expand_path(File.dirname(__FILE__)) +grpc_lib_dir = File.join(File.dirname(this_dir), 'lib') +$LOAD_PATH.unshift(grpc_lib_dir) unless $LOAD_PATH.include?(grpc_lib_dir) + +def main + fail('GRPC constant loaded before expected') if Object.const_defined?(:GRPC) + require 'grpc/logconfig' + fail('GRPC constant not loaded when expected') unless Object.const_defined?(:GRPC) + fail('GRPC DefaultLogger not loaded after required') unless GRPC.const_defined?(:DefaultLogger) + fail('GRPC logger not included after required') unless GRPC.methods.include?(:logger) + fail('GRPC Core loaded before required') if GRPC.const_defined?(:Core) + require 'grpc' + fail('GRPC Core not loaded after required') unless GRPC.const_defined?(:Core) + fail('GRPC library not loaded after required') unless GRPC::Core.const_defined?(:Channel) +end + +main diff --git a/src/ruby/end2end/status_codes_load_before_grpc_lib.rb b/src/ruby/end2end/status_codes_load_before_grpc_lib.rb new file mode 100755 index 00000000000..010c94cb91b --- /dev/null +++ b/src/ruby/end2end/status_codes_load_before_grpc_lib.rb @@ -0,0 +1,32 @@ +#!/usr/bin/env ruby + +# Copyright 2018 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +this_dir = File.expand_path(File.dirname(__FILE__)) +grpc_lib_dir = File.join(File.dirname(this_dir), 'lib') +$LOAD_PATH.unshift(grpc_lib_dir) unless $LOAD_PATH.include?(grpc_lib_dir) + +def main + fail('GRPC constant loaded before expected') if Object.const_defined?(:GRPC) + require 'grpc/core/status_codes' + fail('GRPC constant not loaded when expected') unless Object.const_defined?(:GRPC) + fail('GRPC Core not loaded after required') unless GRPC.const_defined?(:Core) + fail('GRPC StatusCodes not loaded after required') unless GRPC::Core.const_defined?(:StatusCodes) + fail('GRPC library loaded before required') if GRPC::Core.const_defined?(:Channel) + require 'grpc' + fail('GRPC library not loaded after required') unless GRPC::Core.const_defined?(:Channel) +end + +main diff --git a/src/ruby/ext/grpc/ext-export.clang b/src/ruby/ext/grpc/ext-export.clang new file mode 100644 index 00000000000..d568e8e40e0 --- /dev/null +++ b/src/ruby/ext/grpc/ext-export.clang @@ -0,0 +1 @@ +_Init_grpc_c diff --git a/src/ruby/ext/grpc/ext-export.gcc b/src/ruby/ext/grpc/ext-export.gcc new file mode 100644 index 00000000000..b9c8c560334 --- /dev/null +++ b/src/ruby/ext/grpc/ext-export.gcc @@ -0,0 +1,6 @@ +grpc_1.0 { + global: + Init_grpc_c; + local: + *; +}; \ No newline at end of file diff --git a/src/ruby/ext/grpc/extconf.rb b/src/ruby/ext/grpc/extconf.rb index 9950976eeb1..8cdd03f297e 100644 --- a/src/ruby/ext/grpc/extconf.rb +++ b/src/ruby/ext/grpc/extconf.rb @@ -60,6 +60,11 @@ unless windows end $CFLAGS << ' -I' + File.join(grpc_root, 'include') + +ext_export_file = File.join(grpc_root, 'src', 'ruby', 'ext', 'grpc', 'ext-export') +$LDFLAGS << ' -Wl,--version-script="' + ext_export_file + '.gcc"' if RUBY_PLATFORM =~ /linux/ +$LDFLAGS << ' -Wl,-exported_symbols_list,"' + ext_export_file + '.clang"' if RUBY_PLATFORM =~ /darwin/ + $LDFLAGS << ' ' + File.join(grpc_lib_dir, 'libgrpc.a') unless windows if grpc_config == 'gcov' $CFLAGS << ' -O0 -fprofile-arcs -ftest-coverage' diff --git a/src/ruby/ext/grpc/rb_grpc.c b/src/ruby/ext/grpc/rb_grpc.c index 4aa41217251..77cabfca814 100644 --- a/src/ruby/ext/grpc/rb_grpc.c +++ b/src/ruby/ext/grpc/rb_grpc.c @@ -155,45 +155,6 @@ gpr_timespec grpc_rb_time_timeval(VALUE time, int interval) { return t; } -static void Init_grpc_status_codes() { - /* Constants representing the status codes or grpc_status_code in status.h */ - VALUE grpc_rb_mStatusCodes = - rb_define_module_under(grpc_rb_mGrpcCore, "StatusCodes"); - rb_define_const(grpc_rb_mStatusCodes, "OK", INT2NUM(GRPC_STATUS_OK)); - rb_define_const(grpc_rb_mStatusCodes, "CANCELLED", - INT2NUM(GRPC_STATUS_CANCELLED)); - rb_define_const(grpc_rb_mStatusCodes, "UNKNOWN", - INT2NUM(GRPC_STATUS_UNKNOWN)); - rb_define_const(grpc_rb_mStatusCodes, "INVALID_ARGUMENT", - INT2NUM(GRPC_STATUS_INVALID_ARGUMENT)); - rb_define_const(grpc_rb_mStatusCodes, "DEADLINE_EXCEEDED", - INT2NUM(GRPC_STATUS_DEADLINE_EXCEEDED)); - rb_define_const(grpc_rb_mStatusCodes, "NOT_FOUND", - INT2NUM(GRPC_STATUS_NOT_FOUND)); - rb_define_const(grpc_rb_mStatusCodes, "ALREADY_EXISTS", - INT2NUM(GRPC_STATUS_ALREADY_EXISTS)); - rb_define_const(grpc_rb_mStatusCodes, "PERMISSION_DENIED", - INT2NUM(GRPC_STATUS_PERMISSION_DENIED)); - rb_define_const(grpc_rb_mStatusCodes, "UNAUTHENTICATED", - INT2NUM(GRPC_STATUS_UNAUTHENTICATED)); - rb_define_const(grpc_rb_mStatusCodes, "RESOURCE_EXHAUSTED", - INT2NUM(GRPC_STATUS_RESOURCE_EXHAUSTED)); - rb_define_const(grpc_rb_mStatusCodes, "FAILED_PRECONDITION", - INT2NUM(GRPC_STATUS_FAILED_PRECONDITION)); - rb_define_const(grpc_rb_mStatusCodes, "ABORTED", - INT2NUM(GRPC_STATUS_ABORTED)); - rb_define_const(grpc_rb_mStatusCodes, "OUT_OF_RANGE", - INT2NUM(GRPC_STATUS_OUT_OF_RANGE)); - rb_define_const(grpc_rb_mStatusCodes, "UNIMPLEMENTED", - INT2NUM(GRPC_STATUS_UNIMPLEMENTED)); - rb_define_const(grpc_rb_mStatusCodes, "INTERNAL", - INT2NUM(GRPC_STATUS_INTERNAL)); - rb_define_const(grpc_rb_mStatusCodes, "UNAVAILABLE", - INT2NUM(GRPC_STATUS_UNAVAILABLE)); - rb_define_const(grpc_rb_mStatusCodes, "DATA_LOSS", - INT2NUM(GRPC_STATUS_DATA_LOSS)); -} - /* id_at is the constructor method of the ruby standard Time class. */ static ID id_at; @@ -351,8 +312,7 @@ void Init_grpc_c() { grpc_rb_mGrpcCore = rb_define_module_under(grpc_rb_mGRPC, "Core"); grpc_rb_sNewServerRpc = rb_struct_define( "NewServerRpc", "method", "host", "deadline", "metadata", "call", NULL); - grpc_rb_sStatus = - rb_struct_define("Status", "code", "details", "metadata", NULL); + grpc_rb_sStatus = rb_const_get(rb_cStruct, rb_intern("Status")); sym_code = ID2SYM(rb_intern("code")); sym_details = ID2SYM(rb_intern("details")); sym_metadata = ID2SYM(rb_intern("metadata")); @@ -363,7 +323,6 @@ void Init_grpc_c() { Init_grpc_channel_credentials(); Init_grpc_server(); Init_grpc_server_credentials(); - Init_grpc_status_codes(); Init_grpc_time_consts(); Init_grpc_compression_options(); } diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.c b/src/ruby/ext/grpc/rb_grpc_imports.generated.c index fa275c75419..6cb10c9126c 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.c +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.c @@ -164,6 +164,8 @@ grpc_tls_credentials_options_set_credential_reload_config_type grpc_tls_credenti grpc_tls_credentials_options_set_server_authorization_check_config_type grpc_tls_credentials_options_set_server_authorization_check_config_import; grpc_tls_key_materials_config_create_type grpc_tls_key_materials_config_create_import; grpc_tls_key_materials_config_set_key_materials_type grpc_tls_key_materials_config_set_key_materials_import; +grpc_tls_key_materials_config_set_version_type grpc_tls_key_materials_config_set_version_import; +grpc_tls_key_materials_config_get_version_type grpc_tls_key_materials_config_get_version_import; grpc_tls_credential_reload_config_create_type grpc_tls_credential_reload_config_create_import; grpc_tls_server_authorization_check_config_create_type grpc_tls_server_authorization_check_config_create_import; grpc_raw_byte_buffer_create_type grpc_raw_byte_buffer_create_import; @@ -435,6 +437,8 @@ void grpc_rb_load_imports(HMODULE library) { grpc_tls_credentials_options_set_server_authorization_check_config_import = (grpc_tls_credentials_options_set_server_authorization_check_config_type) GetProcAddress(library, "grpc_tls_credentials_options_set_server_authorization_check_config"); grpc_tls_key_materials_config_create_import = (grpc_tls_key_materials_config_create_type) GetProcAddress(library, "grpc_tls_key_materials_config_create"); grpc_tls_key_materials_config_set_key_materials_import = (grpc_tls_key_materials_config_set_key_materials_type) GetProcAddress(library, "grpc_tls_key_materials_config_set_key_materials"); + grpc_tls_key_materials_config_set_version_import = (grpc_tls_key_materials_config_set_version_type) GetProcAddress(library, "grpc_tls_key_materials_config_set_version"); + grpc_tls_key_materials_config_get_version_import = (grpc_tls_key_materials_config_get_version_type) GetProcAddress(library, "grpc_tls_key_materials_config_get_version"); grpc_tls_credential_reload_config_create_import = (grpc_tls_credential_reload_config_create_type) GetProcAddress(library, "grpc_tls_credential_reload_config_create"); grpc_tls_server_authorization_check_config_create_import = (grpc_tls_server_authorization_check_config_create_type) GetProcAddress(library, "grpc_tls_server_authorization_check_config_create"); grpc_raw_byte_buffer_create_import = (grpc_raw_byte_buffer_create_type) GetProcAddress(library, "grpc_raw_byte_buffer_create"); diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h index 1389c301728..46912af5f5a 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h @@ -467,6 +467,12 @@ extern grpc_tls_key_materials_config_create_type grpc_tls_key_materials_config_c typedef int(*grpc_tls_key_materials_config_set_key_materials_type)(grpc_tls_key_materials_config* config, const char* pem_root_certs, const grpc_ssl_pem_key_cert_pair** pem_key_cert_pairs, size_t num_key_cert_pairs); extern grpc_tls_key_materials_config_set_key_materials_type grpc_tls_key_materials_config_set_key_materials_import; #define grpc_tls_key_materials_config_set_key_materials grpc_tls_key_materials_config_set_key_materials_import +typedef int(*grpc_tls_key_materials_config_set_version_type)(grpc_tls_key_materials_config* config, int version); +extern grpc_tls_key_materials_config_set_version_type grpc_tls_key_materials_config_set_version_import; +#define grpc_tls_key_materials_config_set_version grpc_tls_key_materials_config_set_version_import +typedef int(*grpc_tls_key_materials_config_get_version_type)(grpc_tls_key_materials_config* config); +extern grpc_tls_key_materials_config_get_version_type grpc_tls_key_materials_config_get_version_import; +#define grpc_tls_key_materials_config_get_version grpc_tls_key_materials_config_get_version_import typedef grpc_tls_credential_reload_config*(*grpc_tls_credential_reload_config_create_type)(const void* config_user_data, int (*schedule)(void* config_user_data, grpc_tls_credential_reload_arg* arg), void (*cancel)(void* config_user_data, grpc_tls_credential_reload_arg* arg), void (*destruct)(void* config_user_data)); extern grpc_tls_credential_reload_config_create_type grpc_tls_credential_reload_config_create_import; #define grpc_tls_credential_reload_config_create grpc_tls_credential_reload_config_create_import diff --git a/src/ruby/lib/grpc.rb b/src/ruby/lib/grpc.rb index 37b03920727..e0e1c9cd9b6 100644 --- a/src/ruby/lib/grpc.rb +++ b/src/ruby/lib/grpc.rb @@ -15,10 +15,12 @@ ssl_roots_path = File.expand_path('../../../../etc/roots.pem', __FILE__) require_relative 'grpc/errors' +require_relative 'grpc/structs' require_relative 'grpc/grpc' require_relative 'grpc/logconfig' require_relative 'grpc/notifier' require_relative 'grpc/version' +require_relative 'grpc/core/status_codes' require_relative 'grpc/core/time_consts' require_relative 'grpc/generic/active_call' require_relative 'grpc/generic/client_stub' diff --git a/src/ruby/lib/grpc/core/status_codes.rb b/src/ruby/lib/grpc/core/status_codes.rb new file mode 100644 index 00000000000..e7e7a0b1e4a --- /dev/null +++ b/src/ruby/lib/grpc/core/status_codes.rb @@ -0,0 +1,135 @@ +# Copyright 2015 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# GRPC contains the General RPC module. +module GRPC + module Core + # StatusCodes defines the canonical error codes used by gRPC for the RPC + # API. + module StatusCodes + # OK is returned on success. + OK = 0 + + # Canceled indicates the operation was canceled (typically by the caller). + CANCELLED = 1 + + # Unknown error. An example of where this error may be returned is if a + # Status value received from another address space belongs to an + # error-space that is not known in this address space. Also errors raised + # by APIs that do not return enough error information may be converted to + # this error. + UNKNOWN = 2 + + # InvalidArgument indicates client specified an invalid argument. Note + # that this differs from FailedPrecondition. It indicates arguments that + # are problematic regardless of the state of the system (e.g., a malformed + # file name). + INVALID_ARGUMENT = 3 + + # DeadlineExceeded means operation expired before completion. For + # operations that change the state of the system, this error may be + # returned even if the operation has completed successfully. For example, + # a successful response from a server could have been delayed long enough + # for the deadline to expire. + DEADLINE_EXCEEDED = 4 + + # NotFound means some requested entity (e.g., file or directory) was not + # found. + NOT_FOUND = 5 + + # AlreadyExists means an attempt to create an entity failed because one + # already exists. + ALREADY_EXISTS = 6 + + # PermissionDenied indicates the caller does not have permission to + # execute the specified operation. It must not be used for rejections + # caused by exhausting some resource (use ResourceExhausted instead for + # those errors). It must not be used if the caller cannot be identified + # (use Unauthenticated instead for those errors). + PERMISSION_DENIED = 7 + + # ResourceExhausted indicates some resource has been exhausted, perhaps a + # per-user quota, or perhaps the entire file system is out of space. + RESOURCE_EXHAUSTED = 8 + + # FailedPrecondition indicates operation was rejected because the system + # is not in a state required for the operation's execution. For example, + # directory to be deleted may be non-empty, an rmdir operation is applied + # to a non-directory, etc. + # + # A litmus test that may help a service implementor in deciding between + # FailedPrecondition, Aborted, and Unavailable: + # (a) Use Unavailable if the client can retry just the failing call. + # (b) Use Aborted if the client should retry at a higher-level (e.g., + # restarting a read-modify-write sequence). + # (c) Use FailedPrecondition if the client should not retry until the + # system state has been explicitly fixed. E.g., if an "rmdir" fails + # because the directory is non-empty, FailedPrecondition should be + # returned since the client should not retry unless they have first + # fixed up the directory by deleting files from it. + # (d) Use FailedPrecondition if the client performs conditional REST + # Get/Update/Delete on a resource and the resource on the server does + # not match the condition. E.g., conflicting read-modify-write on the + # same resource. + FAILED_PRECONDITION = 9 + + # Aborted indicates the operation was aborted, typically due to a + # concurrency issue like sequencer check failures, transaction aborts, + # etc. + # + # See litmus test above for deciding between FailedPrecondition, Aborted, + # and Unavailable. + ABORTED = 10 + + # OutOfRange means operation was attempted past the valid range. E.g., + # seeking or reading past end of file. + # + # Unlike InvalidArgument, this error indicates a problem that may be fixed + # if the system state changes. For example, a 32-bit file system will + # generate InvalidArgument if asked to read at an offset that is not in + # the range [0,2^32-1], but it will generate OutOfRange if asked to read + # from an offset past the current file size. + # + # There is a fair bit of overlap between FailedPrecondition and + # OutOfRange. We recommend using OutOfRange (the more specific error) when + # it applies so that callers who are iterating through a space can easily + # look for an OutOfRange error to detect when they are done. + OUT_OF_RANGE = 11 + + # Unimplemented indicates operation is not implemented or not + # supported/enabled in this service. + UNIMPLEMENTED = 12 + + # Internal errors. Means some invariants expected by underlying system has + # been broken. If you see one of these errors, something is very broken. + INTERNAL = 13 + + # Unavailable indicates the service is currently unavailable. This is a + # most likely a transient condition and may be corrected by retrying with + # a backoff. Note that it is not always safe to retry non-idempotent + # operations. + # + # See litmus test above for deciding between FailedPrecondition, Aborted, + # and Unavailable. + UNAVAILABLE = 14 + + # DataLoss indicates unrecoverable data loss or corruption. + DATA_LOSS = 15 + + # Unauthenticated indicates the request does not have valid authentication + # credentials for the operation. + UNAUTHENTICATED = 16 + end + end +end diff --git a/src/ruby/lib/grpc/errors.rb b/src/ruby/lib/grpc/errors.rb index 0b27bee1b9c..7a300eb2daa 100644 --- a/src/ruby/lib/grpc/errors.rb +++ b/src/ruby/lib/grpc/errors.rb @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -require_relative './grpc' +require_relative './structs' +require_relative './core/status_codes' +require_relative './google_rpc_status_utils' # GRPC contains the General RPC module. module GRPC @@ -57,12 +59,7 @@ module GRPC # # @return [Google::Rpc::Status, nil] def to_rpc_status - # Lazily require google_rpc_status_utils to scope - # loading protobuf_c.so to the users of this method. - require_relative './google_rpc_status_utils' - status = to_status - return if status.nil? - GoogleRpcStatusUtils.extract_google_rpc_status(status) + GoogleRpcStatusUtils.extract_google_rpc_status(to_status) rescue Google::Protobuf::ParseError => parse_error GRPC.logger.warn('parse error: to_rpc_status failed') GRPC.logger.warn(parse_error) diff --git a/src/ruby/lib/grpc/google_rpc_status_utils.rb b/src/ruby/lib/grpc/google_rpc_status_utils.rb index f253b082b63..adf6cf615c7 100644 --- a/src/ruby/lib/grpc/google_rpc_status_utils.rb +++ b/src/ruby/lib/grpc/google_rpc_status_utils.rb @@ -12,8 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -require_relative './grpc' -require 'google/rpc/status_pb' +require_relative './structs' # GRPC contains the General RPC module. module GRPC @@ -28,8 +27,14 @@ module GRPC def self.extract_google_rpc_status(status) fail ArgumentError, 'bad type' unless status.is_a? Struct::Status grpc_status_details_bin_trailer = 'grpc-status-details-bin' - return nil if status.metadata[grpc_status_details_bin_trailer].nil? - Google::Rpc::Status.decode(status.metadata[grpc_status_details_bin_trailer]) + binstatus = status.metadata[grpc_status_details_bin_trailer] + return nil if binstatus.nil? + + # Lazily load grpc_c and protobuf_c.so for users of this method. + require_relative './grpc' + require 'google/rpc/status_pb' + + Google::Rpc::Status.decode(binstatus) end end end diff --git a/src/ruby/lib/grpc/structs.rb b/src/ruby/lib/grpc/structs.rb new file mode 100644 index 00000000000..e57f1b69619 --- /dev/null +++ b/src/ruby/lib/grpc/structs.rb @@ -0,0 +1,15 @@ +# Copyright 2015 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +Struct.new('Status', :code, :details, :metadata) diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb index 051bc067e55..43f08a0c87b 100644 --- a/src/ruby/lib/grpc/version.rb +++ b/src/ruby/lib/grpc/version.rb @@ -14,5 +14,5 @@ # GRPC contains the General RPC module. module GRPC - VERSION = '1.23.0.dev' + VERSION = '1.24.0.dev' end diff --git a/src/ruby/spec/errors_spec.rb b/src/ruby/spec/errors_spec.rb index bf27a537405..6fb22b15356 100644 --- a/src/ruby/spec/errors_spec.rb +++ b/src/ruby/spec/errors_spec.rb @@ -14,6 +14,7 @@ require 'spec_helper' require 'google/protobuf/well_known_types' +require 'google/rpc/status_pb' require_relative '../pb/src/proto/grpc/testing/messages_pb' describe GRPC::BadStatus do diff --git a/src/ruby/spec/pb/codegen/grpc/testing/package_options_import.proto b/src/ruby/spec/pb/codegen/grpc/testing/package_options_import.proto new file mode 100644 index 00000000000..2205d21b83e --- /dev/null +++ b/src/ruby/spec/pb/codegen/grpc/testing/package_options_import.proto @@ -0,0 +1,22 @@ +// Copyright 2019 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package grpc.testing; + +// For sanity checking package definitions +option ruby_package = "A::Other"; + +message Thing { } diff --git a/src/ruby/spec/pb/codegen/grpc/testing/package_options_ruby_style.proto b/src/ruby/spec/pb/codegen/grpc/testing/package_options_ruby_style.proto new file mode 100644 index 00000000000..4bfe61e2f63 --- /dev/null +++ b/src/ruby/spec/pb/codegen/grpc/testing/package_options_ruby_style.proto @@ -0,0 +1,34 @@ +// Copyright 2019 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package grpc.testing; + +import "grpc/testing/package_options_import.proto"; + +// For sanity checking package definitions +option ruby_package = "RPC::Test::New::Package::Options"; + +message AnotherTestRequest { } + +message AnotherTestResponse { } + +message Foo { } + +service AnotherTestService { + rpc GetTest(AnotherTestRequest) returns (AnotherTestResponse) { } + rpc OtherTest(Thing) returns (Thing) { } + rpc FooTest(Foo) returns (Foo) { } +} diff --git a/src/ruby/spec/pb/codegen/package_option_spec.rb b/src/ruby/spec/pb/codegen/package_option_spec.rb index 0ebd503d79d..870f53ef297 100644 --- a/src/ruby/spec/pb/codegen/package_option_spec.rb +++ b/src/ruby/spec/pb/codegen/package_option_spec.rb @@ -18,35 +18,59 @@ require 'tmpdir' describe 'Code Generation Options' do it 'should generate and respect package options' do - fail 'CONFIG env variable unexpectedly unset' unless ENV['CONFIG'] - bins_sub_dir = ENV['CONFIG'] - - pb_dir = File.dirname(__FILE__) - bins_dir = File.join('..', '..', '..', '..', '..', 'bins', bins_sub_dir) - - plugin = File.join(bins_dir, 'grpc_ruby_plugin') - protoc = File.join(bins_dir, 'protobuf', 'protoc') - - # Generate the service from the proto - Dir.mktmpdir(nil, File.dirname(__FILE__)) do |tmp_dir| - gen_file = system(protoc, - '-I.', - 'grpc/testing/package_options.proto', - "--grpc_out=#{tmp_dir}", # generate the service - "--ruby_out=#{tmp_dir}", # generate the definitions - "--plugin=protoc-gen-grpc=#{plugin}", - chdir: pb_dir, - out: File::NULL) - - expect(gen_file).to be_truthy - begin - $LOAD_PATH.push(tmp_dir) - expect { Grpc::Testing::Package::Options::TestService::Service }.to raise_error(NameError) - expect(require('grpc/testing/package_options_services_pb')).to be_truthy - expect { Grpc::Testing::Package::Options::TestService::Service }.to_not raise_error - ensure - $LOAD_PATH.delete(tmp_dir) - end + with_protos(%w[grpc/testing/package_options.proto]) do + expect { Grpc::Testing::Package::Options::TestService::Service }.to raise_error(NameError) + expect(require('grpc/testing/package_options_services_pb')).to be_truthy + expect { Grpc::Testing::Package::Options::TestService::Service }.to_not raise_error + expect { Grpc::Testing::TestService::Service }.to raise_error(NameError) + end + end + + it 'should generate and respect Ruby style package options' do + with_protos(%w[grpc/testing/package_options_ruby_style.proto grpc/testing/package_options_import.proto]) do + expect { RPC::Test::New::Package::Options::AnotherTestService::Service }.to raise_error(NameError) + expect(require('grpc/testing/package_options_ruby_style_services_pb')).to be_truthy + expect { RPC::Test::New::Package::Options::AnotherTestService::Service }.to_not raise_error + expect { Grpc::Testing::AnotherTestService::Service }.to raise_error(NameError) + + services = RPC::Test::New::Package::Options::AnotherTestService::Service.rpc_descs + expect(services[:GetTest].input).to eq(RPC::Test::New::Package::Options::AnotherTestRequest) + expect(services[:GetTest].output).to eq(RPC::Test::New::Package::Options::AnotherTestResponse) + expect(services[:OtherTest].input).to eq(A::Other::Thing) + expect(services[:OtherTest].output).to eq(A::Other::Thing) + expect(services[:FooTest].input).to eq(RPC::Test::New::Package::Options::Foo) + expect(services[:FooTest].output).to eq(RPC::Test::New::Package::Options::Foo) + end + end +end + +def with_protos(file_paths) + fail 'CONFIG env variable unexpectedly unset' unless ENV['CONFIG'] + bins_sub_dir = ENV['CONFIG'] + + pb_dir = File.dirname(__FILE__) + bins_dir = File.join('..', '..', '..', '..', '..', 'bins', bins_sub_dir) + + plugin = File.join(bins_dir, 'grpc_ruby_plugin') + protoc = File.join(bins_dir, 'protobuf', 'protoc') + + # Generate the service from the proto + Dir.mktmpdir(nil, File.dirname(__FILE__)) do |tmp_dir| + gen_file = system(protoc, + '-I.', + *file_paths, + "--grpc_out=#{tmp_dir}", # generate the service + "--ruby_out=#{tmp_dir}", # generate the definitions + "--plugin=protoc-gen-grpc=#{plugin}", + chdir: pb_dir, + out: File::NULL) + + expect(gen_file).to be_truthy + begin + $LOAD_PATH.push(tmp_dir) + yield + ensure + $LOAD_PATH.delete(tmp_dir) end end end diff --git a/src/ruby/tools/version.rb b/src/ruby/tools/version.rb index e66a4a799fd..b08edb08478 100644 --- a/src/ruby/tools/version.rb +++ b/src/ruby/tools/version.rb @@ -14,6 +14,6 @@ module GRPC module Tools - VERSION = '1.23.0.dev' + VERSION = '1.24.0.dev' end end diff --git a/src/upb/gen_build_yaml.py b/src/upb/gen_build_yaml.py index 181d026fbd2..ba11ebd846c 100755 --- a/src/upb/gen_build_yaml.py +++ b/src/upb/gen_build_yaml.py @@ -21,43 +21,35 @@ import os import sys import yaml -srcs = [ - "third_party/upb/generated_for_cmake/google/protobuf/descriptor.upb.c", - "third_party/upb/upb/decode.c", - "third_party/upb/upb/def.c", - "third_party/upb/upb/encode.c", - "third_party/upb/upb/handlers.c", - "third_party/upb/upb/msg.c", - "third_party/upb/upb/msgfactory.c", - "third_party/upb/upb/sink.c", - "third_party/upb/upb/table.c", - "third_party/upb/upb/upb.c", -] - hdrs = [ - "third_party/upb/generated_for_cmake/google/protobuf/descriptor.upb.h", "third_party/upb/upb/decode.h", - "third_party/upb/upb/def.h", "third_party/upb/upb/encode.h", - "third_party/upb/upb/handlers.h", + "third_party/upb/upb/generated_util.h", "third_party/upb/upb/msg.h", - "third_party/upb/upb/msgfactory.h", - "third_party/upb/upb/sink.h", + "third_party/upb/upb/port_def.inc", + "third_party/upb/upb/port_undef.inc", + "third_party/upb/upb/table.int.h", "third_party/upb/upb/upb.h", ] -os.chdir(os.path.dirname(sys.argv[0])+'/../..') +srcs = [ + "third_party/upb/upb/decode.c", + "third_party/upb/upb/encode.c", + "third_party/upb/upb/msg.c", + "third_party/upb/upb/port.c", + "third_party/upb/upb/table.c", + "third_party/upb/upb/upb.c", +] out = {} try: - out['libs'] = [{ + out['filegroups'] = [{ 'name': 'upb', - 'defaults': 'upb', - 'build': 'private', - 'language': 'c', - 'secure': 'no', 'src': srcs, + 'uses': [ 'upb_headers' ], + }, { + 'name': 'upb_headers', 'headers': hdrs, }] except: diff --git a/src/zlib/gen_build_yaml.py b/src/zlib/gen_build_yaml.py index d0912b9cb62..ee347e0b1f3 100755 --- a/src/zlib/gen_build_yaml.py +++ b/src/zlib/gen_build_yaml.py @@ -42,7 +42,7 @@ try: 'defaults': 'zlib', 'build': 'private', 'language': 'c', - 'secure': 'no', + 'secure': False, 'src': sorted(cmvar('ZLIB_SRCS')), 'headers': sorted(cmvar('ZLIB_PUBLIC_HDRS') + cmvar('ZLIB_PRIVATE_HDRS')), }] diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index 87088abfc53..8d01540453c 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -186,14 +186,15 @@ set(_gRPC_CORE_NOSTDCXX_FLAGS "") endif() - include(cmake/zlib.cmake) + include(cmake/address_sorting.cmake) + include(cmake/benchmark.cmake) include(cmake/cares.cmake) - include(cmake/protobuf.cmake) - include(cmake/ssl.cmake) include(cmake/gflags.cmake) - include(cmake/benchmark.cmake) - include(cmake/address_sorting.cmake) include(cmake/nanopb.cmake) + include(cmake/protobuf.cmake) + include(cmake/ssl.cmake) + include(cmake/upb.cmake) + include(cmake/zlib.cmake) if(NOT MSVC) set(CMAKE_C_FLAGS "<%text>${CMAKE_C_FLAGS} -std=c99") @@ -426,14 +427,17 @@ target_include_directories(${lib.name} PUBLIC <%text>$ $ PRIVATE <%text>${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE <%text>${_gRPC_SSL_INCLUDE_DIR} - PRIVATE <%text>${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE <%text>${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE <%text>${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE <%text>${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE <%text>${_gRPC_CARES_INCLUDE_DIR} PRIVATE <%text>${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE <%text>${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE <%text>${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE <%text>${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE <%text>${_gRPC_SSL_INCLUDE_DIR} + PRIVATE <%text>${_gRPC_UPB_GENERATED_DIR} + PRIVATE <%text>${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE <%text>${_gRPC_UPB_INCLUDE_DIR} + PRIVATE <%text>${_gRPC_ZLIB_INCLUDE_DIR} % if lib.build in ['test', 'private'] and lib.language == 'c++': PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest @@ -522,14 +526,17 @@ target_include_directories(${tgt.name} PRIVATE <%text>${CMAKE_CURRENT_SOURCE_DIR} PRIVATE <%text>${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE <%text>${_gRPC_SSL_INCLUDE_DIR} - PRIVATE <%text>${_gRPC_PROTOBUF_INCLUDE_DIR} - PRIVATE <%text>${_gRPC_ZLIB_INCLUDE_DIR} + PRIVATE <%text>${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE <%text>${_gRPC_BENCHMARK_INCLUDE_DIR} PRIVATE <%text>${_gRPC_CARES_INCLUDE_DIR} PRIVATE <%text>${_gRPC_GFLAGS_INCLUDE_DIR} - PRIVATE <%text>${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} PRIVATE <%text>${_gRPC_NANOPB_INCLUDE_DIR} + PRIVATE <%text>${_gRPC_PROTOBUF_INCLUDE_DIR} + PRIVATE <%text>${_gRPC_SSL_INCLUDE_DIR} + PRIVATE <%text>${_gRPC_UPB_GENERATED_DIR} + PRIVATE <%text>${_gRPC_UPB_GRPC_GENERATED_DIR} + PRIVATE <%text>${_gRPC_UPB_INCLUDE_DIR} + PRIVATE <%text>${_gRPC_ZLIB_INCLUDE_DIR} % if tgt.build in ['test', 'private'] and tgt.language == 'c++': PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest diff --git a/templates/Makefile.template b/templates/Makefile.template index a46a27061ab..c7f8a05739e 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -36,7 +36,7 @@ sources_that_don_t_need_openssl = set() # warnings we'd like, but that dont exist in all compilers - PREFERRED_WARNINGS=['shadow', 'extra-semi'] + PREFERRED_WARNINGS=['extra-semi'] CHECK_WARNINGS=PREFERRED_WARNINGS + ['no-shift-negative-value', 'no-unused-but-set-variable', 'no-maybe-uninitialized'] def warning_var(fmt, warning): @@ -216,7 +216,7 @@ HOST_LD ?= $(LD) HOST_LDXX ?= $(LDXX) - CFLAGS += -std=c99 -Wsign-conversion -Wconversion ${' '.join(warning_var('$(W_%s)', warning) for warning in PREFERRED_WARNINGS)} + CFLAGS += -std=c99 ${' '.join(warning_var('$(W_%s)', warning) for warning in PREFERRED_WARNINGS)} CXXFLAGS += -std=c++11 ifeq ($(SYSTEM),Darwin) CXXFLAGS += -stdlib=libc++ @@ -240,7 +240,7 @@ LDFLAGS += -fPIC endif - INCLUDES = . include $(GENDIR) third_party/upb third_party/upb/generated_for_cmake + INCLUDES = . include $(GENDIR) LDFLAGS += -Llibs/$(CONFIG) ifeq ($(SYSTEM),Darwin) diff --git a/templates/config.m4.template b/templates/config.m4.template index 18378cfc34d..677c7ddf63a 100644 --- a/templates/config.m4.template +++ b/templates/config.m4.template @@ -8,10 +8,12 @@ dnl # --with-grpc -> add include path PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/include) + PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/src/core/ext/upb-generated) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/src/php/ext/grpc) - PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/boringssl/include) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/address_sorting/include) + PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/boringssl/include) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/nanopb) + PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/upb) LIBS="-lpthread $LIBS" diff --git a/templates/config.w32.template b/templates/config.w32.template index 5e37cf568c2..70920f3527d 100644 --- a/templates/config.w32.template +++ b/templates/config.w32.template @@ -26,11 +26,13 @@ "/DPB_FIELD_32BIT "+ "/I"+configure_module_dirname+" "+ "/I"+configure_module_dirname+"\\include "+ + "/I"+configure_module_dirname+"\\src\\core\\ext\\upb-generated "+ "/I"+configure_module_dirname+"\\src\\php\\ext\\grpc "+ - "/I"+configure_module_dirname+"\\third_party\\boringssl\\include "+ - "/I"+configure_module_dirname+"\\third_party\\zlib "+ "/I"+configure_module_dirname+"\\third_party\\address_sorting\\include "+ - "/I"+configure_module_dirname+"\\third_party\\nanopb"); + "/I"+configure_module_dirname+"\\third_party\\boringssl\\include "+ + "/I"+configure_module_dirname+"\\third_party\\nanopb "+ + "/I"+configure_module_dirname+"\\third_party\\upb "+ + "/I"+configure_module_dirname+"\\third_party\\zlib "); <% dirs = {} for lib in libs: diff --git a/templates/gRPC-C++.podspec.template b/templates/gRPC-C++.podspec.template index 9ecdf80143e..6ee6798f95e 100644 --- a/templates/gRPC-C++.podspec.template +++ b/templates/gRPC-C++.podspec.template @@ -223,9 +223,11 @@ end s.prepare_command = <<-END_OF_COMMAND - find src/cpp/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include ;g' - find src/cpp/ -type f -path '*.grpc_back' -print0 | xargs -0 rm - find src/core/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include ;g' - find src/core/ -type f -path '*.grpc_back' -print0 | xargs -0 rm + sed -E -i '' 's;#include "(pb(_.*)?\\.h)";#if COCOAPODS==1\\\n #include \\\n#else\\\n #include "\\1"\\\n#endif;g' $(find src/core -type f -print | xargs grep -H -c '#include \\\n#else\\\n #include "\\1"\\\n#endif;g' $(find src/cpp -type f -print | xargs grep -H -c '#include \\\n#else\\\n #include "\\1"\\\n#endif;g' $(find src/core -type f -print | xargs grep -H -c '#include ;#if COCOAPODS==1\\\n #include \\\n#else\\\n #include \\\n#endif;g' $(find src/core -type f \\( -path '*.h' -or -path '*.cc' \\) -print | xargs grep -H -c '#include /// Current AssemblyVersion attribute of gRPC C# assemblies /// - public const string CurrentAssemblyVersion = "1.0.0.0"; + public const string CurrentAssemblyVersion = "${settings.csharp_version.major}.0.0.0"; /// /// Current AssemblyFileVersion of gRPC C# assemblies /// - public const string CurrentAssemblyFileVersion = "${settings.version.major}.${settings.version.minor}.${settings.version.patch}.0"; + public const string CurrentAssemblyFileVersion = "${settings.csharp_version.major}.${settings.csharp_version.minor}.${settings.csharp_version.patch}.0"; /// /// Current version of gRPC C# diff --git a/templates/src/csharp/build_unitypackage.bat.template b/templates/src/csharp/build_unitypackage.bat.template index 07f19c2af3e..2dbb22a0d17 100755 --- a/templates/src/csharp/build_unitypackage.bat.template +++ b/templates/src/csharp/build_unitypackage.bat.template @@ -66,7 +66,6 @@ @rem add gRPC dependencies @rem TODO(jtattermusch): also include XMLdoc - copy /Y Grpc.Core\bin\Release\net45\System.Interactive.Async.dll unitypackage\unitypackage_skeleton\Plugins\System.Interactive.Async\lib\net45\System.Interactive.Async.dll || goto :error copy /Y Grpc.Core\bin\Release\net45\System.Runtime.CompilerServices.Unsafe.dll unitypackage\unitypackage_skeleton\Plugins\System.Runtime.CompilerServices.Unsafe\lib\net45\System.Runtime.CompilerServices.Unsafe.dll || goto :error copy /Y Grpc.Core\bin\Release\net45\System.Buffers.dll unitypackage\unitypackage_skeleton\Plugins\System.Buffers\lib\net45\System.Buffers.dll || goto :error copy /Y Grpc.Core\bin\Release\net45\System.Memory.dll unitypackage\unitypackage_skeleton\Plugins\System.Memory\lib\net45\System.Memory.dll || goto :error diff --git a/templates/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec.template b/templates/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec.template new file mode 100644 index 00000000000..072a59657da --- /dev/null +++ b/templates/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec.template @@ -0,0 +1,119 @@ +%YAML 1.2 +--- | + # This file has been automatically generated from a template file. + # Please make modifications to + # `templates/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec.template` + # instead. This file can be regenerated from the template by running + # `tools/buildgen/generate_projects.sh`. + + # CocoaPods podspec for the gRPC Proto Compiler Plugin + # + # Copyright 2019, Google Inc. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are + # met: + # + # * Redistributions of source code must retain the above copyright + # notice, this list of conditions and the following disclaimer. + # * Redistributions in binary form must reproduce the above + # copyright notice, this list of conditions and the following disclaimer + # in the documentation and/or other materials provided with the + # distribution. + # * Neither the name of Google Inc. nor the names of its + # contributors may be used to endorse or promote products derived from + # this software without specific prior written permission. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Pod::Spec.new do |s| + # This pod is only a utility that will be used by other pods _at install time_ (not at compile + # time). Other pods can access it in their `prepare_command` script, under /. + # Because CocoaPods installs pods in alphabetical order, beginning this pod's name with an + # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed + # before them. + s.name = '!ProtoCompiler-gRPCCppPlugin' + v = '${settings.version}' + s.version = v + s.summary = 'The gRPC ProtoC plugin generates C++ files from .proto services.' + s.description = <<-DESC + This podspec only downloads the gRPC protoc plugin so that local pods generating protos can use + it in their invocation of protoc, as part of their prepare_command. + DESC + s.homepage = 'https://grpc.io' + s.license = { + :type => 'Apache License, Version 2.0', + :text => <<-LICENSE + Copyright 2019, Google Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + LICENSE + } + s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' } + + repo = 'grpc/grpc' + file = "grpc_cpp_plugin-#{v}-macos-x86_64.zip" + s.source = { + :http => "https://github.com/#{repo}/releases/download/v#{v}/#{file}", + # TODO(jcanizales): Add sha1 or sha256 + # :sha1 => '??', + } + + repo_root = '../..' + bazel = "#{repo_root}/tools/bazel" + plugin = 'grpc_cpp_plugin' + + s.preserve_paths = plugin + + # Restrict the protoc version to the one supported by this plugin. + s.dependency '!ProtoCompiler', '3.8.0' + # For the Protobuf dependency not to complain: + s.ios.deployment_target = '7.0' + s.osx.deployment_target = '10.9' + s.tvos.deployment_target = '10.0' + s.watchos.deployment_target = '2.0' + + # This is only for local development of the plugin: If the Podfile brings this pod from a local + # directory using `:path`, CocoaPods won't download the zip file and so the plugin won't be + # present in this pod's directory. We use that knowledge to check for the existence of the file + # and, if absent, compile the plugin from the local sources. + s.prepare_command = <<-CMD + #{bazel} build //src/compiler:grpc_cpp_plugin + CMD + end diff --git a/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template b/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template index b2335ac8a9e..6286e3369e2 100644 --- a/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template +++ b/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template @@ -98,6 +98,7 @@ } repo_root = '../..' + bazel = "#{repo_root}/tools/bazel" plugin = 'grpc_objective_c_plugin' s.preserve_paths = plugin @@ -108,6 +109,7 @@ s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.9' s.tvos.deployment_target = '10.0' + s.watchos.deployment_target = '4.0' # Restrict the gRPC runtime version to the one supported by this plugin. s.dependency 'gRPC-ProtoRPC', v @@ -116,15 +118,6 @@ # present in this pod's directory. We use that knowledge to check for the existence of the file # and, if absent, compile the plugin from the local sources. s.prepare_command = <<-CMD - if [ ! -f #{plugin} ]; then - cd #{repo_root} - # This will build the plugin and put it in #{repo_root}/bins/opt. - # - # TODO(jcanizales): I reckon make will try to use locally-installed libprotoc (headers and - # library binary) if found, which _we do not want_. Find a way for this to always use the - # sources in the repo. - make #{plugin} - cd - - fi + #{bazel} build //src/compiler:grpc_objective_c_plugin CMD end diff --git a/templates/src/objective-c/BoringSSL-GRPC.podspec.template b/templates/src/objective-c/BoringSSL-GRPC.podspec.template index 408970e25e3..3d2736e3307 100644 --- a/templates/src/objective-c/BoringSSL-GRPC.podspec.template +++ b/templates/src/objective-c/BoringSSL-GRPC.podspec.template @@ -87,6 +87,7 @@ s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.7' s.tvos.deployment_target = '10.0' + s.watchos.deployment_target = '4.0' name = 'openssl_grpc' diff --git a/templates/tools/run_tests/generated/sources_and_headers.json.template b/templates/tools/run_tests/generated/sources_and_headers.json.template deleted file mode 100644 index c7dc3c837d1..00000000000 --- a/templates/tools/run_tests/generated/sources_and_headers.json.template +++ /dev/null @@ -1,72 +0,0 @@ -%YAML 1.2 ---- | - <%! - import json - import os - - def proto_headers(src): - out = [] - for f in src: - name, ext = os.path.splitext(f) - if ext == '.proto': - out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h', '%s_mock.grpc.pb.h']) - return out - - def all_targets(targets, libs, filegroups): - for tgt in targets: - yield ('target', tgt) - for tgt in libs: - yield ('lib', tgt) - for tgt in filegroups: - yield ('filegroup', tgt) - - def no_protos_filter(src): - return os.path.splitext(src)[1] != '.proto' - - def no_third_party_filter(src): - return not src.startswith('third_party/') - - def filter_srcs(srcs, filters): - out = [] - for s in srcs: - filter_passes = (f(s) for f in filters) - if all(filter_passes): - out.append(s) - return out - %> - - ${json.dumps([{"name": tgt.name, - "type": typ, - "is_filegroup": False, - "language": tgt.language, - "third_party": tgt.boringssl or tgt.zlib, - "src": sorted( - filter_srcs(tgt.own_src, (no_protos_filter, no_third_party_filter)) + - filter_srcs(tgt.own_public_headers, (no_protos_filter, no_third_party_filter)) + - filter_srcs(tgt.own_headers, (no_third_party_filter,))), - "headers": sorted( - tgt.own_public_headers + - tgt.own_headers + - proto_headers(tgt.own_src)), - "deps": sorted(tgt.get('deps', []) + - tgt.get('uses', []) + - tgt.get('filegroups', []))} - for typ, tgt in all_targets(targets, libs, [])] + - [{"name": tgt.name, - "type": typ, - "is_filegroup": True, - "language": tgt.language, - "third_party": tgt.boringssl or tgt.zlib, - "src": sorted( - filter_srcs(tgt.own_src, (no_protos_filter, no_third_party_filter)) + - filter_srcs(tgt.own_public_headers, (no_protos_filter, no_third_party_filter)) + - filter_srcs(tgt.own_headers, (no_third_party_filter,))), - "headers": sorted( - tgt.own_public_headers + - tgt.own_headers + - proto_headers(tgt.own_src)), - "deps": sorted(tgt.get('deps', []) + - tgt.get('uses', []) + - tgt.get('filegroups', []))} - for typ, tgt in all_targets([], [], filegroups)], - sort_keys=True, indent=2)} diff --git a/test/build_test/BUILD b/test/build_test/BUILD new file mode 100644 index 00000000000..dd2030ccda6 --- /dev/null +++ b/test/build_test/BUILD @@ -0,0 +1,28 @@ +# Copyright 2019 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) + +package(default_visibility = ["//visibility:public"]) + +load("@bazel_skylib//rules:build_test.bzl", "build_test") + +# build test //test/build_test:objective_c_examples_test +build_test( + name = "objective_c_examples_test", + targets = [ + "//examples/objective-c:HelloWorld", + ], + tags = ["manual"], +) diff --git a/test/core/bad_client/gen_build_yaml.py b/test/core/bad_client/gen_build_yaml.py index e390db90e15..3224dfe3877 100755 --- a/test/core/bad_client/gen_build_yaml.py +++ b/test/core/bad_client/gen_build_yaml.py @@ -68,7 +68,7 @@ def main(): 'cpu_cost': BAD_CLIENT_TESTS[t].cpu_cost, 'build': 'test', 'language': 'c++', - 'secure': 'no', + 'secure': False, 'src': ['test/core/bad_client/tests/%s.cc' % t], 'vs_proj_dir': 'test', 'exclude_iomgrs': ['uv'], diff --git a/test/core/channel/channelz_registry_test.cc b/test/core/channel/channelz_registry_test.cc index deb85d85624..995182da249 100644 --- a/test/core/channel/channelz_registry_test.cc +++ b/test/core/channel/channelz_registry_test.cc @@ -53,7 +53,7 @@ class ChannelzRegistryTest : public ::testing::Test { TEST_F(ChannelzRegistryTest, UuidStartsAboveZeroTest) { RefCountedPtr channelz_channel = - MakeRefCounted(BaseNode::EntityType::kTopLevelChannel); + MakeRefCounted(BaseNode::EntityType::kTopLevelChannel, nullptr); intptr_t uuid = channelz_channel->uuid(); EXPECT_GT(uuid, 0) << "First uuid chose must be greater than zero. Zero if " "reserved according to " @@ -65,8 +65,8 @@ TEST_F(ChannelzRegistryTest, UuidsAreIncreasing) { std::vector> channelz_channels; channelz_channels.reserve(10); for (int i = 0; i < 10; ++i) { - channelz_channels.push_back( - MakeRefCounted(BaseNode::EntityType::kTopLevelChannel)); + channelz_channels.push_back(MakeRefCounted( + BaseNode::EntityType::kTopLevelChannel, nullptr)); } for (size_t i = 1; i < channelz_channels.size(); ++i) { EXPECT_LT(channelz_channels[i - 1]->uuid(), channelz_channels[i]->uuid()) @@ -76,7 +76,7 @@ TEST_F(ChannelzRegistryTest, UuidsAreIncreasing) { TEST_F(ChannelzRegistryTest, RegisterGetTest) { RefCountedPtr channelz_channel = - MakeRefCounted(BaseNode::EntityType::kTopLevelChannel); + MakeRefCounted(BaseNode::EntityType::kTopLevelChannel, nullptr); RefCountedPtr retrieved = ChannelzRegistry::Get(channelz_channel->uuid()); EXPECT_EQ(channelz_channel, retrieved); @@ -85,8 +85,8 @@ TEST_F(ChannelzRegistryTest, RegisterGetTest) { TEST_F(ChannelzRegistryTest, RegisterManyItems) { std::vector> channelz_channels; for (int i = 0; i < 100; i++) { - channelz_channels.push_back( - MakeRefCounted(BaseNode::EntityType::kTopLevelChannel)); + channelz_channels.push_back(MakeRefCounted( + BaseNode::EntityType::kTopLevelChannel, nullptr)); RefCountedPtr retrieved = ChannelzRegistry::Get(channelz_channels[i]->uuid()); EXPECT_EQ(channelz_channels[i], retrieved); @@ -95,7 +95,7 @@ TEST_F(ChannelzRegistryTest, RegisterManyItems) { TEST_F(ChannelzRegistryTest, NullIfNotPresentTest) { RefCountedPtr channelz_channel = - MakeRefCounted(BaseNode::EntityType::kTopLevelChannel); + MakeRefCounted(BaseNode::EntityType::kTopLevelChannel, nullptr); // try to pull out a uuid that does not exist. RefCountedPtr nonexistant = ChannelzRegistry::Get(channelz_channel->uuid() + 1); @@ -117,10 +117,10 @@ TEST_F(ChannelzRegistryTest, TestUnregistration) { std::vector> odd_channels; odd_channels.reserve(kLoopIterations); for (int i = 0; i < kLoopIterations; i++) { - even_channels.push_back( - MakeRefCounted(BaseNode::EntityType::kTopLevelChannel)); - odd_channels.push_back( - MakeRefCounted(BaseNode::EntityType::kTopLevelChannel)); + even_channels.push_back(MakeRefCounted( + BaseNode::EntityType::kTopLevelChannel, nullptr)); + odd_channels.push_back(MakeRefCounted( + BaseNode::EntityType::kTopLevelChannel, nullptr)); odd_uuids.push_back(odd_channels[i]->uuid()); } } @@ -137,8 +137,8 @@ TEST_F(ChannelzRegistryTest, TestUnregistration) { std::vector> more_channels; more_channels.reserve(kLoopIterations); for (int i = 0; i < kLoopIterations; i++) { - more_channels.push_back( - MakeRefCounted(BaseNode::EntityType::kTopLevelChannel)); + more_channels.push_back(MakeRefCounted( + BaseNode::EntityType::kTopLevelChannel, nullptr)); RefCountedPtr retrieved = ChannelzRegistry::Get(more_channels[i]->uuid()); EXPECT_EQ(more_channels[i], retrieved); diff --git a/test/core/channel/channelz_test.cc b/test/core/channel/channelz_test.cc index 7c55f9ffe0f..08ed4dd4fa5 100644 --- a/test/core/channel/channelz_test.cc +++ b/test/core/channel/channelz_test.cc @@ -51,7 +51,8 @@ class CallCountingHelperPeer { grpc_millis last_call_started_millis() const { CallCountingHelper::CounterData data; node_->CollectData(&data); - return (grpc_millis)gpr_atm_no_barrier_load(&data.last_call_started_millis); + gpr_timespec ts = gpr_cycle_counter_to_time(data.last_call_started_cycle); + return grpc_timespec_to_millis_round_up(ts); } private: diff --git a/test/core/channel/minimal_stack_is_minimal_test.cc b/test/core/channel/minimal_stack_is_minimal_test.cc index bee0bfb41f2..3ca1992195b 100644 --- a/test/core/channel/minimal_stack_is_minimal_test.cc +++ b/test/core/channel/minimal_stack_is_minimal_test.cc @@ -100,8 +100,8 @@ int main(int argc, char** argv) { errors += CHECK_STACK("chttp2", nullptr, GRPC_SERVER_CHANNEL, "server", "message_size", "deadline", "http-server", "message_compress", "connected", NULL); - errors += CHECK_STACK(nullptr, nullptr, GRPC_CLIENT_CHANNEL, "client-channel", - NULL); + errors += CHECK_STACK(nullptr, nullptr, GRPC_CLIENT_CHANNEL, + "client_idle, client-channel", NULL); GPR_ASSERT(errors == 0); grpc_shutdown(); diff --git a/test/core/client_channel/service_config_test.cc b/test/core/client_channel/service_config_test.cc index 919441d706a..79dde6bcabe 100644 --- a/test/core/client_channel/service_config_test.cc +++ b/test/core/client_channel/service_config_test.cc @@ -457,28 +457,6 @@ TEST_F(ClientChannelParserTest, InvalidGrpclbLoadBalancingConfig) { VerifyRegexMatch(error, e); } -TEST_F(ClientChannelParserTest, InalidLoadBalancingConfigXds) { - const char* test_json = - "{\n" - " \"loadBalancingConfig\":[\n" - " { \"does_not_exist\":{} },\n" - " { \"xds_experimental\":{} }\n" - " ]\n" - "}"; - grpc_error* error = GRPC_ERROR_NONE; - auto svc_cfg = ServiceConfig::Create(test_json, &error); - gpr_log(GPR_ERROR, "%s", grpc_error_string(error)); - ASSERT_TRUE(error != GRPC_ERROR_NONE); - std::regex e( - std::string("(Service config parsing " - "error)(.*)(referenced_errors)(.*)(Global " - "Params)(.*)(referenced_errors)(.*)(Client channel global " - "parser)(.*)(referenced_errors)(.*)(Xds " - "Parser)(.*)(referenced_errors)(.*)(field:balancerName " - "error:not found)")); - VerifyRegexMatch(error, e); -} - TEST_F(ClientChannelParserTest, ValidLoadBalancingPolicy) { const char* test_json = "{\"loadBalancingPolicy\":\"pick_first\"}"; grpc_error* error = GRPC_ERROR_NONE; diff --git a/test/core/end2end/fixtures/h2_spiffe.cc b/test/core/end2end/fixtures/h2_spiffe.cc index 4352ef640cd..37fb44b5ad6 100644 --- a/test/core/end2end/fixtures/h2_spiffe.cc +++ b/test/core/end2end/fixtures/h2_spiffe.cc @@ -138,6 +138,10 @@ static int server_authz_check_async( // grpc_tls_credentials_options instance. static int client_cred_reload_sync(void* config_user_data, grpc_tls_credential_reload_arg* arg) { + if (!arg->key_materials_config->pem_key_cert_pair_list().empty()) { + arg->status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; + return 0; + } grpc_ssl_pem_key_cert_pair** key_cert_pair = static_cast( gpr_zalloc(sizeof(grpc_ssl_pem_key_cert_pair*))); @@ -160,6 +164,10 @@ static int client_cred_reload_sync(void* config_user_data, // grpc_tls_credentials_options instance. static int server_cred_reload_sync(void* config_user_data, grpc_tls_credential_reload_arg* arg) { + if (!arg->key_materials_config->pem_key_cert_pair_list().empty()) { + arg->status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; + return 0; + } grpc_ssl_pem_key_cert_pair** key_cert_pair = static_cast( gpr_zalloc(sizeof(grpc_ssl_pem_key_cert_pair*))); diff --git a/test/core/end2end/fuzzers/hpack.dictionary b/test/core/end2end/fuzzers/hpack.dictionary index 0469421c975..921018db7f8 100644 --- a/test/core/end2end/fuzzers/hpack.dictionary +++ b/test/core/end2end/fuzzers/hpack.dictionary @@ -20,7 +20,6 @@ "%grpc-internal-stream-encoding-request" "\x0Auser-agent" "\x04host" -"\x08lb-token" "\x1Agrpc-previous-rpc-attempts" "\x16grpc-retry-pushback-ms" "\x0Cgrpc-timeout" @@ -34,6 +33,8 @@ "\x1Egrpc.max_request_message_bytes" "\x1Fgrpc.max_response_message_bytes" "$/grpc.lb.v1.LoadBalancer/BalanceLoad" +"A/envoy.service.load_stats.v2.LoadReportingService/StreamLoadStats" +"6/envoy.api.v2.EndpointDiscoveryService/StreamEndpoints" "\x1C/grpc.health.v1.Health/Watch" "P/envoy.service.discovery.v2.AggregatedDiscoveryService/StreamAggregatedResources" "\x07deflate" @@ -180,7 +181,6 @@ "\x00\x0Faccept-encoding\x00" "\x00\x10content-encoding\x08identity" "\x00\x10content-encoding\x04gzip" -"\x00\x08lb-token\x00" "\x00\x0Blb-cost-bin\x00" "\x00\x14grpc-accept-encoding\x08identity" "\x00\x14grpc-accept-encoding\x07deflate" diff --git a/test/core/end2end/tests/connectivity.cc b/test/core/end2end/tests/connectivity.cc index caa4265aa2c..5511e55ccc7 100644 --- a/test/core/end2end/tests/connectivity.cc +++ b/test/core/end2end/tests/connectivity.cc @@ -33,6 +33,16 @@ typedef struct { grpc_completion_queue* cq; } child_events; +struct CallbackContext { + grpc_experimental_completion_queue_functor functor; + gpr_event finished; + explicit CallbackContext(void (*cb)( + grpc_experimental_completion_queue_functor* functor, int success)) { + functor.functor_run = cb; + gpr_event_init(&finished); + } +}; + static void child_thread(void* arg) { child_events* ce = static_cast(arg); grpc_event ev; @@ -163,9 +173,74 @@ static void test_connectivity(grpc_end2end_test_config config) { cq_verifier_destroy(cqv); } +static void cb_watch_connectivity( + grpc_experimental_completion_queue_functor* functor, int success) { + CallbackContext* cb_ctx = (CallbackContext*)functor; + + gpr_log(GPR_DEBUG, "cb_watch_connectivity called, verifying"); + + /* callback must not have errors */ + GPR_ASSERT(success != 0); + + gpr_event_set(&cb_ctx->finished, (void*)1); +} + +static void cb_shutdown(grpc_experimental_completion_queue_functor* functor, + int success) { + CallbackContext* cb_ctx = (CallbackContext*)functor; + + gpr_log(GPR_DEBUG, "cb_shutdown called, nothing to do"); + gpr_event_set(&cb_ctx->finished, (void*)1); +} + +static void test_watch_connectivity_cq_callback( + grpc_end2end_test_config config) { + CallbackContext cb_ctx(cb_watch_connectivity); + CallbackContext cb_shutdown_ctx(cb_shutdown); + grpc_completion_queue* cq; + grpc_end2end_test_fixture f = config.create_fixture(nullptr, nullptr); + + config.init_client(&f, nullptr); + + /* start connecting */ + grpc_channel_check_connectivity_state(f.client, 1); + + /* create the cq callback */ + cq = grpc_completion_queue_create_for_callback(&cb_shutdown_ctx.functor, + nullptr); + + /* start watching for any change, cb is immediately called + * and no dead lock should be raised */ + grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_IDLE, + grpc_timeout_seconds_to_deadline(3), cq, + &cb_ctx.functor); + + /* we just check that the callback was executed once notifying a connection + * transition */ + GPR_ASSERT(gpr_event_wait(&cb_ctx.finished, + gpr_inf_future(GPR_CLOCK_MONOTONIC)) != nullptr); + + /* shutdown, since shutdown cb might be executed in a background thread + * we actively wait till is executed. */ + grpc_completion_queue_shutdown(cq); + gpr_event_wait(&cb_shutdown_ctx.finished, + gpr_inf_future(GPR_CLOCK_MONOTONIC)); + + /* cleanup */ + grpc_channel_destroy(f.client); + grpc_completion_queue_destroy(cq); + + /* shutdown_cq and cq are not used in this test */ + grpc_completion_queue_destroy(f.cq); + grpc_completion_queue_destroy(f.shutdown_cq); + + config.tear_down_data(&f); +} + void connectivity(grpc_end2end_test_config config) { GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION); test_connectivity(config); + test_watch_connectivity_cq_callback(config); } void connectivity_pre_init(void) {} diff --git a/test/core/iomgr/buffer_list_test.cc b/test/core/iomgr/buffer_list_test.cc index 70e36940425..d71bb9ace2b 100644 --- a/test/core/iomgr/buffer_list_test.cc +++ b/test/core/iomgr/buffer_list_test.cc @@ -92,9 +92,33 @@ static void TestVerifierCalledOnAck() { grpc_core::TracedBuffer::Shutdown(&list, nullptr, GRPC_ERROR_NONE); } +/** Tests that shutdown can be called repeatedly. + */ +static void TestRepeatedShutdown() { + struct sock_extended_err serr; + serr.ee_data = 213; + serr.ee_info = grpc_core::SCM_TSTAMP_ACK; + struct grpc_core::scm_timestamping tss; + tss.ts[0].tv_sec = 123; + tss.ts[0].tv_nsec = 456; + grpc_core::grpc_tcp_set_write_timestamps_callback( + TestVerifierCalledOnAckVerifier); + grpc_core::TracedBuffer* list = nullptr; + gpr_atm verifier_called; + gpr_atm_rel_store(&verifier_called, static_cast(0)); + grpc_core::TracedBuffer::AddNewEntry(&list, 213, 0, &verifier_called); + grpc_core::TracedBuffer::ProcessTimestamp(&list, &serr, nullptr, &tss); + GPR_ASSERT(gpr_atm_acq_load(&verifier_called) == static_cast(1)); + GPR_ASSERT(list == nullptr); + grpc_core::TracedBuffer::Shutdown(&list, nullptr, GRPC_ERROR_NONE); + grpc_core::TracedBuffer::Shutdown(&list, nullptr, GRPC_ERROR_NONE); + grpc_core::TracedBuffer::Shutdown(&list, nullptr, GRPC_ERROR_NONE); +} + static void TestTcpBufferList() { TestVerifierCalledOnAck(); TestShutdownFlushesList(); + TestRepeatedShutdown(); } int main(int argc, char** argv) { diff --git a/test/core/iomgr/ios/CFStreamTests/run_tests.sh b/test/core/iomgr/ios/CFStreamTests/build_and_run_tests.sh similarity index 97% rename from test/core/iomgr/ios/CFStreamTests/run_tests.sh rename to test/core/iomgr/ios/CFStreamTests/build_and_run_tests.sh index e49a2e0b65e..933af6c8d9e 100755 --- a/test/core/iomgr/ios/CFStreamTests/run_tests.sh +++ b/test/core/iomgr/ios/CFStreamTests/build_and_run_tests.sh @@ -23,6 +23,10 @@ cd "$(dirname "$0")" echo "TIME: $(date)" +./build_tests.sh + +echo "TIME: $(date)" + XCODEBUILD_FILTER='(^CompileC |^Ld |^ *[^ ]*clang |^ *cd |^ *export |^Libtool |^ *[^ ]*libtool |^CpHeader |^ *builtin-copy )' xcodebuild \ diff --git a/test/core/iomgr/mpmcqueue_test.cc b/test/core/iomgr/mpmcqueue_test.cc index a301832f608..9ebc1cc7363 100644 --- a/test/core/iomgr/mpmcqueue_test.cc +++ b/test/core/iomgr/mpmcqueue_test.cc @@ -119,6 +119,57 @@ static void test_FIFO(void) { } } +// Test if queue's behavior of expanding is correct. (Only does expansion when +// it gets full, and each time expands to doubled size). +static void test_space_efficiency(void) { + gpr_log(GPR_INFO, "test_space_efficiency"); + grpc_core::InfLenFIFOQueue queue; + for (int i = 0; i < queue.init_num_nodes(); ++i) { + queue.Put(static_cast(grpc_core::New(i))); + } + // Queue should not have been expanded at this time. + GPR_ASSERT(queue.num_nodes() == queue.init_num_nodes()); + for (int i = 0; i < queue.init_num_nodes(); ++i) { + WorkItem* item = static_cast(queue.Get()); + queue.Put(item); + } + GPR_ASSERT(queue.num_nodes() == queue.init_num_nodes()); + for (int i = 0; i < queue.init_num_nodes(); ++i) { + WorkItem* item = static_cast(queue.Get()); + grpc_core::Delete(item); + } + // Queue never shrinks even it is empty. + GPR_ASSERT(queue.num_nodes() == queue.init_num_nodes()); + GPR_ASSERT(queue.count() == 0); + // queue empty now + for (int i = 0; i < queue.init_num_nodes() * 2; ++i) { + queue.Put(static_cast(grpc_core::New(i))); + } + GPR_ASSERT(queue.count() == queue.init_num_nodes() * 2); + // Queue should have been expanded once. + GPR_ASSERT(queue.num_nodes() == queue.init_num_nodes() * 2); + for (int i = 0; i < queue.init_num_nodes(); ++i) { + WorkItem* item = static_cast(queue.Get()); + grpc_core::Delete(item); + } + GPR_ASSERT(queue.count() == queue.init_num_nodes()); + // Queue will never shrink, should keep same number of node as before. + GPR_ASSERT(queue.num_nodes() == queue.init_num_nodes() * 2); + for (int i = 0; i < queue.init_num_nodes() + 1; ++i) { + queue.Put(static_cast(grpc_core::New(i))); + } + GPR_ASSERT(queue.count() == queue.init_num_nodes() * 2 + 1); + // Queue should have been expanded twice. + GPR_ASSERT(queue.num_nodes() == queue.init_num_nodes() * 4); + for (int i = 0; i < queue.init_num_nodes() * 2 + 1; ++i) { + WorkItem* item = static_cast(queue.Get()); + grpc_core::Delete(item); + } + GPR_ASSERT(queue.count() == 0); + GPR_ASSERT(queue.num_nodes() == queue.init_num_nodes() * 4); + gpr_log(GPR_DEBUG, "Done."); +} + static void test_many_thread(void) { gpr_log(GPR_INFO, "test_many_thread"); const int num_producer_threads = 10; @@ -172,6 +223,7 @@ int main(int argc, char** argv) { grpc::testing::TestEnvironment env(argc, argv); grpc_init(); test_FIFO(); + test_space_efficiency(); test_many_thread(); grpc_shutdown(); return 0; diff --git a/test/core/nanopb/fuzzer_response.cc b/test/core/nanopb/fuzzer_response.cc index 3a70dea5e98..c5fb8905935 100644 --- a/test/core/nanopb/fuzzer_response.cc +++ b/test/core/nanopb/fuzzer_response.cc @@ -32,12 +32,13 @@ static void dont_log(gpr_log_func_args* args) {} extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { grpc_init(); if (squelch) gpr_set_log_function(dont_log); + // TODO(veblush): Convert this to upb. + /* grpc_slice slice = grpc_slice_from_copied_buffer((const char*)data, size); - grpc_grpclb_initial_response* response; - if ((response = grpc_grpclb_initial_response_parse(slice))) { - grpc_grpclb_initial_response_destroy(response); - } + upb::Arena arena; + grpc_core::grpc_grpclb_initial_response_parse(slice, arena.ptr()); grpc_slice_unref(slice); + */ grpc_shutdown(); return 0; } diff --git a/test/core/nanopb/fuzzer_serverlist.cc b/test/core/nanopb/fuzzer_serverlist.cc index d0af117ef96..bc812952cd4 100644 --- a/test/core/nanopb/fuzzer_serverlist.cc +++ b/test/core/nanopb/fuzzer_serverlist.cc @@ -32,12 +32,15 @@ static void dont_log(gpr_log_func_args* args) {} extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { grpc_init(); if (squelch) gpr_set_log_function(dont_log); + // TODO(veblush): Convert this to upb. + /* grpc_slice slice = grpc_slice_from_copied_buffer((const char*)data, size); - grpc_grpclb_serverlist* serverlist; - if ((serverlist = grpc_grpclb_response_parse_serverlist(slice))) { + grpc_core::grpc_grpclb_serverlist* serverlist; + if ((serverlist = grpc_core::grpc_grpclb_response_parse_serverlist(slice))) { grpc_grpclb_destroy_serverlist(serverlist); } grpc_slice_unref(slice); + */ grpc_shutdown(); return 0; } diff --git a/test/core/security/BUILD b/test/core/security/BUILD index d430ccfe215..b6d43c62722 100644 --- a/test/core/security/BUILD +++ b/test/core/security/BUILD @@ -252,3 +252,19 @@ grpc_cc_test( "//test/core/util:grpc_test_util", ], ) + +grpc_cc_test( + name = "spiffe_security_connector_test", + srcs = ["spiffe_security_connector_test.cc"], + language = "C++", + external_deps = [ + "gtest", + ], + deps = [ + "//:gpr", + "//:grpc", + "//:grpc_secure", + "//test/core/util:grpc_test_util", + "//test/core/end2end:ssl_test_data", + ], +) diff --git a/test/core/security/spiffe_security_connector_test.cc b/test/core/security/spiffe_security_connector_test.cc new file mode 100644 index 00000000000..785ae1b8128 --- /dev/null +++ b/test/core/security/spiffe_security_connector_test.cc @@ -0,0 +1,282 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include + +#include +#include +#include +#include +#include + +#include "src/core/lib/security/security_connector/tls/spiffe_security_connector.h" +#include "test/core/end2end/data/ssl_test_data.h" +#include "test/core/util/test_config.h" + +namespace { + +enum CredReloadResult { FAIL, SUCCESS, UNCHANGED, ASYNC }; + +void SetKeyMaterials(grpc_tls_key_materials_config* config) { + grpc_ssl_pem_key_cert_pair** key_cert_pair = + static_cast( + gpr_zalloc(sizeof(grpc_ssl_pem_key_cert_pair*))); + key_cert_pair[0] = static_cast( + gpr_zalloc(sizeof(grpc_ssl_pem_key_cert_pair))); + key_cert_pair[0]->private_key = gpr_strdup(test_server1_key); + key_cert_pair[0]->cert_chain = gpr_strdup(test_server1_cert); + grpc_tls_key_materials_config_set_key_materials( + config, gpr_strdup(test_root_cert), + (const grpc_ssl_pem_key_cert_pair**)key_cert_pair, 1); +} + +int CredReloadSuccess(void* config_user_data, + grpc_tls_credential_reload_arg* arg) { + SetKeyMaterials(arg->key_materials_config); + arg->status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW; + return 0; +} + +int CredReloadFail(void* config_user_data, + grpc_tls_credential_reload_arg* arg) { + arg->status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL; + return 0; +} + +int CredReloadUnchanged(void* config_user_data, + grpc_tls_credential_reload_arg* arg) { + arg->status = GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; + return 0; +} + +int CredReloadAsync(void* config_user_data, + grpc_tls_credential_reload_arg* arg) { + return 1; +} + +} // namespace + +namespace grpc { +namespace testing { + +class SpiffeSecurityConnectorTest : public ::testing::Test { + protected: + SpiffeSecurityConnectorTest() {} + void SetUp() override { + options_ = grpc_tls_credentials_options_create()->Ref(); + config_ = grpc_tls_key_materials_config_create()->Ref(); + } + void TearDown() override { config_->Unref(); } + // Set credential reload config in options. + void SetOptions(CredReloadResult type) { + grpc_tls_credential_reload_config* reload_config = nullptr; + switch (type) { + case SUCCESS: + reload_config = grpc_tls_credential_reload_config_create( + nullptr, CredReloadSuccess, nullptr, nullptr); + break; + case FAIL: + reload_config = grpc_tls_credential_reload_config_create( + nullptr, CredReloadFail, nullptr, nullptr); + break; + case UNCHANGED: + reload_config = grpc_tls_credential_reload_config_create( + nullptr, CredReloadUnchanged, nullptr, nullptr); + break; + case ASYNC: + reload_config = grpc_tls_credential_reload_config_create( + nullptr, CredReloadAsync, nullptr, nullptr); + break; + default: + break; + } + grpc_tls_credentials_options_set_credential_reload_config(options_.get(), + reload_config); + } + // Set key materials config. + void SetKeyMaterialsConfig() { SetKeyMaterials(config_.get()); } + grpc_core::RefCountedPtr options_; + grpc_core::RefCountedPtr config_; +}; + +TEST_F(SpiffeSecurityConnectorTest, NoKeysAndConfig) { + grpc_ssl_certificate_config_reload_status reload_status; + grpc_status_code status = + TlsFetchKeyMaterials(config_, *options_, &reload_status); + EXPECT_EQ(status, GRPC_STATUS_FAILED_PRECONDITION); + options_->Unref(); +} + +TEST_F(SpiffeSecurityConnectorTest, NoKeySuccessReload) { + grpc_ssl_certificate_config_reload_status reload_status; + SetOptions(SUCCESS); + grpc_status_code status = + TlsFetchKeyMaterials(config_, *options_, &reload_status); + EXPECT_EQ(status, GRPC_STATUS_OK); + EXPECT_EQ(reload_status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + options_->Unref(); +} + +TEST_F(SpiffeSecurityConnectorTest, NoKeyFailReload) { + grpc_ssl_certificate_config_reload_status reload_status; + SetOptions(FAIL); + grpc_status_code status = + TlsFetchKeyMaterials(config_, *options_, &reload_status); + EXPECT_EQ(status, GRPC_STATUS_INTERNAL); + EXPECT_EQ(reload_status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); + options_->Unref(); +} + +TEST_F(SpiffeSecurityConnectorTest, NoKeyAsyncReload) { + grpc_ssl_certificate_config_reload_status reload_status = + GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; + SetOptions(ASYNC); + grpc_status_code status = + TlsFetchKeyMaterials(config_, *options_, &reload_status); + EXPECT_EQ(status, GRPC_STATUS_UNIMPLEMENTED); + EXPECT_EQ(reload_status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED); + options_->Unref(); +} + +TEST_F(SpiffeSecurityConnectorTest, NoKeyUnchangedReload) { + grpc_ssl_certificate_config_reload_status reload_status = + GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; + SetOptions(UNCHANGED); + grpc_status_code status = + TlsFetchKeyMaterials(config_, *options_, &reload_status); + EXPECT_EQ(status, GRPC_STATUS_OK); + EXPECT_EQ(reload_status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED); + options_->Unref(); +} + +TEST_F(SpiffeSecurityConnectorTest, WithKeyNoReload) { + grpc_ssl_certificate_config_reload_status reload_status = + GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; + SetKeyMaterialsConfig(); + grpc_status_code status = + TlsFetchKeyMaterials(config_, *options_, &reload_status); + EXPECT_EQ(status, GRPC_STATUS_OK); + options_->Unref(); +} + +TEST_F(SpiffeSecurityConnectorTest, WithKeySuccessReload) { + grpc_ssl_certificate_config_reload_status reload_status; + SetOptions(SUCCESS); + SetKeyMaterialsConfig(); + grpc_status_code status = + TlsFetchKeyMaterials(config_, *options_, &reload_status); + EXPECT_EQ(status, GRPC_STATUS_OK); + EXPECT_EQ(reload_status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW); + options_->Unref(); +} + +TEST_F(SpiffeSecurityConnectorTest, WithKeyFailReload) { + grpc_ssl_certificate_config_reload_status reload_status; + SetOptions(FAIL); + SetKeyMaterialsConfig(); + grpc_status_code status = + TlsFetchKeyMaterials(config_, *options_, &reload_status); + EXPECT_EQ(status, GRPC_STATUS_OK); + EXPECT_EQ(reload_status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL); + options_->Unref(); +} + +TEST_F(SpiffeSecurityConnectorTest, WithKeyAsyncReload) { + grpc_ssl_certificate_config_reload_status reload_status = + GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; + SetOptions(ASYNC); + SetKeyMaterialsConfig(); + grpc_status_code status = + TlsFetchKeyMaterials(config_, *options_, &reload_status); + EXPECT_EQ(status, GRPC_STATUS_OK); + EXPECT_EQ(reload_status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED); + options_->Unref(); +} + +TEST_F(SpiffeSecurityConnectorTest, WithKeyUnchangedReload) { + grpc_ssl_certificate_config_reload_status reload_status = + GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED; + SetOptions(UNCHANGED); + SetKeyMaterialsConfig(); + grpc_status_code status = + TlsFetchKeyMaterials(config_, *options_, &reload_status); + EXPECT_EQ(status, GRPC_STATUS_OK); + EXPECT_EQ(reload_status, GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED); + options_->Unref(); +} + +TEST_F(SpiffeSecurityConnectorTest, CreateChannelSecurityConnectorSuccess) { + SetOptions(SUCCESS); + auto cred = grpc_core::UniquePtr( + grpc_tls_spiffe_credentials_create(options_.get())); + const char* target_name = "some_target"; + grpc_channel_args* new_args = nullptr; + auto connector = + cred->create_security_connector(nullptr, target_name, nullptr, &new_args); + EXPECT_NE(connector, nullptr); + grpc_channel_args_destroy(new_args); +} + +TEST_F(SpiffeSecurityConnectorTest, + CreateChannelSecurityConnectorFailNoTargetName) { + SetOptions(SUCCESS); + auto cred = grpc_core::UniquePtr( + grpc_tls_spiffe_credentials_create(options_.get())); + grpc_channel_args* new_args = nullptr; + auto connector = + cred->create_security_connector(nullptr, nullptr, nullptr, &new_args); + EXPECT_EQ(connector, nullptr); +} + +TEST_F(SpiffeSecurityConnectorTest, CreateChannelSecurityConnectorFailInit) { + SetOptions(FAIL); + auto cred = grpc_core::UniquePtr( + grpc_tls_spiffe_credentials_create(options_.get())); + grpc_channel_args* new_args = nullptr; + auto connector = + cred->create_security_connector(nullptr, nullptr, nullptr, &new_args); + EXPECT_EQ(connector, nullptr); +} + +TEST_F(SpiffeSecurityConnectorTest, CreateServerSecurityConnectorSuccess) { + SetOptions(SUCCESS); + auto cred = grpc_core::UniquePtr( + grpc_tls_spiffe_server_credentials_create(options_.get())); + auto connector = cred->create_security_connector(); + EXPECT_NE(connector, nullptr); +} + +TEST_F(SpiffeSecurityConnectorTest, CreateServerSecurityConnectorFailInit) { + SetOptions(FAIL); + auto cred = grpc_core::UniquePtr( + grpc_tls_spiffe_server_credentials_create(options_.get())); + auto connector = cred->create_security_connector(); + EXPECT_EQ(connector, nullptr); +} + +} // namespace testing +} // namespace grpc + +int main(int argc, char** argv) { + grpc_init(); + ::testing::InitGoogleTest(&argc, argv); + int ret = RUN_ALL_TESTS(); + grpc_shutdown(); + return ret; +} diff --git a/test/core/surface/public_headers_must_be_c89.c b/test/core/surface/public_headers_must_be_c89.c index e537e482936..f1f3c7a2745 100644 --- a/test/core/surface/public_headers_must_be_c89.c +++ b/test/core/surface/public_headers_must_be_c89.c @@ -201,6 +201,8 @@ int main(int argc, char **argv) { printf("%lx", (unsigned long) grpc_tls_credentials_options_set_server_authorization_check_config); printf("%lx", (unsigned long) grpc_tls_key_materials_config_create); printf("%lx", (unsigned long) grpc_tls_key_materials_config_set_key_materials); + printf("%lx", (unsigned long) grpc_tls_key_materials_config_set_version); + printf("%lx", (unsigned long) grpc_tls_key_materials_config_get_version); printf("%lx", (unsigned long) grpc_tls_credential_reload_config_create); printf("%lx", (unsigned long) grpc_tls_server_authorization_check_config_create); printf("%lx", (unsigned long) grpc_raw_byte_buffer_create); diff --git a/test/core/transport/chttp2/context_list_test.cc b/test/core/transport/chttp2/context_list_test.cc index 0379eaaee4c..f8c0bee0afb 100644 --- a/test/core/transport/chttp2/context_list_test.cc +++ b/test/core/transport/chttp2/context_list_test.cc @@ -42,21 +42,29 @@ void TestExecuteFlushesListVerifier(void* arg, grpc_core::Timestamps* ts, grpc_error* error) { ASSERT_NE(arg, nullptr); EXPECT_EQ(error, GRPC_ERROR_NONE); - EXPECT_EQ(ts->byte_offset, kByteOffset); + if (ts) { + EXPECT_EQ(ts->byte_offset, kByteOffset); + } gpr_atm* done = reinterpret_cast(arg); gpr_atm_rel_store(done, static_cast(1)); } void discard_write(grpc_slice slice) {} +class ContextListTest : public ::testing::Test { + protected: + void SetUp() override { + grpc_http2_set_write_timestamps_callback(TestExecuteFlushesListVerifier); + grpc_http2_set_fn_get_copied_context(DummyArgsCopier); + } +}; + /** Tests that all ContextList elements in the list are flushed out on * execute. * Also tests that arg and byte_counter are passed correctly. */ -TEST(ContextList, ExecuteFlushesList) { +TEST_F(ContextListTest, ExecuteFlushesList) { grpc_core::ContextList* list = nullptr; - grpc_http2_set_write_timestamps_callback(TestExecuteFlushesListVerifier); - grpc_http2_set_fn_get_copied_context(DummyArgsCopier); const int kNumElems = 5; grpc_core::ExecCtx exec_ctx; grpc_stream_refcount ref; @@ -95,6 +103,62 @@ TEST(ContextList, ExecuteFlushesList) { grpc_resource_quota_unref(resource_quota); exec_ctx.Flush(); } + +TEST_F(ContextListTest, EmptyList) { + grpc_core::ContextList* list = nullptr; + grpc_core::ExecCtx exec_ctx; + grpc_core::Timestamps ts; + grpc_core::ContextList::Execute(list, &ts, GRPC_ERROR_NONE); + exec_ctx.Flush(); +} + +TEST_F(ContextListTest, EmptyListEmptyTimestamp) { + grpc_core::ContextList* list = nullptr; + grpc_core::ExecCtx exec_ctx; + grpc_core::ContextList::Execute(list, nullptr, GRPC_ERROR_NONE); + exec_ctx.Flush(); +} + +TEST_F(ContextListTest, NonEmptyListEmptyTimestamp) { + grpc_core::ContextList* list = nullptr; + const int kNumElems = 5; + grpc_core::ExecCtx exec_ctx; + grpc_stream_refcount ref; + GRPC_STREAM_REF_INIT(&ref, 1, nullptr, nullptr, "dummy ref"); + grpc_resource_quota* resource_quota = + grpc_resource_quota_create("context_list_test"); + grpc_endpoint* mock_endpoint = + grpc_mock_endpoint_create(discard_write, resource_quota); + grpc_transport* t = + grpc_create_chttp2_transport(nullptr, mock_endpoint, true); + std::vector s; + s.reserve(kNumElems); + gpr_atm verifier_called[kNumElems]; + for (auto i = 0; i < kNumElems; i++) { + s.push_back(static_cast( + gpr_malloc(grpc_transport_stream_size(t)))); + grpc_transport_init_stream(reinterpret_cast(t), + reinterpret_cast(s[i]), &ref, + nullptr, nullptr); + s[i]->context = &verifier_called[i]; + s[i]->byte_counter = kByteOffset; + gpr_atm_rel_store(&verifier_called[i], static_cast(0)); + grpc_core::ContextList::Append(&list, s[i]); + } + grpc_core::ContextList::Execute(list, nullptr, GRPC_ERROR_NONE); + for (auto i = 0; i < kNumElems; i++) { + EXPECT_EQ(gpr_atm_acq_load(&verifier_called[i]), static_cast(1)); + grpc_transport_destroy_stream(reinterpret_cast(t), + reinterpret_cast(s[i]), + nullptr); + exec_ctx.Flush(); + gpr_free(s[i]); + } + grpc_transport_destroy(t); + grpc_resource_quota_unref(resource_quota); + exec_ctx.Flush(); +} + } // namespace } // namespace testing } // namespace grpc_core diff --git a/test/core/transport/chttp2/stream_map_test.cc b/test/core/transport/chttp2/stream_map_test.cc index a36c496eb1e..3452c86cdc9 100644 --- a/test/core/transport/chttp2/stream_map_test.cc +++ b/test/core/transport/chttp2/stream_map_test.cc @@ -43,29 +43,6 @@ static void test_empty_find(void) { grpc_chttp2_stream_map_destroy(&map); } -/* test it's safe to delete twice */ -static void test_double_deletion(void) { - grpc_chttp2_stream_map map; - - LOG_TEST("test_double_deletion"); - - grpc_chttp2_stream_map_init(&map, 8); - GPR_ASSERT(0 == grpc_chttp2_stream_map_size(&map)); - grpc_chttp2_stream_map_add(&map, 1, (void*)1); - GPR_ASSERT((void*)1 == grpc_chttp2_stream_map_find(&map, 1)); - GPR_ASSERT(1 == grpc_chttp2_stream_map_size(&map)); - GPR_ASSERT((void*)1 == grpc_chttp2_stream_map_delete(&map, 1)); - GPR_ASSERT(0 == grpc_chttp2_stream_map_size(&map)); - GPR_ASSERT(nullptr == grpc_chttp2_stream_map_find(&map, 1)); - GPR_ASSERT(nullptr == grpc_chttp2_stream_map_delete(&map, 1)); - GPR_ASSERT(nullptr == grpc_chttp2_stream_map_find(&map, 1)); - GPR_ASSERT(nullptr == grpc_chttp2_stream_map_delete(&map, 1)); - GPR_ASSERT(nullptr == grpc_chttp2_stream_map_find(&map, 1)); - GPR_ASSERT(nullptr == grpc_chttp2_stream_map_delete(&map, 1)); - GPR_ASSERT(nullptr == grpc_chttp2_stream_map_find(&map, 1)); - grpc_chttp2_stream_map_destroy(&map); -} - /* test add & lookup */ static void test_basic_add_find(uint32_t n) { grpc_chttp2_stream_map map; @@ -197,7 +174,6 @@ int main(int argc, char** argv) { test_no_op(); test_empty_find(); - test_double_deletion(); while (n < 100000) { test_basic_add_find(n); diff --git a/test/core/tsi/BUILD b/test/core/tsi/BUILD index 14578c0e48b..e9faf5c99f3 100644 --- a/test/core/tsi/BUILD +++ b/test/core/tsi/BUILD @@ -74,6 +74,8 @@ grpc_cc_test( "//src/core/tsi/test_creds:server0.pem", "//src/core/tsi/test_creds:server1.key", "//src/core/tsi/test_creds:server1.pem", + "//src/core/tsi/test_creds:multi-domain.key", + "//src/core/tsi/test_creds:multi-domain.pem", ], language = "C++", deps = [ diff --git a/test/core/tsi/alts/handshaker/BUILD b/test/core/tsi/alts/handshaker/BUILD index 61ba16ad6db..ed97056c003 100644 --- a/test/core/tsi/alts/handshaker/BUILD +++ b/test/core/tsi/alts/handshaker/BUILD @@ -41,17 +41,6 @@ grpc_cc_test( ], ) -grpc_cc_test( - name = "alts_handshaker_service_api_test", - srcs = ["alts_handshaker_service_api_test.cc"], - language = "C++", - deps = [ - ":alts_handshaker_service_api_test_lib", - "//:grpc", - "//test/core/util:grpc_test_util", - ], -) - grpc_cc_test( name = "alts_tsi_handshaker_test", srcs = ["alts_tsi_handshaker_test.cc"], diff --git a/test/core/tsi/alts/handshaker/alts_handshaker_client_test.cc b/test/core/tsi/alts/handshaker/alts_handshaker_client_test.cc index 9a4541bb7d1..4d36c24d910 100644 --- a/test/core/tsi/alts/handshaker/alts_handshaker_client_test.cc +++ b/test/core/tsi/alts/handshaker/alts_handshaker_client_test.cc @@ -54,34 +54,34 @@ typedef struct alts_handshaker_client_test_config { } alts_handshaker_client_test_config; static void validate_rpc_protocol_versions( - grpc_gcp_rpc_protocol_versions* versions) { + const grpc_gcp_RpcProtocolVersions* versions) { GPR_ASSERT(versions != nullptr); - GPR_ASSERT(versions->max_rpc_version.major == kMaxRpcVersionMajor); - GPR_ASSERT(versions->max_rpc_version.minor == kMaxRpcVersionMinor); - GPR_ASSERT(versions->min_rpc_version.major == kMinRpcVersionMajor); - GPR_ASSERT(versions->min_rpc_version.minor == kMinRpcVersionMinor); + const grpc_gcp_RpcProtocolVersions_Version* max_version = + grpc_gcp_RpcProtocolVersions_max_rpc_version(versions); + const grpc_gcp_RpcProtocolVersions_Version* min_version = + grpc_gcp_RpcProtocolVersions_min_rpc_version(versions); + GPR_ASSERT(grpc_gcp_RpcProtocolVersions_Version_major(max_version) == + kMaxRpcVersionMajor); + GPR_ASSERT(grpc_gcp_RpcProtocolVersions_Version_minor(max_version) == + kMaxRpcVersionMinor); + GPR_ASSERT(grpc_gcp_RpcProtocolVersions_Version_major(min_version) == + kMinRpcVersionMajor); + GPR_ASSERT(grpc_gcp_RpcProtocolVersions_Version_minor(min_version) == + kMinRpcVersionMinor); } static void validate_target_identities( - const repeated_field* target_identity_head) { - grpc_gcp_identity* target_identity1 = static_cast( - const_cast(target_identity_head->next->data)); - grpc_gcp_identity* target_identity2 = static_cast( - const_cast(target_identity_head->data)); - grpc_slice* service_account1 = - static_cast(target_identity1->service_account.arg); - grpc_slice* service_account2 = - static_cast(target_identity2->service_account.arg); - GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(*service_account1), - ALTS_HANDSHAKER_CLIENT_TEST_TARGET_SERVICE_ACCOUNT1, - GRPC_SLICE_LENGTH(*service_account1)) == 0); - GPR_ASSERT(strlen(ALTS_HANDSHAKER_CLIENT_TEST_TARGET_SERVICE_ACCOUNT1) == - GRPC_SLICE_LENGTH(*service_account1)); - GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(*service_account2), - ALTS_HANDSHAKER_CLIENT_TEST_TARGET_SERVICE_ACCOUNT2, - GRPC_SLICE_LENGTH(*service_account2)) == 0); - GPR_ASSERT(strlen(ALTS_HANDSHAKER_CLIENT_TEST_TARGET_SERVICE_ACCOUNT2) == - GRPC_SLICE_LENGTH(*service_account2)); + const grpc_gcp_Identity* const* target_identities, + size_t target_identities_count) { + GPR_ASSERT(target_identities_count == 2); + const grpc_gcp_Identity* identity1 = target_identities[1]; + const grpc_gcp_Identity* identity2 = target_identities[0]; + GPR_ASSERT(upb_strview_eql( + grpc_gcp_Identity_service_account(identity1), + upb_strview_makez(ALTS_HANDSHAKER_CLIENT_TEST_TARGET_SERVICE_ACCOUNT1))); + GPR_ASSERT(upb_strview_eql( + grpc_gcp_Identity_service_account(identity2), + upb_strview_makez(ALTS_HANDSHAKER_CLIENT_TEST_TARGET_SERVICE_ACCOUNT2))); } /** @@ -117,14 +117,14 @@ static bool validate_op(alts_handshaker_client* c, const grpc_op* op, return ok; } -static grpc_gcp_handshaker_req* deserialize_handshaker_req( - grpc_gcp_handshaker_req_type type, grpc_byte_buffer* buffer) { +static grpc_gcp_HandshakerReq* deserialize_handshaker_req( + grpc_byte_buffer* buffer, upb_arena* arena) { GPR_ASSERT(buffer != nullptr); - grpc_gcp_handshaker_req* req = grpc_gcp_handshaker_decoded_req_create(type); grpc_byte_buffer_reader bbr; GPR_ASSERT(grpc_byte_buffer_reader_init(&bbr, buffer)); grpc_slice slice = grpc_byte_buffer_reader_readall(&bbr); - GPR_ASSERT(grpc_gcp_handshaker_req_decode(slice, req)); + grpc_gcp_HandshakerReq* req = grpc_gcp_handshaker_req_decode(slice, arena); + GPR_ASSERT(req != nullptr); grpc_slice_unref(slice); grpc_byte_buffer_reader_destroy(&bbr); return req; @@ -150,40 +150,38 @@ static grpc_call_error check_client_start_success(grpc_call* call, const grpc_op* op, size_t nops, grpc_closure* closure) { + upb::Arena arena; alts_handshaker_client* client = static_cast(closure->cb_arg); GPR_ASSERT(alts_handshaker_client_get_closure_for_testing(client) == closure); - grpc_gcp_handshaker_req* req = deserialize_handshaker_req( - CLIENT_START_REQ, - alts_handshaker_client_get_send_buffer_for_testing(client)); - GPR_ASSERT(req->client_start.handshake_security_protocol == - grpc_gcp_HandshakeProtocol_ALTS); - const void* data = (static_cast( - req->client_start.application_protocols.arg)) - ->data; - GPR_ASSERT(data != nullptr); - grpc_slice* application_protocol = (grpc_slice*)data; - data = (static_cast(req->client_start.record_protocols.arg)) - ->data; - grpc_slice* record_protocol = (grpc_slice*)data; - GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(*application_protocol), - ALTS_APPLICATION_PROTOCOL, - GRPC_SLICE_LENGTH(*application_protocol)) == 0); - GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(*record_protocol), - ALTS_RECORD_PROTOCOL, - GRPC_SLICE_LENGTH(*record_protocol)) == 0); - validate_rpc_protocol_versions(&req->client_start.rpc_versions); - validate_target_identities( - static_cast(req->client_start.target_identities.arg)); - grpc_slice* target_name = - static_cast(req->client_start.target_name.arg); - GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(*target_name), - ALTS_HANDSHAKER_CLIENT_TEST_TARGET_NAME, - GRPC_SLICE_LENGTH(*target_name)) == 0); - GPR_ASSERT(GRPC_SLICE_LENGTH(*target_name) == - strlen(ALTS_HANDSHAKER_CLIENT_TEST_TARGET_NAME)); + grpc_gcp_HandshakerReq* req = deserialize_handshaker_req( + alts_handshaker_client_get_send_buffer_for_testing(client), arena.ptr()); + const grpc_gcp_StartClientHandshakeReq* client_start = + grpc_gcp_HandshakerReq_client_start(req); + GPR_ASSERT(grpc_gcp_StartClientHandshakeReq_handshake_security_protocol( + client_start) == grpc_gcp_ALTS); + upb_strview const* application_protocols = + grpc_gcp_StartClientHandshakeReq_application_protocols(client_start, + nullptr); + GPR_ASSERT(upb_strview_eql(application_protocols[0], + upb_strview_makez(ALTS_APPLICATION_PROTOCOL))); + upb_strview const* record_protocols = + grpc_gcp_StartClientHandshakeReq_record_protocols(client_start, nullptr); + GPR_ASSERT(upb_strview_eql(record_protocols[0], + upb_strview_makez(ALTS_RECORD_PROTOCOL))); + const grpc_gcp_RpcProtocolVersions* rpc_protocol_versions = + grpc_gcp_StartClientHandshakeReq_rpc_versions(client_start); + validate_rpc_protocol_versions(rpc_protocol_versions); + size_t target_identities_count; + const grpc_gcp_Identity* const* target_identities = + grpc_gcp_StartClientHandshakeReq_target_identities( + client_start, &target_identities_count); + validate_target_identities(target_identities, target_identities_count); + GPR_ASSERT(upb_strview_eql( + grpc_gcp_StartClientHandshakeReq_target_name(client_start), + upb_strview_makez(ALTS_HANDSHAKER_CLIENT_TEST_TARGET_NAME))); + GPR_ASSERT(validate_op(client, op, nops, true /* is_start */)); - grpc_gcp_handshaker_req_destroy(req); return GRPC_CALL_OK; } @@ -197,34 +195,37 @@ static grpc_call_error check_server_start_success(grpc_call* call, const grpc_op* op, size_t nops, grpc_closure* closure) { + upb::Arena arena; alts_handshaker_client* client = static_cast(closure->cb_arg); GPR_ASSERT(alts_handshaker_client_get_closure_for_testing(client) == closure); - grpc_gcp_handshaker_req* req = deserialize_handshaker_req( - SERVER_START_REQ, - alts_handshaker_client_get_send_buffer_for_testing(client)); - const void* data = (static_cast( - req->server_start.application_protocols.arg)) - ->data; - GPR_ASSERT(data != nullptr); - grpc_slice* application_protocol = (grpc_slice*)data; - GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(*application_protocol), - ALTS_APPLICATION_PROTOCOL, - GRPC_SLICE_LENGTH(*application_protocol)) == 0); - GPR_ASSERT(req->server_start.handshake_parameters_count == 1); - GPR_ASSERT(req->server_start.handshake_parameters[0].key == - grpc_gcp_HandshakeProtocol_ALTS); - data = (static_cast(req->server_start.handshake_parameters[0] - .value.record_protocols.arg)) - ->data; - GPR_ASSERT(data != nullptr); - grpc_slice* record_protocol = (grpc_slice*)data; - GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(*record_protocol), - ALTS_RECORD_PROTOCOL, - GRPC_SLICE_LENGTH(*record_protocol)) == 0); - validate_rpc_protocol_versions(&req->server_start.rpc_versions); + grpc_gcp_HandshakerReq* req = deserialize_handshaker_req( + alts_handshaker_client_get_send_buffer_for_testing(client), arena.ptr()); + const grpc_gcp_StartServerHandshakeReq* server_start = + grpc_gcp_HandshakerReq_server_start(req); + upb_strview const* application_protocols = + grpc_gcp_StartServerHandshakeReq_application_protocols(server_start, + nullptr); + GPR_ASSERT(upb_strview_eql(application_protocols[0], + upb_strview_makez(ALTS_APPLICATION_PROTOCOL))); + size_t handshake_parameters_count; + const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry* const* + handshake_parameters = + grpc_gcp_StartServerHandshakeReq_handshake_parameters( + server_start, &handshake_parameters_count); + GPR_ASSERT(handshake_parameters_count == 1); + GPR_ASSERT(grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_key( + handshake_parameters[0]) == grpc_gcp_ALTS); + const grpc_gcp_ServerHandshakeParameters* value = + grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_value( + handshake_parameters[0]); + upb_strview const* record_protocols = + grpc_gcp_ServerHandshakeParameters_record_protocols(value, nullptr); + GPR_ASSERT(upb_strview_eql(record_protocols[0], + upb_strview_makez(ALTS_RECORD_PROTOCOL))); + validate_rpc_protocol_versions( + grpc_gcp_StartServerHandshakeReq_rpc_versions(server_start)); GPR_ASSERT(validate_op(client, op, nops, true /* is_start */)); - grpc_gcp_handshaker_req_destroy(req); return GRPC_CALL_OK; } @@ -235,20 +236,21 @@ static grpc_call_error check_server_start_success(grpc_call* call, */ static grpc_call_error check_next_success(grpc_call* call, const grpc_op* op, size_t nops, grpc_closure* closure) { + upb::Arena arena; alts_handshaker_client* client = static_cast(closure->cb_arg); GPR_ASSERT(alts_handshaker_client_get_closure_for_testing(client) == closure); - grpc_gcp_handshaker_req* req = deserialize_handshaker_req( - NEXT_REQ, alts_handshaker_client_get_send_buffer_for_testing(client)); - grpc_slice* in_bytes = static_cast(req->next.in_bytes.arg); - GPR_ASSERT(in_bytes != nullptr); - GPR_ASSERT(memcmp(GRPC_SLICE_START_PTR(*in_bytes), - ALTS_HANDSHAKER_CLIENT_TEST_OUT_FRAME, - GRPC_SLICE_LENGTH(*in_bytes)) == 0); + grpc_gcp_HandshakerReq* req = deserialize_handshaker_req( + alts_handshaker_client_get_send_buffer_for_testing(client), arena.ptr()); + const grpc_gcp_NextHandshakeMessageReq* next = + grpc_gcp_HandshakerReq_next(req); + GPR_ASSERT(upb_strview_eql( + grpc_gcp_NextHandshakeMessageReq_in_bytes(next), + upb_strview_makez(ALTS_HANDSHAKER_CLIENT_TEST_OUT_FRAME))); GPR_ASSERT(validate_op(client, op, nops, false /* is_start */)); - grpc_gcp_handshaker_req_destroy(req); return GRPC_CALL_OK; } + /** * A mock grpc_caller used to check if client_start, server_start, and next * operations correctly handle the situation when the grpc call made to the diff --git a/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test.cc b/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test.cc deleted file mode 100644 index 3506264f528..00000000000 --- a/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test.cc +++ /dev/null @@ -1,149 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include -#include -#include - -#include "test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.h" - -int main(int argc, char** argv) { - const char in_bytes[] = "HELLO GOOGLE!"; - const char out_frames[] = "HELLO WORLD!"; - const char key_data[] = "THIS IS KEY DATA."; - const char details[] = "DETAILS NEED TO BE POPULATED"; - const uint32_t max_rpc_version_major = 3; - const uint32_t max_rpc_version_minor = 2; - const uint32_t min_rpc_version_major = 2; - const uint32_t min_rpc_version_minor = 1; - - /* handshaker_req_next. */ - grpc_gcp_handshaker_req* req = grpc_gcp_handshaker_req_create(NEXT_REQ); - grpc_gcp_handshaker_req* decoded_req = - grpc_gcp_handshaker_decoded_req_create(NEXT_REQ); - GPR_ASSERT( - grpc_gcp_handshaker_req_set_in_bytes(req, in_bytes, strlen(in_bytes))); - grpc_slice encoded_req; - GPR_ASSERT(grpc_gcp_handshaker_req_encode(req, &encoded_req)); - GPR_ASSERT(grpc_gcp_handshaker_req_decode(encoded_req, decoded_req)); - GPR_ASSERT(grpc_gcp_handshaker_req_equals(req, decoded_req)); - grpc_gcp_handshaker_req_destroy(req); - grpc_gcp_handshaker_req_destroy(decoded_req); - grpc_slice_unref(encoded_req); - - /* handshaker_req_client_start. */ - req = grpc_gcp_handshaker_req_create(CLIENT_START_REQ); - decoded_req = grpc_gcp_handshaker_decoded_req_create(CLIENT_START_REQ); - GPR_ASSERT(grpc_gcp_handshaker_req_set_handshake_protocol( - req, grpc_gcp_HandshakeProtocol_TLS)); - GPR_ASSERT(grpc_gcp_handshaker_req_set_local_identity_hostname( - req, "www.google.com")); - GPR_ASSERT(grpc_gcp_handshaker_req_set_local_endpoint( - req, "2001:db8::8:800:200C:417a", 9876, grpc_gcp_NetworkProtocol_TCP)); - GPR_ASSERT(grpc_gcp_handshaker_req_set_remote_endpoint( - req, "2001:db8::bac5::fed0:84a2", 1234, grpc_gcp_NetworkProtocol_TCP)); - GPR_ASSERT(grpc_gcp_handshaker_req_add_application_protocol(req, "grpc")); - GPR_ASSERT(grpc_gcp_handshaker_req_add_application_protocol(req, "http2")); - GPR_ASSERT( - grpc_gcp_handshaker_req_add_record_protocol(req, "ALTSRP_GCM_AES256")); - GPR_ASSERT( - grpc_gcp_handshaker_req_add_record_protocol(req, "ALTSRP_GCM_AES384")); - GPR_ASSERT(grpc_gcp_handshaker_req_add_target_identity_service_account( - req, "foo@google.com")); - GPR_ASSERT(grpc_gcp_handshaker_req_set_target_name( - req, "google.example.library.service")); - GPR_ASSERT(grpc_gcp_handshaker_req_set_rpc_versions( - req, max_rpc_version_major, max_rpc_version_minor, min_rpc_version_major, - min_rpc_version_minor)); - GPR_ASSERT(grpc_gcp_handshaker_req_encode(req, &encoded_req)); - GPR_ASSERT(grpc_gcp_handshaker_req_decode(encoded_req, decoded_req)); - GPR_ASSERT(grpc_gcp_handshaker_req_equals(req, decoded_req)); - grpc_gcp_handshaker_req_destroy(req); - grpc_gcp_handshaker_req_destroy(decoded_req); - grpc_slice_unref(encoded_req); - - /* handshaker_req_server_start. */ - req = grpc_gcp_handshaker_req_create(SERVER_START_REQ); - decoded_req = grpc_gcp_handshaker_decoded_req_create(SERVER_START_REQ); - GPR_ASSERT(grpc_gcp_handshaker_req_add_application_protocol(req, "grpc")); - GPR_ASSERT(grpc_gcp_handshaker_req_add_application_protocol(req, "http2")); - GPR_ASSERT(grpc_gcp_handshaker_req_set_local_endpoint( - req, "2001:db8::8:800:200C:417a", 9876, grpc_gcp_NetworkProtocol_TCP)); - GPR_ASSERT(grpc_gcp_handshaker_req_set_remote_endpoint( - req, "2001:db8::bac5::fed0:84a2", 1234, grpc_gcp_NetworkProtocol_UDP)); - GPR_ASSERT( - grpc_gcp_handshaker_req_set_in_bytes(req, in_bytes, strlen(in_bytes))); - GPR_ASSERT(grpc_gcp_handshaker_req_param_add_record_protocol( - req, grpc_gcp_HandshakeProtocol_TLS, "ALTSRP_GCM_AES128")); - GPR_ASSERT(grpc_gcp_handshaker_req_param_add_local_identity_service_account( - req, grpc_gcp_HandshakeProtocol_TLS, "foo@google.com")); - GPR_ASSERT(grpc_gcp_handshaker_req_param_add_local_identity_hostname( - req, grpc_gcp_HandshakeProtocol_TLS, "yihuaz0.mtv.corp.google.com")); - GPR_ASSERT(grpc_gcp_handshaker_req_param_add_record_protocol( - req, grpc_gcp_HandshakeProtocol_ALTS, "ALTSRP_GCM_AES128")); - GPR_ASSERT(grpc_gcp_handshaker_req_param_add_local_identity_hostname( - req, grpc_gcp_HandshakeProtocol_ALTS, "www.amazon.com")); - GPR_ASSERT(grpc_gcp_handshaker_req_set_rpc_versions( - req, max_rpc_version_major, max_rpc_version_minor, min_rpc_version_major, - min_rpc_version_minor)); - - GPR_ASSERT(grpc_gcp_handshaker_req_encode(req, &encoded_req)); - GPR_ASSERT(grpc_gcp_handshaker_req_decode(encoded_req, decoded_req)); - GPR_ASSERT(grpc_gcp_handshaker_req_equals(req, decoded_req)); - grpc_gcp_handshaker_req_destroy(req); - grpc_gcp_handshaker_req_destroy(decoded_req); - grpc_slice_unref(encoded_req); - - /* handshaker_resp. */ - grpc_gcp_handshaker_resp* resp = grpc_gcp_handshaker_resp_create(); - grpc_gcp_handshaker_resp* decoded_resp = grpc_gcp_handshaker_resp_create(); - GPR_ASSERT(grpc_gcp_handshaker_resp_set_out_frames(resp, out_frames, - strlen(out_frames))); - GPR_ASSERT(grpc_gcp_handshaker_resp_set_bytes_consumed(resp, 1024)); - GPR_ASSERT(grpc_gcp_handshaker_resp_set_application_protocol(resp, "http")); - GPR_ASSERT( - grpc_gcp_handshaker_resp_set_record_protocol(resp, "ALTSRP_GCM_AES128")); - GPR_ASSERT( - grpc_gcp_handshaker_resp_set_key_data(resp, key_data, strlen(key_data))); - GPR_ASSERT(grpc_gcp_handshaker_resp_set_local_identity_hostname( - resp, "www.faceboook.com")); - GPR_ASSERT(grpc_gcp_handshaker_resp_set_peer_identity_hostname( - resp, "www.amazon.com")); - GPR_ASSERT(grpc_gcp_handshaker_resp_set_channel_open( - resp, false /* channel_open */)); - GPR_ASSERT(grpc_gcp_handshaker_resp_set_code(resp, 1023)); - GPR_ASSERT(grpc_gcp_handshaker_resp_set_details(resp, details)); - GPR_ASSERT(grpc_gcp_handshaker_resp_set_peer_rpc_versions( - resp, max_rpc_version_major, max_rpc_version_minor, min_rpc_version_major, - min_rpc_version_minor)); - grpc_slice encoded_resp; - GPR_ASSERT(grpc_gcp_handshaker_resp_encode(resp, &encoded_resp)); - GPR_ASSERT(grpc_gcp_handshaker_resp_decode(encoded_resp, decoded_resp)); - GPR_ASSERT(grpc_gcp_handshaker_resp_equals(resp, decoded_resp)); - grpc_gcp_handshaker_resp_destroy(resp); - grpc_gcp_handshaker_resp_destroy(decoded_resp); - grpc_slice_unref(encoded_resp); - /* Test invalid arguments. */ - GPR_ASSERT(!grpc_gcp_handshaker_req_set_in_bytes(nullptr, in_bytes, - strlen(in_bytes))); - GPR_ASSERT(!grpc_gcp_handshaker_req_param_add_record_protocol( - req, grpc_gcp_HandshakeProtocol_TLS, nullptr)); - GPR_ASSERT(!grpc_gcp_handshaker_req_param_add_local_identity_service_account( - nullptr, grpc_gcp_HandshakeProtocol_TLS, nullptr)); - GPR_ASSERT(!grpc_gcp_handshaker_resp_set_record_protocol(nullptr, nullptr)); -} diff --git a/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.cc b/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.cc index ecca04defa5..2ab73a26ff5 100644 --- a/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.cc +++ b/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.cc @@ -18,625 +18,146 @@ #include "test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.h" -const size_t kHandshakeProtocolNum = 3; - -grpc_gcp_handshaker_req* grpc_gcp_handshaker_decoded_req_create( - grpc_gcp_handshaker_req_type type) { - grpc_gcp_handshaker_req* req = - static_cast(gpr_zalloc(sizeof(*req))); - switch (type) { - case CLIENT_START_REQ: - req->has_client_start = true; - req->client_start.target_identities.funcs.decode = - decode_repeated_identity_cb; - req->client_start.application_protocols.funcs.decode = - decode_repeated_string_cb; - req->client_start.record_protocols.funcs.decode = - decode_repeated_string_cb; - req->client_start.local_identity.hostname.funcs.decode = - decode_string_or_bytes_cb; - req->client_start.local_identity.service_account.funcs.decode = - decode_string_or_bytes_cb; - req->client_start.local_endpoint.ip_address.funcs.decode = - decode_string_or_bytes_cb; - req->client_start.remote_endpoint.ip_address.funcs.decode = - decode_string_or_bytes_cb; - req->client_start.target_name.funcs.decode = decode_string_or_bytes_cb; - break; - case SERVER_START_REQ: - req->has_server_start = true; - req->server_start.application_protocols.funcs.decode = - &decode_repeated_string_cb; - for (size_t i = 0; i < kHandshakeProtocolNum; i++) { - req->server_start.handshake_parameters[i] - .value.local_identities.funcs.decode = &decode_repeated_identity_cb; - req->server_start.handshake_parameters[i] - .value.record_protocols.funcs.decode = &decode_repeated_string_cb; - } - req->server_start.in_bytes.funcs.decode = decode_string_or_bytes_cb; - req->server_start.local_endpoint.ip_address.funcs.decode = - decode_string_or_bytes_cb; - req->server_start.remote_endpoint.ip_address.funcs.decode = - decode_string_or_bytes_cb; - break; - case NEXT_REQ: - req->has_next = true; - break; - } - return req; -} - -bool grpc_gcp_handshaker_resp_set_application_protocol( - grpc_gcp_handshaker_resp* resp, const char* application_protocol) { - if (resp == nullptr || application_protocol == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to " - "handshaker_resp_set_application_protocol()."); - return false; - } - resp->has_result = true; - grpc_slice* slice = - create_slice(application_protocol, strlen(application_protocol)); - resp->result.application_protocol.arg = slice; - resp->result.application_protocol.funcs.encode = encode_string_or_bytes_cb; - return true; -} - -bool grpc_gcp_handshaker_resp_set_record_protocol( - grpc_gcp_handshaker_resp* resp, const char* record_protocol) { - if (resp == nullptr || record_protocol == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to " - "handshaker_resp_set_record_protocol()."); - return false; - } - resp->has_result = true; - grpc_slice* slice = create_slice(record_protocol, strlen(record_protocol)); - resp->result.record_protocol.arg = slice; - resp->result.record_protocol.funcs.encode = encode_string_or_bytes_cb; - return true; -} - -bool grpc_gcp_handshaker_resp_set_key_data(grpc_gcp_handshaker_resp* resp, - const char* key_data, size_t size) { - if (resp == nullptr || key_data == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to handshaker_resp_set_key_data()."); - return false; - } - resp->has_result = true; - grpc_slice* slice = create_slice(key_data, size); - resp->result.key_data.arg = slice; - resp->result.key_data.funcs.encode = encode_string_or_bytes_cb; - return true; -} - -static void set_identity_hostname(grpc_gcp_identity* identity, - const char* hostname) { - grpc_slice* slice = create_slice(hostname, strlen(hostname)); - identity->hostname.arg = slice; - identity->hostname.funcs.encode = encode_string_or_bytes_cb; -} - -static void set_identity_service_account(grpc_gcp_identity* identity, - const char* service_account) { - grpc_slice* slice = create_slice(service_account, strlen(service_account)); - identity->service_account.arg = slice; - identity->service_account.funcs.encode = encode_string_or_bytes_cb; -} - -bool grpc_gcp_handshaker_resp_set_local_identity_hostname( - grpc_gcp_handshaker_resp* resp, const char* hostname) { - if (resp == nullptr || hostname == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to " - "grpc_gcp_handshaker_resp_set_local_identity_hostname()."); - return false; - } - resp->has_result = true; - resp->result.has_local_identity = true; - set_identity_hostname(&resp->result.local_identity, hostname); - return true; -} - -bool grpc_gcp_handshaker_resp_set_local_identity_service_account( - grpc_gcp_handshaker_resp* resp, const char* service_account) { - if (resp == nullptr || service_account == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to " - "grpc_gcp_handshaker_resp_set_local_identity_service_account()."); - return false; - } - resp->has_result = true; - resp->result.has_local_identity = true; - set_identity_service_account(&resp->result.local_identity, service_account); - return true; -} - -bool grpc_gcp_handshaker_resp_set_peer_identity_hostname( - grpc_gcp_handshaker_resp* resp, const char* hostname) { - if (resp == nullptr || hostname == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to " - "grpc_gcp_handshaker_resp_set_peer_identity_hostname()."); - return false; - } - resp->has_result = true; - resp->result.has_peer_identity = true; - set_identity_hostname(&resp->result.peer_identity, hostname); - return true; -} - -bool grpc_gcp_handshaker_resp_set_peer_identity_service_account( - grpc_gcp_handshaker_resp* resp, const char* service_account) { - if (resp == nullptr || service_account == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to " - "grpc_gcp_handshaker_resp_set_peer_identity_service_account()."); - return false; - } - resp->has_result = true; - resp->result.has_peer_identity = true; - set_identity_service_account(&resp->result.peer_identity, service_account); - return true; -} - -bool grpc_gcp_handshaker_resp_set_channel_open(grpc_gcp_handshaker_resp* resp, - bool keep_channel_open) { - if (resp == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr argument to " - "grpc_gcp_handshaker_resp_set_channel_open()."); - return false; - } - resp->has_result = true; - resp->result.has_keep_channel_open = true; - resp->result.keep_channel_open = keep_channel_open; - return true; -} - -bool grpc_gcp_handshaker_resp_set_code(grpc_gcp_handshaker_resp* resp, - uint32_t code) { - if (resp == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr argument to grpc_gcp_handshaker_resp_set_code()."); - return false; - } - resp->has_status = true; - resp->status.has_code = true; - resp->status.code = code; - return true; -} - -bool grpc_gcp_handshaker_resp_set_details(grpc_gcp_handshaker_resp* resp, - const char* details) { - if (resp == nullptr || details == nullptr) { - gpr_log( - GPR_ERROR, - "Invalid nullptr arguments to grpc_gcp_handshaker_resp_set_details()."); - return false; - } - resp->has_status = true; - grpc_slice* slice = create_slice(details, strlen(details)); - resp->status.details.arg = slice; - resp->status.details.funcs.encode = encode_string_or_bytes_cb; - return true; -} - -bool grpc_gcp_handshaker_resp_set_out_frames(grpc_gcp_handshaker_resp* resp, - const char* out_frames, - size_t size) { - if (resp == nullptr || out_frames == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to " - "grpc_gcp_handshaker_resp_set_out_frames()."); - return false; - } - grpc_slice* slice = create_slice(out_frames, size); - resp->out_frames.arg = slice; - resp->out_frames.funcs.encode = encode_string_or_bytes_cb; - return true; -} - -bool grpc_gcp_handshaker_resp_set_bytes_consumed(grpc_gcp_handshaker_resp* resp, - int32_t bytes_consumed) { - if (resp == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr argument to " - "grpc_gcp_handshaker_resp_set_bytes_consumed()."); - return false; - } - resp->has_bytes_consumed = true; - resp->bytes_consumed = bytes_consumed; - return true; -} - bool grpc_gcp_handshaker_resp_set_peer_rpc_versions( - grpc_gcp_handshaker_resp* resp, uint32_t max_major, uint32_t max_minor, - uint32_t min_major, uint32_t min_minor) { + grpc_gcp_HandshakerResp* resp, upb_arena* arena, uint32_t max_major, + uint32_t max_minor, uint32_t min_major, uint32_t min_minor) { if (resp == nullptr) { gpr_log(GPR_ERROR, "Invalid nullptr argument to " "grpc_gcp_handshaker_resp_set_peer_rpc_versions()."); return false; } - resp->has_result = true; - resp->result.has_peer_rpc_versions = true; - grpc_gcp_rpc_protocol_versions* versions = &resp->result.peer_rpc_versions; - versions->has_max_rpc_version = true; - versions->has_min_rpc_version = true; - versions->max_rpc_version.has_major = true; - versions->max_rpc_version.has_minor = true; - versions->min_rpc_version.has_major = true; - versions->min_rpc_version.has_minor = true; - versions->max_rpc_version.major = max_major; - versions->max_rpc_version.minor = max_minor; - versions->min_rpc_version.major = min_major; - versions->min_rpc_version.minor = min_minor; + grpc_gcp_rpc_protocol_versions versions; + versions.max_rpc_version.major = max_major; + versions.max_rpc_version.minor = max_minor; + versions.min_rpc_version.major = min_major; + versions.min_rpc_version.minor = min_minor; + grpc_gcp_HandshakerResult* result = + grpc_gcp_HandshakerResp_mutable_result(resp, arena); + grpc_gcp_RpcProtocolVersions* upb_versions = + grpc_gcp_HandshakerResult_mutable_peer_rpc_versions(result, arena); + grpc_gcp_RpcProtocolVersions_assign_from_struct(upb_versions, arena, + &versions); return true; } -bool grpc_gcp_handshaker_resp_encode(grpc_gcp_handshaker_resp* resp, - grpc_slice* slice) { - if (resp == nullptr || slice == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to grpc_gcp_handshaker_resp_encode()."); - return false; +grpc_gcp_HandshakerReq* grpc_gcp_handshaker_req_decode(grpc_slice slice, + upb_arena* arena) { + size_t buf_size = GPR_SLICE_LENGTH(slice); + void* buf = upb_arena_malloc(arena, buf_size); + memcpy(buf, reinterpret_cast(GPR_SLICE_START_PTR(slice)), + buf_size); + grpc_gcp_HandshakerReq* resp = grpc_gcp_HandshakerReq_parse( + reinterpret_cast(buf), buf_size, arena); + if (!resp) { + gpr_log(GPR_ERROR, "grpc_gcp_HandshakerReq decode error"); + return nullptr; } - pb_ostream_t size_stream; - memset(&size_stream, 0, sizeof(pb_ostream_t)); - if (!pb_encode(&size_stream, grpc_gcp_HandshakerResp_fields, resp)) { - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&size_stream)); - return false; - } - size_t encoded_length = size_stream.bytes_written; - *slice = grpc_slice_malloc(encoded_length); - pb_ostream_t output_stream = - pb_ostream_from_buffer(GRPC_SLICE_START_PTR(*slice), encoded_length); - if (!pb_encode(&output_stream, grpc_gcp_HandshakerResp_fields, resp)) { - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&size_stream)); - return false; - } - return true; -} - -bool grpc_gcp_handshaker_req_decode(grpc_slice slice, - grpc_gcp_handshaker_req* req) { - if (req == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr argument to grpc_gcp_handshaker_req_decode()."); - return false; - } - pb_istream_t stream = pb_istream_from_buffer(GRPC_SLICE_START_PTR(slice), - GRPC_SLICE_LENGTH(slice)); - req->next.in_bytes.funcs.decode = decode_string_or_bytes_cb; - if (!pb_decode(&stream, grpc_gcp_HandshakerReq_fields, req)) { - gpr_log(GPR_ERROR, "nanopb error: %s", PB_GET_ERROR(&stream)); - return false; - } - return true; -} - -/* Check equality of a pair of grpc_slice fields. */ -static bool slice_equals(grpc_slice* l_slice, grpc_slice* r_slice) { - if (l_slice == nullptr && r_slice == nullptr) { - return true; - } - if (l_slice != nullptr && r_slice != nullptr) { - return grpc_slice_eq(*l_slice, *r_slice); - } - return false; + return resp; } /* Check equality of a pair of grpc_gcp_identity fields. */ -static bool handshaker_identity_equals(const grpc_gcp_identity* l_id, - const grpc_gcp_identity* r_id) { - if (!((l_id->hostname.arg != nullptr) != (r_id->hostname.arg != nullptr))) { - if (l_id->hostname.arg != nullptr) { - return slice_equals(static_cast(l_id->hostname.arg), - static_cast(r_id->hostname.arg)); - } - } else { - return false; - } - if (!((l_id->service_account.arg != nullptr) != - (r_id->service_account.arg != nullptr))) { - if (l_id->service_account.arg != nullptr) { - return slice_equals(static_cast(l_id->service_account.arg), - static_cast(r_id->service_account.arg)); - } - } else { +static bool handshaker_identity_equals(const grpc_gcp_Identity* l_id, + const grpc_gcp_Identity* r_id) { + if ((grpc_gcp_Identity_has_service_account(l_id) != + grpc_gcp_Identity_has_service_account(r_id)) || + (grpc_gcp_Identity_has_hostname(l_id) != + grpc_gcp_Identity_has_hostname(r_id))) { return false; } - return true; -} - -static bool handshaker_rpc_versions_equals( - const grpc_gcp_rpc_protocol_versions* l_version, - const grpc_gcp_rpc_protocol_versions* r_version) { - bool result = true; - result &= - (l_version->max_rpc_version.major == r_version->max_rpc_version.major); - result &= - (l_version->max_rpc_version.minor == r_version->max_rpc_version.minor); - result &= - (l_version->min_rpc_version.major == r_version->min_rpc_version.major); - result &= - (l_version->min_rpc_version.minor == r_version->min_rpc_version.minor); - return result; -} - -/* Check equality of a pair of grpc_gcp_endpoint fields. */ -static bool handshaker_endpoint_equals(const grpc_gcp_endpoint* l_end, - const grpc_gcp_endpoint* r_end) { - bool result = true; - result &= (l_end->port == r_end->port); - result &= (l_end->protocol == r_end->protocol); - if (!((l_end->ip_address.arg != nullptr) != - (r_end->ip_address.arg != nullptr))) { - if (l_end->ip_address.arg != nullptr) { - result &= slice_equals(static_cast(l_end->ip_address.arg), - static_cast(r_end->ip_address.arg)); - } - } else { - return false; - } - return result; -} -/** - * Check if a specific repeated field (i.e., target) is contained in a repeated - * field list (i.e., head). - */ -static bool repeated_field_list_contains_identity( - const repeated_field* head, const repeated_field* target) { - repeated_field* field = const_cast(head); - while (field != nullptr) { - if (handshaker_identity_equals( - static_cast(field->data), - static_cast(target->data))) { - return true; - } - field = field->next; - } - return false; -} - -static bool repeated_field_list_contains_string(const repeated_field* head, - const repeated_field* target) { - repeated_field* field = const_cast(head); - while (field != nullptr) { - if (slice_equals((grpc_slice*)field->data, (grpc_slice*)target->data)) { - return true; - } - field = field->next; - } - return false; -} - -/* Return a length of repeated field list. */ -static size_t repeated_field_list_get_length(const repeated_field* head) { - repeated_field* field = const_cast(head); - size_t len = 0; - while (field != nullptr) { - len++; - field = field->next; - } - return len; -} -/** - * Check if a pair of repeated field lists contain the same set of repeated - * fields. - */ -static bool repeated_field_list_equals_identity(const repeated_field* l_head, - const repeated_field* r_head) { - if (repeated_field_list_get_length(l_head) != - repeated_field_list_get_length(r_head)) { - return false; - } - repeated_field* field = const_cast(l_head); - repeated_field* head = const_cast(r_head); - while (field != nullptr) { - if (!repeated_field_list_contains_identity(head, field)) { + if (grpc_gcp_Identity_has_service_account(l_id)) { + if (!upb_strview_eql(grpc_gcp_Identity_service_account(l_id), + grpc_gcp_Identity_service_account(r_id))) { return false; } - field = field->next; - } - return true; -} - -static bool repeated_field_list_equals_string(const repeated_field* l_head, - const repeated_field* r_head) { - if (repeated_field_list_get_length(l_head) != - repeated_field_list_get_length(r_head)) { - return false; - } - repeated_field* field = const_cast(l_head); - repeated_field* head = const_cast(r_head); - while (field != nullptr) { - if (!repeated_field_list_contains_string(head, field)) { + } else if (grpc_gcp_Identity_has_hostname(l_id)) { + if (!upb_strview_eql(grpc_gcp_Identity_hostname(l_id), + grpc_gcp_Identity_hostname(r_id))) { return false; } - field = field->next; } return true; } -/* Check equality of a pair of ALTS client_start handshake requests. */ -bool grpc_gcp_handshaker_client_start_req_equals( - grpc_gcp_start_client_handshake_req* l_req, - grpc_gcp_start_client_handshake_req* r_req) { - bool result = true; - /* Compare handshake_security_protocol. */ - result &= - l_req->handshake_security_protocol == r_req->handshake_security_protocol; - /* Compare application_protocols, record_protocols, and target_identities. */ - result &= repeated_field_list_equals_string( - static_cast(l_req->application_protocols.arg), - static_cast(r_req->application_protocols.arg)); - result &= repeated_field_list_equals_string( - static_cast(l_req->record_protocols.arg), - static_cast(r_req->record_protocols.arg)); - result &= repeated_field_list_equals_identity( - static_cast(l_req->target_identities.arg), - static_cast(r_req->target_identities.arg)); - if ((l_req->has_local_identity ^ r_req->has_local_identity) | - (l_req->has_local_endpoint ^ r_req->has_local_endpoint) | - ((l_req->has_remote_endpoint ^ r_req->has_remote_endpoint)) | - (l_req->has_rpc_versions ^ r_req->has_rpc_versions)) { - return false; - } - /* Compare local_identity, local_endpoint, and remote_endpoint. */ - if (l_req->has_local_identity) { - result &= handshaker_identity_equals(&l_req->local_identity, - &r_req->local_identity); - } - if (l_req->has_local_endpoint) { - result &= handshaker_endpoint_equals(&l_req->local_endpoint, - &r_req->local_endpoint); - } - if (l_req->has_remote_endpoint) { - result &= handshaker_endpoint_equals(&l_req->remote_endpoint, - &r_req->remote_endpoint); - } - if (l_req->has_rpc_versions) { - result &= handshaker_rpc_versions_equals(&l_req->rpc_versions, - &r_req->rpc_versions); - } - return result; -} - -/* Check equality of a pair of ALTS server_start handshake requests. */ -bool grpc_gcp_handshaker_server_start_req_equals( - grpc_gcp_start_server_handshake_req* l_req, - grpc_gcp_start_server_handshake_req* r_req) { - bool result = true; - /* Compare application_protocols. */ - result &= repeated_field_list_equals_string( - static_cast(l_req->application_protocols.arg), - static_cast(r_req->application_protocols.arg)); - /* Compare handshake_parameters. */ - size_t i = 0, j = 0; - result &= - (l_req->handshake_parameters_count == r_req->handshake_parameters_count); - for (i = 0; i < l_req->handshake_parameters_count; i++) { - bool found = false; - for (j = 0; j < r_req->handshake_parameters_count; j++) { - if (l_req->handshake_parameters[i].key == - r_req->handshake_parameters[j].key) { - found = true; - result &= repeated_field_list_equals_string( - static_cast( - l_req->handshake_parameters[i].value.record_protocols.arg), - static_cast( - r_req->handshake_parameters[j].value.record_protocols.arg)); - result &= repeated_field_list_equals_identity( - static_cast( - l_req->handshake_parameters[i].value.local_identities.arg), - static_cast( - r_req->handshake_parameters[j].value.local_identities.arg)); - } - } - if (!found) { - return false; - } - } - /* Compare in_bytes, local_endpoint, remote_endpoint. */ - result &= slice_equals(static_cast(l_req->in_bytes.arg), - static_cast(r_req->in_bytes.arg)); - if ((l_req->has_local_endpoint ^ r_req->has_local_endpoint) | - (l_req->has_remote_endpoint ^ r_req->has_remote_endpoint) | - (l_req->has_rpc_versions ^ r_req->has_rpc_versions)) - return false; - if (l_req->has_local_endpoint) { - result &= handshaker_endpoint_equals(&l_req->local_endpoint, - &r_req->local_endpoint); - } - if (l_req->has_remote_endpoint) { - result &= handshaker_endpoint_equals(&l_req->remote_endpoint, - &r_req->remote_endpoint); - } - if (l_req->has_rpc_versions) { - result &= handshaker_rpc_versions_equals(&l_req->rpc_versions, - &r_req->rpc_versions); - } - return result; -} - -/* Check equality of a pair of ALTS handshake requests. */ -bool grpc_gcp_handshaker_req_equals(grpc_gcp_handshaker_req* l_req, - grpc_gcp_handshaker_req* r_req) { - if (l_req->has_next && r_req->has_next) { - return slice_equals(static_cast(l_req->next.in_bytes.arg), - static_cast(r_req->next.in_bytes.arg)); - } else if (l_req->has_client_start && r_req->has_client_start) { - return grpc_gcp_handshaker_client_start_req_equals(&l_req->client_start, - &r_req->client_start); - } else if (l_req->has_server_start && r_req->has_server_start) { - return grpc_gcp_handshaker_server_start_req_equals(&l_req->server_start, - &r_req->server_start); - } - return false; -} - -/* Check equality of a pair of ALTS handshake results. */ -bool grpc_gcp_handshaker_resp_result_equals( - grpc_gcp_handshaker_result* l_result, - grpc_gcp_handshaker_result* r_result) { - bool result = true; - /* Compare application_protocol, record_protocol, and key_data. */ - result &= slice_equals( - static_cast(l_result->application_protocol.arg), - static_cast(r_result->application_protocol.arg)); - result &= - slice_equals(static_cast(l_result->record_protocol.arg), - static_cast(r_result->record_protocol.arg)); - result &= slice_equals(static_cast(l_result->key_data.arg), - static_cast(r_result->key_data.arg)); - /* Compare local_identity, peer_identity, and keep_channel_open. */ - if ((l_result->has_local_identity ^ r_result->has_local_identity) | - (l_result->has_peer_identity ^ r_result->has_peer_identity) | - (l_result->has_peer_rpc_versions ^ r_result->has_peer_rpc_versions)) { - return false; - } - if (l_result->has_local_identity) { - result &= handshaker_identity_equals(&l_result->local_identity, - &r_result->local_identity); - } - if (l_result->has_peer_identity) { - result &= handshaker_identity_equals(&l_result->peer_identity, - &r_result->peer_identity); - } - if (l_result->has_peer_rpc_versions) { - result &= handshaker_rpc_versions_equals(&l_result->peer_rpc_versions, - &r_result->peer_rpc_versions); - } - result &= (l_result->keep_channel_open == r_result->keep_channel_open); - return result; +static bool handshaker_rpc_versions_equals( + const grpc_gcp_RpcProtocolVersions* l_version, + const grpc_gcp_RpcProtocolVersions* r_version) { + const grpc_gcp_RpcProtocolVersions_Version* l_maxver = + grpc_gcp_RpcProtocolVersions_max_rpc_version(l_version); + const grpc_gcp_RpcProtocolVersions_Version* r_maxver = + grpc_gcp_RpcProtocolVersions_max_rpc_version(r_version); + const grpc_gcp_RpcProtocolVersions_Version* l_minver = + grpc_gcp_RpcProtocolVersions_min_rpc_version(l_version); + const grpc_gcp_RpcProtocolVersions_Version* r_minver = + grpc_gcp_RpcProtocolVersions_min_rpc_version(r_version); + return (grpc_gcp_RpcProtocolVersions_Version_major(l_maxver) == + grpc_gcp_RpcProtocolVersions_Version_major(r_maxver)) && + (grpc_gcp_RpcProtocolVersions_Version_minor(l_maxver) == + grpc_gcp_RpcProtocolVersions_Version_minor(r_maxver)) && + (grpc_gcp_RpcProtocolVersions_Version_major(l_minver) == + grpc_gcp_RpcProtocolVersions_Version_major(r_minver)) && + (grpc_gcp_RpcProtocolVersions_Version_minor(l_minver) == + grpc_gcp_RpcProtocolVersions_Version_minor(r_minver)); } /* Check equality of a pair of ALTS handshake responses. */ -bool grpc_gcp_handshaker_resp_equals(grpc_gcp_handshaker_resp* l_resp, - grpc_gcp_handshaker_resp* r_resp) { - bool result = true; - /* Compare out_frames and bytes_consumed. */ - result &= slice_equals(static_cast(l_resp->out_frames.arg), - static_cast(r_resp->out_frames.arg)); - result &= (l_resp->bytes_consumed == r_resp->bytes_consumed); - /* Compare result and status. */ - if ((l_resp->has_result ^ r_resp->has_result) | - (l_resp->has_status ^ r_resp->has_status)) { +bool grpc_gcp_handshaker_resp_equals(const grpc_gcp_HandshakerResp* l_resp, + const grpc_gcp_HandshakerResp* r_resp) { + return upb_strview_eql(grpc_gcp_HandshakerResp_out_frames(l_resp), + grpc_gcp_HandshakerResp_out_frames(r_resp)) && + (grpc_gcp_HandshakerResp_bytes_consumed(l_resp) == + grpc_gcp_HandshakerResp_bytes_consumed(l_resp)) && + grpc_gcp_handshaker_resp_result_equals( + grpc_gcp_HandshakerResp_result(l_resp), + grpc_gcp_HandshakerResp_result(r_resp)) && + grpc_gcp_handshaker_resp_status_equals( + grpc_gcp_HandshakerResp_status(l_resp), + grpc_gcp_HandshakerResp_status(r_resp)); +} + +/* This method checks equality of two handshaker response results. */ +bool grpc_gcp_handshaker_resp_result_equals( + const grpc_gcp_HandshakerResult* l_result, + const grpc_gcp_HandshakerResult* r_result) { + if (l_result == nullptr && r_result == nullptr) { + return true; + } else if ((l_result != nullptr && r_result == nullptr) || + (l_result == nullptr && r_result != nullptr)) { + return false; + } + return upb_strview_eql( + grpc_gcp_HandshakerResult_application_protocol(l_result), + grpc_gcp_HandshakerResult_application_protocol(r_result)) && + upb_strview_eql(grpc_gcp_HandshakerResult_record_protocol(l_result), + grpc_gcp_HandshakerResult_record_protocol(r_result)) && + upb_strview_eql(grpc_gcp_HandshakerResult_key_data(l_result), + grpc_gcp_HandshakerResult_key_data(r_result)) && + handshaker_identity_equals( + grpc_gcp_HandshakerResult_peer_identity(l_result), + grpc_gcp_HandshakerResult_peer_identity(r_result)) && + handshaker_identity_equals( + grpc_gcp_HandshakerResult_local_identity(l_result), + grpc_gcp_HandshakerResult_local_identity(r_result)) && + (grpc_gcp_HandshakerResult_keep_channel_open(l_result) == + grpc_gcp_HandshakerResult_keep_channel_open(r_result)) && + handshaker_rpc_versions_equals( + grpc_gcp_HandshakerResult_peer_rpc_versions(l_result), + grpc_gcp_HandshakerResult_peer_rpc_versions(r_result)); +} + +/* This method checks equality of two handshaker response statuses. */ +bool grpc_gcp_handshaker_resp_status_equals( + const grpc_gcp_HandshakerStatus* l_status, + const grpc_gcp_HandshakerStatus* r_status) { + if (l_status == nullptr && r_status == nullptr) { + return true; + } else if ((l_status != nullptr && r_status == nullptr) || + (l_status == nullptr && r_status != nullptr)) { return false; } - if (l_resp->has_result) { - result &= grpc_gcp_handshaker_resp_result_equals(&l_resp->result, - &r_resp->result); - } - if (l_resp->has_status) { - result &= (l_resp->status.code == r_resp->status.code); - result &= - slice_equals(static_cast(l_resp->status.details.arg), - static_cast(r_resp->status.details.arg)); - } - return result; + return (grpc_gcp_HandshakerStatus_code(l_status) == + grpc_gcp_HandshakerStatus_code(r_status)) && + upb_strview_eql(grpc_gcp_HandshakerStatus_details(l_status), + grpc_gcp_HandshakerStatus_details(r_status)); } diff --git a/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.h b/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.h index 2fcbb4ea99a..d0a7cc836cd 100644 --- a/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.h +++ b/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.h @@ -19,9 +19,8 @@ #ifndef GRPC_TEST_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_SERVICE_API_TEST_LIB_H #define GRPC_TEST_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_SERVICE_API_TEST_LIB_H -#include "src/core/tsi/alts/handshaker/alts_handshaker_service_api.h" -#include "src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h" #include "src/core/tsi/alts/handshaker/transport_security_common_api.h" +#include "src/proto/grpc/gcp/handshaker.upb.h" /** * The first part of this file contains function signatures for de-serializing @@ -30,114 +29,27 @@ * service. */ -/** - * This method creates a ALTS handshaker request that is used to hold - * de-serialized result. - */ -grpc_gcp_handshaker_req* grpc_gcp_handshaker_decoded_req_create( - grpc_gcp_handshaker_req_type type); - -/* This method de-serializes a ALTS handshaker request. */ -bool grpc_gcp_handshaker_req_decode(grpc_slice slice, - grpc_gcp_handshaker_req* req); - -/* This method serializes a ALTS handshaker response. */ -bool grpc_gcp_handshaker_resp_encode(grpc_gcp_handshaker_resp* resp, - grpc_slice* slice); - -/* This method sets application protocol of ALTS handshaker response. */ -bool grpc_gcp_handshaker_resp_set_application_protocol( - grpc_gcp_handshaker_resp* resp, const char* application_protocol); - -/* This method sets record protocol of ALTS handshaker response. */ -bool grpc_gcp_handshaker_resp_set_record_protocol( - grpc_gcp_handshaker_resp* resp, const char* record_protocol); - -/* This method sets key_data of ALTS handshaker response. */ -bool grpc_gcp_handshaker_resp_set_key_data(grpc_gcp_handshaker_resp* resp, - const char* key_data, size_t size); - -/* This method sets local identity's hostname for ALTS handshaker response. */ -bool grpc_gcp_handshaker_resp_set_local_identity_hostname( - grpc_gcp_handshaker_resp* resp, const char* hostname); - -/** - * This method sets local identity's service account for ALTS handshaker - * response. - */ -bool grpc_gcp_handshaker_resp_set_local_identity_service_account( - grpc_gcp_handshaker_resp* resp, const char* service_account); - -/* This method sets peer identity's hostname for ALTS handshaker response. */ -bool grpc_gcp_handshaker_resp_set_peer_identity_hostname( - grpc_gcp_handshaker_resp* resp, const char* hostname); - -/** - * This method sets peer identity's service account for ALTS handshaker - * response. - */ -bool grpc_gcp_handshaker_resp_set_peer_identity_service_account( - grpc_gcp_handshaker_resp* resp, const char* service_account); - -/* This method sets keep_channel_open for ALTS handshaker response. */ -bool grpc_gcp_handshaker_resp_set_channel_open(grpc_gcp_handshaker_resp* resp, - bool keep_channel_open); - -/* This method sets code for ALTS handshaker response. */ -bool grpc_gcp_handshaker_resp_set_code(grpc_gcp_handshaker_resp* resp, - uint32_t code); - -/* This method sets details for ALTS handshaker response. */ -bool grpc_gcp_handshaker_resp_set_details(grpc_gcp_handshaker_resp* resp, - const char* details); - -/* This method sets out_frames for ALTS handshaker response. */ -bool grpc_gcp_handshaker_resp_set_out_frames(grpc_gcp_handshaker_resp* resp, - const char* out_frames, - size_t size); - /* This method sets peer_rpc_versions for ALTS handshaker response. */ bool grpc_gcp_handshaker_resp_set_peer_rpc_versions( - grpc_gcp_handshaker_resp* resp, uint32_t max_major, uint32_t max_minor, - uint32_t min_major, uint32_t min_minor); - -/* This method sets bytes_consumed for ALTS handshaker response. */ -bool grpc_gcp_handshaker_resp_set_bytes_consumed(grpc_gcp_handshaker_resp* resp, - int32_t bytes_consumed); - -/* This method serializes ALTS handshaker response. */ -bool grpc_gcp_handshaker_resp_encode(grpc_gcp_handshaker_resp* resp, - grpc_slice* slice); + grpc_gcp_HandshakerResp* resp, upb_arena* arena, uint32_t max_major, + uint32_t max_minor, uint32_t min_major, uint32_t min_minor); /* This method de-serializes ALTS handshaker request. */ -bool grpc_gcp_handshaker_req_decode(grpc_slice slice, - grpc_gcp_handshaker_req* req); +grpc_gcp_HandshakerReq* grpc_gcp_handshaker_req_decode(grpc_slice slice, + upb_arena* arena); -/** - * The second part contains function signatures for checking equality of a pair - * of ALTS handshake requests/responses. - */ - -/* This method checks equality of two client_start handshaker requests. */ -bool grpc_gcp_handshaker_client_start_req_equals( - grpc_gcp_start_client_handshake_req* l_req, - grpc_gcp_start_client_handshake_req* r_req); - -/* This method checks equality of two server_start handshaker requests. */ -bool grpc_gcp_handshaker_server_start_req_equals( - grpc_gcp_start_server_handshake_req* l_req, - grpc_gcp_start_server_handshake_req* r_req); - -/* This method checks equality of two ALTS handshaker requests. */ -bool grpc_gcp_handshaker_req_equals(grpc_gcp_handshaker_req* l_req, - grpc_gcp_handshaker_req* r_req); +/* This method checks equality of two ALTS handshaker responses. */ +bool grpc_gcp_handshaker_resp_equals(const grpc_gcp_HandshakerResp* l_resp, + const grpc_gcp_HandshakerResp* r_resp); /* This method checks equality of two handshaker response results. */ bool grpc_gcp_handshaker_resp_result_equals( - grpc_gcp_handshaker_result* l_result, grpc_gcp_handshaker_result* r_result); + const grpc_gcp_HandshakerResult* l_result, + const grpc_gcp_HandshakerResult* r_result); -/* This method checks equality of two ALTS handshaker responses. */ -bool grpc_gcp_handshaker_resp_equals(grpc_gcp_handshaker_resp* l_resp, - grpc_gcp_handshaker_resp* r_resp); +/* This method checks equality of two handshaker response statuses. */ +bool grpc_gcp_handshaker_resp_status_equals( + const grpc_gcp_HandshakerStatus* l_status, + const grpc_gcp_HandshakerStatus* r_status); #endif // GRPC_TEST_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_SERVICE_API_TEST_LIB_H diff --git a/test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc b/test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc index 316ff138160..37731379f22 100644 --- a/test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc +++ b/test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc @@ -110,55 +110,64 @@ static void wait(notification* n) { */ static grpc_byte_buffer* generate_handshaker_response( alts_handshaker_response_type type) { - grpc_gcp_handshaker_resp* resp = grpc_gcp_handshaker_resp_create(); - GPR_ASSERT(grpc_gcp_handshaker_resp_set_code(resp, 0)); + upb::Arena arena; + grpc_gcp_HandshakerResult* result; + grpc_gcp_Identity* peer_identity; + grpc_gcp_HandshakerResp* resp = grpc_gcp_HandshakerResp_new(arena.ptr()); + grpc_gcp_HandshakerStatus* status = + grpc_gcp_HandshakerResp_mutable_status(resp, arena.ptr()); + grpc_gcp_HandshakerStatus_set_code(status, 0); switch (type) { case INVALID: break; case CLIENT_START: case SERVER_START: - GPR_ASSERT(grpc_gcp_handshaker_resp_set_out_frames( - resp, ALTS_TSI_HANDSHAKER_TEST_OUT_FRAME, - strlen(ALTS_TSI_HANDSHAKER_TEST_OUT_FRAME))); + grpc_gcp_HandshakerResp_set_out_frames( + resp, upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_OUT_FRAME)); break; case CLIENT_NEXT: - GPR_ASSERT(grpc_gcp_handshaker_resp_set_out_frames( - resp, ALTS_TSI_HANDSHAKER_TEST_OUT_FRAME, - strlen(ALTS_TSI_HANDSHAKER_TEST_OUT_FRAME))); - GPR_ASSERT(grpc_gcp_handshaker_resp_set_peer_identity_service_account( - resp, ALTS_TSI_HANDSHAKER_TEST_PEER_IDENTITY)); - GPR_ASSERT(grpc_gcp_handshaker_resp_set_bytes_consumed( - resp, strlen(ALTS_TSI_HANDSHAKER_TEST_CONSUMED_BYTES))); - GPR_ASSERT(grpc_gcp_handshaker_resp_set_key_data( - resp, ALTS_TSI_HANDSHAKER_TEST_KEY_DATA, - strlen(ALTS_TSI_HANDSHAKER_TEST_KEY_DATA))); + grpc_gcp_HandshakerResp_set_out_frames( + resp, upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_OUT_FRAME)); + grpc_gcp_HandshakerResp_set_bytes_consumed( + resp, strlen(ALTS_TSI_HANDSHAKER_TEST_CONSUMED_BYTES)); + result = grpc_gcp_HandshakerResp_mutable_result(resp, arena.ptr()); + peer_identity = + grpc_gcp_HandshakerResult_mutable_peer_identity(result, arena.ptr()); + grpc_gcp_Identity_set_service_account( + peer_identity, + upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_PEER_IDENTITY)); + grpc_gcp_HandshakerResult_set_key_data( + result, upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_KEY_DATA)); GPR_ASSERT(grpc_gcp_handshaker_resp_set_peer_rpc_versions( - resp, ALTS_TSI_HANDSHAKER_TEST_MAX_RPC_VERSION_MAJOR, + resp, arena.ptr(), ALTS_TSI_HANDSHAKER_TEST_MAX_RPC_VERSION_MAJOR, ALTS_TSI_HANDSHAKER_TEST_MAX_RPC_VERSION_MINOR, ALTS_TSI_HANDSHAKER_TEST_MIN_RPC_VERSION_MAJOR, ALTS_TSI_HANDSHAKER_TEST_MIN_RPC_VERSION_MINOR)); break; case SERVER_NEXT: - GPR_ASSERT(grpc_gcp_handshaker_resp_set_peer_identity_service_account( - resp, ALTS_TSI_HANDSHAKER_TEST_PEER_IDENTITY)); - GPR_ASSERT(grpc_gcp_handshaker_resp_set_bytes_consumed( - resp, strlen(ALTS_TSI_HANDSHAKER_TEST_OUT_FRAME))); - GPR_ASSERT(grpc_gcp_handshaker_resp_set_key_data( - resp, ALTS_TSI_HANDSHAKER_TEST_KEY_DATA, - strlen(ALTS_TSI_HANDSHAKER_TEST_KEY_DATA))); + grpc_gcp_HandshakerResp_set_bytes_consumed( + resp, strlen(ALTS_TSI_HANDSHAKER_TEST_OUT_FRAME)); + result = grpc_gcp_HandshakerResp_mutable_result(resp, arena.ptr()); + peer_identity = + grpc_gcp_HandshakerResult_mutable_peer_identity(result, arena.ptr()); + grpc_gcp_Identity_set_service_account( + peer_identity, + upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_PEER_IDENTITY)); + grpc_gcp_HandshakerResult_set_key_data( + result, upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_KEY_DATA)); GPR_ASSERT(grpc_gcp_handshaker_resp_set_peer_rpc_versions( - resp, ALTS_TSI_HANDSHAKER_TEST_MAX_RPC_VERSION_MAJOR, + resp, arena.ptr(), ALTS_TSI_HANDSHAKER_TEST_MAX_RPC_VERSION_MAJOR, ALTS_TSI_HANDSHAKER_TEST_MAX_RPC_VERSION_MINOR, ALTS_TSI_HANDSHAKER_TEST_MIN_RPC_VERSION_MAJOR, ALTS_TSI_HANDSHAKER_TEST_MIN_RPC_VERSION_MINOR)); break; case FAILED: - GPR_ASSERT( - grpc_gcp_handshaker_resp_set_code(resp, 3 /* INVALID ARGUMENT */)); + grpc_gcp_HandshakerStatus_set_code(status, 3 /* INVALID ARGUMENT */); break; } - grpc_slice slice; - GPR_ASSERT(grpc_gcp_handshaker_resp_encode(resp, &slice)); + size_t buf_len; + char* buf = grpc_gcp_HandshakerResp_serialize(resp, arena.ptr(), &buf_len); + grpc_slice slice = gpr_slice_from_copied_buffer(buf, buf_len); if (type == INVALID) { grpc_slice bad_slice = grpc_slice_split_head(&slice, GRPC_SLICE_LENGTH(slice) - 1); @@ -169,7 +178,6 @@ static grpc_byte_buffer* generate_handshaker_response( grpc_byte_buffer* buffer = grpc_raw_byte_buffer_create(&slice, 1 /* number of slices */); grpc_slice_unref(slice); - grpc_gcp_handshaker_resp_destroy(resp); return buffer; } diff --git a/test/core/tsi/alts/handshaker/alts_tsi_utils_test.cc b/test/core/tsi/alts/handshaker/alts_tsi_utils_test.cc index 8d75d35368d..9b4c9f87d3e 100644 --- a/test/core/tsi/alts/handshaker/alts_tsi_utils_test.cc +++ b/test/core/tsi/alts/handshaker/alts_tsi_utils_test.cc @@ -36,18 +36,20 @@ static void convert_to_tsi_result_test() { } static void deserialize_response_test() { - grpc_gcp_handshaker_resp* resp = grpc_gcp_handshaker_resp_create(); - GPR_ASSERT(grpc_gcp_handshaker_resp_set_out_frames( - resp, ALTS_TSI_UTILS_TEST_OUT_FRAME, - strlen(ALTS_TSI_UTILS_TEST_OUT_FRAME))); - grpc_slice slice; - GPR_ASSERT(grpc_gcp_handshaker_resp_encode(resp, &slice)); + upb::Arena arena; + grpc_gcp_HandshakerResp* resp = grpc_gcp_HandshakerResp_new(arena.ptr()); + grpc_gcp_HandshakerResp_set_out_frames( + resp, upb_strview_makez(ALTS_TSI_UTILS_TEST_OUT_FRAME)); + size_t buf_len; + char* buf = grpc_gcp_HandshakerResp_serialize(resp, arena.ptr(), &buf_len); + grpc_slice slice = grpc_slice_from_copied_buffer(buf, buf_len); /* Valid serialization. */ + upb::Arena arena2; grpc_byte_buffer* buffer = grpc_raw_byte_buffer_create(&slice, 1 /* number of slices */); - grpc_gcp_handshaker_resp* decoded_resp = - alts_tsi_utils_deserialize_response(buffer); + grpc_gcp_HandshakerResp* decoded_resp = + alts_tsi_utils_deserialize_response(buffer, arena2.ptr()); GPR_ASSERT(grpc_gcp_handshaker_resp_equals(resp, decoded_resp)); grpc_byte_buffer_destroy(buffer); @@ -55,14 +57,13 @@ static void deserialize_response_test() { grpc_slice bad_slice = grpc_slice_split_head(&slice, GRPC_SLICE_LENGTH(slice) - 1); buffer = grpc_raw_byte_buffer_create(&bad_slice, 1 /* number of slices */); - GPR_ASSERT(alts_tsi_utils_deserialize_response(buffer) == nullptr); + GPR_ASSERT(alts_tsi_utils_deserialize_response(buffer, arena2.ptr()) == + nullptr); /* Clean up. */ grpc_slice_unref(slice); grpc_slice_unref(bad_slice); grpc_byte_buffer_destroy(buffer); - grpc_gcp_handshaker_resp_destroy(resp); - grpc_gcp_handshaker_resp_destroy(decoded_resp); } int main(int argc, char** argv) { diff --git a/test/core/tsi/alts/handshaker/transport_security_common_api_test.cc b/test/core/tsi/alts/handshaker/transport_security_common_api_test.cc index 6ff1357c270..a2c3d48ca53 100644 --- a/test/core/tsi/alts/handshaker/transport_security_common_api_test.cc +++ b/test/core/tsi/alts/handshaker/transport_security_common_api_test.cc @@ -31,25 +31,17 @@ static bool grpc_gcp_rpc_protocol_versions_equal( grpc_gcp_rpc_protocol_versions* l_versions, grpc_gcp_rpc_protocol_versions* r_versions) { GPR_ASSERT(l_versions != nullptr && r_versions != nullptr); - if ((l_versions->has_max_rpc_version ^ r_versions->has_max_rpc_version) | - (l_versions->has_min_rpc_version ^ r_versions->has_min_rpc_version)) { + if ((l_versions->max_rpc_version.major != + r_versions->max_rpc_version.major) || + (l_versions->max_rpc_version.minor != + r_versions->max_rpc_version.minor)) { return false; } - if (l_versions->has_max_rpc_version) { - if ((l_versions->max_rpc_version.major != - r_versions->max_rpc_version.major) || - (l_versions->max_rpc_version.minor != - r_versions->max_rpc_version.minor)) { - return false; - } - } - if (l_versions->has_min_rpc_version) { - if ((l_versions->min_rpc_version.major != - r_versions->min_rpc_version.major) || - (l_versions->min_rpc_version.minor != - r_versions->min_rpc_version.minor)) { - return false; - } + if ((l_versions->min_rpc_version.major != + r_versions->min_rpc_version.major) || + (l_versions->min_rpc_version.minor != + r_versions->min_rpc_version.minor)) { + return false; } return true; } @@ -61,25 +53,14 @@ static void test_success() { &version, kMaxRpcVersionMajor, kMaxRpcVersionMinor)); GPR_ASSERT(grpc_gcp_rpc_protocol_versions_set_min( &version, kMinRpcVersionMajor, kMinRpcVersionMinor)); - /* Serializes to raw bytes. */ - size_t encoded_length = - grpc_gcp_rpc_protocol_versions_encode_length(&version); - uint8_t* encoded_bytes = static_cast(gpr_malloc(encoded_length)); - GPR_ASSERT(grpc_gcp_rpc_protocol_versions_encode_to_raw_bytes( - &version, encoded_bytes, encoded_length)); - grpc_slice encoded_slice; /* Serializes to grpc slice. */ + grpc_slice encoded_slice; GPR_ASSERT(grpc_gcp_rpc_protocol_versions_encode(&version, &encoded_slice)); - /* Checks serialized raw bytes and serialized grpc slice have same content. */ - GPR_ASSERT(encoded_length == GRPC_SLICE_LENGTH(encoded_slice)); - GPR_ASSERT(memcmp(encoded_bytes, GRPC_SLICE_START_PTR(encoded_slice), - encoded_length) == 0); /* Deserializes and compares with the original version. */ GPR_ASSERT( grpc_gcp_rpc_protocol_versions_decode(encoded_slice, &decoded_version)); GPR_ASSERT(grpc_gcp_rpc_protocol_versions_equal(&version, &decoded_version)); grpc_slice_unref(encoded_slice); - gpr_free(encoded_bytes); } static void test_failure() { @@ -90,24 +71,14 @@ static void test_failure() { nullptr, kMaxRpcVersionMajor, kMaxRpcVersionMinor)); GPR_ASSERT(!grpc_gcp_rpc_protocol_versions_set_min( nullptr, kMinRpcVersionMajor, kMinRpcVersionMinor)); - GPR_ASSERT(grpc_gcp_rpc_protocol_versions_encode_length(nullptr) == 0); GPR_ASSERT(grpc_gcp_rpc_protocol_versions_set_max( &version, kMaxRpcVersionMajor, kMaxRpcVersionMinor)); GPR_ASSERT(grpc_gcp_rpc_protocol_versions_set_min( &version, kMinRpcVersionMajor, kMinRpcVersionMinor)); - size_t encoded_length = - grpc_gcp_rpc_protocol_versions_encode_length(&version); - uint8_t* encoded_bytes = static_cast(gpr_malloc(encoded_length)); - GPR_ASSERT(!grpc_gcp_rpc_protocol_versions_encode_to_raw_bytes( - nullptr, encoded_bytes, encoded_length)); - GPR_ASSERT(!grpc_gcp_rpc_protocol_versions_encode_to_raw_bytes( - &version, nullptr, encoded_length)); - GPR_ASSERT(!grpc_gcp_rpc_protocol_versions_encode_to_raw_bytes( - &version, encoded_bytes, 0)); GPR_ASSERT(!grpc_gcp_rpc_protocol_versions_encode(nullptr, &encoded_slice)); GPR_ASSERT(!grpc_gcp_rpc_protocol_versions_encode(&version, nullptr)); GPR_ASSERT(!grpc_gcp_rpc_protocol_versions_decode(encoded_slice, nullptr)); - /* Test for nanopb decode. */ + /* Test for upb decode. */ GPR_ASSERT(grpc_gcp_rpc_protocol_versions_encode(&version, &encoded_slice)); grpc_slice bad_slice = grpc_slice_split_head( &encoded_slice, GRPC_SLICE_LENGTH(encoded_slice) - 1); @@ -115,7 +86,6 @@ static void test_failure() { GPR_ASSERT( !grpc_gcp_rpc_protocol_versions_decode(bad_slice, &decoded_version)); grpc_slice_unref(bad_slice); - gpr_free(encoded_bytes); } static void test_copy() { diff --git a/test/core/tsi/ssl_transport_security_test.cc b/test/core/tsi/ssl_transport_security_test.cc index 5985b0ecaa5..c5e6e839b18 100644 --- a/test/core/tsi/ssl_transport_security_test.cc +++ b/test/core/tsi/ssl_transport_security_test.cc @@ -790,6 +790,41 @@ void ssl_tsi_test_duplicate_root_certificates() { gpr_free(dup_root_cert); } +void ssl_tsi_test_extract_x509_subject_names() { + char* cert = load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "multi-domain.pem"); + tsi_peer peer; + GPR_ASSERT(tsi_ssl_extract_x509_subject_names_from_pem_cert(cert, &peer) == + TSI_OK); + // One for common name, one for certificate, and six for SAN fields. + size_t expected_property_count = 8; + GPR_ASSERT(peer.property_count == expected_property_count); + // Check common name + const char* expected_cn = "xpigors"; + const tsi_peer_property* property = tsi_peer_get_property_by_name( + &peer, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY); + GPR_ASSERT(property != nullptr); + GPR_ASSERT( + memcmp(property->value.data, expected_cn, property->value.length) == 0); + // Check certificate data + property = tsi_peer_get_property_by_name(&peer, TSI_X509_PEM_CERT_PROPERTY); + GPR_ASSERT(property != nullptr); + GPR_ASSERT(memcmp(property->value.data, cert, property->value.length) == 0); + // Check DNS + GPR_ASSERT(check_subject_alt_name(&peer, "foo.test.domain.com") == 1); + GPR_ASSERT(check_subject_alt_name(&peer, "bar.test.domain.com") == 1); + // Check URI + GPR_ASSERT( + check_subject_alt_name(&peer, "https://foo.test.domain.com/test") == 1); + GPR_ASSERT( + check_subject_alt_name(&peer, "https://bar.test.domain.com/test") == 1); + // Check email address + GPR_ASSERT(check_subject_alt_name(&peer, "foo@test.domain.com") == 1); + GPR_ASSERT(check_subject_alt_name(&peer, "bar@test.domain.com") == 1); + // Free memory + gpr_free(cert); + tsi_peer_destruct(&peer); +} + int main(int argc, char** argv) { grpc::testing::TestEnvironment env(argc, argv); grpc_init(); @@ -815,6 +850,7 @@ int main(int argc, char** argv) { ssl_tsi_test_do_round_trip_odd_buffer_size(); ssl_tsi_test_handshaker_factory_internals(); ssl_tsi_test_duplicate_root_certificates(); + ssl_tsi_test_extract_x509_subject_names(); grpc_shutdown(); return 0; } diff --git a/test/core/util/test_lb_policies.cc b/test/core/util/test_lb_policies.cc index 041ce1f45a1..5ee2f5fe049 100644 --- a/test/core/util/test_lb_policies.cc +++ b/test/core/util/test_lb_policies.cc @@ -20,6 +20,8 @@ #include +#include + #include "src/core/ext/filters/client_channel/lb_policy.h" #include "src/core/ext/filters/client_channel/lb_policy_registry.h" #include "src/core/lib/channel/channel_args.h" @@ -115,7 +117,13 @@ class InterceptRecvTrailingMetadataLoadBalancingPolicy user_data_(user_data) {} PickResult Pick(PickArgs args) override { + // Check that we can read initial metadata. + gpr_log(GPR_INFO, "initial metadata:"); + InterceptRecvTrailingMetadataLoadBalancingPolicy::LogMetadata( + args.initial_metadata); + // Do pick. PickResult result = delegate_picker_->Pick(args); + // Intercept trailing metadata. if (result.type == PickResult::PICK_COMPLETE && result.subchannel != nullptr) { new (args.call_state->Alloc(sizeof(TrailingMetadataHandler))) @@ -180,11 +188,14 @@ class InterceptRecvTrailingMetadataLoadBalancingPolicy private: static void RecordRecvTrailingMetadata( - void* arg, grpc_metadata_batch* recv_trailing_metadata, + void* arg, grpc_error* error, MetadataInterface* recv_trailing_metadata, CallState* call_state) { TrailingMetadataHandler* self = static_cast(arg); GPR_ASSERT(recv_trailing_metadata != nullptr); + gpr_log(GPR_INFO, "trailing metadata:"); + InterceptRecvTrailingMetadataLoadBalancingPolicy::LogMetadata( + recv_trailing_metadata); self->cb_(self->user_data_); self->~TrailingMetadataHandler(); } @@ -192,6 +203,17 @@ class InterceptRecvTrailingMetadataLoadBalancingPolicy InterceptRecvTrailingMetadataCallback cb_; void* user_data_; }; + + static void LogMetadata(MetadataInterface* metadata) { + for (MetadataInterface::Iterator it = metadata->Begin(); + !metadata->IsEnd(it); metadata->Next(&it)) { + gpr_log(GPR_INFO, " \"%.*s\"=>\"%.*s\"", + static_cast(metadata->Key(it).size()), + metadata->Key(it).data(), + static_cast(metadata->Value(it).size()), + metadata->Value(it).data()); + } + } }; class InterceptTrailingFactory : public LoadBalancingPolicyFactory { diff --git a/test/cpp/end2end/BUILD b/test/cpp/end2end/BUILD index ab0ef0c46ba..5567170d371 100644 --- a/test/cpp/end2end/BUILD +++ b/test/cpp/end2end/BUILD @@ -78,6 +78,7 @@ grpc_cc_test( "//test/core/util:grpc_test_util", "//test/cpp/util:test_util", ], + tags = ["no_test_ios"], ) grpc_cc_test( @@ -89,6 +90,7 @@ grpc_cc_test( external_deps = [ "gtest", ], + tags = ["no_windows", "no_test_ios"], deps = [ ":test_service_impl", "//:gpr", @@ -99,7 +101,6 @@ grpc_cc_test( "//test/core/util:grpc_test_util", "//test/cpp/util:test_util", ], - tags = ["no_windows"], ) grpc_cc_test( @@ -121,6 +122,7 @@ grpc_cc_test( "//test/core/util:grpc_test_util", "//test/cpp/util:test_util", ], + tags = ["no_test_ios"], ) grpc_cc_binary( @@ -163,6 +165,25 @@ grpc_cc_test( "//test/core/util:grpc_test_util", "//test/cpp/util:test_util", ], + tags = ["no_test_ios"], +) + +grpc_cc_test( + name = "delegating_channel_test", + srcs = ["delegating_channel_test.cc"], + external_deps = [ + "gtest", + ], + deps = [ + ":test_service_impl", + "//:gpr", + "//:grpc", + "//:grpc++", + "//src/proto/grpc/testing:echo_messages_proto", + "//src/proto/grpc/testing:echo_proto", + "//test/core/util:grpc_test_util", + "//test/cpp/util:test_util", + ], ) grpc_cc_test( @@ -419,6 +440,7 @@ grpc_cc_test( "//test/core/util:test_lb_policies", "//test/cpp/util:test_util", ], + tags = ["no_test_ios"], ) grpc_cc_test( @@ -459,6 +481,7 @@ grpc_cc_test( "//test/core/util:grpc_test_util", "//test/cpp/util:test_util", ], + tags = ["no_test_ios"], ) grpc_cc_test( @@ -473,13 +496,15 @@ grpc_cc_test( "//:grpc", "//:grpc++", "//:grpc_resolver_fake", - "//src/proto/grpc/lb/v1:load_balancer_proto", + "//src/proto/grpc/lb/v2:eds_for_test_proto", + "//src/proto/grpc/lb/v2:lrs_for_test_proto", "//src/proto/grpc/testing:echo_messages_proto", "//src/proto/grpc/testing:echo_proto", "//src/proto/grpc/testing/duplicate:echo_duplicate_proto", "//test/core/util:grpc_test_util", "//test/cpp/util:test_util", ], + tags = ["no_test_ios"], ) grpc_cc_test( @@ -542,6 +567,7 @@ grpc_cc_test( "//test/core/util:grpc_test_util", "//test/cpp/util:test_util", ], + tags = ["no_test_ios"], ) grpc_cc_binary( @@ -595,6 +621,7 @@ grpc_cc_test( "//src/proto/grpc/testing:echo_proto", "//test/cpp/util:test_util", ], + tags = ["no_test_ios"], ) grpc_cc_test( @@ -603,7 +630,7 @@ grpc_cc_test( external_deps = [ "gtest", ], - tags = ["manual"], + tags = ["manual", "no_test_ios"], deps = [ ":test_service_impl", "//:gpr", @@ -640,6 +667,7 @@ grpc_cc_test( external_deps = [ "gtest", ], + tags = ["no_windows"], deps = [ "//:gpr", "//:grpc", @@ -650,7 +678,6 @@ grpc_cc_test( "//test/core/util:grpc_test_util", "//test/cpp/util:test_util", ], - tags = ["no_windows"], ) grpc_cc_test( @@ -670,6 +697,7 @@ grpc_cc_test( "//test/core/util:grpc_test_util", "//test/cpp/util:test_util", ], + tags = ["no_test_ios"], ) grpc_cc_test( @@ -678,7 +706,7 @@ grpc_cc_test( external_deps = [ "gtest", ], - tags = ["manual"], # test requires root, won't work with bazel RBE + tags = ["manual", "no_test_ios"], # test requires root, won't work with bazel RBE deps = [ ":test_service_impl", "//:gpr", @@ -700,8 +728,8 @@ grpc_cc_test( ], deps = [ ":test_service_impl", - "//:grpc", "//:gpr", + "//:grpc", "//:grpc++", "//src/proto/grpc/testing:echo_messages_proto", "//src/proto/grpc/testing:echo_proto", @@ -727,5 +755,5 @@ grpc_cc_test( "//test/core/util:grpc_test_util", "//test/cpp/util:test_util", ], + tags = ["no_test_ios"], ) - diff --git a/test/cpp/end2end/channelz_service_test.cc b/test/cpp/end2end/channelz_service_test.cc index 69c56c574f9..1ed2d8c65f2 100644 --- a/test/cpp/end2end/channelz_service_test.cc +++ b/test/cpp/end2end/channelz_service_test.cc @@ -571,6 +571,8 @@ TEST_F(ChannelzServerTest, ManySubchannelsAndSockets) { get_subchannel_resp.subchannel().socket_ref(0).socket_id()); s = channelz_stub_->GetSocket(&get_socket_ctx, get_socket_req, &get_socket_resp); + EXPECT_TRUE( + get_subchannel_resp.subchannel().socket_ref(0).name().find("http")); EXPECT_TRUE(s.ok()) << s.error_message(); // calls started == streams started AND stream succeeded. Since none of // these RPCs were canceled, all of the streams will succeeded even though @@ -626,6 +628,8 @@ TEST_F(ChannelzServerTest, StreamingRPC) { ClientContext get_socket_context; get_socket_request.set_socket_id( get_subchannel_response.subchannel().socket_ref(0).socket_id()); + EXPECT_TRUE( + get_subchannel_response.subchannel().socket_ref(0).name().find("http")); s = channelz_stub_->GetSocket(&get_socket_context, get_socket_request, &get_socket_response); EXPECT_TRUE(s.ok()) << "s.error_message() = " << s.error_message(); @@ -659,6 +663,7 @@ TEST_F(ChannelzServerTest, GetServerSocketsTest) { &get_server_sockets_response); EXPECT_TRUE(s.ok()) << "s.error_message() = " << s.error_message(); EXPECT_EQ(get_server_sockets_response.socket_ref_size(), 1); + EXPECT_TRUE(get_server_sockets_response.socket_ref(0).name().find("http")); } TEST_F(ChannelzServerTest, GetServerSocketsPaginationTest) { @@ -738,6 +743,8 @@ TEST_F(ChannelzServerTest, GetServerListenSocketsTest) { GetSocketResponse get_socket_response; get_socket_request.set_socket_id( get_server_response.server(0).listen_socket(0).socket_id()); + EXPECT_TRUE( + get_server_response.server(0).listen_socket(0).name().find("http")); ClientContext get_socket_context; s = channelz_stub_->GetSocket(&get_socket_context, get_socket_request, &get_socket_response); diff --git a/test/cpp/end2end/client_lb_end2end_test.cc b/test/cpp/end2end/client_lb_end2end_test.cc index dac7860141c..ceab7506729 100644 --- a/test/cpp/end2end/client_lb_end2end_test.cc +++ b/test/cpp/end2end/client_lb_end2end_test.cc @@ -1471,7 +1471,7 @@ TEST_F(ClientLbEnd2endTest, ChannelIdleness) { StartServers(kNumServers); // Set max idle time and build the channel. ChannelArguments args; - args.SetInt(GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS, 100); + args.SetInt(GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS, 1000); auto response_generator = BuildResolverResponseGenerator(); auto channel = BuildChannel("", response_generator, args); auto stub = BuildStub(channel); @@ -1483,7 +1483,7 @@ TEST_F(ClientLbEnd2endTest, ChannelIdleness) { EXPECT_EQ(channel->GetState(false), GRPC_CHANNEL_READY); // After a period time not using the channel, the channel state should switch // to IDLE. - gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(120)); + gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(1200)); EXPECT_EQ(channel->GetState(false), GRPC_CHANNEL_IDLE); // Sending a new RPC should awake the IDLE channel. response_generator.SetNextResolution(GetServersPorts()); diff --git a/test/cpp/end2end/delegating_channel_test.cc b/test/cpp/end2end/delegating_channel_test.cc new file mode 100644 index 00000000000..4b8ff6f353e --- /dev/null +++ b/test/cpp/end2end/delegating_channel_test.cc @@ -0,0 +1,100 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "src/proto/grpc/testing/echo.grpc.pb.h" +#include "test/core/util/port.h" +#include "test/core/util/test_config.h" +#include "test/cpp/end2end/test_service_impl.h" +#include "test/cpp/util/byte_buffer_proto_helper.h" +#include "test/cpp/util/string_ref_helper.h" + +#include + +namespace grpc { +namespace testing { +namespace { + +class TestChannel : public experimental::DelegatingChannel { + public: + TestChannel(const std::shared_ptr& delegate_channel) + : experimental::DelegatingChannel(delegate_channel) {} + // Always returns GRPC_CHANNEL_READY + grpc_connectivity_state GetState(bool try_to_connect) override { + return GRPC_CHANNEL_READY; + } +}; + +class DelegatingChannelTest : public ::testing::Test { + protected: + DelegatingChannelTest() { + int port = grpc_pick_unused_port_or_die(); + ServerBuilder builder; + server_address_ = "localhost:" + std::to_string(port); + builder.AddListeningPort(server_address_, InsecureServerCredentials()); + builder.RegisterService(&service_); + server_ = builder.BuildAndStart(); + } + + ~DelegatingChannelTest() { server_->Shutdown(); } + + std::string server_address_; + TestServiceImpl service_; + std::unique_ptr server_; +}; + +TEST_F(DelegatingChannelTest, SimpleTest) { + auto channel = CreateChannel(server_address_, InsecureChannelCredentials()); + std::shared_ptr test_channel = + std::make_shared(channel); + // gRPC channel should be in idle state at this point but our test channel + // will return ready. + EXPECT_EQ(channel->GetState(false), GRPC_CHANNEL_IDLE); + EXPECT_EQ(test_channel->GetState(false), GRPC_CHANNEL_READY); + auto stub = grpc::testing::EchoTestService::NewStub(test_channel); + ClientContext ctx; + EchoRequest req; + req.set_message("Hello"); + EchoResponse resp; + Status s = stub->Echo(&ctx, req, &resp); + EXPECT_EQ(s.ok(), true); + EXPECT_EQ(resp.message(), "Hello"); +} + +} // namespace +} // namespace testing +} // namespace grpc + +int main(int argc, char** argv) { + grpc::testing::TestEnvironment env(argc, argv); + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/test/cpp/end2end/filter_end2end_test.cc b/test/cpp/end2end/filter_end2end_test.cc index e96825c33eb..a224d6596a3 100644 --- a/test/cpp/end2end/filter_end2end_test.cc +++ b/test/cpp/end2end/filter_end2end_test.cc @@ -122,9 +122,14 @@ class FilterEnd2endTest : public ::testing::Test { FilterEnd2endTest() : server_host_("localhost") {} static void SetUpTestCase() { - gpr_log(GPR_ERROR, "In SetUpTestCase"); - grpc::RegisterChannelFilter( - "test-filter", GRPC_SERVER_CHANNEL, INT_MAX, nullptr); + // Workaround for + // https://github.com/google/google-toolbox-for-mac/issues/242 + static bool setup_done = false; + if (!setup_done) { + setup_done = true; + grpc::RegisterChannelFilter( + "test-filter", GRPC_SERVER_CHANNEL, INT_MAX, nullptr); + } } void SetUp() override { diff --git a/test/cpp/end2end/time_change_test.cc b/test/cpp/end2end/time_change_test.cc index 688549e5772..a42b7bf6498 100644 --- a/test/cpp/end2end/time_change_test.cc +++ b/test/cpp/end2end/time_change_test.cc @@ -129,25 +129,34 @@ class TimeChangeTest : public ::testing::Test { protected: TimeChangeTest() {} - void SetUp() { + static void SetUpTestCase() { auto port = grpc_pick_unused_port_or_die(); std::ostringstream addr_stream; addr_stream << "localhost:" << port; - auto addr = addr_stream.str(); + server_address_ = addr_stream.str(); server_.reset(new SubProcess({ g_root + "/client_crash_test_server", - "--address=" + addr, + "--address=" + server_address_, })); GPR_ASSERT(server_); - channel_ = grpc::CreateChannel(addr, InsecureChannelCredentials()); + // connect to server and make sure it's reachable. + auto channel = + grpc::CreateChannel(server_address_, InsecureChannelCredentials()); + GPR_ASSERT(channel); + EXPECT_TRUE(channel->WaitForConnected( + grpc_timeout_milliseconds_to_deadline(30000))); + } + + static void TearDownTestCase() { server_.reset(); } + + void SetUp() { + channel_ = + grpc::CreateChannel(server_address_, InsecureChannelCredentials()); GPR_ASSERT(channel_); stub_ = grpc::testing::EchoTestService::NewStub(channel_); } - void TearDown() { - server_.reset(); - reset_now_offset(); - } + void TearDown() { reset_now_offset(); } std::unique_ptr CreateStub() { return grpc::testing::EchoTestService::NewStub(channel_); @@ -159,10 +168,13 @@ class TimeChangeTest : public ::testing::Test { const int TIME_OFFSET2 = 5678; private: - std::unique_ptr server_; + static std::string server_address_; + static std::unique_ptr server_; std::shared_ptr channel_; std::unique_ptr stub_; }; +std::string TimeChangeTest::server_address_; +std::unique_ptr TimeChangeTest::server_; // Wall-clock time jumps forward on client before bidi stream is created TEST_F(TimeChangeTest, TimeJumpForwardBeforeStreamCreated) { @@ -283,76 +295,6 @@ TEST_F(TimeChangeTest, TimeJumpBackAfterStreamCreated) { EXPECT_TRUE(status.ok()); } -// Wall-clock time jumps forward on client before connection to server is up -TEST_F(TimeChangeTest, TimeJumpForwardBeforeServerConnect) { - EchoRequest request; - EchoResponse response; - ClientContext context; - context.set_deadline(grpc_timeout_milliseconds_to_deadline(5000)); - context.AddMetadata(kServerResponseStreamsToSend, "2"); - - auto channel = GetChannel(); - GPR_ASSERT(channel); - - // time jumps forward by TIME_OFFSET2 milliseconds - set_now_offset(TIME_OFFSET2); - - auto ret = - channel->WaitForConnected(grpc_timeout_milliseconds_to_deadline(5000)); - // We use monotonic clock for pthread_cond_timedwait() deadline on linux, and - // realtime clock on other platforms - see gpr_cv_wait() in sync_posix.cc. - // So changes in system clock affect deadlines on non-linux platforms -#ifdef GPR_LINUX - EXPECT_TRUE(ret); - auto stub = CreateStub(); - auto stream = stub->BidiStream(&context); - - request.set_message("Hello"); - EXPECT_TRUE(stream->Write(request)); - EXPECT_TRUE(stream->Read(&response)); - request.set_message("World"); - EXPECT_TRUE(stream->Write(request)); - EXPECT_TRUE(stream->WritesDone()); - EXPECT_TRUE(stream->Read(&response)); - - auto status = stream->Finish(); - EXPECT_TRUE(status.ok()); -#else - EXPECT_FALSE(ret); -#endif -} - -// Wall-clock time jumps back on client before connection to server is up -TEST_F(TimeChangeTest, TimeJumpBackBeforeServerConnect) { - EchoRequest request; - EchoResponse response; - ClientContext context; - context.set_deadline(grpc_timeout_milliseconds_to_deadline(5000)); - context.AddMetadata(kServerResponseStreamsToSend, "2"); - - auto channel = GetChannel(); - GPR_ASSERT(channel); - - // time jumps back by TIME_OFFSET2 milliseconds - set_now_offset(-TIME_OFFSET2); - - EXPECT_TRUE( - channel->WaitForConnected(grpc_timeout_milliseconds_to_deadline(5000))); - auto stub = CreateStub(); - auto stream = stub->BidiStream(&context); - - request.set_message("Hello"); - EXPECT_TRUE(stream->Write(request)); - EXPECT_TRUE(stream->Read(&response)); - request.set_message("World"); - EXPECT_TRUE(stream->Write(request)); - EXPECT_TRUE(stream->WritesDone()); - EXPECT_TRUE(stream->Read(&response)); - - auto status = stream->Finish(); - EXPECT_TRUE(status.ok()); -} - // Wall-clock time jumps forward and backwards during call TEST_F(TimeChangeTest, TimeJumpForwardAndBackDuringCall) { EchoRequest request; diff --git a/test/cpp/end2end/xds_end2end_test.cc b/test/cpp/end2end/xds_end2end_test.cc index 5e7717e4e06..480680c9a32 100644 --- a/test/cpp/end2end/xds_end2end_test.cc +++ b/test/cpp/end2end/xds_end2end_test.cc @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -38,7 +39,9 @@ #include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h" #include "src/core/ext/filters/client_channel/server_address.h" #include "src/core/lib/gpr/env.h" +#include "src/core/lib/gprpp/map.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" +#include "src/core/lib/gprpp/sync.h" #include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/security/credentials/fake/fake_credentials.h" #include "src/cpp/client/secure_credentials.h" @@ -48,7 +51,8 @@ #include "test/core/util/test_config.h" #include "test/cpp/end2end/test_service_impl.h" -#include "src/proto/grpc/lb/v1/load_balancer.grpc.pb.h" +#include "src/proto/grpc/lb/v2/eds_for_test.grpc.pb.h" +#include "src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.h" #include "src/proto/grpc/testing/echo.grpc.pb.h" #include @@ -71,46 +75,62 @@ // 2) the retry timer is active. Again, the weak reference it holds should // prevent a premature call to \a glb_destroy. -using std::chrono::system_clock; - -using grpc::lb::v1::LoadBalanceRequest; -using grpc::lb::v1::LoadBalanceResponse; -using grpc::lb::v1::LoadBalancer; - namespace grpc { namespace testing { namespace { +using std::chrono::system_clock; + +using ::envoy::api::v2::ClusterLoadAssignment; +using ::envoy::api::v2::DiscoveryRequest; +using ::envoy::api::v2::DiscoveryResponse; +using ::envoy::api::v2::EndpointDiscoveryService; +using ::envoy::api::v2::FractionalPercent; +using ::envoy::service::load_stats::v2::ClusterStats; +using ::envoy::service::load_stats::v2::LoadReportingService; +using ::envoy::service::load_stats::v2::LoadStatsRequest; +using ::envoy::service::load_stats::v2::LoadStatsResponse; +using ::envoy::service::load_stats::v2::UpstreamLocalityStats; + +constexpr char kEdsTypeUrl[] = + "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment"; +constexpr char kDefaultLocalityRegion[] = "xds_default_locality_region"; +constexpr char kDefaultLocalityZone[] = "xds_default_locality_zone"; +constexpr char kDefaultLocalitySubzone[] = "xds_default_locality_subzone"; +constexpr char kLbDropType[] = "lb"; +constexpr char kThrottleDropType[] = "throttle"; +constexpr int kDefaultLocalityWeight = 3; + template class CountedService : public ServiceType { public: size_t request_count() { - grpc::internal::MutexLock lock(&mu_); + grpc_core::MutexLock lock(&mu_); return request_count_; } size_t response_count() { - grpc::internal::MutexLock lock(&mu_); + grpc_core::MutexLock lock(&mu_); return response_count_; } void IncreaseResponseCount() { - grpc::internal::MutexLock lock(&mu_); + grpc_core::MutexLock lock(&mu_); ++response_count_; } void IncreaseRequestCount() { - grpc::internal::MutexLock lock(&mu_); + grpc_core::MutexLock lock(&mu_); ++request_count_; } void ResetCounters() { - grpc::internal::MutexLock lock(&mu_); + grpc_core::MutexLock lock(&mu_); request_count_ = 0; response_count_ = 0; } protected: - grpc::internal::Mutex mu_; + grpc_core::Mutex mu_; private: size_t request_count_ = 0; @@ -118,7 +138,8 @@ class CountedService : public ServiceType { }; using BackendService = CountedService; -using BalancerService = CountedService; +using EdsService = CountedService; +using LrsService = CountedService; const char g_kCallCredsMdKey[] = "Balancer should not ..."; const char g_kCallCredsMdValue[] = "... receive me"; @@ -143,202 +164,222 @@ class BackendServiceImpl : public BackendService { return status; } + void Start() {} void Shutdown() {} std::set clients() { - grpc::internal::MutexLock lock(&clients_mu_); + grpc_core::MutexLock lock(&clients_mu_); return clients_; } private: void AddClient(const grpc::string& client) { - grpc::internal::MutexLock lock(&clients_mu_); + grpc_core::MutexLock lock(&clients_mu_); clients_.insert(client); } - grpc::internal::Mutex mu_; - grpc::internal::Mutex clients_mu_; + grpc_core::Mutex mu_; + grpc_core::Mutex clients_mu_; std::set clients_; }; -grpc::string Ip4ToPackedString(const char* ip_str) { - struct in_addr ip4; - GPR_ASSERT(inet_pton(AF_INET, ip_str, &ip4) == 1); - return grpc::string(reinterpret_cast(&ip4), sizeof(ip4)); -} +class ClientStats { + public: + struct LocalityStats { + // Converts from proto message class. + LocalityStats(const UpstreamLocalityStats& upstream_locality_stats) + : total_successful_requests( + upstream_locality_stats.total_successful_requests()), + total_requests_in_progress( + upstream_locality_stats.total_requests_in_progress()), + total_error_requests(upstream_locality_stats.total_error_requests()), + total_issued_requests( + upstream_locality_stats.total_issued_requests()) {} + + uint64_t total_successful_requests; + uint64_t total_requests_in_progress; + uint64_t total_error_requests; + uint64_t total_issued_requests; + }; -struct ClientStats { - size_t num_calls_started = 0; - size_t num_calls_finished = 0; - size_t num_calls_finished_with_client_failed_to_send = 0; - size_t num_calls_finished_known_received = 0; - std::map drop_token_counts; - - ClientStats& operator+=(const ClientStats& other) { - num_calls_started += other.num_calls_started; - num_calls_finished += other.num_calls_finished; - num_calls_finished_with_client_failed_to_send += - other.num_calls_finished_with_client_failed_to_send; - num_calls_finished_known_received += - other.num_calls_finished_known_received; - for (const auto& p : other.drop_token_counts) { - drop_token_counts[p.first] += p.second; + // Converts from proto message class. + ClientStats(const ClusterStats& cluster_stats) + : total_dropped_requests_(cluster_stats.total_dropped_requests()) { + for (const auto& input_locality_stats : + cluster_stats.upstream_locality_stats()) { + locality_stats_.emplace(input_locality_stats.locality().sub_zone(), + LocalityStats(input_locality_stats)); + } + for (const auto& input_dropped_requests : + cluster_stats.dropped_requests()) { + dropped_requests_.emplace(input_dropped_requests.category(), + input_dropped_requests.dropped_count()); } - return *this; } - void Reset() { - num_calls_started = 0; - num_calls_finished = 0; - num_calls_finished_with_client_failed_to_send = 0; - num_calls_finished_known_received = 0; - drop_token_counts.clear(); + uint64_t total_successful_requests() const { + uint64_t sum = 0; + for (auto& p : locality_stats_) { + sum += p.second.total_successful_requests; + } + return sum; } + uint64_t total_requests_in_progress() const { + uint64_t sum = 0; + for (auto& p : locality_stats_) { + sum += p.second.total_requests_in_progress; + } + return sum; + } + uint64_t total_error_requests() const { + uint64_t sum = 0; + for (auto& p : locality_stats_) { + sum += p.second.total_error_requests; + } + return sum; + } + uint64_t total_issued_requests() const { + uint64_t sum = 0; + for (auto& p : locality_stats_) { + sum += p.second.total_issued_requests; + } + return sum; + } + uint64_t total_dropped_requests() const { return total_dropped_requests_; } + uint64_t dropped_requests(const grpc::string& category) const { + auto iter = dropped_requests_.find(category); + GPR_ASSERT(iter != dropped_requests_.end()); + return iter->second; + } + + private: + std::map locality_stats_; + uint64_t total_dropped_requests_; + std::map dropped_requests_; }; -class BalancerServiceImpl : public BalancerService { +class EdsServiceImpl : public EdsService { public: - using Stream = ServerReaderWriter; - using ResponseDelayPair = std::pair; - - explicit BalancerServiceImpl(int client_load_reporting_interval_seconds) - : client_load_reporting_interval_seconds_( - client_load_reporting_interval_seconds) {} + using Stream = ServerReaderWriter; + using ResponseDelayPair = std::pair; - Status BalanceLoad(ServerContext* context, Stream* stream) override { - // TODO(juanlishen): Clean up the scoping. - gpr_log(GPR_INFO, "LB[%p]: BalanceLoad", this); - { - grpc::internal::MutexLock lock(&mu_); - if (serverlist_done_) goto done; - } - { + Status StreamEndpoints(ServerContext* context, Stream* stream) override { + gpr_log(GPR_INFO, "LB[%p]: EDS StreamEndpoints starts", this); + [&]() { + { + grpc_core::MutexLock lock(&eds_mu_); + if (eds_done_) return; + } // Balancer shouldn't receive the call credentials metadata. EXPECT_EQ(context->client_metadata().find(g_kCallCredsMdKey), context->client_metadata().end()); - LoadBalanceRequest request; - std::vector responses_and_delays; - - if (!stream->Read(&request)) { - goto done; - } + // Read request. + DiscoveryRequest request; + if (!stream->Read(&request)) return; IncreaseRequestCount(); gpr_log(GPR_INFO, "LB[%p]: received initial message '%s'", this, request.DebugString().c_str()); - - { - LoadBalanceResponse initial_response; - initial_response.mutable_initial_response() - ->mutable_client_stats_report_interval() - ->set_seconds(client_load_reporting_interval_seconds_); - stream->Write(initial_response); - } - + // Send response. + std::vector responses_and_delays; { - grpc::internal::MutexLock lock(&mu_); + grpc_core::MutexLock lock(&eds_mu_); responses_and_delays = responses_and_delays_; } for (const auto& response_and_delay : responses_and_delays) { SendResponse(stream, response_and_delay.first, response_and_delay.second); } - { - grpc::internal::MutexLock lock(&mu_); - serverlist_cond_.WaitUntil(&mu_, [this] { return serverlist_done_; }); - } - - if (client_load_reporting_interval_seconds_ > 0) { - request.Clear(); - if (stream->Read(&request)) { - gpr_log(GPR_INFO, "LB[%p]: received client load report message '%s'", - this, request.DebugString().c_str()); - GPR_ASSERT(request.has_client_stats()); - // We need to acquire the lock here in order to prevent the notify_one - // below from firing before its corresponding wait is executed. - grpc::internal::MutexLock lock(&mu_); - client_stats_.num_calls_started += - request.client_stats().num_calls_started(); - client_stats_.num_calls_finished += - request.client_stats().num_calls_finished(); - client_stats_.num_calls_finished_with_client_failed_to_send += - request.client_stats() - .num_calls_finished_with_client_failed_to_send(); - client_stats_.num_calls_finished_known_received += - request.client_stats().num_calls_finished_known_received(); - for (const auto& drop_token_count : - request.client_stats().calls_finished_with_drop()) { - client_stats_ - .drop_token_counts[drop_token_count.load_balance_token()] += - drop_token_count.num_calls(); - } - load_report_ready_ = true; - load_report_cond_.Signal(); - } - } - } - done: - gpr_log(GPR_INFO, "LB[%p]: done", this); + // Wait until notified done. + grpc_core::MutexLock lock(&eds_mu_); + eds_cond_.WaitUntil(&eds_mu_, [this] { return eds_done_; }); + }(); + gpr_log(GPR_INFO, "LB[%p]: EDS StreamEndpoints done", this); return Status::OK; } - void add_response(const LoadBalanceResponse& response, int send_after_ms) { - grpc::internal::MutexLock lock(&mu_); + void add_response(const DiscoveryResponse& response, int send_after_ms) { + grpc_core::MutexLock lock(&eds_mu_); responses_and_delays_.push_back(std::make_pair(response, send_after_ms)); } - void Shutdown() { - grpc::internal::MutexLock lock(&mu_); - NotifyDoneWithServerlistsLocked(); + void Start() { + grpc_core::MutexLock lock(&eds_mu_); + eds_done_ = false; responses_and_delays_.clear(); - client_stats_.Reset(); + } + + void Shutdown() { + { + grpc_core::MutexLock lock(&eds_mu_); + NotifyDoneWithEdsCallLocked(); + responses_and_delays_.clear(); + } gpr_log(GPR_INFO, "LB[%p]: shut down", this); } - static LoadBalanceResponse BuildResponseForBackends( - const std::vector& backend_ports, - const std::map& drop_token_counts) { - LoadBalanceResponse response; - for (const auto& drop_token_count : drop_token_counts) { - for (size_t i = 0; i < drop_token_count.second; ++i) { - auto* server = response.mutable_server_list()->add_servers(); - server->set_drop(true); - server->set_load_balance_token(drop_token_count.first); + // TODO(juanlishen): Put the args into a struct. + static DiscoveryResponse BuildResponse( + const std::vector>& backend_ports, + const std::vector& lb_weights = {}, + size_t first_locality_name_index = 0, + const std::map& drop_categories = {}, + const FractionalPercent::DenominatorType denominator = + FractionalPercent::MILLION) { + ClusterLoadAssignment assignment; + assignment.set_cluster_name("service name"); + for (size_t i = 0; i < backend_ports.size(); ++i) { + auto* endpoints = assignment.add_endpoints(); + const int lb_weight = + lb_weights.empty() ? kDefaultLocalityWeight : lb_weights[i]; + endpoints->mutable_load_balancing_weight()->set_value(lb_weight); + endpoints->set_priority(0); + endpoints->mutable_locality()->set_region(kDefaultLocalityRegion); + endpoints->mutable_locality()->set_zone(kDefaultLocalityZone); + std::ostringstream sub_zone; + sub_zone << kDefaultLocalitySubzone << '_' + << first_locality_name_index + i; + endpoints->mutable_locality()->set_sub_zone(sub_zone.str()); + for (const int& backend_port : backend_ports[i]) { + auto* lb_endpoints = endpoints->add_lb_endpoints(); + auto* endpoint = lb_endpoints->mutable_endpoint(); + auto* address = endpoint->mutable_address(); + auto* socket_address = address->mutable_socket_address(); + socket_address->set_address("127.0.0.1"); + socket_address->set_port_value(backend_port); } } - for (const int& backend_port : backend_ports) { - auto* server = response.mutable_server_list()->add_servers(); - server->set_ip_address(Ip4ToPackedString("127.0.0.1")); - server->set_port(backend_port); - static int token_count = 0; - char* token; - gpr_asprintf(&token, "token%03d", ++token_count); - server->set_load_balance_token(token); - gpr_free(token); + if (!drop_categories.empty()) { + auto* policy = assignment.mutable_policy(); + for (const auto& p : drop_categories) { + const grpc::string& name = p.first; + const uint32_t parts_per_million = p.second; + auto* drop_overload = policy->add_drop_overloads(); + drop_overload->set_category(name); + auto* drop_percentage = drop_overload->mutable_drop_percentage(); + drop_percentage->set_numerator(parts_per_million); + drop_percentage->set_denominator(denominator); + } } + DiscoveryResponse response; + response.set_type_url(kEdsTypeUrl); + response.add_resources()->PackFrom(assignment); return response; } - const ClientStats& WaitForLoadReport() { - grpc::internal::MutexLock lock(&mu_); - load_report_cond_.WaitUntil(&mu_, [this] { return load_report_ready_; }); - load_report_ready_ = false; - return client_stats_; - } - - void NotifyDoneWithServerlists() { - grpc::internal::MutexLock lock(&mu_); - NotifyDoneWithServerlistsLocked(); + void NotifyDoneWithEdsCall() { + grpc_core::MutexLock lock(&eds_mu_); + NotifyDoneWithEdsCallLocked(); } - void NotifyDoneWithServerlistsLocked() { - if (!serverlist_done_) { - serverlist_done_ = true; - serverlist_cond_.Broadcast(); + void NotifyDoneWithEdsCallLocked() { + if (!eds_done_) { + eds_done_ = true; + eds_cond_.Broadcast(); } } private: - void SendResponse(Stream* stream, const LoadBalanceResponse& response, + void SendResponse(Stream* stream, const DiscoveryResponse& response, int delay_ms) { gpr_log(GPR_INFO, "LB[%p]: sleeping for %d ms...", this, delay_ms); if (delay_ms > 0) { @@ -350,14 +391,108 @@ class BalancerServiceImpl : public BalancerService { stream->Write(response); } - const int client_load_reporting_interval_seconds_; + grpc_core::CondVar eds_cond_; + // Protect the members below. + grpc_core::Mutex eds_mu_; + bool eds_done_ = false; std::vector responses_and_delays_; - grpc::internal::Mutex mu_; - grpc::internal::CondVar load_report_cond_; +}; + +class LrsServiceImpl : public LrsService { + public: + using Stream = ServerReaderWriter; + + explicit LrsServiceImpl(int client_load_reporting_interval_seconds) + : client_load_reporting_interval_seconds_( + client_load_reporting_interval_seconds) {} + + Status StreamLoadStats(ServerContext* context, Stream* stream) override { + gpr_log(GPR_INFO, "LB[%p]: LRS StreamLoadStats starts", this); + // Read request. + LoadStatsRequest request; + if (stream->Read(&request)) { + if (client_load_reporting_interval_seconds_ > 0) { + IncreaseRequestCount(); + // Send response. + LoadStatsResponse response; + auto server_name = request.cluster_stats()[0].cluster_name(); + GPR_ASSERT(server_name != ""); + response.add_clusters(server_name); + response.mutable_load_reporting_interval()->set_seconds( + client_load_reporting_interval_seconds_); + stream->Write(response); + IncreaseResponseCount(); + // Wait for report. + request.Clear(); + if (stream->Read(&request)) { + gpr_log(GPR_INFO, "LB[%p]: received client load report message '%s'", + this, request.DebugString().c_str()); + GPR_ASSERT(request.cluster_stats().size() == 1); + const ClusterStats& cluster_stats = request.cluster_stats()[0]; + // We need to acquire the lock here in order to prevent the notify_one + // below from firing before its corresponding wait is executed. + grpc_core::MutexLock lock(&load_report_mu_); + GPR_ASSERT(client_stats_ == nullptr); + client_stats_.reset(new ClientStats(cluster_stats)); + load_report_ready_ = true; + load_report_cond_.Signal(); + } + } + // Wait until notified done. + grpc_core::MutexLock lock(&lrs_mu_); + lrs_cv_.WaitUntil(&lrs_mu_, [this] { return lrs_done; }); + } + gpr_log(GPR_INFO, "LB[%p]: LRS done", this); + return Status::OK; + } + + void Start() { + lrs_done = false; + load_report_ready_ = false; + client_stats_.reset(); + } + + void Shutdown() { + { + grpc_core::MutexLock lock(&lrs_mu_); + NotifyDoneWithLrsCallLocked(); + } + gpr_log(GPR_INFO, "LB[%p]: shut down", this); + } + + ClientStats* WaitForLoadReport() { + grpc_core::MutexLock lock(&load_report_mu_); + load_report_cond_.WaitUntil(&load_report_mu_, + [this] { return load_report_ready_; }); + load_report_ready_ = false; + return client_stats_.get(); + } + + void NotifyDoneWithLrsCall() { + grpc_core::MutexLock lock(&lrs_mu_); + NotifyDoneWithLrsCallLocked(); + } + + void NotifyDoneWithLrsCallLocked() { + if (!lrs_done) { + lrs_done = true; + lrs_cv_.Broadcast(); + } + } + + private: + const int client_load_reporting_interval_seconds_; + + grpc_core::CondVar lrs_cv_; + // Protect lrs_done. + grpc_core::Mutex lrs_mu_; + bool lrs_done = false; + + grpc_core::CondVar load_report_cond_; + // Protect the members below. + grpc_core::Mutex load_report_mu_; + std::unique_ptr client_stats_; bool load_report_ready_ = false; - grpc::internal::CondVar serverlist_cond_; - bool serverlist_done_ = false; - ClientStats client_stats_; }; class XdsEnd2endTest : public ::testing::Test { @@ -386,13 +521,13 @@ class XdsEnd2endTest : public ::testing::Test { grpc_core::MakeRefCounted(); // Start the backends. for (size_t i = 0; i < num_backends_; ++i) { - backends_.emplace_back(new ServerThread("backend")); + backends_.emplace_back(new BackendServerThread); backends_.back()->Start(server_host_); } // Start the load balancers. for (size_t i = 0; i < num_balancers_; ++i) { - balancers_.emplace_back(new ServerThread( - "balancer", client_load_reporting_interval_seconds_)); + balancers_.emplace_back( + new BalancerServerThread(client_load_reporting_interval_seconds_)); balancers_.back()->Start(server_host_); } ResetStub(); @@ -416,7 +551,8 @@ class XdsEnd2endTest : public ::testing::Test { void ShutdownBackend(size_t index) { backends_[index]->Shutdown(); } void ResetStub(int fallback_timeout = 0, - const grpc::string& expected_targets = "") { + const grpc::string& expected_targets = "", + grpc::string scheme = "") { ChannelArguments args; // TODO(juanlishen): Add setter to ChannelArguments. if (fallback_timeout > 0) { @@ -427,8 +563,9 @@ class XdsEnd2endTest : public ::testing::Test { if (!expected_targets.empty()) { args.SetString(GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS, expected_targets); } + if (scheme.empty()) scheme = "fake"; std::ostringstream uri; - uri << "fake:///" << kApplicationTargetName_; + uri << scheme << ":///" << kApplicationTargetName_; // TODO(dgq): templatize tests to run everything using both secure and // insecure channel credentials. grpc_channel_credentials* channel_creds = @@ -445,21 +582,13 @@ class XdsEnd2endTest : public ::testing::Test { } void ResetBackendCounters() { - for (auto& backend : backends_) backend->service_.ResetCounters(); - } - - ClientStats WaitForLoadReports() { - ClientStats client_stats; - for (auto& balancer : balancers_) { - client_stats += balancer->service_.WaitForLoadReport(); - } - return client_stats; + for (auto& backend : backends_) backend->backend_service()->ResetCounters(); } bool SeenAllBackends(size_t start_index = 0, size_t stop_index = 0) { if (stop_index == 0) stop_index = backends_.size(); for (size_t i = start_index; i < stop_index; ++i) { - if (backends_[i]->service_.request_count() == 0) return false; + if (backends_[i]->backend_service()->request_count() == 0) return false; } return true; } @@ -501,11 +630,14 @@ class XdsEnd2endTest : public ::testing::Test { return std::make_tuple(num_ok, num_failure, num_drops); } - void WaitForBackend(size_t backend_idx) { + void WaitForBackend(size_t backend_idx, bool reset_counters = true) { + gpr_log(GPR_INFO, + "========= WAITING FOR BACKEND %lu ==========", backend_idx); do { (void)SendRpc(); - } while (backends_[backend_idx]->service_.request_count() == 0); - ResetBackendCounters(); + } while (backends_[backend_idx]->backend_service()->request_count() == 0); + if (reset_counters) ResetBackendCounters(); + gpr_log(GPR_INFO, "========= BACKEND %lu READY ==========", backend_idx); } grpc_core::ServerAddressList CreateLbAddressesFromPortList( @@ -555,7 +687,7 @@ class XdsEnd2endTest : public ::testing::Test { nullptr) { std::vector ports; for (size_t i = 0; i < balancers_.size(); ++i) { - ports.emplace_back(balancers_[i]->port_); + ports.emplace_back(balancers_[i]->port()); } SetNextResolutionForLbChannel(ports, service_config_json, lb_channel_response_generator); @@ -592,15 +724,32 @@ class XdsEnd2endTest : public ::testing::Test { if (stop_index == 0) stop_index = backends_.size(); std::vector backend_ports; for (size_t i = start_index; i < stop_index; ++i) { - backend_ports.push_back(backends_[i]->port_); + backend_ports.push_back(backends_[i]->port()); + } + return backend_ports; + } + + const std::vector> GetBackendPortsInGroups( + size_t start_index = 0, size_t stop_index = 0, + size_t num_group = 1) const { + if (stop_index == 0) stop_index = backends_.size(); + size_t group_size = (stop_index - start_index) / num_group; + std::vector> backend_ports; + for (size_t i = 0; i < num_group; ++i) { + backend_ports.emplace_back(); + size_t group_start = group_size * i + start_index; + size_t group_stop = + i == num_group - 1 ? stop_index : group_start + group_size; + for (size_t j = group_start; j < group_stop; ++j) { + backend_ports[i].push_back(backends_[j]->port()); + } } return backend_ports; } - void ScheduleResponseForBalancer(size_t i, - const LoadBalanceResponse& response, + void ScheduleResponseForBalancer(size_t i, const DiscoveryResponse& response, int delay_ms) { - balancers_[i]->service_.add_response(response, delay_ms); + balancers_[i]->eds_service()->add_response(response, delay_ms); } Status SendRpc(EchoResponse* response = nullptr, int timeout_ms = 1000, @@ -633,71 +782,124 @@ class XdsEnd2endTest : public ::testing::Test { EXPECT_FALSE(status.ok()); } - template - struct ServerThread { - template - explicit ServerThread(const grpc::string& type, Args&&... args) - : port_(grpc_pick_unused_port_or_die()), - type_(type), - service_(std::forward(args)...) {} + class ServerThread { + public: + ServerThread() : port_(grpc_pick_unused_port_or_die()) {} + virtual ~ServerThread(){}; void Start(const grpc::string& server_host) { - gpr_log(GPR_INFO, "starting %s server on port %d", type_.c_str(), port_); + gpr_log(GPR_INFO, "starting %s server on port %d", Type(), port_); GPR_ASSERT(!running_); running_ = true; - grpc::internal::Mutex mu; + StartAllServices(); + grpc_core::Mutex mu; // We need to acquire the lock here in order to prevent the notify_one // by ServerThread::Serve from firing before the wait below is hit. - grpc::internal::MutexLock lock(&mu); - grpc::internal::CondVar cond; + grpc_core::MutexLock lock(&mu); + grpc_core::CondVar cond; thread_.reset(new std::thread( std::bind(&ServerThread::Serve, this, server_host, &mu, &cond))); cond.Wait(&mu); - gpr_log(GPR_INFO, "%s server startup complete", type_.c_str()); + gpr_log(GPR_INFO, "%s server startup complete", Type()); } - void Serve(const grpc::string& server_host, grpc::internal::Mutex* mu, - grpc::internal::CondVar* cond) { + void Serve(const grpc::string& server_host, grpc_core::Mutex* mu, + grpc_core::CondVar* cond) { // We need to acquire the lock here in order to prevent the notify_one // below from firing before its corresponding wait is executed. - grpc::internal::MutexLock lock(mu); + grpc_core::MutexLock lock(mu); std::ostringstream server_address; server_address << server_host << ":" << port_; ServerBuilder builder; std::shared_ptr creds(new SecureServerCredentials( grpc_fake_transport_security_server_credentials_create())); builder.AddListeningPort(server_address.str(), creds); - builder.RegisterService(&service_); + RegisterAllServices(&builder); server_ = builder.BuildAndStart(); cond->Signal(); } void Shutdown() { if (!running_) return; - gpr_log(GPR_INFO, "%s about to shutdown", type_.c_str()); - service_.Shutdown(); + gpr_log(GPR_INFO, "%s about to shutdown", Type()); + ShutdownAllServices(); server_->Shutdown(grpc_timeout_milliseconds_to_deadline(0)); thread_->join(); - gpr_log(GPR_INFO, "%s shutdown completed", type_.c_str()); + gpr_log(GPR_INFO, "%s shutdown completed", Type()); running_ = false; } + int port() const { return port_; } + + private: + virtual void RegisterAllServices(ServerBuilder* builder) = 0; + virtual void StartAllServices() = 0; + virtual void ShutdownAllServices() = 0; + + virtual const char* Type() = 0; + const int port_; - grpc::string type_; - T service_; std::unique_ptr server_; std::unique_ptr thread_; bool running_ = false; }; + class BackendServerThread : public ServerThread { + public: + BackendServiceImpl* backend_service() { return &backend_service_; } + + private: + void RegisterAllServices(ServerBuilder* builder) override { + builder->RegisterService(&backend_service_); + } + + void StartAllServices() override { backend_service_.Start(); } + + void ShutdownAllServices() override { backend_service_.Shutdown(); } + + const char* Type() override { return "Backend"; } + + BackendServiceImpl backend_service_; + }; + + class BalancerServerThread : public ServerThread { + public: + explicit BalancerServerThread(int client_load_reporting_interval = 0) + : lrs_service_(client_load_reporting_interval) {} + + EdsServiceImpl* eds_service() { return &eds_service_; } + LrsServiceImpl* lrs_service() { return &lrs_service_; } + + private: + void RegisterAllServices(ServerBuilder* builder) override { + builder->RegisterService(&eds_service_); + builder->RegisterService(&lrs_service_); + } + + void StartAllServices() override { + eds_service_.Start(); + lrs_service_.Start(); + } + + void ShutdownAllServices() override { + eds_service_.Shutdown(); + lrs_service_.Shutdown(); + } + + const char* Type() override { return "Balancer"; } + + EdsServiceImpl eds_service_; + LrsServiceImpl lrs_service_; + }; + const grpc::string server_host_; const size_t num_backends_; const size_t num_balancers_; const int client_load_reporting_interval_seconds_; std::shared_ptr channel_; std::unique_ptr stub_; - std::vector>> backends_; - std::vector>> balancers_; + std::vector> backends_; + std::vector> balancers_; grpc_core::RefCountedPtr response_generator_; grpc_core::RefCountedPtr @@ -713,6 +915,20 @@ class XdsEnd2endTest : public ::testing::Test { "}"; }; +class XdsResolverTest : public XdsEnd2endTest { + public: + XdsResolverTest() : XdsEnd2endTest(0, 0, 0) {} +}; + +TEST_F(XdsResolverTest, XdsResolverIsUsed) { + // Use xds-experimental scheme in URI. + ResetStub(0, "", "xds-experimental"); + // Send an RPC to trigger resolution. + auto unused_result = SendRpc(); + // Xds resolver returns xds_experimental as the LB policy. + EXPECT_EQ("xds_experimental", channel_->GetLoadBalancingPolicyName()); +} + class SingleBalancerTest : public XdsEnd2endTest { public: SingleBalancerTest() : XdsEnd2endTest(4, 1, 0) {} @@ -723,8 +939,7 @@ TEST_F(SingleBalancerTest, Vanilla) { SetNextResolutionForLbChannelAllBalancers(); const size_t kNumRpcsPerAddress = 100; ScheduleResponseForBalancer( - 0, BalancerServiceImpl::BuildResponseForBackends(GetBackendPorts(), {}), - 0); + 0, EdsServiceImpl::BuildResponse(GetBackendPortsInGroups()), 0); // Make sure that trying to connect works without a call. channel_->GetState(true /* try_to_connect */); // We need to wait for all backends to come online. @@ -733,14 +948,12 @@ TEST_F(SingleBalancerTest, Vanilla) { CheckRpcSendOk(kNumRpcsPerAddress * num_backends_); // Each backend should have gotten 100 requests. for (size_t i = 0; i < backends_.size(); ++i) { - EXPECT_EQ(kNumRpcsPerAddress, backends_[i]->service_.request_count()); + EXPECT_EQ(kNumRpcsPerAddress, + backends_[i]->backend_service()->request_count()); } - balancers_[0]->service_.NotifyDoneWithServerlists(); - // The balancer got a single request. - EXPECT_EQ(1U, balancers_[0]->service_.request_count()); - // and sent a single response. - EXPECT_EQ(1U, balancers_[0]->service_.response_count()); - + // The EDS service got a single request, and sent a single response. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); // Check LB policy name for the channel. EXPECT_EQ("xds_experimental", channel_->GetLoadBalancingPolicyName()); } @@ -750,32 +963,30 @@ TEST_F(SingleBalancerTest, SameBackendListedMultipleTimes) { SetNextResolutionForLbChannelAllBalancers(); // Same backend listed twice. std::vector ports; - ports.push_back(backends_[0]->port_); - ports.push_back(backends_[0]->port_); + ports.push_back(backends_[0]->port()); + ports.push_back(backends_[0]->port()); const size_t kNumRpcsPerAddress = 10; - ScheduleResponseForBalancer( - 0, BalancerServiceImpl::BuildResponseForBackends(ports, {}), 0); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse({ports}), 0); // We need to wait for the backend to come online. WaitForBackend(0); // Send kNumRpcsPerAddress RPCs per server. CheckRpcSendOk(kNumRpcsPerAddress * ports.size()); // Backend should have gotten 20 requests. - EXPECT_EQ(kNumRpcsPerAddress * 2, backends_[0]->service_.request_count()); + EXPECT_EQ(kNumRpcsPerAddress * 2, + backends_[0]->backend_service()->request_count()); // And they should have come from a single client port, because of // subchannel sharing. - EXPECT_EQ(1UL, backends_[0]->service_.clients().size()); - balancers_[0]->service_.NotifyDoneWithServerlists(); + EXPECT_EQ(1UL, backends_[0]->backend_service()->clients().size()); } TEST_F(SingleBalancerTest, SecureNaming) { // TODO(juanlishen): Use separate fake creds for the balancer channel. ResetStub(0, kApplicationTargetName_ + ";lb"); SetNextResolution({}, kDefaultServiceConfig_.c_str()); - SetNextResolutionForLbChannel({balancers_[0]->port_}); + SetNextResolutionForLbChannel({balancers_[0]->port()}); const size_t kNumRpcsPerAddress = 100; ScheduleResponseForBalancer( - 0, BalancerServiceImpl::BuildResponseForBackends(GetBackendPorts(), {}), - 0); + 0, EdsServiceImpl::BuildResponse(GetBackendPortsInGroups()), 0); // Make sure that trying to connect works without a call. channel_->GetState(true /* try_to_connect */); // We need to wait for all backends to come online. @@ -785,12 +996,12 @@ TEST_F(SingleBalancerTest, SecureNaming) { // Each backend should have gotten 100 requests. for (size_t i = 0; i < backends_.size(); ++i) { - EXPECT_EQ(kNumRpcsPerAddress, backends_[i]->service_.request_count()); + EXPECT_EQ(kNumRpcsPerAddress, + backends_[i]->backend_service()->request_count()); } - // The balancer got a single request. - EXPECT_EQ(1U, balancers_[0]->service_.request_count()); - // and sent a single response. - EXPECT_EQ(1U, balancers_[0]->service_.response_count()); + // The EDS service got a single request, and sent a single response. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); } TEST_F(SingleBalancerTest, SecureNamingDeathTest) { @@ -808,7 +1019,7 @@ TEST_F(SingleBalancerTest, SecureNamingDeathTest) { "\"fake:///wrong_lb\" } }\n" " ]\n" "}"); - SetNextResolutionForLbChannel({balancers_[0]->port_}); + SetNextResolutionForLbChannel({balancers_[0]->port()}); channel_->WaitForConnected(grpc_timeout_seconds_to_deadline(1)); }, ""); @@ -820,10 +1031,10 @@ TEST_F(SingleBalancerTest, InitiallyEmptyServerlist) { const int kServerlistDelayMs = 500 * grpc_test_slowdown_factor(); const int kCallDeadlineMs = kServerlistDelayMs * 2; // First response is an empty serverlist, sent right away. - ScheduleResponseForBalancer(0, LoadBalanceResponse(), 0); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse({{}}), 0); // Send non-empty serverlist only after kServerlistDelayMs ScheduleResponseForBalancer( - 0, BalancerServiceImpl::BuildResponseForBackends(GetBackendPorts(), {}), + 0, EdsServiceImpl::BuildResponse(GetBackendPortsInGroups()), kServerlistDelayMs); const auto t0 = system_clock::now(); // Client will block: LB will initially send empty serverlist. @@ -836,11 +1047,10 @@ TEST_F(SingleBalancerTest, InitiallyEmptyServerlist) { // populated serverlist but under the call's deadline (which is enforced by // the call's deadline). EXPECT_GT(ellapsed_ms.count(), kServerlistDelayMs); - balancers_[0]->service_.NotifyDoneWithServerlists(); - // The balancer got a single request. - EXPECT_EQ(1U, balancers_[0]->service_.request_count()); + // The EDS service got a single request. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); // and sent two responses. - EXPECT_EQ(2U, balancers_[0]->service_.response_count()); + EXPECT_EQ(2U, balancers_[0]->eds_service()->response_count()); } TEST_F(SingleBalancerTest, AllServersUnreachableFailFast) { @@ -851,16 +1061,427 @@ TEST_F(SingleBalancerTest, AllServersUnreachableFailFast) { for (size_t i = 0; i < kNumUnreachableServers; ++i) { ports.push_back(grpc_pick_unused_port_or_die()); } - ScheduleResponseForBalancer( - 0, BalancerServiceImpl::BuildResponseForBackends(ports, {}), 0); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse({ports}), 0); const Status status = SendRpc(); // The error shouldn't be DEADLINE_EXCEEDED. EXPECT_EQ(StatusCode::UNAVAILABLE, status.error_code()); - balancers_[0]->service_.NotifyDoneWithServerlists(); - // The balancer got a single request. - EXPECT_EQ(1U, balancers_[0]->service_.request_count()); - // and sent a single response. - EXPECT_EQ(1U, balancers_[0]->service_.response_count()); + // The EDS service got a single request, and sent a single response. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); +} + +TEST_F(SingleBalancerTest, LocalityMapWeightedRoundRobin) { + SetNextResolution({}, kDefaultServiceConfig_.c_str()); + SetNextResolutionForLbChannelAllBalancers(); + const size_t kNumRpcs = 5000; + const int kLocalityWeight0 = 2; + const int kLocalityWeight1 = 8; + const int kTotalLocalityWeight = kLocalityWeight0 + kLocalityWeight1; + const double kLocalityWeightRate0 = + static_cast(kLocalityWeight0) / kTotalLocalityWeight; + const double kLocalityWeightRate1 = + static_cast(kLocalityWeight1) / kTotalLocalityWeight; + // EDS response contains 2 localities, each of which contains 1 backend. + ScheduleResponseForBalancer( + 0, + EdsServiceImpl::BuildResponse(GetBackendPortsInGroups(0, 2, 2), + {kLocalityWeight0, kLocalityWeight1}), + 0); + // Wait for both backends to be ready. + WaitForAllBackends(1, 0, 2); + // Send kNumRpcs RPCs. + CheckRpcSendOk(kNumRpcs); + // The locality picking rates should be roughly equal to the expectation. + const double locality_picked_rate_0 = + static_cast(backends_[0]->backend_service()->request_count()) / + kNumRpcs; + const double locality_picked_rate_1 = + static_cast(backends_[1]->backend_service()->request_count()) / + kNumRpcs; + const double kErrorTolerance = 0.2; + EXPECT_THAT(locality_picked_rate_0, + ::testing::AllOf( + ::testing::Ge(kLocalityWeightRate0 * (1 - kErrorTolerance)), + ::testing::Le(kLocalityWeightRate0 * (1 + kErrorTolerance)))); + EXPECT_THAT(locality_picked_rate_1, + ::testing::AllOf( + ::testing::Ge(kLocalityWeightRate1 * (1 - kErrorTolerance)), + ::testing::Le(kLocalityWeightRate1 * (1 + kErrorTolerance)))); + // The EDS service got a single request, and sent a single response. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); +} + +TEST_F(SingleBalancerTest, LocalityMapStressTest) { + SetNextResolution({}, kDefaultServiceConfig_.c_str()); + SetNextResolutionForLbChannelAllBalancers(); + const size_t kNumLocalities = 100; + // The first EDS response contains kNumLocalities localities, each of which + // contains backend 0. + const std::vector> locality_list_0(kNumLocalities, + {backends_[0]->port()}); + // The second EDS response contains 1 locality, which contains backend 1. + const std::vector> locality_list_1 = + GetBackendPortsInGroups(1, 2); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(locality_list_0), + 0); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(locality_list_1), + 60 * 1000); + // Wait until backend 0 is ready, before which kNumLocalities localities are + // received and handled by the xds policy. + WaitForBackend(0, /*reset_counters=*/false); + EXPECT_EQ(0U, backends_[1]->backend_service()->request_count()); + // Wait until backend 1 is ready, before which kNumLocalities localities are + // removed by the xds policy. + WaitForBackend(1); + // The EDS service got a single request. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + // and sent two responses. + EXPECT_EQ(2U, balancers_[0]->eds_service()->response_count()); +} + +TEST_F(SingleBalancerTest, LocalityMapUpdate) { + SetNextResolution({}, kDefaultServiceConfig_.c_str()); + SetNextResolutionForLbChannelAllBalancers(); + const size_t kNumRpcs = 1000; + // The locality weight for the first 3 localities. + const std::vector kLocalityWeights0 = {2, 3, 4}; + const double kTotalLocalityWeight0 = + std::accumulate(kLocalityWeights0.begin(), kLocalityWeights0.end(), 0); + std::vector locality_weight_rate_0; + for (int weight : kLocalityWeights0) { + locality_weight_rate_0.push_back(weight / kTotalLocalityWeight0); + } + // Delete the first locality, keep the second locality, change the third + // locality's weight from 4 to 2, and add a new locality with weight 6. + const std::vector kLocalityWeights1 = {3, 2, 6}; + const double kTotalLocalityWeight1 = + std::accumulate(kLocalityWeights1.begin(), kLocalityWeights1.end(), 0); + std::vector locality_weight_rate_1 = { + 0 /* placeholder for locality 0 */}; + for (int weight : kLocalityWeights1) { + locality_weight_rate_1.push_back(weight / kTotalLocalityWeight1); + } + ScheduleResponseForBalancer( + 0, + EdsServiceImpl::BuildResponse( + GetBackendPortsInGroups(0 /*start_index*/, 3 /*stop_index*/, + 3 /*num_group*/), + kLocalityWeights0), + 0); + ScheduleResponseForBalancer( + 0, + EdsServiceImpl::BuildResponse( + GetBackendPortsInGroups(1 /*start_index*/, 4 /*stop_index*/, + 3 /*num_group*/), + kLocalityWeights1, 1 /*first_locality_name_index*/), + 5000); + // Wait for the first 3 backends to be ready. + WaitForAllBackends(1, 0, 3); + gpr_log(GPR_INFO, "========= BEFORE FIRST BATCH =========="); + // Send kNumRpcs RPCs. + CheckRpcSendOk(kNumRpcs); + gpr_log(GPR_INFO, "========= DONE WITH FIRST BATCH =========="); + // The picking rates of the first 3 backends should be roughly equal to the + // expectation. + std::vector locality_picked_rates; + for (size_t i = 0; i < 3; ++i) { + locality_picked_rates.push_back( + static_cast(backends_[i]->backend_service()->request_count()) / + kNumRpcs); + } + const double kErrorTolerance = 0.2; + for (size_t i = 0; i < 3; ++i) { + EXPECT_THAT( + locality_picked_rates[i], + ::testing::AllOf( + ::testing::Ge(locality_weight_rate_0[i] * (1 - kErrorTolerance)), + ::testing::Le(locality_weight_rate_0[i] * (1 + kErrorTolerance)))); + } + // Backend 3 hasn't received any request. + EXPECT_EQ(0U, backends_[3]->backend_service()->request_count()); + // The EDS service got a single request, and sent a single response. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); + // Wait until the locality update has been processed, as signaled by backend 3 + // receiving a request. + WaitForBackend(3); + gpr_log(GPR_INFO, "========= BEFORE SECOND BATCH =========="); + // Send kNumRpcs RPCs. + CheckRpcSendOk(kNumRpcs); + gpr_log(GPR_INFO, "========= DONE WITH SECOND BATCH =========="); + // Backend 0 no longer receives any request. + EXPECT_EQ(0U, backends_[0]->backend_service()->request_count()); + // The picking rates of the last 3 backends should be roughly equal to the + // expectation. + locality_picked_rates = {0 /* placeholder for backend 0 */}; + for (size_t i = 1; i < 4; ++i) { + locality_picked_rates.push_back( + static_cast(backends_[i]->backend_service()->request_count()) / + kNumRpcs); + } + for (size_t i = 1; i < 4; ++i) { + EXPECT_THAT( + locality_picked_rates[i], + ::testing::AllOf( + ::testing::Ge(locality_weight_rate_1[i] * (1 - kErrorTolerance)), + ::testing::Le(locality_weight_rate_1[i] * (1 + kErrorTolerance)))); + } + // The EDS service got a single request. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + // and sent two responses. + EXPECT_EQ(2U, balancers_[0]->eds_service()->response_count()); +} + +TEST_F(SingleBalancerTest, Drop) { + SetNextResolution({}, kDefaultServiceConfig_.c_str()); + SetNextResolutionForLbChannelAllBalancers(); + const size_t kNumRpcs = 5000; + const uint32_t kDropPerMillionForLb = 100000; + const uint32_t kDropPerMillionForThrottle = 200000; + const double kDropRateForLb = kDropPerMillionForLb / 1000000.0; + const double kDropRateForThrottle = kDropPerMillionForThrottle / 1000000.0; + const double KDropRateForLbAndThrottle = + kDropRateForLb + (1 - kDropRateForLb) * kDropRateForThrottle; + // The EDS response contains two drop categories. + ScheduleResponseForBalancer( + 0, + EdsServiceImpl::BuildResponse( + GetBackendPortsInGroups(), {}, 0, + {{kLbDropType, kDropPerMillionForLb}, + {kThrottleDropType, kDropPerMillionForThrottle}}), + 0); + WaitForAllBackends(); + // Send kNumRpcs RPCs and count the drops. + size_t num_drops = 0; + for (size_t i = 0; i < kNumRpcs; ++i) { + EchoResponse response; + const Status status = SendRpc(&response); + if (!status.ok() && + status.error_message() == "Call dropped by load balancing policy") { + ++num_drops; + } else { + EXPECT_TRUE(status.ok()) << "code=" << status.error_code() + << " message=" << status.error_message(); + EXPECT_EQ(response.message(), kRequestMessage_); + } + } + // The drop rate should be roughly equal to the expectation. + const double seen_drop_rate = static_cast(num_drops) / kNumRpcs; + const double kErrorTolerance = 0.2; + EXPECT_THAT( + seen_drop_rate, + ::testing::AllOf( + ::testing::Ge(KDropRateForLbAndThrottle * (1 - kErrorTolerance)), + ::testing::Le(KDropRateForLbAndThrottle * (1 + kErrorTolerance)))); + // The EDS service got a single request, and sent a single response. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); +} + +TEST_F(SingleBalancerTest, DropPerHundred) { + SetNextResolution({}, kDefaultServiceConfig_.c_str()); + SetNextResolutionForLbChannelAllBalancers(); + const size_t kNumRpcs = 5000; + const uint32_t kDropPerHundredForLb = 10; + const double kDropRateForLb = kDropPerHundredForLb / 100.0; + // The EDS response contains one drop category. + ScheduleResponseForBalancer( + 0, + EdsServiceImpl::BuildResponse(GetBackendPortsInGroups(), {}, 0, + {{kLbDropType, kDropPerHundredForLb}}, + FractionalPercent::HUNDRED), + 0); + WaitForAllBackends(); + // Send kNumRpcs RPCs and count the drops. + size_t num_drops = 0; + for (size_t i = 0; i < kNumRpcs; ++i) { + EchoResponse response; + const Status status = SendRpc(&response); + if (!status.ok() && + status.error_message() == "Call dropped by load balancing policy") { + ++num_drops; + } else { + EXPECT_TRUE(status.ok()) << "code=" << status.error_code() + << " message=" << status.error_message(); + EXPECT_EQ(response.message(), kRequestMessage_); + } + } + // The drop rate should be roughly equal to the expectation. + const double seen_drop_rate = static_cast(num_drops) / kNumRpcs; + const double kErrorTolerance = 0.2; + EXPECT_THAT( + seen_drop_rate, + ::testing::AllOf(::testing::Ge(kDropRateForLb * (1 - kErrorTolerance)), + ::testing::Le(kDropRateForLb * (1 + kErrorTolerance)))); + // The EDS service got a single request, and sent a single response. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); +} + +TEST_F(SingleBalancerTest, DropPerTenThousand) { + SetNextResolution({}, kDefaultServiceConfig_.c_str()); + SetNextResolutionForLbChannelAllBalancers(); + const size_t kNumRpcs = 5000; + const uint32_t kDropPerTenThousandForLb = 1000; + const double kDropRateForLb = kDropPerTenThousandForLb / 10000.0; + // The EDS response contains one drop category. + ScheduleResponseForBalancer( + 0, + EdsServiceImpl::BuildResponse(GetBackendPortsInGroups(), {}, 0, + {{kLbDropType, kDropPerTenThousandForLb}}, + FractionalPercent::TEN_THOUSAND), + 0); + WaitForAllBackends(); + // Send kNumRpcs RPCs and count the drops. + size_t num_drops = 0; + for (size_t i = 0; i < kNumRpcs; ++i) { + EchoResponse response; + const Status status = SendRpc(&response); + if (!status.ok() && + status.error_message() == "Call dropped by load balancing policy") { + ++num_drops; + } else { + EXPECT_TRUE(status.ok()) << "code=" << status.error_code() + << " message=" << status.error_message(); + EXPECT_EQ(response.message(), kRequestMessage_); + } + } + // The drop rate should be roughly equal to the expectation. + const double seen_drop_rate = static_cast(num_drops) / kNumRpcs; + const double kErrorTolerance = 0.2; + EXPECT_THAT( + seen_drop_rate, + ::testing::AllOf(::testing::Ge(kDropRateForLb * (1 - kErrorTolerance)), + ::testing::Le(kDropRateForLb * (1 + kErrorTolerance)))); + // The EDS service got a single request, and sent a single response. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); +} + +TEST_F(SingleBalancerTest, DropUpdate) { + SetNextResolution({}, kDefaultServiceConfig_.c_str()); + SetNextResolutionForLbChannelAllBalancers(); + const size_t kNumRpcs = 5000; + const uint32_t kDropPerMillionForLb = 100000; + const uint32_t kDropPerMillionForThrottle = 200000; + const double kDropRateForLb = kDropPerMillionForLb / 1000000.0; + const double kDropRateForThrottle = kDropPerMillionForThrottle / 1000000.0; + const double KDropRateForLbAndThrottle = + kDropRateForLb + (1 - kDropRateForLb) * kDropRateForThrottle; + // The first EDS response contains one drop category. + ScheduleResponseForBalancer( + 0, + EdsServiceImpl::BuildResponse(GetBackendPortsInGroups(), {}, 0, + {{kLbDropType, kDropPerMillionForLb}}), + 0); + // The second EDS response contains two drop categories. + // TODO(juanlishen): Change the EDS response sending to deterministic style + // (e.g., by using condition variable) so that we can shorten the test + // duration. + ScheduleResponseForBalancer( + 0, + EdsServiceImpl::BuildResponse( + GetBackendPortsInGroups(), {}, 0, + {{kLbDropType, kDropPerMillionForLb}, + {kThrottleDropType, kDropPerMillionForThrottle}}), + 10000); + WaitForAllBackends(); + // Send kNumRpcs RPCs and count the drops. + size_t num_drops = 0; + gpr_log(GPR_INFO, "========= BEFORE FIRST BATCH =========="); + for (size_t i = 0; i < kNumRpcs; ++i) { + EchoResponse response; + const Status status = SendRpc(&response); + if (!status.ok() && + status.error_message() == "Call dropped by load balancing policy") { + ++num_drops; + } else { + EXPECT_TRUE(status.ok()) << "code=" << status.error_code() + << " message=" << status.error_message(); + EXPECT_EQ(response.message(), kRequestMessage_); + } + } + gpr_log(GPR_INFO, "========= DONE WITH FIRST BATCH =========="); + // The drop rate should be roughly equal to the expectation. + double seen_drop_rate = static_cast(num_drops) / kNumRpcs; + const double kErrorTolerance = 0.2; + EXPECT_THAT( + seen_drop_rate, + ::testing::AllOf(::testing::Ge(kDropRateForLb * (1 - kErrorTolerance)), + ::testing::Le(kDropRateForLb * (1 + kErrorTolerance)))); + // Wait until the drop rate increases to the middle of the two configs, which + // implies that the update has been in effect. + const double kDropRateThreshold = + (kDropRateForLb + KDropRateForLbAndThrottle) / 2; + size_t num_rpcs = kNumRpcs; + while (seen_drop_rate < kDropRateThreshold) { + EchoResponse response; + const Status status = SendRpc(&response); + ++num_rpcs; + if (!status.ok() && + status.error_message() == "Call dropped by load balancing policy") { + ++num_drops; + } else { + EXPECT_TRUE(status.ok()) << "code=" << status.error_code() + << " message=" << status.error_message(); + EXPECT_EQ(response.message(), kRequestMessage_); + } + seen_drop_rate = static_cast(num_drops) / num_rpcs; + } + // Send kNumRpcs RPCs and count the drops. + num_drops = 0; + gpr_log(GPR_INFO, "========= BEFORE SECOND BATCH =========="); + for (size_t i = 0; i < kNumRpcs; ++i) { + EchoResponse response; + const Status status = SendRpc(&response); + if (!status.ok() && + status.error_message() == "Call dropped by load balancing policy") { + ++num_drops; + } else { + EXPECT_TRUE(status.ok()) << "code=" << status.error_code() + << " message=" << status.error_message(); + EXPECT_EQ(response.message(), kRequestMessage_); + } + } + gpr_log(GPR_INFO, "========= DONE WITH SECOND BATCH =========="); + // The new drop rate should be roughly equal to the expectation. + seen_drop_rate = static_cast(num_drops) / kNumRpcs; + EXPECT_THAT( + seen_drop_rate, + ::testing::AllOf( + ::testing::Ge(KDropRateForLbAndThrottle * (1 - kErrorTolerance)), + ::testing::Le(KDropRateForLbAndThrottle * (1 + kErrorTolerance)))); + // The EDS service got a single request, + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + // and sent two responses + EXPECT_EQ(2U, balancers_[0]->eds_service()->response_count()); +} + +TEST_F(SingleBalancerTest, DropAll) { + SetNextResolution({}, kDefaultServiceConfig_.c_str()); + SetNextResolutionForLbChannelAllBalancers(); + const size_t kNumRpcs = 1000; + const uint32_t kDropPerMillionForLb = 100000; + const uint32_t kDropPerMillionForThrottle = 1000000; + // The EDS response contains two drop categories. + ScheduleResponseForBalancer( + 0, + EdsServiceImpl::BuildResponse( + GetBackendPortsInGroups(), {}, 0, + {{kLbDropType, kDropPerMillionForLb}, + {kThrottleDropType, kDropPerMillionForThrottle}}), + 0); + // Send kNumRpcs RPCs and all of them are dropped. + for (size_t i = 0; i < kNumRpcs; ++i) { + EchoResponse response; + const Status status = SendRpc(&response); + EXPECT_TRUE(!status.ok() && status.error_message() == + "Call dropped by load balancing policy"); + } + // The EDS service got a single request, and sent a single response. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); } TEST_F(SingleBalancerTest, Fallback) { @@ -874,8 +1495,8 @@ TEST_F(SingleBalancerTest, Fallback) { // Send non-empty serverlist only after kServerlistDelayMs. ScheduleResponseForBalancer( 0, - BalancerServiceImpl::BuildResponseForBackends( - GetBackendPorts(kNumBackendsInResolution /* start_index */), {}), + EdsServiceImpl::BuildResponse( + GetBackendPortsInGroups(kNumBackendsInResolution /* start_index */)), kServerlistDelayMs); // Wait until all the fallback backends are reachable. WaitForAllBackends(1 /* num_requests_multiple_of */, 0 /* start_index */, @@ -886,10 +1507,10 @@ TEST_F(SingleBalancerTest, Fallback) { // Fallback is used: each backend returned by the resolver should have // gotten one request. for (size_t i = 0; i < kNumBackendsInResolution; ++i) { - EXPECT_EQ(1U, backends_[i]->service_.request_count()); + EXPECT_EQ(1U, backends_[i]->backend_service()->request_count()); } for (size_t i = kNumBackendsInResolution; i < backends_.size(); ++i) { - EXPECT_EQ(0U, backends_[i]->service_.request_count()); + EXPECT_EQ(0U, backends_[i]->backend_service()->request_count()); } // Wait until the serverlist reception has been processed and all backends // in the serverlist are reachable. @@ -901,15 +1522,14 @@ TEST_F(SingleBalancerTest, Fallback) { // Serverlist is used: each backend returned by the balancer should // have gotten one request. for (size_t i = 0; i < kNumBackendsInResolution; ++i) { - EXPECT_EQ(0U, backends_[i]->service_.request_count()); + EXPECT_EQ(0U, backends_[i]->backend_service()->request_count()); } for (size_t i = kNumBackendsInResolution; i < backends_.size(); ++i) { - EXPECT_EQ(1U, backends_[i]->service_.request_count()); + EXPECT_EQ(1U, backends_[i]->backend_service()->request_count()); } - // The balancer got a single request. - EXPECT_EQ(1U, balancers_[0]->service_.request_count()); - // and sent a single response. - EXPECT_EQ(1U, balancers_[0]->service_.response_count()); + // The EDS service got a single request, and sent a single response. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); } TEST_F(SingleBalancerTest, FallbackUpdate) { @@ -924,10 +1544,9 @@ TEST_F(SingleBalancerTest, FallbackUpdate) { // Send non-empty serverlist only after kServerlistDelayMs. ScheduleResponseForBalancer( 0, - BalancerServiceImpl::BuildResponseForBackends( - GetBackendPorts(kNumBackendsInResolution + - kNumBackendsInResolutionUpdate /* start_index */), - {}), + EdsServiceImpl::BuildResponse(GetBackendPortsInGroups( + kNumBackendsInResolution + + kNumBackendsInResolutionUpdate /* start_index */)), kServerlistDelayMs); // Wait until all the fallback backends are reachable. WaitForAllBackends(1 /* num_requests_multiple_of */, 0 /* start_index */, @@ -938,10 +1557,10 @@ TEST_F(SingleBalancerTest, FallbackUpdate) { // Fallback is used: each backend returned by the resolver should have // gotten one request. for (size_t i = 0; i < kNumBackendsInResolution; ++i) { - EXPECT_EQ(1U, backends_[i]->service_.request_count()); + EXPECT_EQ(1U, backends_[i]->backend_service()->request_count()); } for (size_t i = kNumBackendsInResolution; i < backends_.size(); ++i) { - EXPECT_EQ(0U, backends_[i]->service_.request_count()); + EXPECT_EQ(0U, backends_[i]->backend_service()->request_count()); } SetNextResolution(GetBackendPorts(kNumBackendsInResolution, kNumBackendsInResolution + @@ -959,15 +1578,15 @@ TEST_F(SingleBalancerTest, FallbackUpdate) { // The resolution update is used: each backend in the resolution update should // have gotten one request. for (size_t i = 0; i < kNumBackendsInResolution; ++i) { - EXPECT_EQ(0U, backends_[i]->service_.request_count()); + EXPECT_EQ(0U, backends_[i]->backend_service()->request_count()); } for (size_t i = kNumBackendsInResolution; i < kNumBackendsInResolution + kNumBackendsInResolutionUpdate; ++i) { - EXPECT_EQ(1U, backends_[i]->service_.request_count()); + EXPECT_EQ(1U, backends_[i]->backend_service()->request_count()); } for (size_t i = kNumBackendsInResolution + kNumBackendsInResolutionUpdate; i < backends_.size(); ++i) { - EXPECT_EQ(0U, backends_[i]->service_.request_count()); + EXPECT_EQ(0U, backends_[i]->backend_service()->request_count()); } // Wait until the serverlist reception has been processed and all backends // in the serverlist are reachable. @@ -982,23 +1601,22 @@ TEST_F(SingleBalancerTest, FallbackUpdate) { // have gotten one request. for (size_t i = 0; i < kNumBackendsInResolution + kNumBackendsInResolutionUpdate; ++i) { - EXPECT_EQ(0U, backends_[i]->service_.request_count()); + EXPECT_EQ(0U, backends_[i]->backend_service()->request_count()); } for (size_t i = kNumBackendsInResolution + kNumBackendsInResolutionUpdate; i < backends_.size(); ++i) { - EXPECT_EQ(1U, backends_[i]->service_.request_count()); + EXPECT_EQ(1U, backends_[i]->backend_service()->request_count()); } - // The balancer got a single request. - EXPECT_EQ(1U, balancers_[0]->service_.request_count()); - // and sent a single response. - EXPECT_EQ(1U, balancers_[0]->service_.response_count()); + // The EDS service got a single request, and sent a single response. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); } TEST_F(SingleBalancerTest, FallbackEarlyWhenBalancerChannelFails) { const int kFallbackTimeoutMs = 10000 * grpc_test_slowdown_factor(); ResetStub(kFallbackTimeoutMs); // Return an unreachable balancer and one fallback backend. - SetNextResolution({backends_[0]->port_}, kDefaultServiceConfig_.c_str()); + SetNextResolution({backends_[0]->port()}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannel({grpc_pick_unused_port_or_die()}); // Send RPC with deadline less than the fallback timeout and make sure it // succeeds. @@ -1010,10 +1628,10 @@ TEST_F(SingleBalancerTest, FallbackEarlyWhenBalancerCallFails) { const int kFallbackTimeoutMs = 10000 * grpc_test_slowdown_factor(); ResetStub(kFallbackTimeoutMs); // Return one balancer and one fallback backend. - SetNextResolution({backends_[0]->port_}, kDefaultServiceConfig_.c_str()); + SetNextResolution({backends_[0]->port()}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); // Balancer drops call without sending a serverlist. - balancers_[0]->service_.NotifyDoneWithServerlists(); + balancers_[0]->eds_service()->NotifyDoneWithEdsCall(); // Send RPC with deadline less than the fallback timeout and make sure it // succeeds. CheckRpcSendOk(/* times */ 1, /* timeout_ms */ 1000, @@ -1023,14 +1641,12 @@ TEST_F(SingleBalancerTest, FallbackEarlyWhenBalancerCallFails) { TEST_F(SingleBalancerTest, FallbackIfResponseReceivedButChildNotReady) { const int kFallbackTimeoutMs = 500 * grpc_test_slowdown_factor(); ResetStub(kFallbackTimeoutMs); - SetNextResolution({backends_[0]->port_}, kDefaultServiceConfig_.c_str()); + SetNextResolution({backends_[0]->port()}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); // Send a serverlist that only contains an unreachable backend before fallback // timeout. - ScheduleResponseForBalancer(0, - BalancerServiceImpl::BuildResponseForBackends( - {grpc_pick_unused_port_or_die()}, {}), - 0); + ScheduleResponseForBalancer( + 0, EdsServiceImpl::BuildResponse({{grpc_pick_unused_port_or_die()}}), 0); // Because no child policy is ready before fallback timeout, we enter fallback // mode. WaitForBackend(0); @@ -1038,13 +1654,16 @@ TEST_F(SingleBalancerTest, FallbackIfResponseReceivedButChildNotReady) { TEST_F(SingleBalancerTest, FallbackModeIsExitedWhenBalancerSaysToDropAllCalls) { // Return an unreachable balancer and one fallback backend. - SetNextResolution({backends_[0]->port_}, kDefaultServiceConfig_.c_str()); + SetNextResolution({backends_[0]->port()}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannel({grpc_pick_unused_port_or_die()}); // Enter fallback mode because the LB channel fails to connect. WaitForBackend(0); - // Return a new balancer that sends an empty serverlist. + // Return a new balancer that sends a response to drop all calls. ScheduleResponseForBalancer( - 0, BalancerServiceImpl::BuildResponseForBackends({}, {}), 0); + 0, + EdsServiceImpl::BuildResponse(GetBackendPortsInGroups(), {}, 0, + {{kLbDropType, 1000000}}), + 0); SetNextResolutionForLbChannelAllBalancers(); // Send RPCs until failure. gpr_timespec deadline = gpr_time_add( @@ -1058,16 +1677,14 @@ TEST_F(SingleBalancerTest, FallbackModeIsExitedWhenBalancerSaysToDropAllCalls) { TEST_F(SingleBalancerTest, FallbackModeIsExitedAfterChildRready) { // Return an unreachable balancer and one fallback backend. - SetNextResolution({backends_[0]->port_}, kDefaultServiceConfig_.c_str()); + SetNextResolution({backends_[0]->port()}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannel({grpc_pick_unused_port_or_die()}); // Enter fallback mode because the LB channel fails to connect. WaitForBackend(0); // Return a new balancer that sends a dead backend. ShutdownBackend(1); ScheduleResponseForBalancer( - 0, - BalancerServiceImpl::BuildResponseForBackends({backends_[1]->port_}, {}), - 0); + 0, EdsServiceImpl::BuildResponse({{backends_[1]->port()}}), 0); SetNextResolutionForLbChannelAllBalancers(); // The state (TRANSIENT_FAILURE) update from the child policy will be ignored // because we are still in fallback mode. @@ -1084,16 +1701,15 @@ TEST_F(SingleBalancerTest, FallbackModeIsExitedAfterChildRready) { // We have exited fallback mode, so calls will go to the child policy // exclusively. CheckRpcSendOk(100); - EXPECT_EQ(0U, backends_[0]->service_.request_count()); - EXPECT_EQ(100U, backends_[1]->service_.request_count()); + EXPECT_EQ(0U, backends_[0]->backend_service()->request_count()); + EXPECT_EQ(100U, backends_[1]->backend_service()->request_count()); } TEST_F(SingleBalancerTest, BackendsRestart) { SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); ScheduleResponseForBalancer( - 0, BalancerServiceImpl::BuildResponseForBackends(GetBackendPorts(), {}), - 0); + 0, EdsServiceImpl::BuildResponse(GetBackendPortsInGroups()), 0); WaitForAllBackends(); // Stop backends. RPCs should fail. ShutdownAllBackends(); @@ -1112,12 +1728,12 @@ class UpdatesTest : public XdsEnd2endTest { TEST_F(UpdatesTest, UpdateBalancersButKeepUsingOriginalBalancer) { SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); - const std::vector first_backend{GetBackendPorts()[0]}; - const std::vector second_backend{GetBackendPorts()[1]}; - ScheduleResponseForBalancer( - 0, BalancerServiceImpl::BuildResponseForBackends(first_backend, {}), 0); - ScheduleResponseForBalancer( - 1, BalancerServiceImpl::BuildResponseForBackends(second_backend, {}), 0); + auto first_backend = GetBackendPortsInGroups(0, 1); + auto second_backend = GetBackendPortsInGroups(1, 2); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(first_backend), + 0); + ScheduleResponseForBalancer(1, EdsServiceImpl::BuildResponse(second_backend), + 0); // Wait until the first backend is ready. WaitForBackend(0); @@ -1128,22 +1744,22 @@ TEST_F(UpdatesTest, UpdateBalancersButKeepUsingOriginalBalancer) { gpr_log(GPR_INFO, "========= DONE WITH FIRST BATCH =========="); // All 10 requests should have gone to the first backend. - EXPECT_EQ(10U, backends_[0]->service_.request_count()); + EXPECT_EQ(10U, backends_[0]->backend_service()->request_count()); - // Balancer 0 got a single request. - EXPECT_EQ(1U, balancers_[0]->service_.request_count()); - // and sent a single response. - EXPECT_EQ(1U, balancers_[0]->service_.response_count()); - EXPECT_EQ(0U, balancers_[1]->service_.request_count()); - EXPECT_EQ(0U, balancers_[1]->service_.response_count()); - EXPECT_EQ(0U, balancers_[2]->service_.request_count()); - EXPECT_EQ(0U, balancers_[2]->service_.response_count()); + // The EDS service of balancer 0 got a single request, and sent a single + // response. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); + EXPECT_EQ(0U, balancers_[1]->eds_service()->request_count()); + EXPECT_EQ(0U, balancers_[1]->eds_service()->response_count()); + EXPECT_EQ(0U, balancers_[2]->eds_service()->request_count()); + EXPECT_EQ(0U, balancers_[2]->eds_service()->response_count()); gpr_log(GPR_INFO, "========= ABOUT TO UPDATE 1 =========="); - SetNextResolutionForLbChannel({balancers_[1]->port_}); + SetNextResolutionForLbChannel({balancers_[1]->port()}); gpr_log(GPR_INFO, "========= UPDATE 1 DONE =========="); - EXPECT_EQ(0U, backends_[1]->service_.request_count()); + EXPECT_EQ(0U, backends_[1]->backend_service()->request_count()); gpr_timespec deadline = gpr_time_add( gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_millis(10000, GPR_TIMESPAN)); // Send 10 seconds worth of RPCs @@ -1152,25 +1768,25 @@ TEST_F(UpdatesTest, UpdateBalancersButKeepUsingOriginalBalancer) { } while (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), deadline) < 0); // The current LB call is still working, so xds continued using it to the // first balancer, which doesn't assign the second backend. - EXPECT_EQ(0U, backends_[1]->service_.request_count()); - - EXPECT_EQ(1U, balancers_[0]->service_.request_count()); - EXPECT_EQ(1U, balancers_[0]->service_.response_count()); - EXPECT_EQ(0U, balancers_[1]->service_.request_count()); - EXPECT_EQ(0U, balancers_[1]->service_.response_count()); - EXPECT_EQ(0U, balancers_[2]->service_.request_count()); - EXPECT_EQ(0U, balancers_[2]->service_.response_count()); + EXPECT_EQ(0U, backends_[1]->backend_service()->request_count()); + + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); + EXPECT_EQ(0U, balancers_[1]->eds_service()->request_count()); + EXPECT_EQ(0U, balancers_[1]->eds_service()->response_count()); + EXPECT_EQ(0U, balancers_[2]->eds_service()->request_count()); + EXPECT_EQ(0U, balancers_[2]->eds_service()->response_count()); } TEST_F(UpdatesTest, UpdateBalancerName) { SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); - const std::vector first_backend{GetBackendPorts()[0]}; - const std::vector second_backend{GetBackendPorts()[1]}; - ScheduleResponseForBalancer( - 0, BalancerServiceImpl::BuildResponseForBackends(first_backend, {}), 0); - ScheduleResponseForBalancer( - 1, BalancerServiceImpl::BuildResponseForBackends(second_backend, {}), 0); + auto first_backend = GetBackendPortsInGroups(0, 1); + auto second_backend = GetBackendPortsInGroups(1, 2); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(first_backend), + 0); + ScheduleResponseForBalancer(1, EdsServiceImpl::BuildResponse(second_backend), + 0); // Wait until the first backend is ready. WaitForBackend(0); @@ -1181,19 +1797,19 @@ TEST_F(UpdatesTest, UpdateBalancerName) { gpr_log(GPR_INFO, "========= DONE WITH FIRST BATCH =========="); // All 10 requests should have gone to the first backend. - EXPECT_EQ(10U, backends_[0]->service_.request_count()); + EXPECT_EQ(10U, backends_[0]->backend_service()->request_count()); - // Balancer 0 got a single request. - EXPECT_EQ(1U, balancers_[0]->service_.request_count()); - // and sent a single response. - EXPECT_EQ(1U, balancers_[0]->service_.response_count()); - EXPECT_EQ(0U, balancers_[1]->service_.request_count()); - EXPECT_EQ(0U, balancers_[1]->service_.response_count()); - EXPECT_EQ(0U, balancers_[2]->service_.request_count()); - EXPECT_EQ(0U, balancers_[2]->service_.response_count()); + // The EDS service of balancer 0 got a single request, and sent a single + // response. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); + EXPECT_EQ(0U, balancers_[1]->eds_service()->request_count()); + EXPECT_EQ(0U, balancers_[1]->eds_service()->response_count()); + EXPECT_EQ(0U, balancers_[2]->eds_service()->request_count()); + EXPECT_EQ(0U, balancers_[2]->eds_service()->response_count()); std::vector ports; - ports.emplace_back(balancers_[1]->port_); + ports.emplace_back(balancers_[1]->port()); auto new_lb_channel_response_generator = grpc_core::MakeRefCounted(); SetNextResolutionForLbChannel(ports, nullptr, @@ -1212,22 +1828,22 @@ TEST_F(UpdatesTest, UpdateBalancerName) { // Wait until update has been processed, as signaled by the second backend // receiving a request. - EXPECT_EQ(0U, backends_[1]->service_.request_count()); + EXPECT_EQ(0U, backends_[1]->backend_service()->request_count()); WaitForBackend(1); - backends_[1]->service_.ResetCounters(); + backends_[1]->backend_service()->ResetCounters(); gpr_log(GPR_INFO, "========= BEFORE SECOND BATCH =========="); CheckRpcSendOk(10); gpr_log(GPR_INFO, "========= DONE WITH SECOND BATCH =========="); // All 10 requests should have gone to the second backend. - EXPECT_EQ(10U, backends_[1]->service_.request_count()); - - EXPECT_EQ(1U, balancers_[0]->service_.request_count()); - EXPECT_EQ(1U, balancers_[0]->service_.response_count()); - EXPECT_EQ(1U, balancers_[1]->service_.request_count()); - EXPECT_EQ(1U, balancers_[1]->service_.response_count()); - EXPECT_EQ(0U, balancers_[2]->service_.request_count()); - EXPECT_EQ(0U, balancers_[2]->service_.response_count()); + EXPECT_EQ(10U, backends_[1]->backend_service()->request_count()); + + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); + EXPECT_EQ(1U, balancers_[1]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[1]->eds_service()->response_count()); + EXPECT_EQ(0U, balancers_[2]->eds_service()->request_count()); + EXPECT_EQ(0U, balancers_[2]->eds_service()->response_count()); } // Send an update with the same set of LBs as the one in SetUp() in order to @@ -1236,13 +1852,12 @@ TEST_F(UpdatesTest, UpdateBalancerName) { TEST_F(UpdatesTest, UpdateBalancersRepeated) { SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); - const std::vector first_backend{GetBackendPorts()[0]}; - const std::vector second_backend{GetBackendPorts()[0]}; - - ScheduleResponseForBalancer( - 0, BalancerServiceImpl::BuildResponseForBackends(first_backend, {}), 0); - ScheduleResponseForBalancer( - 1, BalancerServiceImpl::BuildResponseForBackends(second_backend, {}), 0); + auto first_backend = GetBackendPortsInGroups(0, 1); + auto second_backend = GetBackendPortsInGroups(1, 2); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(first_backend), + 0); + ScheduleResponseForBalancer(1, EdsServiceImpl::BuildResponse(second_backend), + 0); // Wait until the first backend is ready. WaitForBackend(0); @@ -1253,26 +1868,26 @@ TEST_F(UpdatesTest, UpdateBalancersRepeated) { gpr_log(GPR_INFO, "========= DONE WITH FIRST BATCH =========="); // All 10 requests should have gone to the first backend. - EXPECT_EQ(10U, backends_[0]->service_.request_count()); + EXPECT_EQ(10U, backends_[0]->backend_service()->request_count()); - // Balancer 0 got a single request. - EXPECT_EQ(1U, balancers_[0]->service_.request_count()); - // and sent a single response. - EXPECT_EQ(1U, balancers_[0]->service_.response_count()); - EXPECT_EQ(0U, balancers_[1]->service_.request_count()); - EXPECT_EQ(0U, balancers_[1]->service_.response_count()); - EXPECT_EQ(0U, balancers_[2]->service_.request_count()); - EXPECT_EQ(0U, balancers_[2]->service_.response_count()); + // The EDS service of balancer 0 got a single request, and sent a single + // response. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); + EXPECT_EQ(0U, balancers_[1]->eds_service()->request_count()); + EXPECT_EQ(0U, balancers_[1]->eds_service()->response_count()); + EXPECT_EQ(0U, balancers_[2]->eds_service()->request_count()); + EXPECT_EQ(0U, balancers_[2]->eds_service()->response_count()); std::vector ports; - ports.emplace_back(balancers_[0]->port_); - ports.emplace_back(balancers_[1]->port_); - ports.emplace_back(balancers_[2]->port_); + ports.emplace_back(balancers_[0]->port()); + ports.emplace_back(balancers_[1]->port()); + ports.emplace_back(balancers_[2]->port()); gpr_log(GPR_INFO, "========= ABOUT TO UPDATE 1 =========="); SetNextResolutionForLbChannel(ports); gpr_log(GPR_INFO, "========= UPDATE 1 DONE =========="); - EXPECT_EQ(0U, backends_[1]->service_.request_count()); + EXPECT_EQ(0U, backends_[1]->backend_service()->request_count()); gpr_timespec deadline = gpr_time_add( gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_millis(10000, GPR_TIMESPAN)); // Send 10 seconds worth of RPCs @@ -1281,16 +1896,16 @@ TEST_F(UpdatesTest, UpdateBalancersRepeated) { } while (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), deadline) < 0); // xds continued using the original LB call to the first balancer, which // doesn't assign the second backend. - EXPECT_EQ(0U, backends_[1]->service_.request_count()); + EXPECT_EQ(0U, backends_[1]->backend_service()->request_count()); ports.clear(); - ports.emplace_back(balancers_[0]->port_); - ports.emplace_back(balancers_[1]->port_); + ports.emplace_back(balancers_[0]->port()); + ports.emplace_back(balancers_[1]->port()); gpr_log(GPR_INFO, "========= ABOUT TO UPDATE 2 =========="); SetNextResolutionForLbChannel(ports); gpr_log(GPR_INFO, "========= UPDATE 2 DONE =========="); - EXPECT_EQ(0U, backends_[1]->service_.request_count()); + EXPECT_EQ(0U, backends_[1]->backend_service()->request_count()); deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_millis(10000, GPR_TIMESPAN)); // Send 10 seconds worth of RPCs @@ -1299,26 +1914,25 @@ TEST_F(UpdatesTest, UpdateBalancersRepeated) { } while (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), deadline) < 0); // xds continued using the original LB call to the first balancer, which // doesn't assign the second backend. - EXPECT_EQ(0U, backends_[1]->service_.request_count()); + EXPECT_EQ(0U, backends_[1]->backend_service()->request_count()); } TEST_F(UpdatesTest, UpdateBalancersDeadUpdate) { SetNextResolution({}, kDefaultServiceConfig_.c_str()); - SetNextResolutionForLbChannel({balancers_[0]->port_}); - const std::vector first_backend{GetBackendPorts()[0]}; - const std::vector second_backend{GetBackendPorts()[1]}; - - ScheduleResponseForBalancer( - 0, BalancerServiceImpl::BuildResponseForBackends(first_backend, {}), 0); - ScheduleResponseForBalancer( - 1, BalancerServiceImpl::BuildResponseForBackends(second_backend, {}), 0); + SetNextResolutionForLbChannel({balancers_[0]->port()}); + auto first_backend = GetBackendPortsInGroups(0, 1); + auto second_backend = GetBackendPortsInGroups(1, 2); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(first_backend), + 0); + ScheduleResponseForBalancer(1, EdsServiceImpl::BuildResponse(second_backend), + 0); // Start servers and send 10 RPCs per server. gpr_log(GPR_INFO, "========= BEFORE FIRST BATCH =========="); CheckRpcSendOk(10); gpr_log(GPR_INFO, "========= DONE WITH FIRST BATCH =========="); // All 10 requests should have gone to the first backend. - EXPECT_EQ(10U, backends_[0]->service_.request_count()); + EXPECT_EQ(10U, backends_[0]->backend_service()->request_count()); // Kill balancer 0 gpr_log(GPR_INFO, "********** ABOUT TO KILL BALANCER 0 *************"); @@ -1330,48 +1944,48 @@ TEST_F(UpdatesTest, UpdateBalancersDeadUpdate) { CheckRpcSendOk(10); gpr_log(GPR_INFO, "========= DONE WITH SECOND BATCH =========="); // All 10 requests should again have gone to the first backend. - EXPECT_EQ(20U, backends_[0]->service_.request_count()); - EXPECT_EQ(0U, backends_[1]->service_.request_count()); - - // Balancer 0 got a single request. - EXPECT_EQ(1U, balancers_[0]->service_.request_count()); - // and sent a single response. - EXPECT_EQ(1U, balancers_[0]->service_.response_count()); - EXPECT_EQ(0U, balancers_[1]->service_.request_count()); - EXPECT_EQ(0U, balancers_[1]->service_.response_count()); - EXPECT_EQ(0U, balancers_[2]->service_.request_count()); - EXPECT_EQ(0U, balancers_[2]->service_.response_count()); + EXPECT_EQ(20U, backends_[0]->backend_service()->request_count()); + EXPECT_EQ(0U, backends_[1]->backend_service()->request_count()); + + // The EDS service of balancer 0 got a single request, and sent a single + // response. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); + EXPECT_EQ(0U, balancers_[1]->eds_service()->request_count()); + EXPECT_EQ(0U, balancers_[1]->eds_service()->response_count()); + EXPECT_EQ(0U, balancers_[2]->eds_service()->request_count()); + EXPECT_EQ(0U, balancers_[2]->eds_service()->response_count()); gpr_log(GPR_INFO, "========= ABOUT TO UPDATE 1 =========="); - SetNextResolutionForLbChannel({balancers_[1]->port_}); + SetNextResolutionForLbChannel({balancers_[1]->port()}); gpr_log(GPR_INFO, "========= UPDATE 1 DONE =========="); // Wait until update has been processed, as signaled by the second backend // receiving a request. In the meantime, the client continues to be serviced // (by the first backend) without interruption. - EXPECT_EQ(0U, backends_[1]->service_.request_count()); + EXPECT_EQ(0U, backends_[1]->backend_service()->request_count()); WaitForBackend(1); // This is serviced by the updated RR policy - backends_[1]->service_.ResetCounters(); + backends_[1]->backend_service()->ResetCounters(); gpr_log(GPR_INFO, "========= BEFORE THIRD BATCH =========="); CheckRpcSendOk(10); gpr_log(GPR_INFO, "========= DONE WITH THIRD BATCH =========="); // All 10 requests should have gone to the second backend. - EXPECT_EQ(10U, backends_[1]->service_.request_count()); + EXPECT_EQ(10U, backends_[1]->backend_service()->request_count()); - EXPECT_EQ(1U, balancers_[0]->service_.request_count()); - EXPECT_EQ(1U, balancers_[0]->service_.response_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); // The second balancer, published as part of the first update, may end up // getting two requests (that is, 1 <= #req <= 2) if the LB call retry timer // firing races with the arrival of the update containing the second // balancer. - EXPECT_GE(balancers_[1]->service_.request_count(), 1U); - EXPECT_GE(balancers_[1]->service_.response_count(), 1U); - EXPECT_LE(balancers_[1]->service_.request_count(), 2U); - EXPECT_LE(balancers_[1]->service_.response_count(), 2U); - EXPECT_EQ(0U, balancers_[2]->service_.request_count()); - EXPECT_EQ(0U, balancers_[2]->service_.response_count()); + EXPECT_GE(balancers_[1]->eds_service()->request_count(), 1U); + EXPECT_GE(balancers_[1]->eds_service()->response_count(), 1U); + EXPECT_LE(balancers_[1]->eds_service()->request_count(), 2U); + EXPECT_LE(balancers_[1]->eds_service()->response_count(), 2U); + EXPECT_EQ(0U, balancers_[2]->eds_service()->request_count()); + EXPECT_EQ(0U, balancers_[2]->eds_service()->response_count()); } // The re-resolution tests are deferred because they rely on the fallback mode, @@ -1382,28 +1996,178 @@ TEST_F(UpdatesTest, UpdateBalancersDeadUpdate) { // TODO(juanlishen): Add TEST_F(UpdatesWithClientLoadReportingTest, // ReresolveDeadBalancer) -// The drop tests are deferred because the drop handling hasn't been added yet. - -// TODO(roth): Add TEST_F(SingleBalancerTest, Drop) - -// TODO(roth): Add TEST_F(SingleBalancerTest, DropAllFirst) - -// TODO(roth): Add TEST_F(SingleBalancerTest, DropAll) - class SingleBalancerWithClientLoadReportingTest : public XdsEnd2endTest { public: SingleBalancerWithClientLoadReportingTest() : XdsEnd2endTest(4, 1, 3) {} }; -// The client load reporting tests are deferred because the client load -// reporting hasn't been supported yet. +TEST_F(SingleBalancerWithClientLoadReportingTest, Vanilla) { + SetNextResolution({}, kDefaultServiceConfig_.c_str()); + SetNextResolutionForLbChannel({balancers_[0]->port()}); + const size_t kNumRpcsPerAddress = 100; + // TODO(juanlishen): Partition the backends after multiple localities is + // tested. + ScheduleResponseForBalancer(0, + EdsServiceImpl::BuildResponse( + GetBackendPortsInGroups(0, backends_.size())), + 0); + // Wait until all backends are ready. + int num_ok = 0; + int num_failure = 0; + int num_drops = 0; + std::tie(num_ok, num_failure, num_drops) = WaitForAllBackends(); + // Send kNumRpcsPerAddress RPCs per server. + CheckRpcSendOk(kNumRpcsPerAddress * num_backends_); + // Each backend should have gotten 100 requests. + for (size_t i = 0; i < backends_.size(); ++i) { + EXPECT_EQ(kNumRpcsPerAddress, + backends_[i]->backend_service()->request_count()); + } + // The EDS service got a single request, and sent a single response. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); + // The LRS service got a single request, and sent a single response. + EXPECT_EQ(1U, balancers_[0]->lrs_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->lrs_service()->response_count()); + // The load report received at the balancer should be correct. + ClientStats* client_stats = balancers_[0]->lrs_service()->WaitForLoadReport(); + EXPECT_EQ(kNumRpcsPerAddress * num_backends_ + num_ok, + client_stats->total_successful_requests()); + EXPECT_EQ(0U, client_stats->total_requests_in_progress()); + EXPECT_EQ(kNumRpcsPerAddress * num_backends_ + num_ok, + client_stats->total_issued_requests()); + EXPECT_EQ(0U, client_stats->total_error_requests()); + EXPECT_EQ(0U, client_stats->total_dropped_requests()); +} -// TODO(vpowar): Add TEST_F(SingleBalancerWithClientLoadReportingTest, Vanilla) +TEST_F(SingleBalancerWithClientLoadReportingTest, BalancerRestart) { + SetNextResolution({}, kDefaultServiceConfig_.c_str()); + SetNextResolutionForLbChannel({balancers_[0]->port()}); + const size_t kNumBackendsFirstPass = backends_.size() / 2; + const size_t kNumBackendsSecondPass = + backends_.size() - kNumBackendsFirstPass; + ScheduleResponseForBalancer( + 0, + EdsServiceImpl::BuildResponse( + GetBackendPortsInGroups(0, kNumBackendsFirstPass)), + 0); + // Wait until all backends returned by the balancer are ready. + int num_ok = 0; + int num_failure = 0; + int num_drops = 0; + std::tie(num_ok, num_failure, num_drops) = + WaitForAllBackends(/* num_requests_multiple_of */ 1, /* start_index */ 0, + /* stop_index */ kNumBackendsFirstPass); + ClientStats* client_stats = balancers_[0]->lrs_service()->WaitForLoadReport(); + EXPECT_EQ(static_cast(num_ok), + client_stats->total_successful_requests()); + EXPECT_EQ(0U, client_stats->total_requests_in_progress()); + EXPECT_EQ(0U, client_stats->total_error_requests()); + EXPECT_EQ(0U, client_stats->total_dropped_requests()); + // Shut down the balancer. + balancers_[0]->Shutdown(); + // Send 1 more request per backend. This will continue using the + // last serverlist we received from the balancer before it was shut down. + ResetBackendCounters(); + CheckRpcSendOk(kNumBackendsFirstPass); + int num_started = kNumBackendsFirstPass; + // Each backend should have gotten 1 request. + for (size_t i = 0; i < kNumBackendsFirstPass; ++i) { + EXPECT_EQ(1UL, backends_[i]->backend_service()->request_count()); + } + // Now restart the balancer, this time pointing to the new backends. + balancers_[0]->Start(server_host_); + ScheduleResponseForBalancer( + 0, + EdsServiceImpl::BuildResponse( + GetBackendPortsInGroups(kNumBackendsFirstPass)), + 0); + // Wait for queries to start going to one of the new backends. + // This tells us that we're now using the new serverlist. + std::tie(num_ok, num_failure, num_drops) = + WaitForAllBackends(/* num_requests_multiple_of */ 1, + /* start_index */ kNumBackendsFirstPass); + num_started += num_ok + num_failure + num_drops; + // Send one RPC per backend. + CheckRpcSendOk(kNumBackendsSecondPass); + num_started += kNumBackendsSecondPass; + // Check client stats. + client_stats = balancers_[0]->lrs_service()->WaitForLoadReport(); + EXPECT_EQ(num_started, client_stats->total_successful_requests()); + EXPECT_EQ(0U, client_stats->total_requests_in_progress()); + EXPECT_EQ(0U, client_stats->total_error_requests()); + EXPECT_EQ(0U, client_stats->total_dropped_requests()); +} -// TODO(roth): Add TEST_F(SingleBalancerWithClientLoadReportingTest, -// BalancerRestart) +class SingleBalancerWithClientLoadReportingAndDropTest : public XdsEnd2endTest { + public: + SingleBalancerWithClientLoadReportingAndDropTest() + : XdsEnd2endTest(4, 1, 20) {} +}; -// TODO(roth): Add TEST_F(SingleBalancerWithClientLoadReportingTest, Drop) +TEST_F(SingleBalancerWithClientLoadReportingAndDropTest, Vanilla) { + SetNextResolution({}, kDefaultServiceConfig_.c_str()); + SetNextResolutionForLbChannelAllBalancers(); + const size_t kNumRpcs = 3000; + const uint32_t kDropPerMillionForLb = 100000; + const uint32_t kDropPerMillionForThrottle = 200000; + const double kDropRateForLb = kDropPerMillionForLb / 1000000.0; + const double kDropRateForThrottle = kDropPerMillionForThrottle / 1000000.0; + const double KDropRateForLbAndThrottle = + kDropRateForLb + (1 - kDropRateForLb) * kDropRateForThrottle; + // The EDS response contains two drop categories. + ScheduleResponseForBalancer( + 0, + EdsServiceImpl::BuildResponse( + GetBackendPortsInGroups(), {}, 0, + {{kLbDropType, kDropPerMillionForLb}, + {kThrottleDropType, kDropPerMillionForThrottle}}), + 0); + int num_ok = 0; + int num_failure = 0; + int num_drops = 0; + std::tie(num_ok, num_failure, num_drops) = WaitForAllBackends(); + const size_t num_warmup = num_ok + num_failure + num_drops; + // Send kNumRpcs RPCs and count the drops. + for (size_t i = 0; i < kNumRpcs; ++i) { + EchoResponse response; + const Status status = SendRpc(&response); + if (!status.ok() && + status.error_message() == "Call dropped by load balancing policy") { + ++num_drops; + } else { + EXPECT_TRUE(status.ok()) << "code=" << status.error_code() + << " message=" << status.error_message(); + EXPECT_EQ(response.message(), kRequestMessage_); + } + } + // The drop rate should be roughly equal to the expectation. + const double seen_drop_rate = static_cast(num_drops) / kNumRpcs; + const double kErrorTolerance = 0.2; + EXPECT_THAT( + seen_drop_rate, + ::testing::AllOf( + ::testing::Ge(KDropRateForLbAndThrottle * (1 - kErrorTolerance)), + ::testing::Le(KDropRateForLbAndThrottle * (1 + kErrorTolerance)))); + // Check client stats. + ClientStats* client_stats = balancers_[0]->lrs_service()->WaitForLoadReport(); + EXPECT_EQ(num_drops, client_stats->total_dropped_requests()); + const size_t total_rpc = num_warmup + kNumRpcs; + EXPECT_THAT( + client_stats->dropped_requests(kLbDropType), + ::testing::AllOf( + ::testing::Ge(total_rpc * kDropRateForLb * (1 - kErrorTolerance)), + ::testing::Le(total_rpc * kDropRateForLb * (1 + kErrorTolerance)))); + EXPECT_THAT(client_stats->dropped_requests(kThrottleDropType), + ::testing::AllOf( + ::testing::Ge(total_rpc * (1 - kDropRateForLb) * + kDropRateForThrottle * (1 - kErrorTolerance)), + ::testing::Le(total_rpc * (1 - kDropRateForLb) * + kDropRateForThrottle * (1 + kErrorTolerance)))); + // The EDS service got a single request, and sent a single response. + EXPECT_EQ(1U, balancers_[0]->eds_service()->request_count()); + EXPECT_EQ(1U, balancers_[0]->eds_service()->response_count()); +} } // namespace } // namespace testing diff --git a/test/cpp/grpclb/grpclb_api_test.cc b/test/cpp/grpclb/grpclb_api_test.cc index 0ace512c278..62e7c06bbb8 100644 --- a/test/cpp/grpclb/grpclb_api_test.cc +++ b/test/cpp/grpclb/grpclb_api_test.cc @@ -20,6 +20,7 @@ #include #include +#include "google/protobuf/duration.upb.h" #include "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h" #include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/iomgr/sockaddr_utils.h" @@ -44,7 +45,8 @@ grpc::string Ip4ToPackedString(const char* ip_str) { return grpc::string(reinterpret_cast(&ip4), sizeof(ip4)); } -grpc::string PackedStringToIp(const grpc_grpclb_ip_address& pb_ip) { +grpc::string PackedStringToIp( + const grpc_core::grpc_grpclb_server_ip_address& pb_ip) { char ip_str[46] = {0}; int af = -1; if (pb_ip.size == 4) { @@ -54,21 +56,22 @@ grpc::string PackedStringToIp(const grpc_grpclb_ip_address& pb_ip) { } else { abort(); } - GPR_ASSERT(inet_ntop(af, (void*)pb_ip.bytes, ip_str, 46) != nullptr); + GPR_ASSERT(inet_ntop(af, (void*)pb_ip.data, ip_str, 46) != nullptr); return ip_str; } TEST_F(GrpclbTest, CreateRequest) { const grpc::string service_name = "AServiceName"; LoadBalanceRequest request; - grpc_grpclb_request* c_req = grpc_grpclb_request_create(service_name.c_str()); - grpc_slice slice = grpc_grpclb_request_encode(c_req); + upb::Arena arena; + grpc_core::grpc_grpclb_request* c_req = + grpc_core::grpc_grpclb_request_create(service_name.c_str(), arena.ptr()); + grpc_slice slice = grpc_core::grpc_grpclb_request_encode(c_req, arena.ptr()); const int num_bytes_written = GRPC_SLICE_LENGTH(slice); EXPECT_GT(num_bytes_written, 0); request.ParseFromArray(GRPC_SLICE_START_PTR(slice), num_bytes_written); EXPECT_EQ(request.initial_request().name(), service_name); grpc_slice_unref(slice); - grpc_grpclb_request_destroy(c_req); } TEST_F(GrpclbTest, ParseInitialResponse) { @@ -82,13 +85,21 @@ TEST_F(GrpclbTest, ParseInitialResponse) { grpc_slice encoded_slice = grpc_slice_from_copied_string(encoded_response.c_str()); - grpc_grpclb_initial_response* c_initial_response = - grpc_grpclb_initial_response_parse(encoded_slice); - EXPECT_FALSE(c_initial_response->has_load_balancer_delegate); - EXPECT_EQ(c_initial_response->client_stats_report_interval.seconds, 123); - EXPECT_EQ(c_initial_response->client_stats_report_interval.nanos, 456); + upb::Arena arena; + const grpc_core::grpc_grpclb_initial_response* c_initial_response = + grpc_core::grpc_grpclb_initial_response_parse(encoded_slice, arena.ptr()); + + upb_strview load_balancer_delegate = + grpc_lb_v1_InitialLoadBalanceResponse_load_balancer_delegate( + c_initial_response); + EXPECT_EQ(load_balancer_delegate.size, 0); + + const google_protobuf_Duration* report_interval = + grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval( + c_initial_response); + EXPECT_EQ(google_protobuf_Duration_seconds(report_interval), 123); + EXPECT_EQ(google_protobuf_Duration_nanos(report_interval), 456); grpc_slice_unref(encoded_slice); - grpc_grpclb_initial_response_destroy(c_initial_response); } TEST_F(GrpclbTest, ParseResponseServerList) { @@ -108,16 +119,14 @@ TEST_F(GrpclbTest, ParseResponseServerList) { const grpc::string encoded_response = response.SerializeAsString(); const grpc_slice encoded_slice = grpc_slice_from_copied_buffer( encoded_response.data(), encoded_response.size()); - grpc_grpclb_serverlist* c_serverlist = - grpc_grpclb_response_parse_serverlist(encoded_slice); + grpc_core::grpc_grpclb_serverlist* c_serverlist = + grpc_core::grpc_grpclb_response_parse_serverlist(encoded_slice); ASSERT_EQ(c_serverlist->num_servers, 2ul); - EXPECT_TRUE(c_serverlist->servers[0]->has_ip_address); EXPECT_EQ(PackedStringToIp(c_serverlist->servers[0]->ip_address), "127.0.0.1"); EXPECT_EQ(c_serverlist->servers[0]->port, 12345); EXPECT_STREQ(c_serverlist->servers[0]->load_balance_token, "rate_limting"); EXPECT_TRUE(c_serverlist->servers[0]->drop); - EXPECT_TRUE(c_serverlist->servers[1]->has_ip_address); EXPECT_EQ(PackedStringToIp(c_serverlist->servers[1]->ip_address), "10.0.0.1"); EXPECT_EQ(c_serverlist->servers[1]->port, 54321); diff --git a/test/cpp/ios/CronetTests/CppCronetEnd2EndTests.mm b/test/cpp/ios/CronetTests/CppCronetEnd2EndTests.mm new file mode 100644 index 00000000000..c6c3e3f345b --- /dev/null +++ b/test/cpp/ios/CronetTests/CppCronetEnd2EndTests.mm @@ -0,0 +1,595 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import +#import + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#import "TestHelper.h" +#import "test/core/end2end/data/ssl_test_data.h" + +#import +#import +#import +#import + +using namespace grpc::testing; +using std::chrono::system_clock; +using grpc::Status; +using grpc::ServerContext; +using grpc::ClientContext; + +@interface CppCronetEnd2EndTests : XCTestCase + +@end + +@implementation CppCronetEnd2EndTests { + std::unique_ptr _server; + TestServiceImpl _service; + TestServiceImpl _foo_service; +} + +// The setUp() function is run before the test cases run and only run once ++ (void)setUp { + [super setUp]; + configureCronet(); +} + +- (void)startServer { + if (_server) { + // server is already running + return; + } + + grpc::ServerBuilder builder; + grpc::SslServerCredentialsOptions ssl_opts; + + ssl_opts.pem_root_certs = ""; + grpc::SslServerCredentialsOptions::PemKeyCertPair pkcp = {test_server1_key, test_server1_cert}; + ssl_opts.pem_key_cert_pairs.push_back(pkcp); + auto server_creds = SslServerCredentials(ssl_opts); + builder.AddListeningPort("localhost:5000", server_creds); + builder.RegisterService(&_service); + builder.RegisterService("foo.test.youtube.com", &_foo_service); + _server = builder.BuildAndStart(); +} + +- (void)stopServer { + _server.reset(); +} + +- (void)restartServer { + [self stopServer]; + [self startServer]; +} + +- (void)setUp { + [self startServer]; +} + +- (void)sendRPCWithStub:(EchoTestService::Stub*)stub + numRPCs:(int)num_rpcs + withBinaryMetadata:(BOOL)with_binary_metadata { + EchoRequest request; + EchoResponse response; + request.set_message("Hello hello hello hello"); + + for (int i = 0; i < num_rpcs; ++i) { + ClientContext context; + if (with_binary_metadata) { + char bytes[8] = {'\0', '\1', '\2', '\3', '\4', '\5', '\6', static_cast(i)}; + context.AddMetadata("custom-bin", grpc::string(bytes, 8)); + } + context.set_compression_algorithm(GRPC_COMPRESS_GZIP); + Status s = stub->Echo(&context, request, &response); + XCTAssertEqual(response.message(), request.message()); + XCTAssertTrue(s.ok()); + } +} + +- (std::shared_ptr<::grpc::Channel>)getChannel { + stream_engine* cronetEngine = [Cronet getGlobalEngine]; + auto cronetChannelCredentials = grpc::CronetChannelCredentials(cronetEngine); + grpc::ChannelArguments args; + args.SetSslTargetNameOverride("foo.test.google.fr"); + args.SetUserAgentPrefix("custom_prefix"); + args.SetString(GRPC_ARG_SECONDARY_USER_AGENT_STRING, "end2end_test"); + auto channel = grpc::CreateCustomChannel("127.0.0.1:5000", cronetChannelCredentials, args); + return channel; +} + +- (std::shared_ptr<::grpc::Channel>)getChannelWithInterceptors: + (std::vector>)creators { + stream_engine* cronetEngine = [Cronet getGlobalEngine]; + auto cronetChannelCredentials = grpc::CronetChannelCredentials(cronetEngine); + grpc::ChannelArguments args; + args.SetSslTargetNameOverride("foo.test.google.fr"); + args.SetUserAgentPrefix("custom_prefix"); + args.SetString(GRPC_ARG_SECONDARY_USER_AGENT_STRING, "end2end_test"); + auto channel = grpc::experimental::CreateCustomChannelWithInterceptors( + "127.0.01:5000", cronetChannelCredentials, args, std::move(creators)); + return channel; +} + +- (std::unique_ptr)getStub { + auto channel = [self getChannel]; + auto stub = EchoTestService::NewStub(channel); + return stub; +} + +- (void)testUserAgent { + ClientContext context; + EchoRequest request; + EchoResponse response; + request.set_message("Hello"); + request.mutable_param()->set_echo_metadata(true); + auto stub = [self getStub]; + Status s = stub->Echo(&context, request, &response); + XCTAssertTrue(s.ok()); + const auto& trailing_metadata = context.GetServerTrailingMetadata(); + auto iter = trailing_metadata.find("user-agent"); + XCTAssert(iter->second.starts_with("custom_prefix grpc-c++")); +} + +- (void)testMultipleRPCs { + auto stub = [self getStub]; + std::vector threads; + threads.reserve(10); + for (int i = 0; i < 10; ++i) { + threads.emplace_back( + [self, &stub]() { [self sendRPCWithStub:stub.get() numRPCs:10 withBinaryMetadata:NO]; }); + } + for (int i = 0; i < 10; ++i) { + threads[i].join(); + } +} + +- (void)testMultipleRPCsWithBinaryMetadata { + auto stub = [self getStub]; + std::vector threads; + threads.reserve(10); + for (int i = 0; i < 10; ++i) { + threads.emplace_back( + [self, &stub]() { [self sendRPCWithStub:stub.get() numRPCs:10 withBinaryMetadata:YES]; }); + } + for (int i = 0; i < 10; ++i) { + threads[i].join(); + } +} + +- (void)testEmptyBinaryMetadata { + EchoRequest request; + EchoResponse response; + request.set_message("Hello hello hello hello"); + ClientContext context; + context.AddMetadata("custom-bin", ""); + auto stub = [self getStub]; + Status s = stub->Echo(&context, request, &response); + XCTAssertEqual(response.message(), request.message()); + XCTAssertTrue(s.ok()); +} + +- (void)testReconnectChannel { + auto stub = [self getStub]; + [self sendRPCWithStub:stub.get() numRPCs:1 withBinaryMetadata:NO]; + + [self restartServer]; + [self sendRPCWithStub:stub.get() numRPCs:1 withBinaryMetadata:NO]; +} + +- (void)testRequestStreamOneRequest { + auto stub = [self getStub]; + EchoRequest request; + EchoResponse response; + ClientContext context; + auto stream = stub->RequestStream(&context, &response); + request.set_message("hello"); + XCTAssertTrue(stream->Write(request)); + stream->WritesDone(); + Status s = stream->Finish(); + XCTAssertEqual(response.message(), request.message()); + XCTAssertTrue(s.ok()); + XCTAssertTrue(context.debug_error_string().empty()); +} + +- (void)testRequestStreamOneRequestWithCoalescingApi { + auto stub = [self getStub]; + EchoRequest request; + EchoResponse response; + ClientContext context; + context.set_initial_metadata_corked(true); + auto stream = stub->RequestStream(&context, &response); + request.set_message("hello"); + XCTAssertTrue(stream->Write(request)); + stream->WritesDone(); + Status s = stream->Finish(); + XCTAssertEqual(response.message(), request.message()); + XCTAssertTrue(s.ok()); +} + +- (void)testRequestStreamTwoRequests { + auto stub = [self getStub]; + EchoRequest request; + EchoResponse response; + ClientContext context; + auto stream = stub->RequestStream(&context, &response); + request.set_message("hello"); + XCTAssertTrue(stream->Write(request)); + XCTAssertTrue(stream->Write(request)); + stream->WritesDone(); + Status s = stream->Finish(); + XCTAssertEqual(response.message(), "hellohello"); + XCTAssertTrue(s.ok()); +} + +- (void)testResponseStream { + auto stub = [self getStub]; + EchoRequest request; + EchoResponse response; + ClientContext context; + request.set_message("hello"); + + auto stream = stub->ResponseStream(&context, request); + for (int i = 0; i < kServerDefaultResponseStreamsToSend; ++i) { + XCTAssertTrue(stream->Read(&response)); + XCTAssertEqual(response.message(), request.message() + grpc::to_string(i)); + } + XCTAssertFalse(stream->Read(&response)); + + Status s = stream->Finish(); + XCTAssertTrue(s.ok()); +} + +- (void)testBidiStream { + auto stub = [self getStub]; + EchoRequest request; + EchoResponse response; + ClientContext context; + grpc::string msg("hello"); + + auto stream = stub->BidiStream(&context); + + for (int i = 0; i < kServerDefaultResponseStreamsToSend; ++i) { + request.set_message(msg + grpc::to_string(i)); + XCTAssertTrue(stream->Write(request)); + XCTAssertTrue(stream->Read(&response)); + XCTAssertEqual(response.message(), request.message()); + } + + stream->WritesDone(); + XCTAssertFalse(stream->Read(&response)); + XCTAssertFalse(stream->Read(&response)); + + Status s = stream->Finish(); + XCTAssertTrue(s.ok()); +} + +- (void)testBidiStreamWithCoalescingApi { + auto stub = [self getStub]; + EchoRequest request; + EchoResponse response; + ClientContext context; + context.AddMetadata(kServerFinishAfterNReads, "3"); + context.set_initial_metadata_corked(true); + grpc::string msg("hello"); + + auto stream = stub->BidiStream(&context); + + request.set_message(msg + "0"); + XCTAssertTrue(stream->Write(request)); + XCTAssertTrue(stream->Read(&response)); + XCTAssertEqual(response.message(), request.message()); + + request.set_message(msg + "1"); + XCTAssertTrue(stream->Write(request)); + XCTAssertTrue(stream->Read(&response)); + XCTAssertEqual(response.message(), request.message()); + + request.set_message(msg + "2"); + stream->WriteLast(request, grpc::WriteOptions()); + XCTAssertTrue(stream->Read(&response)); + XCTAssertEqual(response.message(), request.message()); + + XCTAssertFalse(stream->Read(&response)); + XCTAssertFalse(stream->Read(&response)); + + Status s = stream->Finish(); + XCTAssertTrue(s.ok()); +} + +- (void)testCancelBeforeStart { + auto stub = [self getStub]; + EchoRequest request; + EchoResponse response; + ClientContext context; + request.set_message("hello"); + context.TryCancel(); + Status s = stub->Echo(&context, request, &response); + XCTAssertEqual("", response.message()); + XCTAssertEqual(grpc::StatusCode::CANCELLED, s.error_code()); +} + +- (void)testClientCancelsRequestStream { + auto stub = [self getStub]; + EchoRequest request; + EchoResponse response; + ClientContext context; + request.set_message("hello"); + + auto stream = stub->RequestStream(&context, &response); + XCTAssertTrue(stream->Write(request)); + XCTAssertTrue(stream->Write(request)); + + context.TryCancel(); + + Status s = stream->Finish(); + XCTAssertEqual(grpc::StatusCode::CANCELLED, s.error_code()); + XCTAssertEqual(response.message(), ""); +} + +- (void)testClientCancelsResponseStream { + auto stub = [self getStub]; + EchoRequest request; + EchoResponse response; + ClientContext context; + request.set_message("hello"); + + auto stream = stub->ResponseStream(&context, request); + + XCTAssertTrue(stream->Read(&response)); + XCTAssertEqual(response.message(), request.message() + "0"); + XCTAssertTrue(stream->Read(&response)); + XCTAssertEqual(response.message(), request.message() + "1"); + + context.TryCancel(); + + // The cancellation races with responses, so there might be zero or + // one responses pending, read till failure + + if (stream->Read(&response)) { + XCTAssertEqual(response.message(), request.message() + "2"); + // Since we have cancelled, we expect the next attempt to read to fail + XCTAssertFalse(stream->Read(&response)); + } +} + +- (void)testlClientCancelsBidiStream { + auto stub = [self getStub]; + EchoRequest request; + EchoResponse response; + ClientContext context; + grpc::string msg("hello"); + + auto stream = stub->BidiStream(&context); + + request.set_message(msg + "0"); + XCTAssertTrue(stream->Write(request)); + XCTAssertTrue(stream->Read(&response)); + XCTAssertEqual(response.message(), request.message()); + + request.set_message(msg + "1"); + XCTAssertTrue(stream->Write(request)); + + context.TryCancel(); + + // The cancellation races with responses, so there might be zero or + // one responses pending, read till failure + + if (stream->Read(&response)) { + XCTAssertEqual(response.message(), request.message()); + // Since we have cancelled, we expect the next attempt to read to fail + XCTAssertFalse(stream->Read(&response)); + } + + Status s = stream->Finish(); + XCTAssertEqual(grpc::StatusCode::CANCELLED, s.error_code()); +} + +- (void)testNonExistingService { + auto channel = [self getChannel]; + auto stub = grpc::testing::UnimplementedEchoService::NewStub(channel); + + EchoRequest request; + EchoResponse response; + request.set_message("Hello"); + + ClientContext context; + Status s = stub->Unimplemented(&context, request, &response); + XCTAssertEqual(grpc::StatusCode::UNIMPLEMENTED, s.error_code()); + XCTAssertEqual("", s.error_message()); +} + +- (void)testBinaryTrailer { + auto stub = [self getStub]; + EchoRequest request; + EchoResponse response; + ClientContext context; + + request.mutable_param()->set_echo_metadata(true); + DebugInfo* info = request.mutable_param()->mutable_debug_info(); + info->add_stack_entries("stack_entry_1"); + info->add_stack_entries("stack_entry_2"); + info->add_stack_entries("stack_entry_3"); + info->set_detail("detailed debug info"); + grpc::string expected_string = info->SerializeAsString(); + request.set_message("Hello"); + + Status s = stub->Echo(&context, request, &response); + XCTAssertFalse(s.ok()); + auto trailers = context.GetServerTrailingMetadata(); + XCTAssertEqual(1u, trailers.count(kDebugInfoTrailerKey)); + auto iter = trailers.find(kDebugInfoTrailerKey); + XCTAssertEqual(expected_string, iter->second); + // Parse the returned trailer into a DebugInfo proto. + DebugInfo returned_info; + XCTAssertTrue(returned_info.ParseFromString(ToString(iter->second))); +} + +- (void)testExpectError { + auto stub = [self getStub]; + std::vector expected_status; + expected_status.emplace_back(); + expected_status.back().set_code(13); // INTERNAL + // No Error message or details + + expected_status.emplace_back(); + expected_status.back().set_code(13); // INTERNAL + expected_status.back().set_error_message("text error message"); + expected_status.back().set_binary_error_details("text error details"); + + expected_status.emplace_back(); + expected_status.back().set_code(13); // INTERNAL + expected_status.back().set_error_message("text error message"); + expected_status.back().set_binary_error_details("\x0\x1\x2\x3\x4\x5\x6\x8\x9\xA\xB"); + + for (auto iter = expected_status.begin(); iter != expected_status.end(); ++iter) { + EchoRequest request; + EchoResponse response; + ClientContext context; + request.set_message("Hello"); + auto* error = request.mutable_param()->mutable_expected_error(); + error->set_code(iter->code()); + error->set_error_message(iter->error_message()); + error->set_binary_error_details(iter->binary_error_details()); + + Status s = stub->Echo(&context, request, &response); + XCTAssertFalse(s.ok()); + XCTAssertEqual(iter->code(), s.error_code()); + XCTAssertEqual(iter->error_message(), s.error_message()); + XCTAssertEqual(iter->binary_error_details(), s.error_details()); + XCTAssertTrue(context.debug_error_string().find("created") != std::string::npos); + XCTAssertTrue(context.debug_error_string().find("file") != std::string::npos); + XCTAssertTrue(context.debug_error_string().find("line") != std::string::npos); + XCTAssertTrue(context.debug_error_string().find("status") != std::string::npos); + XCTAssertTrue(context.debug_error_string().find("13") != std::string::npos); + } +} + +- (void)testRpcDeadlineExpires { + auto stub = [self getStub]; + EchoRequest request; + EchoResponse response; + request.set_message("Hello"); + request.mutable_param()->set_skip_cancelled_check(true); + // Let server sleep for 40 ms first to guarantee expiry. + request.mutable_param()->set_server_sleep_us(40 * 1000); + + ClientContext context; + std::chrono::system_clock::time_point deadline = + std::chrono::system_clock::now() + std::chrono::milliseconds(1); + context.set_deadline(deadline); + Status s = stub->Echo(&context, request, &response); + XCTAssertEqual(grpc::StatusCode::DEADLINE_EXCEEDED, s.error_code()); +} + +- (void)testRpcLongDeadline { + auto stub = [self getStub]; + EchoRequest request; + EchoResponse response; + request.set_message("Hello"); + + ClientContext context; + std::chrono::system_clock::time_point deadline = + std::chrono::system_clock::now() + std::chrono::hours(1); + context.set_deadline(deadline); + Status s = stub->Echo(&context, request, &response); + XCTAssertEqual(response.message(), request.message()); + XCTAssertTrue(s.ok()); +} + +- (void)testEchoDeadlineForNoDeadlineRpc { + auto stub = [self getStub]; + EchoRequest request; + EchoResponse response; + request.set_message("Hello"); + request.mutable_param()->set_echo_deadline(true); + + ClientContext context; + Status s = stub->Echo(&context, request, &response); + XCTAssertEqual(response.message(), request.message()); + XCTAssertTrue(s.ok()); + XCTAssertEqual(response.param().request_deadline(), gpr_inf_future(GPR_CLOCK_REALTIME).tv_sec); +} + +- (void)testEchoDeadline { + auto stub = [self getStub]; + EchoRequest request; + EchoResponse response; + request.set_message("Hello"); + request.mutable_param()->set_echo_deadline(true); + + ClientContext context; + std::chrono::system_clock::time_point deadline = + std::chrono::system_clock::now() + std::chrono::seconds(100); + context.set_deadline(deadline); + Status s = stub->Echo(&context, request, &response); + XCTAssertEqual(response.message(), request.message()); + XCTAssertTrue(s.ok()); + gpr_timespec sent_deadline; + grpc::Timepoint2Timespec(deadline, &sent_deadline); + // We want to allow some reasonable error given: + // - request_deadline() only has 1sec resolution so the best we can do is +-1 + // - if sent_deadline.tv_nsec is very close to the next second's boundary we + // can end up being off by 2 in one direction. + XCTAssertLessThanOrEqual(response.param().request_deadline() - sent_deadline.tv_sec, 2); + XCTAssertGreaterThanOrEqual(response.param().request_deadline() - sent_deadline.tv_sec, -1); + NSLog(@"request deadline: %d sent_deadline: %d", response.param().request_deadline(), + sent_deadline.tv_sec); +} + +- (void)testPeer { + auto stub = [self getStub]; + EchoRequest request; + EchoResponse response; + request.set_message("Hello"); + ClientContext context; + Status s = stub->Echo(&context, request, &response); + XCTAssertTrue(s.ok()); + XCTAssertTrue(CheckIsLocalhost(context.peer())); +} + +- (void)testClientInterceptor { + DummyInterceptor::Reset(); + std::vector> creators; + // Add 20 dummy interceptors + for (auto i = 0; i < 20; i++) { + creators.push_back(std::unique_ptr(new DummyInterceptorFactory())); + } + auto channel = [self getChannelWithInterceptors:std::move(creators)]; + auto stub = EchoTestService::NewStub(channel); + + EchoRequest request; + EchoResponse response; + ClientContext context; + request.set_message("Hello"); + Status s = stub->Echo(&context, request, &response); + XCTAssertTrue(s.ok()); + XCTAssertEqual(DummyInterceptor::GetNumTimesRun(), 20); +} + +@end diff --git a/test/cpp/ios/CronetTests/TestHelper.h b/test/cpp/ios/CronetTests/TestHelper.h new file mode 100644 index 00000000000..fb8a42d459a --- /dev/null +++ b/test/cpp/ios/CronetTests/TestHelper.h @@ -0,0 +1,81 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef TESTHELPER_H +#define TESTHELPER_H + +#import +#import +#import + +#import +#import +#import +#import +#import + +const char* const kServerFinishAfterNReads = "server_finish_after_n_reads"; +const char* const kServerResponseStreamsToSend = "server_responses_to_send"; +const int kServerDefaultResponseStreamsToSend = 3; +const char* const kDebugInfoTrailerKey = "debug-info-bin"; + +grpc::string ToString(const grpc::string_ref& r); +void configureCronet(void); +bool CheckIsLocalhost(const grpc::string& addr); + +class DummyInterceptor : public grpc::experimental::Interceptor { + public: + DummyInterceptor() {} + virtual void Intercept(grpc::experimental::InterceptorBatchMethods* methods); + static void Reset(); + static int GetNumTimesRun(); + + private: + static std::atomic num_times_run_; + static std::atomic num_times_run_reverse_; +}; + +class DummyInterceptorFactory + : public grpc::experimental::ClientInterceptorFactoryInterface { + public: + virtual grpc::experimental::Interceptor* CreateClientInterceptor( + grpc::experimental::ClientRpcInfo* info) override { + return new DummyInterceptor(); + } +}; + +class TestServiceImpl : public grpc::testing::EchoTestService::Service { + public: + grpc::Status Echo(grpc::ServerContext* context, + const grpc::testing::EchoRequest* request, + grpc::testing::EchoResponse* response); + grpc::Status RequestStream( + grpc::ServerContext* context, + grpc::ServerReader* reader, + grpc::testing::EchoResponse* response); + grpc::Status ResponseStream( + grpc::ServerContext* context, const grpc::testing::EchoRequest* request, + grpc::ServerWriter* writer); + + grpc::Status BidiStream( + grpc::ServerContext* context, + grpc::ServerReaderWriter* stream); +}; + +#endif /* TESTHELPER_H */ diff --git a/test/cpp/ios/CronetTests/TestHelper.mm b/test/cpp/ios/CronetTests/TestHelper.mm new file mode 100644 index 00000000000..3b2d1803960 --- /dev/null +++ b/test/cpp/ios/CronetTests/TestHelper.mm @@ -0,0 +1,198 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import "TestHelper.h" +#import +#import +#import + +using std::chrono::system_clock; +using grpc::testing::EchoRequest; +using grpc::testing::EchoResponse; +using grpc::testing::EchoTestService; +using grpc::ServerContext; +using grpc::Status; + +std::atomic DummyInterceptor::num_times_run_; +std::atomic DummyInterceptor::num_times_run_reverse_; + +grpc::string ToString(const grpc::string_ref& r) { return grpc::string(r.data(), r.size()); } + +void configureCronet(void) { + static dispatch_once_t configureCronet; + dispatch_once(&configureCronet, ^{ + [Cronet setHttp2Enabled:YES]; + [Cronet setSslKeyLogFileName:@"Documents/key"]; + [Cronet enableTestCertVerifierForTesting]; + NSURL* url = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory + inDomains:NSUserDomainMask] lastObject]; + [Cronet start]; + [Cronet startNetLogToFile:@"cronet_netlog.json" logBytes:YES]; + }); +} + +bool CheckIsLocalhost(const grpc::string& addr) { + const grpc::string kIpv6("[::1]:"); + const grpc::string kIpv4MappedIpv6("[::ffff:127.0.0.1]:"); + const grpc::string kIpv4("127.0.0.1:"); + return addr.substr(0, kIpv4.size()) == kIpv4 || + addr.substr(0, kIpv4MappedIpv6.size()) == kIpv4MappedIpv6 || + addr.substr(0, kIpv6.size()) == kIpv6; +} + +int GetIntValueFromMetadataHelper(const char* key, + const std::multimap& metadata, + int default_value) { + if (metadata.find(key) != metadata.end()) { + std::istringstream iss(ToString(metadata.find(key)->second)); + iss >> default_value; + } + + return default_value; +} + +int GetIntValueFromMetadata(const char* key, + const std::multimap& metadata, + int default_value) { + return GetIntValueFromMetadataHelper(key, metadata, default_value); +} + +// When echo_deadline is requested, deadline seen in the ServerContext is set in +// the response in seconds. +void MaybeEchoDeadline(ServerContext* context, const EchoRequest* request, EchoResponse* response) { + if (request->has_param() && request->param().echo_deadline()) { + gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_REALTIME); + if (context->deadline() != system_clock::time_point::max()) { + grpc::Timepoint2Timespec(context->deadline(), &deadline); + } + response->mutable_param()->set_request_deadline(deadline.tv_sec); + } +} + +Status TestServiceImpl::Echo(ServerContext* context, const EchoRequest* request, + EchoResponse* response) { + // A bit of sleep to make sure that short deadline tests fail + if (request->has_param() && request->param().server_sleep_us() > 0) { + gpr_sleep_until( + gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), + gpr_time_from_micros(request->param().server_sleep_us(), GPR_TIMESPAN))); + } + + if (request->has_param() && request->param().has_expected_error()) { + const auto& error = request->param().expected_error(); + return Status(static_cast(error.code()), error.error_message(), + error.binary_error_details()); + } + + if (request->has_param() && request->param().echo_metadata()) { + const std::multimap& client_metadata = + context->client_metadata(); + for (std::multimap::const_iterator iter = + client_metadata.begin(); + iter != client_metadata.end(); ++iter) { + context->AddTrailingMetadata(ToString(iter->first), ToString(iter->second)); + } + // Terminate rpc with error and debug info in trailer. + if (request->param().debug_info().stack_entries_size() || + !request->param().debug_info().detail().empty()) { + grpc::string serialized_debug_info = request->param().debug_info().SerializeAsString(); + context->AddTrailingMetadata(kDebugInfoTrailerKey, serialized_debug_info); + return Status::CANCELLED; + } + } + + response->set_message(request->message()); + MaybeEchoDeadline(context, request, response); + return Status::OK; +} + +Status TestServiceImpl::RequestStream(ServerContext* context, + grpc::ServerReader* reader, + EchoResponse* response) { + EchoRequest request; + response->set_message(""); + int num_msgs_read = 0; + while (reader->Read(&request)) { + response->mutable_message()->append(request.message()); + ++num_msgs_read; + } + return Status::OK; +} + +Status TestServiceImpl::ResponseStream(ServerContext* context, const EchoRequest* request, + grpc::ServerWriter* writer) { + EchoResponse response; + int server_responses_to_send = + GetIntValueFromMetadata(kServerResponseStreamsToSend, context->client_metadata(), + kServerDefaultResponseStreamsToSend); + for (int i = 0; i < server_responses_to_send; i++) { + response.set_message(request->message() + grpc::to_string(i)); + if (i == server_responses_to_send - 1) { + writer->WriteLast(response, grpc::WriteOptions()); + } else { + writer->Write(response); + } + } + return Status::OK; +} + +Status TestServiceImpl::BidiStream(ServerContext* context, + grpc::ServerReaderWriter* stream) { + EchoRequest request; + EchoResponse response; + + // kServerFinishAfterNReads suggests after how many reads, the server should + // write the last message and send status (coalesced using WriteLast) + int server_write_last = + GetIntValueFromMetadata(kServerFinishAfterNReads, context->client_metadata(), 0); + + int read_counts = 0; + while (stream->Read(&request)) { + read_counts++; + response.set_message(request.message()); + if (read_counts == server_write_last) { + stream->WriteLast(response, grpc::WriteOptions()); + } else { + stream->Write(response); + } + } + + return Status::OK; +} + +void DummyInterceptor::Intercept(grpc::experimental::InterceptorBatchMethods* methods) { + if (methods->QueryInterceptionHookPoint( + grpc::experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) { + num_times_run_++; + } else if (methods->QueryInterceptionHookPoint( + grpc::experimental::InterceptionHookPoints::POST_RECV_INITIAL_METADATA)) { + num_times_run_reverse_++; + } + methods->Proceed(); +} + +void DummyInterceptor::Reset() { + num_times_run_.store(0); + num_times_run_reverse_.store(0); +} + +int DummyInterceptor::GetNumTimesRun() { + NSCAssert(num_times_run_.load() == num_times_run_reverse_.load(), + @"Interceptor must run same number of times in both directions"); + return num_times_run_.load(); +} diff --git a/test/cpp/ios/Info.plist b/test/cpp/ios/Info.plist new file mode 100644 index 00000000000..fbeeb96ba6c --- /dev/null +++ b/test/cpp/ios/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + gRPC.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/test/cpp/ios/Podfile b/test/cpp/ios/Podfile new file mode 100644 index 00000000000..49044d2a050 --- /dev/null +++ b/test/cpp/ios/Podfile @@ -0,0 +1,102 @@ +source 'https://github.com/CocoaPods/Specs.git' + +install! 'cocoapods', :deterministic_uuids => false + +# Location of gRPC's repo root relative to this file. +GRPC_LOCAL_SRC = '../../..' + + +target 'CronetTests' do + platform :ios, '8.0' + pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf", :inhibit_warnings => true + + pod '!ProtoCompiler', :path => "#{GRPC_LOCAL_SRC}/src/objective-c" + pod '!ProtoCompiler-gRPCCppPlugin', :path => "#{GRPC_LOCAL_SRC}/src/objective-c" + pod 'Protobuf-C++', :podspec => "#{GRPC_LOCAL_SRC}/src/cpp", :inhibit_warnings => true + + pod 'BoringSSL-GRPC', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c", :inhibit_warnings => true + + pod 'gRPC-Core', :path => GRPC_LOCAL_SRC + pod 'gRPC-C++', :path => GRPC_LOCAL_SRC + pod 'gRPC-C++/Protobuf', :path => GRPC_LOCAL_SRC + pod 'RemoteTestCpp', :path => "RemoteTestClientCpp", :inhibit_warnings => true + + pod 'gRPC-Core/Cronet-Implementation', :path => GRPC_LOCAL_SRC + pod 'CronetFramework', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c" + pod 'gRPC-Core/Tests', :path => GRPC_LOCAL_SRC, :inhibit_warnings => true +end + +# gRPC-Core.podspec needs to be modified to be successfully used for local development. A Podfile's +# pre_install hook lets us do that. The block passed to it runs after the podspecs are downloaded +# and before they are installed in the user project. +# +# This podspec searches for the gRPC core library headers under "$(PODS_ROOT)/gRPC-Core", where +# Cocoapods normally places the downloaded sources. When doing local development of the libraries, +# though, Cocoapods just takes the sources from whatever directory was specified using `:path`, and +# doesn't copy them under $(PODS_ROOT). When using static libraries, one can sometimes rely on the +# symbolic links to the pods headers that Cocoapods creates under "$(PODS_ROOT)/Headers". But those +# aren't created when using dynamic frameworks. So our solution is to modify the podspec on the fly +# to point at the local directory where the sources are. +# +# TODO(jcanizales): Send a PR to Cocoapods to get rid of this need. +pre_install do |installer| + # This is the gRPC-Core podspec object, as initialized by its podspec file. + grpc_core_spec = installer.pod_targets.find{|t| t.name.start_with?('gRPC-Core')}.root_spec + + # Copied from gRPC-Core.podspec, except for the adjusted src_root: + src_root = "$(PODS_ROOT)/../#{GRPC_LOCAL_SRC}" + grpc_core_spec.pod_target_xcconfig = { + 'GRPC_SRC_ROOT' => src_root, + 'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(GRPC_SRC_ROOT)/include"', + 'USER_HEADER_SEARCH_PATHS' => '"$(GRPC_SRC_ROOT)"', + # If we don't set these two settings, `include/grpc/support/time.h` and + # `src/core/lib/gpr/string.h` shadow the system `` and ``, breaking the + # build. + 'USE_HEADERMAP' => 'NO', + 'ALWAYS_SEARCH_USER_PATHS' => 'NO', + } +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['GCC_TREAT_WARNINGS_AS_ERRORS'] = 'YES' + end + + # CocoaPods creates duplicated library targets of gRPC-Core when the test targets include + # non-default subspecs of gRPC-Core. All of these library targets start with prefix 'gRPC-Core' + # and require the same error suppresion. + if target.name.start_with?('gRPC-Core') + target.build_configurations.each do |config| + # TODO(zyc): Remove this setting after the issue is resolved + # GPR_UNREACHABLE_CODE causes "Control may reach end of non-void + # function" warning + config.build_settings['GCC_WARN_ABOUT_RETURN_TYPE'] = 'NO' + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_CRONET_WITH_PACKET_COALESCING=1 GRPC_CFSTREAM=1' + end + end + + # Activate Cronet for the dedicated build configuration 'Cronet', which will be used solely by + # the test target 'InteropTestsRemoteWithCronet' + # Activate GRPCCall+InternalTests functions for the dedicated build configuration 'Test', which will + # be used by all test targets using it. + if /gRPC-(mac|i)OS/.match(target.name) + target.build_configurations.each do |config| + if config.name == 'Cronet' + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_COMPILE_WITH_CRONET=1 GRPC_TEST_OBJC=1' + elsif config.name == 'Test' + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_TEST_OBJC=1' + end + end + end + + # Enable NSAssert on gRPC + if /(gRPC|ProtoRPC|RxLibrary)-(mac|i)OS/.match(target.name) + target.build_configurations.each do |config| + if config.name != 'Release' + config.build_settings['ENABLE_NS_ASSERTIONS'] = 'YES' + end + end + end + end +end diff --git a/test/cpp/ios/RemoteTestClientCpp/RemoteTestCpp.podspec b/test/cpp/ios/RemoteTestClientCpp/RemoteTestCpp.podspec new file mode 100644 index 00000000000..debe2943208 --- /dev/null +++ b/test/cpp/ios/RemoteTestClientCpp/RemoteTestCpp.podspec @@ -0,0 +1,45 @@ +Pod::Spec.new do |s| + s.name = "RemoteTestCpp" + s.version = "0.0.1" + s.license = "Apache License, Version 2.0" + s.authors = { 'gRPC contributors' => 'grpc-io@googlegroups.com' } + s.homepage = "https://grpc.io/" + s.summary = "RemoteTest example" + s.source = { :git => 'https://github.com/grpc/grpc.git' } + + s.ios.deployment_target = '7.1' + s.osx.deployment_target = '10.9' + + # Run protoc with the C++ and gRPC plugins to generate protocol messages and gRPC clients. + s.dependency "!ProtoCompiler-gRPCCppPlugin" + s.dependency "Protobuf-C++" + s.dependency "gRPC-C++" + s.source_files = "src/proto/grpc/testing/*.pb.{h,cc}" + s.header_mappings_dir = "." + s.requires_arc = false + + repo_root = '../../../..' + bazel_exec_root = "#{repo_root}/bazel-out/darwin-fastbuild/bin" + + protoc = "#{bazel_exec_root}/external/com_google_protobuf/protoc" + well_known_types_dir = "#{repo_root}/third_party/protobuf/src" + plugin = "#{bazel_exec_root}/src/compiler/grpc_cpp_plugin" + proto_dir = "#{repo_root}/src/proto/grpc/testing" + + s.prepare_command = <<-CMD + #{protoc} \ + --plugin=protoc-gen-grpc=#{plugin} \ + --cpp_out=. \ + --grpc_out=. \ + -I #{repo_root} \ + -I #{well_known_types_dir} \ + #{proto_dir}/echo.proto #{proto_dir}/echo_messages.proto #{proto_dir}/simple_messages.proto + CMD + + s.pod_target_xcconfig = { + # This is needed by all pods that depend on Protobuf: + 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1 GPB_GRPC_FORWARD_DECLARE_MESSAGE_PROTO=1', + # This is needed by all pods that depend on gRPC-RxLibrary: + 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES', + } +end diff --git a/test/cpp/ios/Tests.xcodeproj/project.pbxproj b/test/cpp/ios/Tests.xcodeproj/project.pbxproj new file mode 100644 index 00000000000..865fc6636ff --- /dev/null +++ b/test/cpp/ios/Tests.xcodeproj/project.pbxproj @@ -0,0 +1,594 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + B02C351522E8E5FE00708B55 /* TestHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = B02C351322E8E5FE00708B55 /* TestHelper.mm */; }; + B0B151E622D7DFCA00C4BFE0 /* CppCronetEnd2EndTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = B0B151E522D7DFCA00C4BFE0 /* CppCronetEnd2EndTests.mm */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 00DA7762CD572056A66501B3 /* Pods-CronetTests.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CronetTests.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-CronetTests/Pods-CronetTests.cronet.xcconfig"; sourceTree = ""; }; + 5E7F485922775B15006656AD /* CronetTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CronetTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 5E7F486622776AD8006656AD /* Cronet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cronet.framework; path = Pods/CronetFramework/Cronet.framework; sourceTree = ""; }; + 635697D81B14FC11007A7283 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 7B0DE0EC5EB517A302CD4698 /* Pods-CronetTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CronetTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CronetTests/Pods-CronetTests.release.xcconfig"; sourceTree = ""; }; + B02C351322E8E5FE00708B55 /* TestHelper.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = TestHelper.mm; sourceTree = ""; }; + B02C351422E8E5FE00708B55 /* TestHelper.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = TestHelper.h; sourceTree = ""; }; + B0B151E522D7DFCA00C4BFE0 /* CppCronetEnd2EndTests.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = CppCronetEnd2EndTests.mm; sourceTree = ""; }; + CDB4E9D8890B97B6FAF35A4F /* Pods-CronetTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CronetTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CronetTests/Pods-CronetTests.debug.xcconfig"; sourceTree = ""; }; + ED8BB10304E81C38CAE911C2 /* Pods-CronetTests.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CronetTests.test.xcconfig"; path = "Pods/Target Support Files/Pods-CronetTests/Pods-CronetTests.test.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 5E7F485622775B15006656AD /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 136D535E19727099B941D7B1 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 5E7F486622776AD8006656AD /* Cronet.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 51E4650F34F854F41FF053B3 /* Pods */ = { + isa = PBXGroup; + children = ( + CDB4E9D8890B97B6FAF35A4F /* Pods-CronetTests.debug.xcconfig */, + ED8BB10304E81C38CAE911C2 /* Pods-CronetTests.test.xcconfig */, + 00DA7762CD572056A66501B3 /* Pods-CronetTests.cronet.xcconfig */, + 7B0DE0EC5EB517A302CD4698 /* Pods-CronetTests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 5E7F485A22775B15006656AD /* CronetTests */ = { + isa = PBXGroup; + children = ( + B0B151E522D7DFCA00C4BFE0 /* CppCronetEnd2EndTests.mm */, + B02C351322E8E5FE00708B55 /* TestHelper.mm */, + B02C351422E8E5FE00708B55 /* TestHelper.h */, + ); + path = CronetTests; + sourceTree = ""; + }; + 635697BE1B14FC11007A7283 = { + isa = PBXGroup; + children = ( + 635697C91B14FC11007A7283 /* Tests */, + 5E7F485A22775B15006656AD /* CronetTests */, + 635697C81B14FC11007A7283 /* Products */, + 51E4650F34F854F41FF053B3 /* Pods */, + 136D535E19727099B941D7B1 /* Frameworks */, + ); + sourceTree = ""; + }; + 635697C81B14FC11007A7283 /* Products */ = { + isa = PBXGroup; + children = ( + 5E7F485922775B15006656AD /* CronetTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 635697C91B14FC11007A7283 /* Tests */ = { + isa = PBXGroup; + children = ( + 635697D71B14FC11007A7283 /* Supporting Files */, + ); + name = Tests; + sourceTree = SOURCE_ROOT; + }; + 635697D71B14FC11007A7283 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 635697D81B14FC11007A7283 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 5E7F485822775B15006656AD /* CronetTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5E7F485E22775B15006656AD /* Build configuration list for PBXNativeTarget "CronetTests" */; + buildPhases = ( + CCAEC0F23E05489651A07D53 /* [CP] Check Pods Manifest.lock */, + 5E7F485522775B15006656AD /* Sources */, + 5E7F485622775B15006656AD /* Frameworks */, + 5E7F485722775B15006656AD /* Resources */, + 292EA42A76AC7933A37235FD /* [CP] Embed Pods Frameworks */, + 30AFD6F6FC40B9923632A866 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CronetTests; + productName = CronetTests; + productReference = 5E7F485922775B15006656AD /* CronetTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 635697BF1B14FC11007A7283 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0630; + ORGANIZATIONNAME = gRPC; + TargetAttributes = { + 5E7F485822775B15006656AD = { + CreatedOnToolsVersion = 10.1; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 635697C21B14FC11007A7283 /* Build configuration list for PBXProject "Tests" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + English, + en, + ); + mainGroup = 635697BE1B14FC11007A7283; + productRefGroup = 635697C81B14FC11007A7283 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 5E7F485822775B15006656AD /* CronetTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 5E7F485722775B15006656AD /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 292EA42A76AC7933A37235FD /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-CronetTests/Pods-CronetTests-frameworks.sh", + "${PODS_ROOT}/CronetFramework/Cronet.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cronet.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CronetTests/Pods-CronetTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 30AFD6F6FC40B9923632A866 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-CronetTests/Pods-CronetTests-resources.sh", + "${PODS_CONFIGURATION_BUILD_DIR}/gRPC-C++/gRPCCertificates-Cpp.bundle", + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates-Cpp.bundle", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CronetTests/Pods-CronetTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + CCAEC0F23E05489651A07D53 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-CronetTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 5E7F485522775B15006656AD /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B0B151E622D7DFCA00C4BFE0 /* CppCronetEnd2EndTests.mm in Sources */, + B02C351522E8E5FE00708B55 /* TestHelper.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 5E1228981E4D400F00E8504F /* Test */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + "GRPC_TEST_OBJC=1", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Test; + }; + 5E7F485F22775B15006656AD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CDB4E9D8890B97B6FAF35A4F /* Pods-CronetTests.debug.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Pods/CronetFramework", + ); + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + INFOPLIST_FILE = Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = io.grpc.CronetTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = ../../..; + }; + name = Debug; + }; + 5E7F486022775B15006656AD /* Test */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = ED8BB10304E81C38CAE911C2 /* Pods-CronetTests.test.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Pods/CronetFramework", + ); + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + INFOPLIST_FILE = Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = io.grpc.CronetTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = ../../..; + }; + name = Test; + }; + 5E7F486122775B15006656AD /* Cronet */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 00DA7762CD572056A66501B3 /* Pods-CronetTests.cronet.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Pods/CronetFramework", + ); + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + INFOPLIST_FILE = Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = io.grpc.CronetTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = ../../..; + }; + name = Cronet; + }; + 5E7F486222775B15006656AD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7B0DE0EC5EB517A302CD4698 /* Pods-CronetTests.release.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Pods/CronetFramework", + ); + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; + INFOPLIST_FILE = Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = io.grpc.CronetTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = ../../..; + }; + name = Release; + }; + 5EC3C7A01D4FC18C000330E2 /* Cronet */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + "GRPC_TEST_OBJC=1", + "GRPC_COMPILE_WITH_CRONET=1", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Cronet; + }; + 635697D91B14FC11007A7283 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 635697DA1B14FC11007A7283 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 5E7F485E22775B15006656AD /* Build configuration list for PBXNativeTarget "CronetTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5E7F485F22775B15006656AD /* Debug */, + 5E7F486022775B15006656AD /* Test */, + 5E7F486122775B15006656AD /* Cronet */, + 5E7F486222775B15006656AD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 635697C21B14FC11007A7283 /* Build configuration list for PBXProject "Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 635697D91B14FC11007A7283 /* Debug */, + 5E1228981E4D400F00E8504F /* Test */, + 5EC3C7A01D4FC18C000330E2 /* Cronet */, + 635697DA1B14FC11007A7283 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 635697BF1B14FC11007A7283 /* Project object */; +} diff --git a/test/cpp/ios/Tests.xcodeproj/xcshareddata/xcschemes/CronetTests.xcscheme b/test/cpp/ios/Tests.xcodeproj/xcshareddata/xcschemes/CronetTests.xcscheme new file mode 100644 index 00000000000..0156c906971 --- /dev/null +++ b/test/cpp/ios/Tests.xcodeproj/xcshareddata/xcschemes/CronetTests.xcscheme @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/cpp/ios/build_and_run_tests.sh b/test/cpp/ios/build_and_run_tests.sh new file mode 100755 index 00000000000..83db83fd199 --- /dev/null +++ b/test/cpp/ios/build_and_run_tests.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Copyright 2019 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Don't run this script standalone. Instead, run from the repository root: +# ./tools/run_tests/run_tests.py -l c++ + +set -ev + +cd "$(dirname "$0")" + +echo "TIME: $(date)" + +./build_tests.sh + +echo "TIME: $(date)" + +set -o pipefail + +XCODEBUILD_FILTER='(^CompileC |^Ld |^ *[^ ]*clang |^ *cd |^ *export |^Libtool |^ *[^ ]*libtool |^CpHeader |^ *builtin-copy )' + +xcodebuild \ + -workspace Tests.xcworkspace \ + -scheme CronetTests \ + -destination name="iPhone 8" \ + test \ + | egrep -v "$XCODEBUILD_FILTER" \ + | egrep -v '^$' - diff --git a/test/cpp/ios/build_tests.sh b/test/cpp/ios/build_tests.sh new file mode 100755 index 00000000000..ead0159dcc9 --- /dev/null +++ b/test/cpp/ios/build_tests.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Copyright 2019 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Don't run this script standalone. Instead, run from the repository root: +# ./tools/run_tests/run_tests.py -l objc + +set -e + +# CocoaPods requires the terminal to be using UTF-8 encoding. +export LANG=en_US.UTF-8 + +cd "$(dirname "$0")" + +hash pod 2>/dev/null || { echo >&2 "Cocoapods needs to be installed."; exit 1; } +hash xcodebuild 2>/dev/null || { + echo >&2 "XCode command-line tools need to be installed." + exit 1 +} + +# clean the directory +rm -rf Pods +rm -rf Tests.xcworkspace +rm -f Podfile.lock +rm -rf RemoteTestClientCpp/src + +echo "TIME: $(date)" +pod install + diff --git a/test/cpp/microbenchmarks/BUILD b/test/cpp/microbenchmarks/BUILD index d9424f24f16..b8e9b14d4b4 100644 --- a/test/cpp/microbenchmarks/BUILD +++ b/test/cpp/microbenchmarks/BUILD @@ -222,6 +222,14 @@ grpc_cc_binary( deps = [":helpers"], ) +grpc_cc_binary( + name = "bm_threadpool", + testonly = 1, + srcs = ["bm_threadpool.cc"], + tags = ["no_windows"], + deps = [":helpers"], +) + grpc_cc_library( name = "bm_callback_test_service_impl", testonly = 1, diff --git a/test/cpp/microbenchmarks/bm_metadata.cc b/test/cpp/microbenchmarks/bm_metadata.cc index ff8fe541dfc..d472363eb87 100644 --- a/test/cpp/microbenchmarks/bm_metadata.cc +++ b/test/cpp/microbenchmarks/bm_metadata.cc @@ -21,6 +21,7 @@ #include #include +#include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/transport/metadata.h" #include "src/core/lib/transport/static_metadata.h" @@ -30,7 +31,7 @@ static void BM_SliceFromStatic(benchmark::State& state) { TrackCounters track_counters; while (state.KeepRunning()) { - benchmark::DoNotOptimize(grpc_slice_from_static_string("abc")); + benchmark::DoNotOptimize(grpc_core::ExternallyManagedSlice("abc")); } track_counters.Finish(state); } @@ -39,7 +40,7 @@ BENCHMARK(BM_SliceFromStatic); static void BM_SliceFromCopied(benchmark::State& state) { TrackCounters track_counters; while (state.KeepRunning()) { - grpc_slice_unref(grpc_slice_from_copied_string("abc")); + grpc_slice_unref(grpc_core::UnmanagedMemorySlice("abc")); } track_counters.Finish(state); } @@ -47,9 +48,9 @@ BENCHMARK(BM_SliceFromCopied); static void BM_SliceIntern(benchmark::State& state) { TrackCounters track_counters; - gpr_slice slice = grpc_slice_from_static_string("abc"); + grpc_core::ExternallyManagedSlice slice("abc"); while (state.KeepRunning()) { - grpc_slice_unref(grpc_slice_intern(slice)); + grpc_slice_unref(grpc_core::ManagedMemorySlice(&slice)); } track_counters.Finish(state); } @@ -57,11 +58,11 @@ BENCHMARK(BM_SliceIntern); static void BM_SliceReIntern(benchmark::State& state) { TrackCounters track_counters; - gpr_slice slice = grpc_slice_intern(grpc_slice_from_static_string("abc")); + grpc_core::ExternallyManagedSlice static_slice("abc"); + grpc_core::ManagedMemorySlice slice(&static_slice); while (state.KeepRunning()) { - grpc_slice_unref(grpc_slice_intern(slice)); + grpc_slice_unref(grpc_core::ManagedMemorySlice(&slice)); } - grpc_slice_unref(slice); track_counters.Finish(state); } BENCHMARK(BM_SliceReIntern); @@ -69,7 +70,7 @@ BENCHMARK(BM_SliceReIntern); static void BM_SliceInternStaticMetadata(benchmark::State& state) { TrackCounters track_counters; while (state.KeepRunning()) { - grpc_slice_intern(GRPC_MDSTR_GZIP); + benchmark::DoNotOptimize(grpc_core::ManagedMemorySlice(&GRPC_MDSTR_GZIP)); } track_counters.Finish(state); } @@ -77,9 +78,9 @@ BENCHMARK(BM_SliceInternStaticMetadata); static void BM_SliceInternEqualToStaticMetadata(benchmark::State& state) { TrackCounters track_counters; - gpr_slice slice = grpc_slice_from_static_string("gzip"); + grpc_core::ExternallyManagedSlice slice("gzip"); while (state.KeepRunning()) { - grpc_slice_intern(slice); + benchmark::DoNotOptimize(grpc_core::ManagedMemorySlice(&slice)); } track_counters.Finish(state); } @@ -87,8 +88,8 @@ BENCHMARK(BM_SliceInternEqualToStaticMetadata); static void BM_MetadataFromNonInternedSlices(benchmark::State& state) { TrackCounters track_counters; - gpr_slice k = grpc_slice_from_static_string("key"); - gpr_slice v = grpc_slice_from_static_string("value"); + grpc_core::ExternallyManagedSlice k("key"); + grpc_core::ExternallyManagedSlice v("value"); grpc_core::ExecCtx exec_ctx; while (state.KeepRunning()) { GRPC_MDELEM_UNREF(grpc_mdelem_create(k, v, nullptr)); @@ -100,8 +101,8 @@ BENCHMARK(BM_MetadataFromNonInternedSlices); static void BM_MetadataFromInternedSlices(benchmark::State& state) { TrackCounters track_counters; - gpr_slice k = grpc_slice_intern(grpc_slice_from_static_string("key")); - gpr_slice v = grpc_slice_intern(grpc_slice_from_static_string("value")); + grpc_core::ManagedMemorySlice k("key"); + grpc_core::ManagedMemorySlice v("value"); grpc_core::ExecCtx exec_ctx; while (state.KeepRunning()) { GRPC_MDELEM_UNREF(grpc_mdelem_create(k, v, nullptr)); @@ -116,8 +117,8 @@ BENCHMARK(BM_MetadataFromInternedSlices); static void BM_MetadataFromInternedSlicesAlreadyInIndex( benchmark::State& state) { TrackCounters track_counters; - gpr_slice k = grpc_slice_intern(grpc_slice_from_static_string("key")); - gpr_slice v = grpc_slice_intern(grpc_slice_from_static_string("value")); + grpc_core::ManagedMemorySlice k("key"); + grpc_core::ManagedMemorySlice v("value"); grpc_core::ExecCtx exec_ctx; grpc_mdelem seed = grpc_mdelem_create(k, v, nullptr); while (state.KeepRunning()) { @@ -133,8 +134,8 @@ BENCHMARK(BM_MetadataFromInternedSlicesAlreadyInIndex); static void BM_MetadataFromInternedKey(benchmark::State& state) { TrackCounters track_counters; - gpr_slice k = grpc_slice_intern(grpc_slice_from_static_string("key")); - gpr_slice v = grpc_slice_from_static_string("value"); + grpc_core::ManagedMemorySlice k("key"); + grpc_core::ExternallyManagedSlice v("value"); grpc_core::ExecCtx exec_ctx; while (state.KeepRunning()) { GRPC_MDELEM_UNREF(grpc_mdelem_create(k, v, nullptr)); @@ -148,8 +149,8 @@ BENCHMARK(BM_MetadataFromInternedKey); static void BM_MetadataFromNonInternedSlicesWithBackingStore( benchmark::State& state) { TrackCounters track_counters; - gpr_slice k = grpc_slice_from_static_string("key"); - gpr_slice v = grpc_slice_from_static_string("value"); + grpc_core::ExternallyManagedSlice k("key"); + grpc_core::ExternallyManagedSlice v("value"); char backing_store[sizeof(grpc_mdelem_data)]; grpc_core::ExecCtx exec_ctx; while (state.KeepRunning()) { @@ -164,8 +165,8 @@ BENCHMARK(BM_MetadataFromNonInternedSlicesWithBackingStore); static void BM_MetadataFromInternedSlicesWithBackingStore( benchmark::State& state) { TrackCounters track_counters; - gpr_slice k = grpc_slice_intern(grpc_slice_from_static_string("key")); - gpr_slice v = grpc_slice_intern(grpc_slice_from_static_string("value")); + grpc_core::ManagedMemorySlice k("key"); + grpc_core::ManagedMemorySlice v("value"); char backing_store[sizeof(grpc_mdelem_data)]; grpc_core::ExecCtx exec_ctx; while (state.KeepRunning()) { @@ -182,8 +183,8 @@ BENCHMARK(BM_MetadataFromInternedSlicesWithBackingStore); static void BM_MetadataFromInternedKeyWithBackingStore( benchmark::State& state) { TrackCounters track_counters; - gpr_slice k = grpc_slice_intern(grpc_slice_from_static_string("key")); - gpr_slice v = grpc_slice_from_static_string("value"); + grpc_core::ManagedMemorySlice k("key"); + grpc_core::ExternallyManagedSlice v("value"); char backing_store[sizeof(grpc_mdelem_data)]; grpc_core::ExecCtx exec_ctx; while (state.KeepRunning()) { @@ -198,14 +199,12 @@ BENCHMARK(BM_MetadataFromInternedKeyWithBackingStore); static void BM_MetadataFromStaticMetadataStrings(benchmark::State& state) { TrackCounters track_counters; - gpr_slice k = GRPC_MDSTR_STATUS; - gpr_slice v = GRPC_MDSTR_200; grpc_core::ExecCtx exec_ctx; while (state.KeepRunning()) { - GRPC_MDELEM_UNREF(grpc_mdelem_create(k, v, nullptr)); + GRPC_MDELEM_UNREF( + grpc_mdelem_create(GRPC_MDSTR_STATUS, GRPC_MDSTR_200, nullptr)); } - grpc_slice_unref(k); track_counters.Finish(state); } BENCHMARK(BM_MetadataFromStaticMetadataStrings); @@ -213,14 +212,12 @@ BENCHMARK(BM_MetadataFromStaticMetadataStrings); static void BM_MetadataFromStaticMetadataStringsNotIndexed( benchmark::State& state) { TrackCounters track_counters; - gpr_slice k = GRPC_MDSTR_STATUS; - gpr_slice v = GRPC_MDSTR_GZIP; grpc_core::ExecCtx exec_ctx; while (state.KeepRunning()) { - GRPC_MDELEM_UNREF(grpc_mdelem_create(k, v, nullptr)); + GRPC_MDELEM_UNREF( + grpc_mdelem_create(GRPC_MDSTR_STATUS, GRPC_MDSTR_GZIP, nullptr)); } - grpc_slice_unref(k); track_counters.Finish(state); } BENCHMARK(BM_MetadataFromStaticMetadataStringsNotIndexed); @@ -229,9 +226,10 @@ static void BM_MetadataRefUnrefExternal(benchmark::State& state) { TrackCounters track_counters; char backing_store[sizeof(grpc_mdelem_data)]; grpc_core::ExecCtx exec_ctx; - grpc_mdelem el = grpc_mdelem_create( - grpc_slice_from_static_string("a"), grpc_slice_from_static_string("b"), - reinterpret_cast(backing_store)); + grpc_mdelem el = + grpc_mdelem_create(grpc_core::ExternallyManagedSlice("a"), + grpc_core::ExternallyManagedSlice("b"), + reinterpret_cast(backing_store)); while (state.KeepRunning()) { GRPC_MDELEM_UNREF(GRPC_MDELEM_REF(el)); } @@ -245,8 +243,8 @@ static void BM_MetadataRefUnrefInterned(benchmark::State& state) { TrackCounters track_counters; char backing_store[sizeof(grpc_mdelem_data)]; grpc_core::ExecCtx exec_ctx; - gpr_slice k = grpc_slice_intern(grpc_slice_from_static_string("key")); - gpr_slice v = grpc_slice_intern(grpc_slice_from_static_string("value")); + grpc_core::ManagedMemorySlice k("key"); + grpc_core::ManagedMemorySlice v("value"); grpc_mdelem el = grpc_mdelem_create( k, v, reinterpret_cast(backing_store)); grpc_slice_unref(k); @@ -264,8 +262,8 @@ static void BM_MetadataRefUnrefAllocated(benchmark::State& state) { TrackCounters track_counters; grpc_core::ExecCtx exec_ctx; grpc_mdelem el = - grpc_mdelem_create(grpc_slice_from_static_string("a"), - grpc_slice_from_static_string("b"), nullptr); + grpc_mdelem_create(grpc_core::ExternallyManagedSlice("a"), + grpc_core::ExternallyManagedSlice("b"), nullptr); while (state.KeepRunning()) { GRPC_MDELEM_UNREF(GRPC_MDELEM_REF(el)); } diff --git a/test/cpp/microbenchmarks/bm_threadpool.cc b/test/cpp/microbenchmarks/bm_threadpool.cc new file mode 100644 index 00000000000..55c8772e5b5 --- /dev/null +++ b/test/cpp/microbenchmarks/bm_threadpool.cc @@ -0,0 +1,324 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include + +#include +#include + +#include "src/core/lib/iomgr/executor/threadpool.h" +#include "test/cpp/microbenchmarks/helpers.h" +#include "test/cpp/util/test_config.h" + +namespace grpc { +namespace testing { + +// This helper class allows a thread to block for a pre-specified number of +// actions. BlockingCounter has an initial non-negative count on initialization. +// Each call to DecrementCount will decrease the count by 1. When making a call +// to Wait, if the count is greater than 0, the thread will be blocked, until +// the count reaches 0. +class BlockingCounter { + public: + BlockingCounter(int count) : count_(count) {} + void DecrementCount() { + std::lock_guard l(mu_); + count_--; + if (count_ == 0) cv_.notify_all(); + } + + void Wait() { + std::unique_lock l(mu_); + while (count_ > 0) { + cv_.wait(l); + } + } + + private: + int count_; + std::mutex mu_; + std::condition_variable cv_; +}; + +// This is a functor/closure class for threadpool microbenchmark. +// This functor (closure) class will add another functor into pool if the +// number passed in (num_add) is greater than 0. Otherwise, it will decrement +// the counter to indicate that task is finished. This functor will suicide at +// the end, therefore, no need for caller to do clean-ups. +class AddAnotherFunctor : public grpc_experimental_completion_queue_functor { + public: + AddAnotherFunctor(grpc_core::ThreadPool* pool, BlockingCounter* counter, + int num_add) + : pool_(pool), counter_(counter), num_add_(num_add) { + functor_run = &AddAnotherFunctor::Run; + internal_next = this; + internal_success = 0; + } + // When the functor gets to run in thread pool, it will take itself as first + // argument and internal_success as second one. + static void Run(grpc_experimental_completion_queue_functor* cb, int ok) { + auto* callback = static_cast(cb); + if (--callback->num_add_ > 0) { + callback->pool_->Add(new AddAnotherFunctor( + callback->pool_, callback->counter_, callback->num_add_)); + } else { + callback->counter_->DecrementCount(); + } + // Suicides. + delete callback; + } + + private: + grpc_core::ThreadPool* pool_; + BlockingCounter* counter_; + int num_add_; +}; + +template +static void ThreadPoolAddAnother(benchmark::State& state) { + const int num_iterations = state.range(0); + const int num_threads = state.range(1); + // Number of adds done by each closure. + const int num_add = num_iterations / kConcurrentFunctor; + grpc_core::ThreadPool pool(num_threads); + while (state.KeepRunningBatch(num_iterations)) { + BlockingCounter counter(kConcurrentFunctor); + for (int i = 0; i < kConcurrentFunctor; ++i) { + pool.Add(new AddAnotherFunctor(&pool, &counter, num_add)); + } + counter.Wait(); + } + state.SetItemsProcessed(state.iterations()); +} + +// First pair of arguments is range for number of iterations (num_iterations). +// Second pair of arguments is range for thread pool size (num_threads). +BENCHMARK_TEMPLATE(ThreadPoolAddAnother, 1)->RangePair(524288, 524288, 1, 1024); +BENCHMARK_TEMPLATE(ThreadPoolAddAnother, 4)->RangePair(524288, 524288, 1, 1024); +BENCHMARK_TEMPLATE(ThreadPoolAddAnother, 8)->RangePair(524288, 524288, 1, 1024); +BENCHMARK_TEMPLATE(ThreadPoolAddAnother, 16) + ->RangePair(524288, 524288, 1, 1024); +BENCHMARK_TEMPLATE(ThreadPoolAddAnother, 32) + ->RangePair(524288, 524288, 1, 1024); +BENCHMARK_TEMPLATE(ThreadPoolAddAnother, 64) + ->RangePair(524288, 524288, 1, 1024); +BENCHMARK_TEMPLATE(ThreadPoolAddAnother, 128) + ->RangePair(524288, 524288, 1, 1024); +BENCHMARK_TEMPLATE(ThreadPoolAddAnother, 512) + ->RangePair(524288, 524288, 1, 1024); +BENCHMARK_TEMPLATE(ThreadPoolAddAnother, 2048) + ->RangePair(524288, 524288, 1, 1024); + +// A functor class that will delete self on end of running. +class SuicideFunctorForAdd : public grpc_experimental_completion_queue_functor { + public: + SuicideFunctorForAdd(BlockingCounter* counter) : counter_(counter) { + functor_run = &SuicideFunctorForAdd::Run; + internal_next = this; + internal_success = 0; + } + + static void Run(grpc_experimental_completion_queue_functor* cb, int ok) { + // On running, the first argument would be itself. + auto* callback = static_cast(cb); + callback->counter_->DecrementCount(); + delete callback; + } + + private: + BlockingCounter* counter_; +}; + +// Performs the scenario of external thread(s) adding closures into pool. +static void BM_ThreadPoolExternalAdd(benchmark::State& state) { + static grpc_core::ThreadPool* external_add_pool = nullptr; + // Setup for each run of test. + if (state.thread_index == 0) { + const int num_threads = state.range(1); + external_add_pool = grpc_core::New(num_threads); + } + const int num_iterations = state.range(0) / state.threads; + while (state.KeepRunningBatch(num_iterations)) { + BlockingCounter counter(num_iterations); + for (int i = 0; i < num_iterations; ++i) { + external_add_pool->Add(new SuicideFunctorForAdd(&counter)); + } + counter.Wait(); + } + + // Teardown at the end of each test run. + if (state.thread_index == 0) { + state.SetItemsProcessed(state.range(0)); + grpc_core::Delete(external_add_pool); + } +} +BENCHMARK(BM_ThreadPoolExternalAdd) + // First pair is range for number of iterations (num_iterations). + // Second pair is range for thread pool size (num_threads). + ->RangePair(524288, 524288, 1, 1024) + ->ThreadRange(1, 256); // Concurrent external thread(s) up to 256 + +// Functor (closure) that adds itself into pool repeatedly. By adding self, the +// overhead would be low and can measure the time of add more accurately. +class AddSelfFunctor : public grpc_experimental_completion_queue_functor { + public: + AddSelfFunctor(grpc_core::ThreadPool* pool, BlockingCounter* counter, + int num_add) + : pool_(pool), counter_(counter), num_add_(num_add) { + functor_run = &AddSelfFunctor::Run; + internal_next = this; + internal_success = 0; + } + // When the functor gets to run in thread pool, it will take itself as first + // argument and internal_success as second one. + static void Run(grpc_experimental_completion_queue_functor* cb, int ok) { + auto* callback = static_cast(cb); + if (--callback->num_add_ > 0) { + callback->pool_->Add(cb); + } else { + callback->counter_->DecrementCount(); + // Suicides. + delete callback; + } + } + + private: + grpc_core::ThreadPool* pool_; + BlockingCounter* counter_; + int num_add_; +}; + +template +static void ThreadPoolAddSelf(benchmark::State& state) { + const int num_iterations = state.range(0); + const int num_threads = state.range(1); + // Number of adds done by each closure. + const int num_add = num_iterations / kConcurrentFunctor; + grpc_core::ThreadPool pool(num_threads); + while (state.KeepRunningBatch(num_iterations)) { + BlockingCounter counter(kConcurrentFunctor); + for (int i = 0; i < kConcurrentFunctor; ++i) { + pool.Add(new AddSelfFunctor(&pool, &counter, num_add)); + } + counter.Wait(); + } + state.SetItemsProcessed(state.iterations()); +} + +// First pair of arguments is range for number of iterations (num_iterations). +// Second pair of arguments is range for thread pool size (num_threads). +BENCHMARK_TEMPLATE(ThreadPoolAddSelf, 1)->RangePair(524288, 524288, 1, 1024); +BENCHMARK_TEMPLATE(ThreadPoolAddSelf, 4)->RangePair(524288, 524288, 1, 1024); +BENCHMARK_TEMPLATE(ThreadPoolAddSelf, 8)->RangePair(524288, 524288, 1, 1024); +BENCHMARK_TEMPLATE(ThreadPoolAddSelf, 16)->RangePair(524288, 524288, 1, 1024); +BENCHMARK_TEMPLATE(ThreadPoolAddSelf, 32)->RangePair(524288, 524288, 1, 1024); +BENCHMARK_TEMPLATE(ThreadPoolAddSelf, 64)->RangePair(524288, 524288, 1, 1024); +BENCHMARK_TEMPLATE(ThreadPoolAddSelf, 128)->RangePair(524288, 524288, 1, 1024); +BENCHMARK_TEMPLATE(ThreadPoolAddSelf, 512)->RangePair(524288, 524288, 1, 1024); +BENCHMARK_TEMPLATE(ThreadPoolAddSelf, 2048)->RangePair(524288, 524288, 1, 1024); + +#if defined(__GNUC__) && !defined(SWIG) +#if defined(__i386__) || defined(__x86_64__) +#define CACHELINE_SIZE 64 +#elif defined(__powerpc64__) +#define CACHELINE_SIZE 128 +#elif defined(__aarch64__) +#define CACHELINE_SIZE 64 +#elif defined(__arm__) +#if defined(__ARM_ARCH_5T__) +#define CACHELINE_SIZE 32 +#elif defined(__ARM_ARCH_7A__) +#define CACHELINE_SIZE 64 +#endif +#endif +#ifndef CACHELINE_SIZE +#define CACHELINE_SIZE 64 +#endif +#endif + +// A functor (closure) that simulates closures with small but non-trivial amount +// of work. +class ShortWorkFunctorForAdd + : public grpc_experimental_completion_queue_functor { + public: + BlockingCounter* counter_; + + ShortWorkFunctorForAdd() { + functor_run = &ShortWorkFunctorForAdd::Run; + internal_next = this; + internal_success = 0; + val_ = 0; + } + static void Run(grpc_experimental_completion_queue_functor* cb, int ok) { + auto* callback = static_cast(cb); + // Uses pad to avoid compiler complaining unused variable error. + callback->pad[0] = 0; + for (int i = 0; i < 1000; ++i) { + callback->val_++; + } + callback->counter_->DecrementCount(); + } + + private: + char pad[CACHELINE_SIZE]; + volatile int val_; +}; + +// Simulates workloads where many short running callbacks are added to the +// threadpool. The callbacks are not enough to keep all the workers busy +// continuously so the number of workers running changes overtime. +// +// In effect this tests how well the threadpool avoids spurious wakeups. +static void BM_SpikyLoad(benchmark::State& state) { + const int num_threads = state.range(0); + + const int kNumSpikes = 1000; + const int batch_size = 3 * num_threads; + std::vector work_vector(batch_size); + grpc_core::ThreadPool pool(num_threads); + while (state.KeepRunningBatch(kNumSpikes * batch_size)) { + for (int i = 0; i != kNumSpikes; ++i) { + BlockingCounter counter(batch_size); + for (auto& w : work_vector) { + w.counter_ = &counter; + pool.Add(&w); + } + counter.Wait(); + } + } + state.SetItemsProcessed(state.iterations() * batch_size); +} +BENCHMARK(BM_SpikyLoad)->Arg(1)->Arg(2)->Arg(4)->Arg(8)->Arg(16); + +} // namespace testing +} // namespace grpc + +// Some distros have RunSpecifiedBenchmarks under the benchmark namespace, +// and others do not. This allows us to support both modes. +namespace benchmark { +void RunTheBenchmarksNamespaced() { RunSpecifiedBenchmarks(); } +} // namespace benchmark + +int main(int argc, char* argv[]) { + LibraryInitializer libInit; + ::benchmark::Initialize(&argc, argv); + ::grpc::testing::InitTest(&argc, &argv, false); + benchmark::RunTheBenchmarksNamespaced(); + return 0; +} diff --git a/test/cpp/util/BUILD b/test/cpp/util/BUILD index d112611ef35..858b88eb01b 100644 --- a/test/cpp/util/BUILD +++ b/test/cpp/util/BUILD @@ -187,7 +187,9 @@ grpc_cc_test( external_deps = [ "gtest", ], - tags = ["nomsan"], # death tests seem to be incompatible with msan + tags = ["nomsan", # death tests seem to be incompatible with msan + "no_test_ios" + ], deps = [ ":grpc_cli_libs", ":test_util", diff --git a/third_party/BUILD b/third_party/BUILD index 91d73b2c688..f0135652238 100644 --- a/third_party/BUILD +++ b/third_party/BUILD @@ -7,4 +7,7 @@ exports_files([ "zope_interface.BUILD", "constantly.BUILD", "cython.BUILD", + "six.BUILD", + "enum34.BUILD", + "futures.BUILD", ]) diff --git a/third_party/cares/cares.BUILD b/third_party/cares/cares.BUILD index 78a4590c3e0..203712b182f 100644 --- a/third_party/cares/cares.BUILD +++ b/third_party/cares/cares.BUILD @@ -44,6 +44,38 @@ config_setting( values = {"cpu": "ios_arm64"}, ) +# The following architectures are found in +# https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/apple/ApplePlatform.java +config_setting( + name = "tvos_x86_64", + values = {"cpu": "tvos_x86_64"}, +) + +config_setting( + name = "tvos_arm64", + values = {"cpu": "tvos_arm64"} +) + +config_setting( + name = "watchos_i386", + values = {"cpu": "watchos_i386"}, +) + +config_setting( + name = "watchos_x86_64", + values = {"cpu": "watchos_x86_64"} +) + +config_setting( + name = "watchos_armv7k", + values = {"cpu": "watchos_armv7k"}, +) + +config_setting( + name = "watchos_arm64_32", + values = {"cpu": "watchos_arm64_32"} +) + genrule( name = "ares_build_h", srcs = ["@com_github_grpc_grpc//third_party/cares:ares_build.h"], @@ -58,6 +90,12 @@ genrule( ":ios_armv7": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"], ":ios_armv7s": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"], ":ios_arm64": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"], + ":tvos_x86_64": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"], + ":tvos_arm64": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"], + ":watchos_i386": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"], + ":watchos_x86_64": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"], + ":watchos_armv7k": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"], + ":watchos_arm64_32": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"], ":darwin": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"], ":darwin_x86_64": ["@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h"], ":windows": ["@com_github_grpc_grpc//third_party/cares:config_windows/ares_config.h"], diff --git a/third_party/enum34.BUILD b/third_party/enum34.BUILD new file mode 100644 index 00000000000..3fc2b3de571 --- /dev/null +++ b/third_party/enum34.BUILD @@ -0,0 +1,6 @@ +py_library( + name = "enum34", + srcs = ["enum/__init__.py"], + srcs_version = "PY2AND3", + visibility = ["//visibility:public"], +) diff --git a/third_party/futures.BUILD b/third_party/futures.BUILD new file mode 100644 index 00000000000..c280e1edfd7 --- /dev/null +++ b/third_party/futures.BUILD @@ -0,0 +1,6 @@ +py_library( + name = "futures", + srcs = glob(["concurrent/**/*.py"]), + srcs_version = "PY2AND3", + visibility = ["//visibility:public"], +) diff --git a/third_party/objective_c/google_toolbox_for_mac/BUILD b/third_party/objective_c/google_toolbox_for_mac/BUILD new file mode 100644 index 00000000000..dc505f30fc3 --- /dev/null +++ b/third_party/objective_c/google_toolbox_for_mac/BUILD @@ -0,0 +1,31 @@ +# gRPC Bazel BUILD file. +# +# Copyright 2019 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) +native.objc_library( + name = "GTM_GoogleTestRunner_GTM_USING_XCTEST", + testonly = 1, + srcs = [ + "UnitTesting/GTMGoogleTestRunner.mm", + ], + copts = [ + "-DGTM_USING_XCTEST", + ], + deps = [ + "//external:gtest", + ], + visibility = ["//visibility:public"] +) diff --git a/third_party/objective_c/google_toolbox_for_mac/UnitTesting/GTMGoogleTestRunner.mm b/third_party/objective_c/google_toolbox_for_mac/UnitTesting/GTMGoogleTestRunner.mm new file mode 100644 index 00000000000..3e8e9245fd4 --- /dev/null +++ b/third_party/objective_c/google_toolbox_for_mac/UnitTesting/GTMGoogleTestRunner.mm @@ -0,0 +1,233 @@ +// +// GTMGoogleTestRunner.mm +// +// Copyright 2013 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy +// of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. +// + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +// This is a SenTest/XCTest based unit test that will run all of the GoogleTest +// https://code.google.com/p/googletest/ +// based tests in the project, and will report results correctly via SenTest so +// that Xcode can pick them up in it's UI. + +// SenTest dynamically creates one SenTest per GoogleTest. +// GoogleTest is set up using a custom event listener (GoogleTestPrinter) +// which knows how to log GoogleTest test results in a manner that SenTest (and +// the Xcode IDE) understand. + +// Note that this does not able you to control individual tests from the Xcode +// UI. You can only turn on/off all of the C++ tests. It does however give +// you output that you can click on in the Xcode UI and immediately jump to a +// test failure. + +// This class is not compiled as part of the standard Google Toolbox For Mac +// project because of it's dependency on https://code.google.com/p/googletest/ + +// To use this: +// - If you are using XCTest (vs SenTest) make sure to define GTM_USING_XCTEST +// in the settings for your testing bundle. +// - Add GTMGoogleTestRunner to your test bundle sources. +// - Add gtest-all.cc from gtest to your test bundle sources. +// - Write some C++ tests and add them to your test bundle sources. +// - Build and run tests. Your C++ tests should just execute. + +// If you are using this with XCTest (as opposed to SenTestingKit) +// make sure to define GTM_USING_XCTEST. +#ifndef GTM_USING_XCTEST +#define GTM_USING_XCTEST 0 +#endif + +#if GTM_USING_XCTEST +#import +#define SenTestCase XCTestCase +#define SenTestSuite XCTestSuite +#else // GTM_USING_XCTEST +#import +#endif // GTM_USING_XCTEST + +#import + +#include + +using ::testing::EmptyTestEventListener; +using ::testing::TestCase; +using ::testing::TestEventListeners; +using ::testing::TestInfo; +using ::testing::TestPartResult; +using ::testing::TestResult; +using ::testing::UnitTest; + +namespace { + +// A gtest printer that takes care of reporting gtest results via the +// SenTest interface. Note that a test suite in SenTest == a test case in gtest +// and a test case in SenTest == a test in gtest. +// This will handle fatal and non-fatal gtests properly. +class GoogleTestPrinter : public EmptyTestEventListener { + public: + GoogleTestPrinter(SenTestCase *test_case) : test_case_(test_case) {} + + virtual ~GoogleTestPrinter() {} + + virtual void OnTestPartResult(const TestPartResult &test_part_result) { + if (!test_part_result.passed()) { + NSString *file = @(test_part_result.file_name()); + int line = test_part_result.line_number(); + NSString *summary = @(test_part_result.summary()); + + // gtest likes to give multi-line summaries. These don't look good in + // the Xcode UI, so we clean them up. + NSString *oneLineSummary = + [summary stringByReplacingOccurrencesOfString:@"\n" withString:@" "]; +#if GTM_USING_XCTEST + BOOL expected = test_part_result.nonfatally_failed(); + [test_case_ recordFailureWithDescription:oneLineSummary + inFile:file + atLine:line + expected:expected]; +#else // GTM_USING_XCTEST + NSException *exception = + [NSException failureInFile:file + atLine:line + withDescription:@"%@", oneLineSummary]; + + // failWithException: will log appropriately. + [test_case_ failWithException:exception]; +#endif // GTM_USING_XCTEST + } + } + + private: + SenTestCase *test_case_; +}; + +NSString *SelectorNameFromGTestName(NSString *testName) { + NSRange dot = [testName rangeOfString:@"."]; + return [NSString stringWithFormat:@"%@::%@", + [testName substringToIndex:dot.location], + [testName substringFromIndex:dot.location + 1]]; +} + +} // namespace + +// GTMGoogleTestRunner is a GTMTestCase that makes a sub test suite populated +// with all of the GoogleTest unit tests. +@interface GTMGoogleTestRunner : SenTestCase { + NSString *testName_; +} + +// The name for a test is the GoogleTest name which is "TestCase.Test" +- (id)initWithName:(NSString *)testName; +@end + +@implementation GTMGoogleTestRunner + ++ (void)initGoogleTest { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + NSArray *arguments = [NSProcessInfo processInfo].arguments; + int argc = (int)arguments.count; + char **argv = static_cast(alloca((sizeof(char *) * (argc + 1)))); + for (int index = 0; index < argc; index++) { + argv[index] = const_cast ([arguments[index] UTF8String]); + } + argv[argc] = NULL; + + testing::InitGoogleTest(&argc, argv); + }); +} + ++ (id)defaultTestSuite { + [GTMGoogleTestRunner initGoogleTest]; + SenTestSuite *result = + [[SenTestSuite alloc] initWithName:NSStringFromClass(self)]; + UnitTest *test = UnitTest::GetInstance(); + + // Walk the GoogleTest tests, adding sub tests and sub suites as appropriate. + int total_test_case_count = test->total_test_case_count(); + for (int i = 0; i < total_test_case_count; ++i) { + const TestCase *test_case = test->GetTestCase(i); + int total_test_count = test_case->total_test_count(); + SenTestSuite *subSuite = + [[SenTestSuite alloc] initWithName:@(test_case->name())]; + [result addTest:subSuite]; + for (int j = 0; j < total_test_count; ++j) { + const TestInfo *test_info = test_case->GetTestInfo(j); + NSString *testName = [NSString stringWithFormat:@"%s.%s", + test_case->name(), test_info->name()]; + SenTestCase *senTest = [[self alloc] initWithName:testName]; + [subSuite addTest:senTest]; + } + } + return result; +} + +- (id)initWithName:(NSString *)testName { + // Xcode 6.1 started taking the testName from the selector instead of calling + // -name. + // So we will add selectors to GTMGoogleTestRunner. + // They should all be unique because the selectors are named cppclass.method + // Filed as radar 18798444. + Class cls = [self class]; + NSString *selectorTestName = SelectorNameFromGTestName(testName); + SEL selector = sel_registerName([selectorTestName UTF8String]); + Method method = class_getInstanceMethod(cls, @selector(runGoogleTest)); + IMP implementation = method_getImplementation(method); + const char *encoding = method_getTypeEncoding(method); + if (!class_addMethod(cls, selector, implementation, encoding)) { + // If we can't add a method, we should blow up here. + [NSException raise:NSInternalInconsistencyException + format:@"Unable to add %@ to %@.", testName, cls]; + } + if ((self = [super initWithSelector:selector])) { + testName_ = testName; + } + return self; +} + +- (NSString *)name { + // A SenTest name must be "-[foo bar]" or it won't be parsed properly. + NSRange dot = [testName_ rangeOfString:@"."]; + return [NSString stringWithFormat:@"-[%@ %@]", + [testName_ substringToIndex:dot.location], + [testName_ substringFromIndex:dot.location + 1]]; +} + +- (void)runGoogleTest { + [GTMGoogleTestRunner initGoogleTest]; + + // Gets hold of the event listener list. + TestEventListeners& listeners = UnitTest::GetInstance()->listeners(); + + // Adds a listener to the end. Google Test takes the ownership. + listeners.Append(new GoogleTestPrinter(self)); + + // Remove the default printer. + delete listeners.Release(listeners.default_result_printer()); + + // Since there is no way of running a single GoogleTest directly, we use the + // filter mechanism in GoogleTest to simulate it for us. + ::testing::GTEST_FLAG(filter) = [testName_ UTF8String]; + + // Intentionally ignore return value of RUN_ALL_TESTS. We will be printing + // the output appropriately, and there is no reason to mark this test as + // "failed" if RUN_ALL_TESTS returns non-zero. + (void)RUN_ALL_TESTS(); +} + +@end diff --git a/third_party/six.BUILD b/third_party/six.BUILD new file mode 100644 index 00000000000..60dc7811492 --- /dev/null +++ b/third_party/six.BUILD @@ -0,0 +1,6 @@ +py_library( + name = "six", + srcs = ["six.py"], + srcs_version = "PY2AND3", + visibility = ["//visibility:public"], +) diff --git a/third_party/upb b/third_party/upb index 423ea5ca9ce..931bbecbd32 160000 --- a/third_party/upb +++ b/third_party/upb @@ -1 +1 @@ -Subproject commit 423ea5ca9ce8da69611e6e95559efcb3a1ba8ad8 +Subproject commit 931bbecbd3230ae7f22efa5d203639facc47f719 diff --git a/tools/buildgen/plugins/check_attrs.py b/tools/buildgen/plugins/check_attrs.py new file mode 100644 index 00000000000..0730f8a1bbb --- /dev/null +++ b/tools/buildgen/plugins/check_attrs.py @@ -0,0 +1,126 @@ +# Copyright 2019 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Buildgen attribute validation plugin.""" + + +def anything(): + return lambda v: None + + +def one_of(values): + return lambda v: ('{0} is not in [{1}]'.format(v, values) if v not in values else None) + + +def subset_of(values): + return lambda v: ('{0} is not subset of [{1}]'.format(v, values) + if not all(e in values for e in v) else None) + + +VALID_ATTRIBUTE_KEYS_MAP = { + 'filegroup': { + 'deps': anything(), + 'headers': anything(), + 'plugin': anything(), + 'public_headers': anything(), + 'src': anything(), + 'uses': anything(), + }, + 'lib': { + 'baselib': anything(), + 'boringssl': one_of((True,)), + 'build_system': anything(), + 'build': anything(), + 'defaults': anything(), + 'deps_linkage': one_of(('static',)), + 'deps': anything(), + 'dll': one_of((True, 'only')), + 'filegroups': anything(), + 'generate_plugin_registry': anything(), + 'headers': anything(), + 'language': one_of(('c', 'c++', 'csharp')), + 'LDFLAGS': anything(), + 'platforms': subset_of(('linux', 'mac', 'posix', 'windows')), + 'public_headers': anything(), + 'secure': one_of(('check', True, False)), + 'src': anything(), + 'vs_proj_dir': anything(), + 'zlib': one_of((True,)), + }, + 'target': { + 'args': anything(), + 'benchmark': anything(), + 'boringssl': one_of((True,)), + 'build': anything(), + 'ci_platforms': anything(), + 'corpus_dirs': anything(), + 'cpu_cost': anything(), + 'defaults': anything(), + 'deps': anything(), + 'dict': anything(), + 'exclude_configs': anything(), + 'exclude_iomgrs': anything(), + 'excluded_poll_engines': anything(), + 'filegroups': anything(), + 'flaky': one_of((True, False)), + 'gtest': one_of((True, False)), + 'headers': anything(), + 'language': one_of(('c', 'c89', 'c++', 'csharp')), + 'maxlen': anything(), + 'platforms': subset_of(('linux', 'mac', 'posix', 'windows')), + 'run': one_of((True, False)), + 'secure': one_of(('check', True, False)), + 'src': anything(), + 'timeout_seconds': anything(), + 'uses_polling': anything(), + 'vs_proj_dir': anything(), + 'zlib': one_of((True,)), + }, +} + + +def check_attributes(entity, kind, errors): + attributes = VALID_ATTRIBUTE_KEYS_MAP[kind] + name = entity.get('name', anything()) + for key, value in entity.items(): + if key == 'name': + continue + validator = attributes.get(key) + if validator: + error = validator(value) + if error: + errors.append( + "{0}({1}) has an invalid value for '{2}': {3}".format( + name, kind, key, error)) + else: + errors.append("{0}({1}) has an invalid attribute '{2}'".format( + name, kind, key)) + + +def mako_plugin(dictionary): + """The exported plugin code for check_attr. + + This validates that filegroups, libs, and target can have only valid + attributes. This is mainly for preventing build.yaml from having + unnecessary and misleading attributes accidently. + """ + + errors = [] + for filegroup in dictionary.get('filegroups', {}): + check_attributes(filegroup, 'filegroup', errors) + for lib in dictionary.get('libs', {}): + check_attributes(lib, 'lib', errors) + for target in dictionary.get('targets', {}): + check_attributes(target, 'target', errors) + if errors: + raise Exception('\n'.join(errors)) diff --git a/tools/buildgen/plugins/expand_version.py b/tools/buildgen/plugins/expand_version.py index a73446940da..08cc10b3c60 100755 --- a/tools/buildgen/plugins/expand_version.py +++ b/tools/buildgen/plugins/expand_version.py @@ -34,18 +34,22 @@ LANGUAGES = [ class Version: - def __init__(self, s): + def __init__(self, version_str, override_major=None): self.tag = None - if '-' in s: - s, self.tag = s.split('-') - self.major, self.minor, self.patch = [int(x) for x in s.split('.')] + if '-' in version_str: + version_str, self.tag = version_str.split('-') + self.major, self.minor, self.patch = [ + int(x) for x in version_str.split('.') + ] + if override_major: + self.major = override_major def __str__(self): """Version string in a somewhat idiomatic style for most languages""" - s = '%d.%d.%d' % (self.major, self.minor, self.patch) + version_str = '%d.%d.%d' % (self.major, self.minor, self.patch) if self.tag: - s += '-%s' % self.tag - return s + version_str += '-%s' % self.tag + return version_str def pep440(self): """Version string in Python PEP440 style""" @@ -105,11 +109,15 @@ def mako_plugin(dictionary): """ settings = dictionary['settings'] - master_version = Version(settings['version']) + version_str = settings['version'] + master_version = Version(version_str) settings['version'] = master_version for language in LANGUAGES: version_tag = '%s_version' % language + override_major = settings.get('%s_major_version' % language, None) if version_tag in settings: - settings[version_tag] = Version(settings[version_tag]) + settings[version_tag] = Version( + settings[version_tag], override_major=override_major) else: - settings[version_tag] = master_version + settings[version_tag] = Version( + version_str, override_major=override_major) diff --git a/tools/codegen/core/gen_static_metadata.py b/tools/codegen/core/gen_static_metadata.py index 95a545f5542..fc1bfe99934 100755 --- a/tools/codegen/core/gen_static_metadata.py +++ b/tools/codegen/core/gen_static_metadata.py @@ -63,6 +63,8 @@ CONFIG = [ 'grpc.max_response_message_bytes', # well known method names '/grpc.lb.v1.LoadBalancer/BalanceLoad', + '/envoy.service.load_stats.v2.LoadReportingService/StreamLoadStats', + '/envoy.api.v2.EndpointDiscoveryService/StreamEndpoints', '/grpc.health.v1.Health/Watch', '/envoy.service.discovery.v2.AggregatedDiscoveryService/StreamAggregatedResources', # compression algorithm names @@ -146,38 +148,35 @@ CONFIG = [ ('accept-encoding', ''), ('content-encoding', 'identity'), ('content-encoding', 'gzip'), - ('lb-token', ''), ('lb-cost-bin', ''), ] # All entries here are ignored when counting non-default initial metadata that # prevents the chttp2 server from sending a Trailers-Only response. METADATA_BATCH_CALLOUTS = [ - # (name) - (':path'), - (':method'), - (':status'), - (':authority'), - (':scheme'), - ('te'), - ('grpc-message'), - ('grpc-status'), - ('grpc-payload-bin'), - ('grpc-encoding'), - ('grpc-accept-encoding'), - ('grpc-server-stats-bin'), - ('grpc-tags-bin'), - ('grpc-trace-bin'), - ('content-type'), - ('content-encoding'), - ('accept-encoding'), - ('grpc-internal-encoding-request'), - ('grpc-internal-stream-encoding-request'), - ('user-agent'), - ('host'), - ('lb-token'), - ('grpc-previous-rpc-attempts'), - ('grpc-retry-pushback-ms'), + ':path', + ':method', + ':status', + ':authority', + ':scheme', + 'te', + 'grpc-message', + 'grpc-status', + 'grpc-payload-bin', + 'grpc-encoding', + 'grpc-accept-encoding', + 'grpc-server-stats-bin', + 'grpc-tags-bin', + 'grpc-trace-bin', + 'content-type', + 'content-encoding', + 'accept-encoding', + 'grpc-internal-encoding-request', + 'grpc-internal-stream-encoding-request', + 'user-agent', + 'host', + 'grpc-previous-rpc-attempts', + 'grpc-retry-pushback-ms', ] COMPRESSION_ALGORITHMS = [ @@ -395,16 +394,21 @@ for i, elem in enumerate(all_strs): def slice_def(i): - return ('{&grpc_static_metadata_refcounts[%d],' - ' {{%d, g_bytes+%d}}}') % (i, len(all_strs[i]), id2strofs[i]) + return ( + 'grpc_core::StaticMetadataSlice(&grpc_static_metadata_refcounts[%d].base, %d, g_bytes+%d)' + ) % (i, len(all_strs[i]), id2strofs[i]) # validate configuration for elem in METADATA_BATCH_CALLOUTS: assert elem in all_strs - +static_slice_dest_assert = ( + 'static_assert(std::is_trivially_destructible' + + '::value, ' + '"grpc_core::StaticMetadataSlice must be trivially destructible.");') +print >> H, static_slice_dest_assert print >> H, '#define GRPC_STATIC_MDSTR_COUNT %d' % len(all_strs) -print >> H, ('extern const grpc_slice ' +print >> H, ('extern const grpc_core::StaticMetadataSlice ' 'grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT];') for i, elem in enumerate(all_strs): print >> H, '/* "%s" */' % elem @@ -414,29 +418,29 @@ print >> H print >> C, 'static uint8_t g_bytes[] = {%s};' % (','.join( '%d' % ord(c) for c in ''.join(all_strs))) print >> C -print >> C, ('static grpc_slice_refcount static_sub_refcnt;') -print >> H, ('extern grpc_slice_refcount ' +print >> H, ('namespace grpc_core { struct StaticSliceRefcount; }') +print >> H, ('extern grpc_core::StaticSliceRefcount ' 'grpc_static_metadata_refcounts[GRPC_STATIC_MDSTR_COUNT];') -print >> C, ('grpc_slice_refcount ' +print >> C, 'grpc_slice_refcount grpc_core::StaticSliceRefcount::kStaticSubRefcount;' +print >> C, ('grpc_core::StaticSliceRefcount ' 'grpc_static_metadata_refcounts[GRPC_STATIC_MDSTR_COUNT] = {') for i, elem in enumerate(all_strs): - print >> C, (' grpc_slice_refcount(&static_sub_refcnt, ' - 'grpc_slice_refcount::Type::STATIC), ') + print >> C, ' grpc_core::StaticSliceRefcount(%d), ' % i print >> C, '};' print >> C print >> H, '#define GRPC_IS_STATIC_METADATA_STRING(slice) \\' print >> H, (' ((slice).refcount != NULL && (slice).refcount->GetType() == ' 'grpc_slice_refcount::Type::STATIC)') print >> H -print >> C, ('const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT]' - ' = {') +print >> C, ( + 'const grpc_core::StaticMetadataSlice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT]' + ' = {') for i, elem in enumerate(all_strs): print >> C, slice_def(i) + ',' print >> C, '};' print >> C print >> H, '#define GRPC_STATIC_METADATA_INDEX(static_slice) \\' -print >> H, (' (static_cast(((static_slice).refcount - ' - 'grpc_static_metadata_refcounts)))') +print >> H, '(reinterpret_cast((static_slice).refcount)->index)' print >> H print >> D, '# hpack fuzzing dictionary' @@ -595,8 +599,26 @@ for elem in METADATA_BATCH_CALLOUTS: print >> H, ' } named;' print >> H, '} grpc_metadata_batch_callouts;' print >> H -print >> H, '#define GRPC_BATCH_INDEX_OF(slice) \\' -print >> H, ' (GRPC_IS_STATIC_METADATA_STRING((slice)) ? static_cast(GPR_CLAMP(GRPC_STATIC_METADATA_INDEX((slice)), 0, static_cast(GRPC_BATCH_CALLOUTS_COUNT))) : GRPC_BATCH_CALLOUTS_COUNT)' + +batch_idx_of_hdr = '#define GRPC_BATCH_INDEX_OF(slice) \\' +static_slice = 'GRPC_IS_STATIC_METADATA_STRING((slice))' +slice_to_slice_ref = '(slice).refcount' +static_slice_ref_type = 'grpc_core::StaticSliceRefcount*' +slice_ref_as_static = ('reinterpret_cast<' + static_slice_ref_type + '>(' + + slice_to_slice_ref + ')') +slice_ref_idx = slice_ref_as_static + '->index' +batch_idx_type = 'grpc_metadata_batch_callouts_index' +slice_ref_idx_to_batch_idx = ( + 'static_cast<' + batch_idx_type + '>(' + slice_ref_idx + ')') +batch_invalid_idx = 'GRPC_BATCH_CALLOUTS_COUNT' +batch_invalid_u32 = 'static_cast(' + batch_invalid_idx + ')' +# Assemble GRPC_BATCH_INDEX_OF(slice) macro as a join for ease of reading. +batch_idx_of_pieces = [ + batch_idx_of_hdr, '\n', '(', static_slice, '&&', slice_ref_idx, '<=', + batch_invalid_u32, '?', slice_ref_idx_to_batch_idx, ':', batch_invalid_idx, + ')' +] +print >> H, ''.join(batch_idx_of_pieces) print >> H print >> H, 'extern const uint8_t grpc_static_accept_encoding_metadata[%d];' % ( diff --git a/tools/codegen/core/gen_upb_api.sh b/tools/codegen/core/gen_upb_api.sh index 710039b0157..4a9239a2828 100755 --- a/tools/codegen/core/gen_upb_api.sh +++ b/tools/codegen/core/gen_upb_api.sh @@ -14,23 +14,29 @@ # See the License for the specific language governing permissions and # limitations under the License. -# REQUIRES: Bazel set -ex +cd $(dirname $0)/../../.. +bazel=`pwd`/tools/bazel + +if [ $# -eq 0 ]; then + UPB_OUTPUT_DIR=$PWD/src/core/ext/upb-generated + rm -rf $UPB_OUTPUT_DIR + mkdir -p $UPB_OUTPUT_DIR +else + UPB_OUTPUT_DIR=$1 +fi + pushd third_party/protobuf -bazel build :protoc +$bazel build :protoc PROTOC=$PWD/bazel-bin/protoc popd pushd third_party/upb -bazel build :protoc-gen-upb +$bazel build :protoc-gen-upb UPB_PLUGIN=$PWD/bazel-bin/protoc-gen-upb popd -UPB_OUTPUT_DIR=$PWD/src/core/ext/upb-generated -rm -rf $UPB_OUTPUT_DIR -mkdir $UPB_OUTPUT_DIR - proto_files=( \ "envoy/api/v2/auth/cert.proto" \ "envoy/api/v2/cds.proto" \ @@ -61,11 +67,12 @@ proto_files=( \ "google/protobuf/timestamp.proto" \ "google/protobuf/wrappers.proto" \ "google/rpc/status.proto" \ - "grpc/gcp/altscontext.proto" \ - "grpc/gcp/handshaker.proto" \ - "grpc/gcp/transport_security_common.proto" \ - "grpc/health/v1/health.proto" \ - "grpc/lb/v1/load_balancer.proto" \ + "src/proto/grpc/gcp/altscontext.proto" \ + "src/proto/grpc/gcp/handshaker.proto" \ + "src/proto/grpc/gcp/transport_security_common.proto" \ + "src/proto/grpc/health/v1/health.proto" \ + "src/proto/grpc/health/v1/health.proto" \ + "src/proto/grpc/lb/v1/load_balancer.proto" \ "validate/validate.proto") for i in "${proto_files[@]}" @@ -75,7 +82,6 @@ do -I=$PWD/third_party/googleapis \ -I=$PWD/third_party/protobuf/src \ -I=$PWD/third_party/protoc-gen-validate \ - -I=$PWD/src/proto \ -I=$PWD \ $i \ --upb_out=$UPB_OUTPUT_DIR \ diff --git a/tools/distrib/check_copyright.py b/tools/distrib/check_copyright.py index aed63474b2d..a67802b2a2c 100755 --- a/tools/distrib/check_copyright.py +++ b/tools/distrib/check_copyright.py @@ -75,8 +75,6 @@ _EXEMPT = frozenset(( 'examples/python/multiplex/route_guide_pb2_grpc.py', 'examples/python/route_guide/route_guide_pb2.py', 'examples/python/route_guide/route_guide_pb2_grpc.py', - 'src/core/ext/filters/client_channel/health/health.pb.h', - 'src/core/ext/filters/client_channel/health/health.pb.c', 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c', 'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h', diff --git a/tools/distrib/check_nanopb_output.sh b/tools/distrib/check_nanopb_output.sh index 018cbb7b66a..573e02e98ff 100755 --- a/tools/distrib/check_nanopb_output.sh +++ b/tools/distrib/check_nanopb_output.sh @@ -15,7 +15,6 @@ set -ex -readonly NANOPB_ALTS_TMP_OUTPUT="$(mktemp -d)" readonly NANOPB_HEALTH_TMP_OUTPUT="$(mktemp -d)" readonly NANOPB_TMP_OUTPUT="$(mktemp -d)" readonly PROTOBUF_INSTALL_PREFIX="$(mktemp -d)" @@ -42,32 +41,6 @@ make -j 8 # back to the root directory popd -# -# Checks for load_balancer.proto -# -readonly LOAD_BALANCER_GRPC_OUTPUT_PATH='src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1' -# nanopb-compile the proto to a temp location -./tools/codegen/core/gen_nano_proto.sh \ - src/proto/grpc/lb/v1/load_balancer.proto \ - "$NANOPB_TMP_OUTPUT" \ - "$LOAD_BALANCER_GRPC_OUTPUT_PATH" - -./tools/codegen/core/gen_nano_proto.sh \ - third_party/protobuf/src/google/protobuf/duration.proto \ - "$NANOPB_TMP_OUTPUT/google/protobuf" \ - "$LOAD_BALANCER_GRPC_OUTPUT_PATH/google/protobuf" - -./tools/codegen/core/gen_nano_proto.sh \ - third_party/protobuf/src/google/protobuf/timestamp.proto \ - "$NANOPB_TMP_OUTPUT/google/protobuf" \ - "$LOAD_BALANCER_GRPC_OUTPUT_PATH/google/protobuf" - -# compare outputs to checked compiled code -if ! diff -r "$NANOPB_TMP_OUTPUT" src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1; then - echo "Outputs differ: $NANOPB_TMP_OUTPUT vs $LOAD_BALANCER_GRPC_OUTPUT_PATH" - exit 2 -fi - # # checks for health.proto # @@ -84,29 +57,3 @@ for NANOPB_OUTPUT_FILE in $NANOPB_HEALTH_TMP_OUTPUT/*.pb.*; do exit 2 fi done - -# -# Checks for handshaker.proto and transport_security_common.proto -# -readonly HANDSHAKER_GRPC_OUTPUT_PATH='src/core/tsi/alts/handshaker' -# nanopb-compile the proto to a temp location -./tools/codegen/core/gen_nano_proto.sh \ - src/core/tsi/alts/handshaker/proto/handshaker.proto \ - "$NANOPB_ALTS_TMP_OUTPUT" \ - "$HANDSHAKER_GRPC_OUTPUT_PATH" -./tools/codegen/core/gen_nano_proto.sh \ - src/core/tsi/alts/handshaker/proto/transport_security_common.proto \ - "$NANOPB_ALTS_TMP_OUTPUT" \ - "$HANDSHAKER_GRPC_OUTPUT_PATH" -./tools/codegen/core/gen_nano_proto.sh \ - src/core/tsi/alts/handshaker/proto/altscontext.proto \ - "$NANOPB_ALTS_TMP_OUTPUT" \ - "$HANDSHAKER_GRPC_OUTPUT_PATH" - -# compare outputs to checked compiled code -for NANOPB_OUTPUT_FILE in $NANOPB_ALTS_TMP_OUTPUT/*.pb.*; do - if ! diff "$NANOPB_OUTPUT_FILE" "src/core/tsi/alts/handshaker/$(basename $NANOPB_OUTPUT_FILE)"; then - echo "Outputs differ: $NANOPB_ALTS_TMP_OUTPUT vs $HANDSHAKER_GRPC_OUTPUT_PATH" - exit 2 - fi -done diff --git a/src/csharp/experimental/build_unitypackage.sh b/tools/distrib/check_upb_output.sh similarity index 54% rename from src/csharp/experimental/build_unitypackage.sh rename to tools/distrib/check_upb_output.sh index cca52658e85..6febd0e9835 100755 --- a/src/csharp/experimental/build_unitypackage.sh +++ b/tools/distrib/check_upb_output.sh @@ -1,5 +1,5 @@ -#!/bin/sh -# Copyright 2018 gRPC authors. +#!/bin/bash +# Copyright 2019 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,20 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Builds an experimental .unitypackage file to be imported into Unity projects. - set -ex -cd "$(dirname "$0")/.." - -dotnet restore Grpc.sln - -mkdir -p GrpcUnity -dotnet build --configuration Release --framework net45 Grpc.Core --output ../GrpcUnity +readonly UPB_GENERATED_SRC=src/core/ext/upb-generated +readonly UPB_TMP_OUTPUT="$(mktemp -d)" -#TODO: add ThirdParty/Grpc.Core: -# - assembly -# - native libraries (mac dylib need to be renamed to grpc_csharp_ext.bundle) +tools/codegen/core/gen_upb_api.sh "$UPB_TMP_OUTPUT" -#TODO: add ThirdParty/Grpc.Tools: -# - protoc and grpc plugin +diff -rq "$UPB_GENERATED_SRC" "$UPB_TMP_OUTPUT" diff --git a/tools/distrib/python/grpcio_tools/grpc_version.py b/tools/distrib/python/grpcio_tools/grpc_version.py index 127d3c1f9bc..184a0a9dda6 100644 --- a/tools/distrib/python/grpcio_tools/grpc_version.py +++ b/tools/distrib/python/grpcio_tools/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! -VERSION = '1.23.0.dev0' +VERSION = '1.24.0.dev0' diff --git a/tools/distrib/yapf_code.sh b/tools/distrib/yapf_code.sh index 27c5e3129dd..1fddb706498 100755 --- a/tools/distrib/yapf_code.sh +++ b/tools/distrib/yapf_code.sh @@ -30,7 +30,7 @@ EXCLUSIONS=( VIRTUALENV=yapf_virtual_environment -python -m virtualenv $VIRTUALENV +python3 -m virtualenv $VIRTUALENV PYTHON=${VIRTUALENV}/bin/python "$PYTHON" -m pip install --upgrade pip==10.0.1 "$PYTHON" -m pip install --upgrade futures diff --git a/tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh b/tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh index e1932ed0bf1..d439b906bc3 100755 --- a/tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh +++ b/tools/dockerfile/grpc_clang_tidy/clang_tidy_all_the_things.sh @@ -20,5 +20,5 @@ CLANG_TIDY=${CLANG_TIDY:-clang-tidy-5.0} cd ${CLANG_TIDY_ROOT} -find src/core src/cpp test/core test/cpp -name '*.h' -print0 -or -name '*.cc' -print0 \ +find src/core src/cpp test/core test/cpp ! -path 'src/core/ext/upb-generated/*' -name '*.h' -or -name '*.cc' -print0 \ | xargs -0 tools/distrib/run_clang_tidy.py "$@" diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 114d5147eef..63ee5f0ad20 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.23.0-dev +PROJECT_NUMBER = 1.24.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -972,6 +972,7 @@ include/grpcpp/impl/codegen/config_protobuf.h \ include/grpcpp/impl/codegen/core_codegen.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ +include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 0e99b88a4db..f1bc3c010e5 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.23.0-dev +PROJECT_NUMBER = 1.24.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -974,6 +974,7 @@ include/grpcpp/impl/codegen/core_codegen.h \ include/grpcpp/impl/codegen/core_codegen.h \ include/grpcpp/impl/codegen/core_codegen_interface.h \ include/grpcpp/impl/codegen/create_auth_context.h \ +include/grpcpp/impl/codegen/delegating_channel.h \ include/grpcpp/impl/codegen/grpc_library.h \ include/grpcpp/impl/codegen/intercepted_channel.h \ include/grpcpp/impl/codegen/interceptor.h \ @@ -1059,9 +1060,9 @@ include/grpcpp/support/sync_stream.h \ include/grpcpp/support/sync_stream_impl.h \ include/grpcpp/support/time.h \ include/grpcpp/support/validate_service_config.h \ -src/core/ext/filters/client_channel/health/health.pb.c \ -src/core/ext/filters/client_channel/health/health.pb.h \ src/core/ext/transport/inproc/inproc_transport.h \ +src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ +src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h \ src/core/lib/avl/avl.h \ src/core/lib/backoff/backoff.h \ src/core/lib/channel/channel_args.h \ @@ -1294,12 +1295,23 @@ src/cpp/util/status.cc \ src/cpp/util/string_ref.cc \ src/cpp/util/time_cc.cc \ third_party/nanopb/pb.h \ -third_party/nanopb/pb_common.c \ third_party/nanopb/pb_common.h \ -third_party/nanopb/pb_decode.c \ third_party/nanopb/pb_decode.h \ -third_party/nanopb/pb_encode.c \ -third_party/nanopb/pb_encode.h +third_party/nanopb/pb_encode.h \ +third_party/upb/upb/decode.c \ +third_party/upb/upb/decode.h \ +third_party/upb/upb/encode.c \ +third_party/upb/upb/encode.h \ +third_party/upb/upb/generated_util.h \ +third_party/upb/upb/msg.c \ +third_party/upb/upb/msg.h \ +third_party/upb/upb/port.c \ +third_party/upb/upb/port_def.inc \ +third_party/upb/upb/port_undef.inc \ +third_party/upb/upb/table.c \ +third_party/upb/upb/table.int.h \ +third_party/upb/upb/upb.c \ +third_party/upb/upb/upb.h # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core index 2836412b031..f4533f240bd 100644 --- a/tools/doxygen/Doxyfile.core +++ b/tools/doxygen/Doxyfile.core @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 7.0.0 +PROJECT_NUMBER = 8.0.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 6c1253f7ae8..e2900b2e701 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 7.0.0 +PROJECT_NUMBER = 8.0.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -889,8 +889,6 @@ src/core/ext/filters/client_channel/connector.cc \ src/core/ext/filters/client_channel/connector.h \ src/core/ext/filters/client_channel/global_subchannel_pool.cc \ src/core/ext/filters/client_channel/global_subchannel_pool.h \ -src/core/ext/filters/client_channel/health/health.pb.c \ -src/core/ext/filters/client_channel/health/health.pb.h \ src/core/ext/filters/client_channel/health/health_check_client.cc \ src/core/ext/filters/client_channel/health/health_check_client.h \ src/core/ext/filters/client_channel/http_connect_handshaker.cc \ @@ -909,12 +907,6 @@ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h \ -src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c \ -src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h \ -src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c \ -src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h \ -src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \ -src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/filters/client_channel/lb_policy/subchannel_list.h \ @@ -960,6 +952,7 @@ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h \ src/core/ext/filters/client_channel/resolver/sockaddr/README.md \ src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc \ +src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc \ src/core/ext/filters/client_channel/resolver_factory.h \ src/core/ext/filters/client_channel/resolver_registry.cc \ src/core/ext/filters/client_channel/resolver_registry.h \ @@ -1066,6 +1059,76 @@ src/core/ext/transport/chttp2/transport/writing.cc \ src/core/ext/transport/inproc/inproc_plugin.cc \ src/core/ext/transport/inproc/inproc_transport.cc \ src/core/ext/transport/inproc/inproc_transport.h \ +src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/cds.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/eds.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h \ +src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c \ +src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h \ +src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c \ +src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h \ +src/core/ext/upb-generated/envoy/type/percent.upb.c \ +src/core/ext/upb-generated/envoy/type/percent.upb.h \ +src/core/ext/upb-generated/envoy/type/range.upb.c \ +src/core/ext/upb-generated/envoy/type/range.upb.h \ +src/core/ext/upb-generated/gogoproto/gogo.upb.c \ +src/core/ext/upb-generated/gogoproto/gogo.upb.h \ +src/core/ext/upb-generated/google/api/annotations.upb.c \ +src/core/ext/upb-generated/google/api/annotations.upb.h \ +src/core/ext/upb-generated/google/api/http.upb.c \ +src/core/ext/upb-generated/google/api/http.upb.h \ +src/core/ext/upb-generated/google/protobuf/any.upb.c \ +src/core/ext/upb-generated/google/protobuf/any.upb.h \ +src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ +src/core/ext/upb-generated/google/protobuf/descriptor.upb.h \ +src/core/ext/upb-generated/google/protobuf/duration.upb.c \ +src/core/ext/upb-generated/google/protobuf/duration.upb.h \ +src/core/ext/upb-generated/google/protobuf/empty.upb.c \ +src/core/ext/upb-generated/google/protobuf/empty.upb.h \ +src/core/ext/upb-generated/google/protobuf/struct.upb.c \ +src/core/ext/upb-generated/google/protobuf/struct.upb.h \ +src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ +src/core/ext/upb-generated/google/protobuf/timestamp.upb.h \ +src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ +src/core/ext/upb-generated/google/protobuf/wrappers.upb.h \ +src/core/ext/upb-generated/google/rpc/status.upb.c \ +src/core/ext/upb-generated/google/rpc/status.upb.h \ +src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c \ +src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h \ +src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c \ +src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h \ +src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c \ +src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h \ +src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ +src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h \ +src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \ +src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h \ +src/core/ext/upb-generated/validate/validate.upb.c \ +src/core/ext/upb-generated/validate/validate.upb.h \ src/core/lib/README.md \ src/core/lib/avl/avl.cc \ src/core/lib/avl/avl.h \ @@ -1542,10 +1605,6 @@ src/core/tsi/alts/frame_protector/frame_handler.cc \ src/core/tsi/alts/frame_protector/frame_handler.h \ src/core/tsi/alts/handshaker/alts_handshaker_client.cc \ src/core/tsi/alts/handshaker/alts_handshaker_client.h \ -src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc \ -src/core/tsi/alts/handshaker/alts_handshaker_service_api.h \ -src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc \ -src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h \ src/core/tsi/alts/handshaker/alts_shared_resource.cc \ src/core/tsi/alts/handshaker/alts_shared_resource.h \ src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc \ @@ -1553,12 +1612,6 @@ src/core/tsi/alts/handshaker/alts_tsi_handshaker.h \ src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h \ src/core/tsi/alts/handshaker/alts_tsi_utils.cc \ src/core/tsi/alts/handshaker/alts_tsi_utils.h \ -src/core/tsi/alts/handshaker/altscontext.pb.c \ -src/core/tsi/alts/handshaker/altscontext.pb.h \ -src/core/tsi/alts/handshaker/handshaker.pb.c \ -src/core/tsi/alts/handshaker/handshaker.pb.h \ -src/core/tsi/alts/handshaker/transport_security_common.pb.c \ -src/core/tsi/alts/handshaker/transport_security_common.pb.h \ src/core/tsi/alts/handshaker/transport_security_common_api.cc \ src/core/tsi/alts/handshaker/transport_security_common_api.h \ src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc \ @@ -1590,13 +1643,20 @@ src/core/tsi/transport_security.h \ src/core/tsi/transport_security_grpc.cc \ src/core/tsi/transport_security_grpc.h \ src/core/tsi/transport_security_interface.h \ -third_party/nanopb/pb.h \ -third_party/nanopb/pb_common.c \ -third_party/nanopb/pb_common.h \ -third_party/nanopb/pb_decode.c \ -third_party/nanopb/pb_decode.h \ -third_party/nanopb/pb_encode.c \ -third_party/nanopb/pb_encode.h +third_party/upb/upb/decode.c \ +third_party/upb/upb/decode.h \ +third_party/upb/upb/encode.c \ +third_party/upb/upb/encode.h \ +third_party/upb/upb/generated_util.h \ +third_party/upb/upb/msg.c \ +third_party/upb/upb/msg.h \ +third_party/upb/upb/port.c \ +third_party/upb/upb/port_def.inc \ +third_party/upb/upb/port_undef.inc \ +third_party/upb/upb/table.c \ +third_party/upb/upb/table.int.h \ +third_party/upb/upb/upb.c \ +third_party/upb/upb/upb.h # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh b/tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh index d844cff7f9a..f725eb7a3d7 100755 --- a/tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh +++ b/tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh @@ -29,3 +29,9 @@ bazel test --spawn_strategy=standalone --genrule_strategy=standalone --test_outp bazel clean --expunge bazel test --config=python3 --spawn_strategy=standalone --genrule_strategy=standalone --test_output=errors //src/python/... bazel test --config=python3 --spawn_strategy=standalone --genrule_strategy=standalone --test_output=errors //examples/python/... + +# TODO(https://github.com/grpc/grpc/issues/19854): Move this to a new Kokoro +# job. +(cd /var/local/git/grpc/bazel/test/python_test_repo; + bazel test --test_output=errors //... +) diff --git a/tools/internal_ci/macos/grpc_basictests_cpp_ios.cfg b/tools/internal_ci/macos/grpc_basictests_cpp_ios.cfg new file mode 100644 index 00000000000..3c8e402d3fc --- /dev/null +++ b/tools/internal_ci/macos/grpc_basictests_cpp_ios.cfg @@ -0,0 +1,31 @@ +# Copyright 2019 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Config file for the internal CI (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" +timeout_mins: 120 +action { + define_artifacts { + regex: "**/*sponge_log.*" + regex: "github/grpc/reports/**" + } +} + +env_vars { + key: "RUN_TESTS_FLAGS" + value: "-f basictests macos objc opt --internal_ci -j 1 --inner_jobs 4 --bq_result_table aggregate_results --extra_args -r ios-cpp-test-.*" +} diff --git a/tools/internal_ci/macos/grpc_basictests_objc_tvos.cfg b/tools/internal_ci/macos/grpc_basictests_objc_tvos.cfg new file mode 100644 index 00000000000..a3f3935b5d6 --- /dev/null +++ b/tools/internal_ci/macos/grpc_basictests_objc_tvos.cfg @@ -0,0 +1,32 @@ +# Copyright 2019 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Config file for the internal CI (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" +timeout_mins: 120 +action { + define_artifacts { + regex: "**/*sponge_log.*" + regex: "github/grpc/reports/**" + } +} + +env_vars { + key: "RUN_TESTS_FLAGS" + value: "-f basictests macos objc opt --internal_ci -j 1 --inner_jobs 4 --bq_result_table aggregate_results --extra_args -r tvos-test-.*" +} + diff --git a/tools/internal_ci/macos/grpc_bazel_cpp_ios_tests.cfg b/tools/internal_ci/macos/grpc_bazel_cpp_ios_tests.cfg new file mode 100644 index 00000000000..ccc27e8fbe5 --- /dev/null +++ b/tools/internal_ci/macos/grpc_bazel_cpp_ios_tests.cfg @@ -0,0 +1,19 @@ +# Copyright 2019 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Config file for the internal CI (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc/tools/internal_ci/macos/grpc_run_bazel_cpp_ios_tests.sh" + diff --git a/tools/internal_ci/macos/grpc_run_bazel_cpp_ios_tests.sh b/tools/internal_ci/macos/grpc_run_bazel_cpp_ios_tests.sh new file mode 100644 index 00000000000..bc2a8295521 --- /dev/null +++ b/tools/internal_ci/macos/grpc_run_bazel_cpp_ios_tests.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# Copyright 2019 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -ex + +# change to grpc repo root +cd $(dirname $0)/../../.. + +# Download bazel +temp_dir="$(mktemp -d)" +wget -q https://github.com/bazelbuild/bazel/releases/download/0.26.0/bazel-0.26.0-darwin-x86_64 -O "${temp_dir}/bazel" +chmod 755 "${temp_dir}/bazel" +export PATH="${temp_dir}:${PATH}" +# This should show ${temp_dir}/bazel +which bazel + +./tools/run_tests/start_port_server.py + +dirs=(end2end server client common codegen util grpclb test) +for dir in ${dirs[*]}; do + echo $dir + out=`bazel query "kind(ios_unit_test, tests(//test/cpp/$dir/...))"` + for test in $out; do + echo "Running: $test" + bazel test --test_summary=detailed --test_output=all $test + done +done diff --git a/tools/internal_ci/macos/pull_request/grpc_basictests_cpp_ios.cfg b/tools/internal_ci/macos/pull_request/grpc_basictests_cpp_ios.cfg new file mode 100644 index 00000000000..f831aba3b94 --- /dev/null +++ b/tools/internal_ci/macos/pull_request/grpc_basictests_cpp_ios.cfg @@ -0,0 +1,31 @@ +# Copyright 2019 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Config file for the internal CI (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" +timeout_mins: 120 +action { + define_artifacts { + regex: "**/*sponge_log.*" + regex: "github/grpc/reports/**" + } +} + +env_vars { + key: "RUN_TESTS_FLAGS" + value: "-f basictests macos objc opt --internal_ci -j 1 --inner_jobs 4 --extra_args -r ios-cpp-test-.*" +} diff --git a/tools/internal_ci/macos/pull_request/grpc_basictests_objc_tvos.cfg b/tools/internal_ci/macos/pull_request/grpc_basictests_objc_tvos.cfg new file mode 100644 index 00000000000..ec776def565 --- /dev/null +++ b/tools/internal_ci/macos/pull_request/grpc_basictests_objc_tvos.cfg @@ -0,0 +1,31 @@ +# Copyright 2018 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Config file for the internal CI (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" +timeout_mins: 120 +action { + define_artifacts { + regex: "**/*sponge_log.*" + regex: "github/grpc/reports/**" + } +} + +env_vars { + key: "RUN_TESTS_FLAGS" + value: "-f basictests macos objc opt --internal_ci -j 1 --inner_jobs 4 --extra_args -r tvos-test-.*" +} diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py index 585734283a7..51a47d92f97 100644 --- a/tools/interop_matrix/client_matrix.py +++ b/tools/interop_matrix/client_matrix.py @@ -142,8 +142,8 @@ LANG_RELEASE_MATRIX = { ('v1.19.0', ReleaseInfo(runtimes=['go1.11'], testcases_file='go__v1.0.5')), ('v1.20.0', ReleaseInfo(runtimes=['go1.11'])), - ('v1.21.0', ReleaseInfo(runtimes=['go1.11'])), - ('v1.22.0', ReleaseInfo(runtimes=['go1.11'])), + ('v1.21.2', ReleaseInfo(runtimes=['go1.11'])), + ('v1.22.1', ReleaseInfo(runtimes=['go1.11'])), ]), 'java': OrderedDict([ diff --git a/tools/profiling/ios_bin/binary_size.py b/tools/profiling/ios_bin/binary_size.py index f0c8dd01a01..1fd848f851f 100755 --- a/tools/profiling/ios_bin/binary_size.py +++ b/tools/profiling/ios_bin/binary_size.py @@ -100,14 +100,14 @@ for frameworks in [False, True]: ['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip() subprocess.check_call(['git', 'checkout', '--', '.']) subprocess.check_call(['git', 'checkout', args.diff_base]) - subprocess.check_call(['git', 'submodule', 'update']) + subprocess.check_call(['git', 'submodule', 'update', '--force']) try: build('old', frameworks) old_size = get_size('old', frameworks) finally: subprocess.check_call(['git', 'checkout', '--', '.']) subprocess.check_call(['git', 'checkout', where_am_i]) - subprocess.check_call(['git', 'submodule', 'update']) + subprocess.check_call(['git', 'submodule', 'update', '--force']) text += ('***************FRAMEWORKS****************\n' if frameworks else '*****************STATIC******************\n') diff --git a/tools/run_tests/artifacts/build_artifact_python.sh b/tools/run_tests/artifacts/build_artifact_python.sh index c5e380fe5dc..55fd4ead04d 100755 --- a/tools/run_tests/artifacts/build_artifact_python.sh +++ b/tools/run_tests/artifacts/build_artifact_python.sh @@ -48,7 +48,7 @@ clean_non_source_files() { ( cd "$1" find . -type f \ | grep -v '\.c$' | grep -v '\.cc$' | grep -v '\.cpp$' \ - | grep -v '\.h$' | grep -v '\.hh$' \ + | grep -v '\.h$' | grep -v '\.hh$' | grep -v '\.inc$' \ | grep -v '\.s$' | grep -v '\.py$' \ | while read -r file; do rm -f "$file" || true diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json deleted file mode 100644 index f91cbfe0814..00000000000 --- a/tools/run_tests/generated/sources_and_headers.json +++ /dev/null @@ -1,10934 +0,0 @@ - - -[ - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "algorithm_test", - "src": [ - "test/core/compression/algorithm_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "alloc_test", - "src": [ - "test/core/gpr/alloc_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "alpn_test", - "src": [ - "test/core/transport/chttp2/alpn_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "alts_credentials_fuzzer", - "src": [ - "test/core/security/alts_credentials_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "api_fuzzer", - "src": [ - "test/core/end2end/fuzzers/api_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "arena_test", - "src": [ - "test/core/gpr/arena_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "avl_test", - "src": [ - "test/core/avl/avl_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util", - "test_tcp_server" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "bad_server_response_test", - "src": [ - "test/core/end2end/bad_server_response_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "bin_decoder_test", - "src": [ - "test/core/transport/chttp2/bin_decoder_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "bin_encoder_test", - "src": [ - "test/core/transport/chttp2/bin_encoder_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "buffer_list_test", - "src": [ - "test/core/iomgr/buffer_list_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "channel_create_test", - "src": [ - "test/core/surface/channel_create_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "check_epollexclusive", - "src": [ - "test/build/check_epollexclusive.c" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "chttp2_hpack_encoder_test", - "src": [ - "test/core/transport/chttp2/hpack_encoder_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "chttp2_stream_map_test", - "src": [ - "test/core/transport/chttp2/stream_map_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "chttp2_varint_test", - "src": [ - "test/core/transport/chttp2/varint_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "client_fuzzer", - "src": [ - "test/core/end2end/fuzzers/client_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "close_fd_test", - "src": [ - "test/core/bad_connection/close_fd_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "cmdline_test", - "src": [ - "test/core/util/cmdline_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "combiner_test", - "src": [ - "test/core/iomgr/combiner_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "compression_test", - "src": [ - "test/core/compression/compression_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "concurrent_connectivity_test", - "src": [ - "test/core/surface/concurrent_connectivity_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "connection_refused_test", - "src": [ - "test/core/end2end/connection_refused_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "dns_resolver_connectivity_test", - "src": [ - "test/core/client_channel/resolvers/dns_resolver_connectivity_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "dns_resolver_cooldown_using_ares_resolver_test", - "src": [ - "test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "dns_resolver_cooldown_using_native_resolver_test", - "src": [ - "test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "dns_resolver_test", - "src": [ - "test/core/client_channel/resolvers/dns_resolver_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "dualstack_socket_test", - "src": [ - "test/core/end2end/dualstack_socket_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "endpoint_pair_test", - "src": [ - "test/core/iomgr/endpoint_pair_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "error_test", - "src": [ - "test/core/iomgr/error_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "ev_epollex_linux_test", - "src": [ - "test/core/iomgr/ev_epollex_linux_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "fake_resolver_test", - "src": [ - "test/core/client_channel/resolvers/fake_resolver_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util", - "transport_security_test_lib" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "fake_transport_security_test", - "src": [ - "test/core/tsi/fake_transport_security_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "fd_conservation_posix_test", - "src": [ - "test/core/iomgr/fd_conservation_posix_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "fd_posix_test", - "src": [ - "test/core/iomgr/fd_posix_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "fling_client", - "src": [ - "test/core/fling/client.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "fling_server", - "src": [ - "test/core/fling/server.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "fling_stream_test", - "src": [ - "test/core/fling/fling_stream_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "fling_test", - "src": [ - "test/core/fling/fling_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "fork_test", - "src": [ - "test/core/gprpp/fork_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "goaway_server_test", - "src": [ - "test/core/end2end/goaway_server_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "gpr_cpu_test", - "src": [ - "test/core/gpr/cpu_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "gpr_env_test", - "src": [ - "test/core/gpr/env_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "gpr_host_port_test", - "src": [ - "test/core/gprpp/host_port_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "gpr_log_test", - "src": [ - "test/core/gpr/log_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "gpr_manual_constructor_test", - "src": [ - "test/core/gprpp/manual_constructor_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "gpr_mpscq_test", - "src": [ - "test/core/gpr/mpscq_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "gpr_spinlock_test", - "src": [ - "test/core/gpr/spinlock_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "gpr_string_test", - "src": [ - "test/core/gpr/string_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "gpr_sync_test", - "src": [ - "test/core/gpr/sync_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "gpr_thd_test", - "src": [ - "test/core/gprpp/thd_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "gpr_time_test", - "src": [ - "test/core/gpr/time_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "gpr_tls_test", - "src": [ - "test/core/gpr/tls_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "gpr_useful_test", - "src": [ - "test/core/gpr/useful_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_auth_context_test", - "src": [ - "test/core/security/auth_context_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_b64_test", - "src": [ - "test/core/slice/b64_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_byte_buffer_reader_test", - "src": [ - "test/core/surface/byte_buffer_reader_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_channel_args_test", - "src": [ - "test/core/channel/channel_args_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_channel_stack_builder_test", - "src": [ - "test/core/channel/channel_stack_builder_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_channel_stack_test", - "src": [ - "test/core/channel/channel_stack_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_completion_queue_test", - "src": [ - "test/core/surface/completion_queue_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_completion_queue_threading_test", - "src": [ - "test/core/surface/completion_queue_threading_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_control_plane_credentials_test", - "src": [ - "test/core/security/control_plane_credentials_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "cmdline", - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_create_jwt", - "src": [ - "test/core/security/create_jwt.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_credentials_test", - "src": [ - "test/core/security/credentials_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_ipv6_loopback_available_test", - "src": [ - "test/core/iomgr/grpc_ipv6_loopback_available_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_json_token_test", - "src": [ - "test/core/security/json_token_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_jwt_verifier_test", - "src": [ - "test/core/security/jwt_verifier_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "cmdline", - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_print_google_default_creds_token", - "src": [ - "test/core/security/print_google_default_creds_token.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_security_connector_test", - "src": [ - "test/core/security/security_connector_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_ssl_credentials_test", - "src": [ - "test/core/security/ssl_credentials_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "cmdline", - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_verify_jwt", - "src": [ - "test/core/security/verify_jwt.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "handshake_client_ssl", - "src": [ - "test/core/handshake/client_ssl.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [ - "test/core/handshake/server_ssl_common.h" - ], - "is_filegroup": false, - "language": "c", - "name": "handshake_server_ssl", - "src": [ - "test/core/handshake/server_ssl.cc", - "test/core/handshake/server_ssl_common.cc", - "test/core/handshake/server_ssl_common.h" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [ - "test/core/handshake/server_ssl_common.h" - ], - "is_filegroup": false, - "language": "c", - "name": "handshake_server_with_readahead_handshaker", - "src": [ - "test/core/handshake/readahead_handshaker_server_ssl.cc", - "test/core/handshake/server_ssl_common.cc", - "test/core/handshake/server_ssl_common.h" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "handshake_verify_peer_options", - "src": [ - "test/core/handshake/verify_peer_options.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "histogram_test", - "src": [ - "test/core/util/histogram_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "hpack_parser_fuzzer_test", - "src": [ - "test/core/transport/chttp2/hpack_parser_fuzzer_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "hpack_parser_test", - "src": [ - "test/core/transport/chttp2/hpack_parser_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "hpack_table_test", - "src": [ - "test/core/transport/chttp2/hpack_table_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "http_parser_test", - "src": [ - "test/core/http/parser_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "http_request_fuzzer_test", - "src": [ - "test/core/http/request_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "http_response_fuzzer_test", - "src": [ - "test/core/http/response_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "httpcli_format_request_test", - "src": [ - "test/core/http/format_request_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "httpcli_test", - "src": [ - "test/core/http/httpcli_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "httpscli_test", - "src": [ - "test/core/http/httpscli_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "init_test", - "src": [ - "test/core/surface/init_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [ - "test/core/end2end/end2end_tests.h" - ], - "is_filegroup": false, - "language": "c", - "name": "inproc_callback_test", - "src": [ - "test/core/end2end/end2end_tests.h", - "test/core/end2end/inproc_callback_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "invalid_call_argument_test", - "src": [ - "test/core/end2end/invalid_call_argument_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "json_fuzzer_test", - "src": [ - "test/core/json/fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "json_rewrite", - "src": [ - "test/core/json/json_rewrite.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "json_rewrite_test", - "src": [ - "test/core/json/json_rewrite_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "json_stream_error_test", - "src": [ - "test/core/json/json_stream_error_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "json_test", - "src": [ - "test/core/json/json_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "lame_client_test", - "src": [ - "test/core/surface/lame_client_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "load_file_test", - "src": [ - "test/core/iomgr/load_file_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "low_level_ping_pong_benchmark", - "src": [ - "test/core/network_benchmarks/low_level_ping_pong.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "memory_usage_client", - "src": [ - "test/core/memory_usage/client.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "memory_usage_server", - "src": [ - "test/core/memory_usage/server.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "memory_usage_test", - "src": [ - "test/core/memory_usage/memory_usage_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "message_compress_test", - "src": [ - "test/core/compression/message_compress_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "minimal_stack_is_minimal_test", - "src": [ - "test/core/channel/minimal_stack_is_minimal_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "mpmcqueue_test", - "src": [ - "test/core/iomgr/mpmcqueue_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "multiple_server_queues_test", - "src": [ - "test/core/end2end/multiple_server_queues_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "murmur_hash_test", - "src": [ - "test/core/gpr/murmur_hash_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "nanopb_fuzzer_response_test", - "src": [ - "test/core/nanopb/fuzzer_response.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "nanopb_fuzzer_serverlist_test", - "src": [ - "test/core/nanopb/fuzzer_serverlist.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "no_server_test", - "src": [ - "test/core/end2end/no_server_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "num_external_connectivity_watchers_test", - "src": [ - "test/core/surface/num_external_connectivity_watchers_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "parse_address_test", - "src": [ - "test/core/client_channel/parse_address_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "parse_address_with_named_scope_id_test", - "src": [ - "test/core/client_channel/parse_address_with_named_scope_id_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "percent_decode_fuzzer", - "src": [ - "test/core/slice/percent_decode_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "percent_encode_fuzzer", - "src": [ - "test/core/slice/percent_encode_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "percent_encoding_test", - "src": [ - "test/core/slice/percent_encoding_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "resolve_address_using_ares_resolver_posix_test", - "src": [ - "test/core/iomgr/resolve_address_posix_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "resolve_address_using_ares_resolver_test", - "src": [ - "test/core/iomgr/resolve_address_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "resolve_address_using_native_resolver_posix_test", - "src": [ - "test/core/iomgr/resolve_address_posix_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "resolve_address_using_native_resolver_test", - "src": [ - "test/core/iomgr/resolve_address_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "resource_quota_test", - "src": [ - "test/core/iomgr/resource_quota_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "secure_channel_create_test", - "src": [ - "test/core/surface/secure_channel_create_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "secure_endpoint_test", - "src": [ - "test/core/security/secure_endpoint_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "sequential_connectivity_test", - "src": [ - "test/core/surface/sequential_connectivity_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "server_chttp2_test", - "src": [ - "test/core/surface/server_chttp2_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "server_fuzzer", - "src": [ - "test/core/end2end/fuzzers/server_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "server_test", - "src": [ - "test/core/surface/server_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "slice_buffer_test", - "src": [ - "test/core/slice/slice_buffer_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "slice_string_helpers_test", - "src": [ - "test/core/slice/slice_string_helpers_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "slice_test", - "src": [ - "test/core/slice/slice_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "sockaddr_resolver_test", - "src": [ - "test/core/client_channel/resolvers/sockaddr_resolver_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "sockaddr_utils_test", - "src": [ - "test/core/iomgr/sockaddr_utils_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "socket_utils_test", - "src": [ - "test/core/iomgr/socket_utils_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "ssl_server_fuzzer", - "src": [ - "test/core/security/ssl_server_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util", - "transport_security_test_lib" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "ssl_transport_security_test", - "src": [ - "test/core/tsi/ssl_transport_security_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "status_conversion_test", - "src": [ - "test/core/transport/status_conversion_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "stream_compression_test", - "src": [ - "test/core/compression/stream_compression_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "stream_owned_slice_test", - "src": [ - "test/core/transport/stream_owned_slice_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "tcp_client_posix_test", - "src": [ - "test/core/iomgr/tcp_client_posix_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "tcp_client_uv_test", - "src": [ - "test/core/iomgr/tcp_client_uv_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "tcp_posix_test", - "src": [ - "test/core/iomgr/tcp_posix_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "tcp_server_posix_test", - "src": [ - "test/core/iomgr/tcp_server_posix_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "tcp_server_uv_test", - "src": [ - "test/core/iomgr/tcp_server_uv_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "threadpool_test", - "src": [ - "test/core/iomgr/threadpool_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "time_averaged_stats_test", - "src": [ - "test/core/iomgr/time_averaged_stats_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "timeout_encoding_test", - "src": [ - "test/core/transport/timeout_encoding_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "timer_heap_test", - "src": [ - "test/core/iomgr/timer_heap_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "timer_list_test", - "src": [ - "test/core/iomgr/timer_list_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "transport_connectivity_state_test", - "src": [ - "test/core/transport/connectivity_state_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "transport_metadata_test", - "src": [ - "test/core/transport/metadata_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "transport_security_test", - "src": [ - "test/core/tsi/transport_security_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "udp_server_test", - "src": [ - "test/core/iomgr/udp_server_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "uri_fuzzer_test", - "src": [ - "test/core/client_channel/uri_fuzzer_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "uri_parser_test", - "src": [ - "test/core/client_channel/uri_parser_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "alarm_test", - "src": [ - "test/cpp/common/alarm_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "alts_test_util", - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "alts_counter_test", - "src": [ - "test/core/tsi/alts/frame_protector/alts_counter_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "alts_test_util", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "alts_crypt_test", - "src": [ - "test/core/tsi/alts/crypt/aes_gcm_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "alts_test_util", - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "alts_crypter_test", - "src": [ - "test/core/tsi/alts/frame_protector/alts_crypter_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "alts_test_util", - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "alts_frame_handler_test", - "src": [ - "test/core/tsi/alts/frame_protector/frame_handler_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "alts_test_util", - "gpr", - "grpc", - "transport_security_test_lib" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "alts_frame_protector_test", - "src": [ - "test/core/tsi/alts/frame_protector/alts_frame_protector_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "alts_test_util", - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "alts_grpc_record_protocol_test", - "src": [ - "test/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "alts_test_util", - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "alts_handshaker_client_test", - "src": [ - "test/core/tsi/alts/handshaker/alts_handshaker_client_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "alts_test_util", - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "alts_handshaker_service_api_test", - "src": [ - "test/core/tsi/alts/handshaker/alts_handshaker_service_api_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "alts_test_util", - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "alts_iovec_record_protocol_test", - "src": [ - "test/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "alts_security_connector_test", - "src": [ - "test/core/security/alts_security_connector_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "alts_test_util", - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "alts_tsi_handshaker_test", - "src": [ - "test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "alts_test_util", - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "alts_tsi_utils_test", - "src": [ - "test/core/tsi/alts/handshaker/alts_tsi_utils_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "alts_test_util", - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "alts_zero_copy_grpc_protector_test", - "src": [ - "test/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "async_end2end_test", - "src": [ - "test/cpp/end2end/async_end2end_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "auth_property_iterator_test", - "src": [ - "test/cpp/common/auth_property_iterator_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "backoff_test", - "src": [ - "test/core/backoff/backoff_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "bdp_estimator_test", - "src": [ - "test/core/transport/bdp_estimator_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "bm_alarm", - "src": [ - "test/cpp/microbenchmarks/bm_alarm.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "bm_arena", - "src": [ - "test/cpp/microbenchmarks/bm_arena.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "bm_byte_buffer", - "src": [ - "test/cpp/microbenchmarks/bm_byte_buffer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "bm_call_create", - "src": [ - "test/cpp/microbenchmarks/bm_call_create.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "bm_callback_test_service_impl", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [ - "test/cpp/microbenchmarks/callback_streaming_ping_pong.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "bm_callback_streaming_ping_pong", - "src": [ - "test/cpp/microbenchmarks/bm_callback_streaming_ping_pong.cc", - "test/cpp/microbenchmarks/callback_streaming_ping_pong.h" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "bm_callback_test_service_impl", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [ - "test/cpp/microbenchmarks/callback_unary_ping_pong.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "bm_callback_unary_ping_pong", - "src": [ - "test/cpp/microbenchmarks/bm_callback_unary_ping_pong.cc", - "test/cpp/microbenchmarks/callback_unary_ping_pong.h" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "bm_channel", - "src": [ - "test/cpp/microbenchmarks/bm_channel.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "bm_chttp2_hpack", - "src": [ - "test/cpp/microbenchmarks/bm_chttp2_hpack.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "bm_chttp2_transport", - "src": [ - "test/cpp/microbenchmarks/bm_chttp2_transport.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "bm_closure", - "src": [ - "test/cpp/microbenchmarks/bm_closure.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "bm_cq", - "src": [ - "test/cpp/microbenchmarks/bm_cq.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "bm_cq_multiple_threads", - "src": [ - "test/cpp/microbenchmarks/bm_cq_multiple_threads.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "bm_error", - "src": [ - "test/cpp/microbenchmarks/bm_error.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [ - "test/cpp/microbenchmarks/fullstack_streaming_ping_pong.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "bm_fullstack_streaming_ping_pong", - "src": [ - "test/cpp/microbenchmarks/bm_fullstack_streaming_ping_pong.cc", - "test/cpp/microbenchmarks/fullstack_streaming_ping_pong.h" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [ - "test/cpp/microbenchmarks/fullstack_streaming_pump.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "bm_fullstack_streaming_pump", - "src": [ - "test/cpp/microbenchmarks/bm_fullstack_streaming_pump.cc", - "test/cpp/microbenchmarks/fullstack_streaming_pump.h" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "bm_fullstack_trickle", - "src": [ - "test/cpp/microbenchmarks/bm_fullstack_trickle.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [ - "test/cpp/microbenchmarks/fullstack_unary_ping_pong.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "bm_fullstack_unary_ping_pong", - "src": [ - "test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.cc", - "test/cpp/microbenchmarks/fullstack_unary_ping_pong.h" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "bm_metadata", - "src": [ - "test/cpp/microbenchmarks/bm_metadata.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "bm_pollset", - "src": [ - "test/cpp/microbenchmarks/bm_pollset.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "bm_timer", - "src": [ - "test/cpp/microbenchmarks/bm_timer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "byte_stream_test", - "src": [ - "test/core/transport/byte_stream_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "channel_arguments_test", - "src": [ - "test/cpp/common/channel_arguments_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "channel_filter_test", - "src": [ - "test/cpp/common/channel_filter_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test", - "grpc++_test_util", - "grpc_test_util", - "grpcpp_channelz_proto" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "channel_trace_test", - "src": [ - "test/core/channel/channel_trace_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "channelz_registry_test", - "src": [ - "test/core/channel/channelz_registry_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util", - "grpcpp_channelz", - "grpcpp_channelz_proto" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "channelz_service_test", - "src": [ - "test/cpp/end2end/channelz_service_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test", - "grpc++_test_util", - "grpc_test_util", - "grpcpp_channelz_proto" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "channelz_test", - "src": [ - "test/core/channel/channelz_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "check_gcp_environment_linux_test", - "src": [ - "test/core/security/check_gcp_environment_linux_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "check_gcp_environment_windows_test", - "src": [ - "test/core/security/check_gcp_environment_windows_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "chttp2_settings_timeout_test", - "src": [ - "test/core/transport/chttp2/settings_timeout_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_cli_libs", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "cli_call_test", - "src": [ - "test/cpp/util/cli_call_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "client_callback_end2end_test", - "src": [ - "test/cpp/end2end/client_callback_end2end_test.cc", - "test/cpp/end2end/interceptors_util.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [ - "src/proto/grpc/lb/v1/load_balancer.grpc.pb.h", - "src/proto/grpc/lb/v1/load_balancer.pb.h", - "src/proto/grpc/lb/v1/load_balancer_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "client_channel_stress_test", - "src": [ - "test/cpp/client/client_channel_stress_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "client_crash_test", - "src": [ - "test/cpp/end2end/client_crash_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "client_crash_test_server", - "src": [ - "test/cpp/end2end/client_crash_test_server.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [ - "test/cpp/end2end/interceptors_util.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "client_interceptors_end2end_test", - "src": [ - "test/cpp/end2end/client_interceptors_end2end_test.cc", - "test/cpp/end2end/interceptors_util.cc", - "test/cpp/end2end/interceptors_util.h" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "client_lb_end2end_test", - "src": [ - "test/cpp/end2end/client_lb_end2end_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_codegen_base", - "grpc++_core_stats" - ], - "headers": [ - "src/proto/grpc/testing/benchmark_service.grpc.pb.h", - "src/proto/grpc/testing/benchmark_service.pb.h", - "src/proto/grpc/testing/benchmark_service_mock.grpc.pb.h", - "src/proto/grpc/testing/control.grpc.pb.h", - "src/proto/grpc/testing/control.pb.h", - "src/proto/grpc/testing/control_mock.grpc.pb.h", - "src/proto/grpc/testing/messages.grpc.pb.h", - "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", - "src/proto/grpc/testing/payloads.grpc.pb.h", - "src/proto/grpc/testing/payloads.pb.h", - "src/proto/grpc/testing/payloads_mock.grpc.pb.h", - "src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.h", - "src/proto/grpc/testing/report_qps_scenario_service.pb.h", - "src/proto/grpc/testing/report_qps_scenario_service_mock.grpc.pb.h", - "src/proto/grpc/testing/stats.grpc.pb.h", - "src/proto/grpc/testing/stats.pb.h", - "src/proto/grpc/testing/stats_mock.grpc.pb.h", - "src/proto/grpc/testing/worker_service.grpc.pb.h", - "src/proto/grpc/testing/worker_service.pb.h", - "src/proto/grpc/testing/worker_service_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "codegen_test_full", - "src": [ - "test/cpp/codegen/codegen_test_full.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++_codegen_base", - "grpc++_codegen_base_src", - "grpc++_core_stats" - ], - "headers": [ - "src/proto/grpc/testing/benchmark_service.grpc.pb.h", - "src/proto/grpc/testing/benchmark_service.pb.h", - "src/proto/grpc/testing/benchmark_service_mock.grpc.pb.h", - "src/proto/grpc/testing/control.grpc.pb.h", - "src/proto/grpc/testing/control.pb.h", - "src/proto/grpc/testing/control_mock.grpc.pb.h", - "src/proto/grpc/testing/messages.grpc.pb.h", - "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", - "src/proto/grpc/testing/payloads.grpc.pb.h", - "src/proto/grpc/testing/payloads.pb.h", - "src/proto/grpc/testing/payloads_mock.grpc.pb.h", - "src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.h", - "src/proto/grpc/testing/report_qps_scenario_service.pb.h", - "src/proto/grpc/testing/report_qps_scenario_service_mock.grpc.pb.h", - "src/proto/grpc/testing/stats.grpc.pb.h", - "src/proto/grpc/testing/stats.pb.h", - "src/proto/grpc/testing/stats_mock.grpc.pb.h", - "src/proto/grpc/testing/worker_service.grpc.pb.h", - "src/proto/grpc/testing/worker_service.pb.h", - "src/proto/grpc/testing/worker_service_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "codegen_test_minimal", - "src": [ - "test/cpp/codegen/codegen_test_minimal.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "context_list_test", - "src": [ - "test/core/transport/chttp2/context_list_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "credentials_test", - "src": [ - "test/cpp/client/credentials_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "cxx_byte_buffer_test", - "src": [ - "test/cpp/util/byte_buffer_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "cxx_slice_test", - "src": [ - "test/cpp/util/slice_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "grpc", - "grpc++" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "cxx_string_ref_test", - "src": [ - "test/cpp/util/string_ref_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "cxx_time_test", - "src": [ - "test/cpp/util/time_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [ - "test/cpp/end2end/interceptors_util.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "end2end_test", - "src": [ - "test/cpp/end2end/end2end_test.cc", - "test/cpp/end2end/interceptors_util.cc", - "test/cpp/end2end/interceptors_util.h" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "grpc++", - "grpc++_error_details" - ], - "headers": [ - "src/proto/grpc/testing/echo_messages.grpc.pb.h", - "src/proto/grpc/testing/echo_messages.pb.h", - "src/proto/grpc/testing/echo_messages_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "error_details_test", - "src": [ - "test/cpp/util/error_details_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "exception_test", - "src": [ - "test/cpp/end2end/exception_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "filter_end2end_test", - "src": [ - "test/cpp/end2end/filter_end2end_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "generic_end2end_test", - "src": [ - "test/cpp/end2end/generic_end2end_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "global_config_env_test", - "src": [ - "test/core/gprpp/global_config_env_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "global_config_test", - "src": [ - "test/core/gprpp/global_config_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_config" - ], - "headers": [ - "src/proto/grpc/testing/compiler_test.grpc.pb.h", - "src/proto/grpc/testing/compiler_test.pb.h", - "src/proto/grpc/testing/compiler_test_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "golden_file_test", - "src": [ - "test/cpp/codegen/golden_file_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "grpc_alts_credentials_options_test", - "src": [ - "test/core/security/grpc_alts_credentials_options_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_proto_reflection_desc_db", - "grpc++_test_config", - "grpc_cli_libs" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "grpc_cli", - "src": [ - "test/cpp/util/grpc_cli.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test", - "grpc_test_util" - ], - "headers": [ - "test/core/gprpp/map_tester.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "grpc_core_map_test", - "src": [ - "test/core/gprpp/map_test.cc", - "test/core/gprpp/map_tester.h" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "grpc_plugin_support" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "grpc_cpp_plugin", - "src": [ - "src/compiler/cpp_plugin.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "grpc_plugin_support" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "grpc_csharp_plugin", - "src": [ - "src/compiler/csharp_plugin.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "grpc_fetch_oauth2", - "src": [ - "test/core/security/fetch_oauth2.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "grpc_linux_system_roots_test", - "src": [ - "test/core/security/linux_system_roots_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "grpc_plugin_support" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "grpc_node_plugin", - "src": [ - "src/compiler/node_plugin.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "grpc_plugin_support" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "grpc_objective_c_plugin", - "src": [ - "src/compiler/objective_c_plugin.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "grpc_plugin_support" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "grpc_php_plugin", - "src": [ - "src/compiler/php_plugin.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "grpc_plugin_support" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "grpc_python_plugin", - "src": [ - "src/compiler/python_plugin.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "grpc_plugin_support" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "grpc_ruby_plugin", - "src": [ - "src/compiler/ruby_plugin.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_codegen_proto", - "grpc++_proto_reflection_desc_db", - "grpc++_reflection", - "grpc++_test_util", - "grpc_cli_libs", - "grpc_test_util" - ], - "headers": [ - "src/proto/grpc/testing/echo.grpc.pb.h", - "src/proto/grpc/testing/echo.pb.h", - "src/proto/grpc/testing/echo_messages.grpc.pb.h", - "src/proto/grpc/testing/echo_messages.pb.h", - "src/proto/grpc/testing/echo_messages_mock.grpc.pb.h", - "src/proto/grpc/testing/echo_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "grpc_tool_test", - "src": [ - "test/cpp/util/grpc_tool_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [ - "src/proto/grpc/lb/v1/load_balancer.grpc.pb.h", - "src/proto/grpc/lb/v1/load_balancer.pb.h", - "src/proto/grpc/lb/v1/load_balancer_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "grpclb_api_test", - "src": [ - "test/cpp/grpclb/grpclb_api_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [ - "src/proto/grpc/lb/v1/load_balancer.grpc.pb.h", - "src/proto/grpc/lb/v1/load_balancer.pb.h", - "src/proto/grpc/lb/v1/load_balancer_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "grpclb_end2end_test", - "src": [ - "test/cpp/end2end/grpclb_end2end_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [ - "src/proto/grpc/testing/empty.grpc.pb.h", - "src/proto/grpc/testing/empty.pb.h", - "src/proto/grpc/testing/empty_mock.grpc.pb.h", - "src/proto/grpc/testing/messages.grpc.pb.h", - "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", - "src/proto/grpc/testing/test.grpc.pb.h", - "src/proto/grpc/testing/test.pb.h", - "src/proto/grpc/testing/test_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "grpclb_fallback_test", - "src": [ - "test/cpp/interop/grpclb_fallback_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test", - "grpc_test_util" - ], - "headers": [ - "test/core/end2end/end2end_tests.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "h2_ssl_cert_test", - "src": [ - "test/core/end2end/end2end_tests.h", - "test/core/end2end/h2_ssl_cert_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test", - "grpc_test_util" - ], - "headers": [ - "test/core/end2end/end2end_tests.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "h2_ssl_session_reuse_test", - "src": [ - "test/core/end2end/end2end_tests.h", - "test/core/end2end/h2_ssl_session_reuse_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "health_service_end2end_test", - "src": [ - "test/cpp/end2end/health_service_end2end_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util", - "http2_client_main" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "http2_client", - "src": [], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "hybrid_end2end_test", - "src": [ - "test/cpp/end2end/hybrid_end2end_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "inlined_vector_test", - "src": [ - "test/core/gprpp/inlined_vector_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_core_stats", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util", - "qps" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "inproc_sync_unary_ping_pong_test", - "src": [ - "test/cpp/qps/inproc_sync_unary_ping_pong_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util", - "interop_client_helper", - "interop_client_main" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "interop_client", - "src": [], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util", - "interop_server_helper", - "interop_server_lib", - "interop_server_main" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "interop_server", - "src": [], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++_test_config", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "interop_test", - "src": [ - "test/cpp/interop/interop_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "json_run_localhost", - "src": [ - "test/cpp/qps/json_run_localhost.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "memory_test", - "src": [ - "test/core/gprpp/memory_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "message_allocator_end2end_test", - "src": [ - "test/cpp/end2end/message_allocator_end2end_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_config" - ], - "headers": [ - "src/proto/grpc/testing/metrics.grpc.pb.h", - "src/proto/grpc/testing/metrics.pb.h", - "src/proto/grpc/testing/metrics_mock.grpc.pb.h", - "test/cpp/util/metrics_server.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "metrics_client", - "src": [ - "test/cpp/interop/metrics_client.cc", - "test/cpp/util/metrics_server.h" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [ - "include/grpc++/test/mock_stream.h", - "include/grpcpp/test/mock_stream.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "mock_test", - "src": [ - "include/grpc++/test/mock_stream.h", - "include/grpcpp/test/mock_stream.h", - "test/cpp/end2end/mock_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "nonblocking_test", - "src": [ - "test/cpp/end2end/nonblocking_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "benchmark" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "noop-benchmark", - "src": [ - "test/cpp/microbenchmarks/noop-benchmark.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "optional_test", - "src": [ - "test/core/gprpp/optional_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "orphanable_test", - "src": [ - "test/core/gprpp/orphanable_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util", - "test_tcp_server" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "port_sharing_end2end_test", - "src": [ - "test/cpp/end2end/port_sharing_end2end_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_proto_reflection_desc_db", - "grpc++_reflection", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "proto_server_reflection_test", - "src": [ - "test/cpp/end2end/proto_server_reflection_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "grpc", - "grpc++", - "grpc++_codegen_base", - "grpc++_codegen_proto" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "proto_utils_test", - "src": [ - "test/cpp/codegen/proto_utils_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util", - "qps" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "qps_interarrival_test", - "src": [ - "test/cpp/qps/qps_interarrival_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_core_stats", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util", - "qps" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "qps_json_driver", - "src": [ - "test/cpp/qps/qps_json_driver.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_core_stats", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util", - "qps" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "qps_openloop_test", - "src": [ - "test/cpp/qps/qps_openloop_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_core_stats", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util", - "qps" - ], - "headers": [ - "test/cpp/qps/client.h", - "test/cpp/qps/server.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "qps_worker", - "src": [ - "test/cpp/qps/client.h", - "test/cpp/qps/server.h", - "test/cpp/qps/worker.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "raw_end2end_test", - "src": [ - "test/cpp/end2end/raw_end2end_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [ - "src/proto/grpc/testing/empty.grpc.pb.h", - "src/proto/grpc/testing/empty.pb.h", - "src/proto/grpc/testing/empty_mock.grpc.pb.h", - "src/proto/grpc/testing/messages.grpc.pb.h", - "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", - "src/proto/grpc/testing/test.grpc.pb.h", - "src/proto/grpc/testing/test.pb.h", - "src/proto/grpc/testing/test_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "reconnect_interop_client", - "src": [ - "test/cpp/interop/reconnect_interop_client.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util", - "reconnect_server", - "test_tcp_server" - ], - "headers": [ - "src/proto/grpc/testing/empty.grpc.pb.h", - "src/proto/grpc/testing/empty.pb.h", - "src/proto/grpc/testing/empty_mock.grpc.pb.h", - "src/proto/grpc/testing/messages.grpc.pb.h", - "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", - "src/proto/grpc/testing/test.grpc.pb.h", - "src/proto/grpc/testing/test.pb.h", - "src/proto/grpc/testing/test_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "reconnect_interop_server", - "src": [ - "test/cpp/interop/reconnect_interop_server.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "ref_counted_ptr_test", - "src": [ - "test/core/gprpp/ref_counted_ptr_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "ref_counted_test", - "src": [ - "test/core/gprpp/ref_counted_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "retry_throttle_test", - "src": [ - "test/core/client_channel/retry_throttle_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "secure_auth_context_test", - "src": [ - "test/cpp/common/secure_auth_context_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_core_stats", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util", - "qps" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "secure_sync_unary_ping_pong_test", - "src": [ - "test/cpp/qps/secure_sync_unary_ping_pong_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "server_builder_plugin_test", - "src": [ - "test/cpp/end2end/server_builder_plugin_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [ - "src/proto/grpc/testing/echo.grpc.pb.h", - "src/proto/grpc/testing/echo.pb.h", - "src/proto/grpc/testing/echo_messages.grpc.pb.h", - "src/proto/grpc/testing/echo_messages.pb.h", - "src/proto/grpc/testing/echo_messages_mock.grpc.pb.h", - "src/proto/grpc/testing/echo_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "server_builder_test", - "src": [ - "test/cpp/server/server_builder_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [ - "src/proto/grpc/testing/echo.grpc.pb.h", - "src/proto/grpc/testing/echo.pb.h", - "src/proto/grpc/testing/echo_messages.grpc.pb.h", - "src/proto/grpc/testing/echo_messages.pb.h", - "src/proto/grpc/testing/echo_messages_mock.grpc.pb.h", - "src/proto/grpc/testing/echo_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "server_builder_with_socket_mutator_test", - "src": [ - "test/cpp/server/server_builder_with_socket_mutator_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "server_context_test_spouse_test", - "src": [ - "test/cpp/test/server_context_test_spouse_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "server_crash_test", - "src": [ - "test/cpp/end2end/server_crash_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "server_crash_test_client", - "src": [ - "test/cpp/end2end/server_crash_test_client.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "server_early_return_test", - "src": [ - "test/cpp/end2end/server_early_return_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [ - "test/cpp/end2end/interceptors_util.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "server_interceptors_end2end_test", - "src": [ - "test/cpp/end2end/interceptors_util.cc", - "test/cpp/end2end/interceptors_util.h", - "test/cpp/end2end/server_interceptors_end2end_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [ - "src/proto/grpc/testing/echo.grpc.pb.h", - "src/proto/grpc/testing/echo.pb.h", - "src/proto/grpc/testing/echo_messages.grpc.pb.h", - "src/proto/grpc/testing/echo_messages.pb.h", - "src/proto/grpc/testing/echo_messages_mock.grpc.pb.h", - "src/proto/grpc/testing/echo_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "server_request_call_test", - "src": [ - "test/cpp/server/server_request_call_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "service_config_end2end_test", - "src": [ - "test/cpp/end2end/service_config_end2end_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "service_config_test", - "src": [ - "test/core/client_channel/service_config_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "shutdown_test", - "src": [ - "test/cpp/end2end/shutdown_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "slice_hash_table_test", - "src": [ - "test/core/slice/slice_hash_table_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "slice_weak_hash_table_test", - "src": [ - "test/core/slice/slice_weak_hash_table_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "stats_test", - "src": [ - "test/core/debug/stats_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "status_metadata_test", - "src": [ - "test/core/transport/status_metadata_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "status_util_test", - "src": [ - "test/core/channel/status_util_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "streaming_throughput_test", - "src": [ - "test/cpp/end2end/streaming_throughput_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [ - "src/proto/grpc/testing/empty.grpc.pb.h", - "src/proto/grpc/testing/empty.pb.h", - "src/proto/grpc/testing/empty_mock.grpc.pb.h", - "src/proto/grpc/testing/messages.grpc.pb.h", - "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", - "src/proto/grpc/testing/metrics.grpc.pb.h", - "src/proto/grpc/testing/metrics.pb.h", - "src/proto/grpc/testing/metrics_mock.grpc.pb.h", - "src/proto/grpc/testing/test.grpc.pb.h", - "src/proto/grpc/testing/test.pb.h", - "src/proto/grpc/testing/test_mock.grpc.pb.h", - "test/cpp/interop/client_helper.h", - "test/cpp/interop/interop_client.h", - "test/cpp/interop/stress_interop_client.h", - "test/cpp/util/create_test_channel.h", - "test/cpp/util/metrics_server.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "stress_test", - "src": [ - "test/cpp/interop/client_helper.h", - "test/cpp/interop/interop_client.cc", - "test/cpp/interop/interop_client.h", - "test/cpp/interop/stress_interop_client.cc", - "test/cpp/interop/stress_interop_client.h", - "test/cpp/interop/stress_test.cc", - "test/cpp/util/create_test_channel.h", - "test/cpp/util/metrics_server.cc", - "test/cpp/util/metrics_server.h" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "string_view_test", - "src": [ - "test/core/gprpp/string_view_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc++_test_config", - "grpc++_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "thread_manager_test", - "src": [ - "test/cpp/thread_manager/thread_manager_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "thread_stress_test", - "src": [ - "test/cpp/end2end/thread_stress_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "time_change_test", - "src": [ - "test/cpp/end2end/time_change_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "transport_pid_controller_test", - "src": [ - "test/core/transport/pid_controller_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "alts_test_util", - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "transport_security_common_api_test", - "src": [ - "test/core/tsi/alts/handshaker/transport_security_common_api_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "writes_per_rpc_test", - "src": [ - "test/cpp/performance/writes_per_rpc_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [ - "src/proto/grpc/lb/v1/load_balancer.grpc.pb.h", - "src/proto/grpc/lb/v1/load_balancer.pb.h", - "src/proto/grpc/lb/v1/load_balancer_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "xds_end2end_test", - "src": [ - "test/cpp/end2end/xds_end2end_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "c89", - "name": "public_headers_must_be_c89", - "src": [ - "test/core/surface/public_headers_must_be_c89.c" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "cc", - "name": "gen_hpack_tables", - "src": [ - "tools/codegen/core/gen_hpack_tables.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [], - "headers": [], - "is_filegroup": false, - "language": "cc", - "name": "gen_legal_metadata_characters", - "src": [ - "tools/codegen/core/gen_legal_metadata_characters.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [], - "headers": [], - "is_filegroup": false, - "language": "cc", - "name": "gen_percent_encoding_tables", - "src": [ - "tools/codegen/core/gen_percent_encoding_tables.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "boringssl", - "boringssl_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "boringssl_ssl_test", - "src": [], - "third_party": true, - "type": "target" - }, - { - "deps": [ - "boringssl", - "boringssl_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "boringssl_crypto_test", - "src": [ - "src/boringssl/crypto_test_data.cc" - ], - "third_party": true, - "type": "target" - }, - { - "deps": [ - "bad_client_test", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "bad_streaming_id_bad_client_test", - "src": [ - "test/core/bad_client/tests/bad_streaming_id.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "bad_client_test", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "badreq_bad_client_test", - "src": [ - "test/core/bad_client/tests/badreq.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "bad_client_test", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "connection_prefix_bad_client_test", - "src": [ - "test/core/bad_client/tests/connection_prefix.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "bad_client_test", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "duplicate_header_bad_client_test", - "src": [ - "test/core/bad_client/tests/duplicate_header.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "bad_client_test", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "head_of_line_blocking_bad_client_test", - "src": [ - "test/core/bad_client/tests/head_of_line_blocking.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "bad_client_test", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "headers_bad_client_test", - "src": [ - "test/core/bad_client/tests/headers.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "bad_client_test", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "initial_settings_frame_bad_client_test", - "src": [ - "test/core/bad_client/tests/initial_settings_frame.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "bad_client_test", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "large_metadata_bad_client_test", - "src": [ - "test/core/bad_client/tests/large_metadata.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "bad_client_test", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "out_of_bounds_bad_client_test", - "src": [ - "test/core/bad_client/tests/out_of_bounds.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "bad_client_test", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "server_registered_method_bad_client_test", - "src": [ - "test/core/bad_client/tests/server_registered_method.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "bad_client_test", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "simple_request_bad_client_test", - "src": [ - "test/core/bad_client/tests/simple_request.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "bad_client_test", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "unknown_frame_bad_client_test", - "src": [ - "test/core/bad_client/tests/unknown_frame.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "bad_client_test", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "window_overflow_bad_client_test", - "src": [ - "test/core/bad_client/tests/window_overflow.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "bad_ssl_test_server", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "bad_ssl_cert_server", - "src": [ - "test/core/bad_ssl/servers/cert.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "bad_ssl_cert_test", - "src": [ - "test/core/bad_ssl/bad_ssl_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_census_test", - "src": [ - "test/core/end2end/fixtures/h2_census.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_compress_test", - "src": [ - "test/core/end2end/fixtures/h2_compress.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_fakesec_test", - "src": [ - "test/core/end2end/fixtures/h2_fakesec.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_fd_test", - "src": [ - "test/core/end2end/fixtures/h2_fd.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_full_test", - "src": [ - "test/core/end2end/fixtures/h2_full.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_full+pipe_test", - "src": [ - "test/core/end2end/fixtures/h2_full+pipe.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_full+trace_test", - "src": [ - "test/core/end2end/fixtures/h2_full+trace.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_full+workarounds_test", - "src": [ - "test/core/end2end/fixtures/h2_full+workarounds.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_http_proxy_test", - "src": [ - "test/core/end2end/fixtures/h2_http_proxy.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_local_ipv4_test", - "src": [ - "test/core/end2end/fixtures/h2_local_ipv4.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_local_ipv6_test", - "src": [ - "test/core/end2end/fixtures/h2_local_ipv6.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_local_uds_test", - "src": [ - "test/core/end2end/fixtures/h2_local_uds.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_oauth2_test", - "src": [ - "test/core/end2end/fixtures/h2_oauth2.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_proxy_test", - "src": [ - "test/core/end2end/fixtures/h2_proxy.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_sockpair_test", - "src": [ - "test/core/end2end/fixtures/h2_sockpair.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_sockpair+trace_test", - "src": [ - "test/core/end2end/fixtures/h2_sockpair+trace.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_sockpair_1byte_test", - "src": [ - "test/core/end2end/fixtures/h2_sockpair_1byte.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_spiffe_test", - "src": [ - "test/core/end2end/fixtures/h2_spiffe.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_ssl_test", - "src": [ - "test/core/end2end/fixtures/h2_ssl.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_ssl_cred_reload_test", - "src": [ - "test/core/end2end/fixtures/h2_ssl_cred_reload.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_ssl_proxy_test", - "src": [ - "test/core/end2end/fixtures/h2_ssl_proxy.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_uds_test", - "src": [ - "test/core/end2end/fixtures/h2_uds.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_tests", - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "inproc_test", - "src": [ - "test/core/end2end/fixtures/inproc.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_nosec_tests", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_census_nosec_test", - "src": [ - "test/core/end2end/fixtures/h2_census.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_nosec_tests", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_compress_nosec_test", - "src": [ - "test/core/end2end/fixtures/h2_compress.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_nosec_tests", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_fd_nosec_test", - "src": [ - "test/core/end2end/fixtures/h2_fd.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_nosec_tests", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_full_nosec_test", - "src": [ - "test/core/end2end/fixtures/h2_full.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_nosec_tests", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_full+pipe_nosec_test", - "src": [ - "test/core/end2end/fixtures/h2_full+pipe.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_nosec_tests", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_full+trace_nosec_test", - "src": [ - "test/core/end2end/fixtures/h2_full+trace.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_nosec_tests", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_full+workarounds_nosec_test", - "src": [ - "test/core/end2end/fixtures/h2_full+workarounds.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_nosec_tests", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_http_proxy_nosec_test", - "src": [ - "test/core/end2end/fixtures/h2_http_proxy.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_nosec_tests", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_proxy_nosec_test", - "src": [ - "test/core/end2end/fixtures/h2_proxy.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_nosec_tests", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_sockpair_nosec_test", - "src": [ - "test/core/end2end/fixtures/h2_sockpair.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_nosec_tests", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_sockpair+trace_nosec_test", - "src": [ - "test/core/end2end/fixtures/h2_sockpair+trace.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_nosec_tests", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_sockpair_1byte_nosec_test", - "src": [ - "test/core/end2end/fixtures/h2_sockpair_1byte.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "end2end_nosec_tests", - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "h2_uds_nosec_test", - "src": [ - "test/core/end2end/fixtures/h2_uds.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "dns_test_util", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "resolver_component_test_unsecure", - "src": [ - "test/cpp/naming/resolver_component_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "dns_test_util", - "gpr", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "resolver_component_test", - "src": [ - "test/cpp/naming/resolver_component_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "resolver_component_tests_runner_invoker_unsecure", - "src": [ - "test/cpp/naming/resolver_component_tests_runner_invoker.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "resolver_component_tests_runner_invoker", - "src": [ - "test/cpp/naming/resolver_component_tests_runner_invoker.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "address_sorting_test_unsecure", - "src": [ - "test/cpp/naming/address_sorting_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "address_sorting_test", - "src": [ - "test/cpp/naming/address_sorting_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "dns_test_util", - "gpr", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "cancel_ares_query_test", - "src": [ - "test/cpp/naming/cancel_ares_query_test.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "alts_credentials_fuzzer_one_entry", - "src": [ - "test/core/security/alts_credentials_fuzzer.cc", - "test/core/util/one_corpus_entry_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "api_fuzzer_one_entry", - "src": [ - "test/core/end2end/fuzzers/api_fuzzer.cc", - "test/core/util/one_corpus_entry_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "client_fuzzer_one_entry", - "src": [ - "test/core/end2end/fuzzers/client_fuzzer.cc", - "test/core/util/one_corpus_entry_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "hpack_parser_fuzzer_test_one_entry", - "src": [ - "test/core/transport/chttp2/hpack_parser_fuzzer_test.cc", - "test/core/util/one_corpus_entry_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "http_request_fuzzer_test_one_entry", - "src": [ - "test/core/http/request_fuzzer.cc", - "test/core/util/one_corpus_entry_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "http_response_fuzzer_test_one_entry", - "src": [ - "test/core/http/response_fuzzer.cc", - "test/core/util/one_corpus_entry_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "json_fuzzer_test_one_entry", - "src": [ - "test/core/json/fuzzer.cc", - "test/core/util/one_corpus_entry_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "nanopb_fuzzer_response_test_one_entry", - "src": [ - "test/core/nanopb/fuzzer_response.cc", - "test/core/util/one_corpus_entry_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "nanopb_fuzzer_serverlist_test_one_entry", - "src": [ - "test/core/nanopb/fuzzer_serverlist.cc", - "test/core/util/one_corpus_entry_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "percent_decode_fuzzer_one_entry", - "src": [ - "test/core/slice/percent_decode_fuzzer.cc", - "test/core/util/one_corpus_entry_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "percent_encode_fuzzer_one_entry", - "src": [ - "test/core/slice/percent_encode_fuzzer.cc", - "test/core/util/one_corpus_entry_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "server_fuzzer_one_entry", - "src": [ - "test/core/end2end/fuzzers/server_fuzzer.cc", - "test/core/util/one_corpus_entry_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "ssl_server_fuzzer_one_entry", - "src": [ - "test/core/security/ssl_server_fuzzer.cc", - "test/core/util/one_corpus_entry_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "uri_fuzzer_test_one_entry", - "src": [ - "test/core/client_channel/uri_fuzzer_test.cc", - "test/core/util/one_corpus_entry_fuzzer.cc" - ], - "third_party": false, - "type": "target" - }, - { - "deps": [], - "headers": [ - "third_party/address_sorting/address_sorting_internal.h", - "third_party/address_sorting/include/address_sorting/address_sorting.h" - ], - "is_filegroup": false, - "language": "c", - "name": "address_sorting", - "src": [], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "grpc" - ], - "headers": [ - "test/core/tsi/alts/crypt/gsec_test_util.h", - "test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.h" - ], - "is_filegroup": false, - "language": "c", - "name": "alts_test_util", - "src": [ - "test/core/tsi/alts/crypt/gsec_test_util.cc", - "test/core/tsi/alts/crypt/gsec_test_util.h", - "test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.cc", - "test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "cxxabi", - "src": [], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "gpr_base" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "gpr", - "src": [], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "census", - "gpr", - "grpc_base", - "grpc_client_authority_filter", - "grpc_client_idle_filter", - "grpc_deadline_filter", - "grpc_lb_policy_grpclb_secure", - "grpc_lb_policy_pick_first", - "grpc_lb_policy_round_robin", - "grpc_lb_policy_xds_secure", - "grpc_max_age_filter", - "grpc_message_size_filter", - "grpc_resolver_dns_ares", - "grpc_resolver_dns_native", - "grpc_resolver_fake", - "grpc_resolver_sockaddr", - "grpc_secure", - "grpc_server_backward_compatibility", - "grpc_transport_chttp2_client_insecure", - "grpc_transport_chttp2_client_secure", - "grpc_transport_chttp2_server_insecure", - "grpc_transport_chttp2_server_secure", - "grpc_transport_inproc", - "grpc_workaround_cronet_compression_filter" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc", - "src": [ - "src/core/lib/surface/init.cc" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_transport_chttp2_client_secure", - "grpc_transport_cronet_client_secure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_cronet", - "src": [ - "src/core/ext/transport/cronet/plugin_registry/grpc_cronet_plugin_registry.cc", - "src/core/lib/surface/init.cc" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util_base" - ], - "headers": [ - "test/core/end2end/data/ssl_test_data.h", - "test/core/security/oauth2_utils.h" - ], - "is_filegroup": false, - "language": "c", - "name": "grpc_test_util", - "src": [ - "test/core/end2end/data/client_certs.cc", - "test/core/end2end/data/server1_cert.cc", - "test/core/end2end/data/server1_key.cc", - "test/core/end2end/data/ssl_test_data.h", - "test/core/end2end/data/test_root_cert.cc", - "test/core/security/oauth2_utils.cc", - "test/core/security/oauth2_utils.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "gpr", - "grpc_test_util_base", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_test_util_unsecure", - "src": [], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "census", - "gpr", - "grpc_base", - "grpc_client_authority_filter", - "grpc_client_idle_filter", - "grpc_deadline_filter", - "grpc_lb_policy_grpclb", - "grpc_lb_policy_pick_first", - "grpc_lb_policy_round_robin", - "grpc_lb_policy_xds", - "grpc_max_age_filter", - "grpc_message_size_filter", - "grpc_resolver_dns_ares", - "grpc_resolver_dns_native", - "grpc_resolver_fake", - "grpc_resolver_sockaddr", - "grpc_server_backward_compatibility", - "grpc_transport_chttp2_client_insecure", - "grpc_transport_chttp2_server_insecure", - "grpc_transport_inproc", - "grpc_workaround_cronet_compression_filter" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "grpc_unsecure", - "src": [ - "src/core/lib/surface/init.cc", - "src/core/lib/surface/init_unsecure.cc" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util", - "test_tcp_server" - ], - "headers": [ - "test/core/util/reconnect_server.h" - ], - "is_filegroup": false, - "language": "c", - "name": "reconnect_server", - "src": [ - "test/core/util/reconnect_server.cc", - "test/core/util/reconnect_server.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [ - "test/core/util/test_tcp_server.h" - ], - "is_filegroup": false, - "language": "c", - "name": "test_tcp_server", - "src": [ - "test/core/util/test_tcp_server.cc", - "test/core/util/test_tcp_server.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "benchmark", - "gpr", - "grpc++_test_config", - "grpc++_test_util_unsecure", - "grpc++_unsecure", - "grpc_benchmark", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [ - "src/proto/grpc/testing/echo.grpc.pb.h", - "src/proto/grpc/testing/echo.pb.h", - "src/proto/grpc/testing/echo_mock.grpc.pb.h", - "test/cpp/microbenchmarks/callback_test_service.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "bm_callback_test_service_impl", - "src": [ - "test/cpp/microbenchmarks/callback_test_service.cc", - "test/cpp/microbenchmarks/callback_test_service.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [], - "headers": [ - "test/cpp/naming/dns_test_util.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "dns_test_util", - "src": [ - "test/cpp/naming/dns_test_util.cc", - "test/cpp/naming/dns_test_util.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++_base", - "grpc++_codegen_base", - "grpc++_codegen_base_src", - "grpc++_codegen_proto" - ], - "headers": [ - "include/grpc++/impl/codegen/core_codegen.h", - "include/grpcpp/impl/codegen/core_codegen.h", - "src/cpp/client/secure_credentials.h", - "src/cpp/common/secure_auth_context.h", - "src/cpp/server/secure_server_credentials.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "grpc++", - "src": [ - "include/grpc++/impl/codegen/core_codegen.h", - "include/grpcpp/impl/codegen/core_codegen.h", - "src/cpp/client/insecure_credentials.cc", - "src/cpp/client/secure_credentials.cc", - "src/cpp/client/secure_credentials.h", - "src/cpp/common/auth_property_iterator.cc", - "src/cpp/common/secure_auth_context.cc", - "src/cpp/common/secure_auth_context.h", - "src/cpp/common/secure_channel_arguments.cc", - "src/cpp/common/secure_create_auth_context.cc", - "src/cpp/common/tls_credentials_options.cc", - "src/cpp/server/insecure_server_credentials.cc", - "src/cpp/server/secure_server_credentials.cc", - "src/cpp/server/secure_server_credentials.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "grpc++" - ], - "headers": [ - "src/cpp/util/core_stats.h", - "src/proto/grpc/core/stats.grpc.pb.h", - "src/proto/grpc/core/stats.pb.h", - "src/proto/grpc/core/stats_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "grpc++_core_stats", - "src": [ - "src/cpp/util/core_stats.cc", - "src/cpp/util/core_stats.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "grpc++" - ], - "headers": [ - "include/grpc++/support/error_details.h", - "include/grpcpp/support/error_details.h", - "include/grpcpp/support/error_details_impl.h", - "src/proto/grpc/status/status.grpc.pb.h", - "src/proto/grpc/status/status.pb.h", - "src/proto/grpc/status/status_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "grpc++_error_details", - "src": [ - "include/grpc++/support/error_details.h", - "include/grpcpp/support/error_details.h", - "include/grpcpp/support/error_details_impl.h", - "src/cpp/util/error_details.cc" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "grpc", - "grpc++", - "grpc++_config_proto", - "grpc++_reflection_proto" - ], - "headers": [ - "test/cpp/util/proto_reflection_descriptor_database.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "grpc++_proto_reflection_desc_db", - "src": [ - "test/cpp/util/proto_reflection_descriptor_database.cc", - "test/cpp/util/proto_reflection_descriptor_database.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "grpc", - "grpc++", - "grpc++_reflection_proto" - ], - "headers": [ - "include/grpc++/ext/proto_server_reflection_plugin.h", - "include/grpcpp/ext/proto_server_reflection_plugin.h", - "include/grpcpp/ext/proto_server_reflection_plugin_impl.h", - "src/cpp/ext/proto_server_reflection.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "grpc++_reflection", - "src": [ - "include/grpc++/ext/proto_server_reflection_plugin.h", - "include/grpcpp/ext/proto_server_reflection_plugin.h", - "include/grpcpp/ext/proto_server_reflection_plugin_impl.h", - "src/cpp/ext/proto_server_reflection.cc", - "src/cpp/ext/proto_server_reflection.h", - "src/cpp/ext/proto_server_reflection_plugin.cc" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [], - "headers": [ - "test/cpp/util/test_config.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "grpc++_test_config", - "src": [ - "test/cpp/util/test_config.h", - "test/cpp/util/test_config_cc.cc" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "grpc", - "grpc++", - "grpc++_codegen_base", - "grpc++_codegen_base_src", - "grpc++_codegen_proto", - "grpc++_config_proto", - "grpc_test_util" - ], - "headers": [ - "src/proto/grpc/channelz/channelz.grpc.pb.h", - "src/proto/grpc/channelz/channelz.pb.h", - "src/proto/grpc/channelz/channelz_mock.grpc.pb.h", - "src/proto/grpc/health/v1/health.grpc.pb.h", - "src/proto/grpc/health/v1/health.pb.h", - "src/proto/grpc/health/v1/health_mock.grpc.pb.h", - "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h", - "src/proto/grpc/testing/duplicate/echo_duplicate.pb.h", - "src/proto/grpc/testing/duplicate/echo_duplicate_mock.grpc.pb.h", - "src/proto/grpc/testing/echo.grpc.pb.h", - "src/proto/grpc/testing/echo.pb.h", - "src/proto/grpc/testing/echo_messages.grpc.pb.h", - "src/proto/grpc/testing/echo_messages.pb.h", - "src/proto/grpc/testing/echo_messages_mock.grpc.pb.h", - "src/proto/grpc/testing/echo_mock.grpc.pb.h", - "src/proto/grpc/testing/simple_messages.grpc.pb.h", - "src/proto/grpc/testing/simple_messages.pb.h", - "src/proto/grpc/testing/simple_messages_mock.grpc.pb.h", - "test/cpp/end2end/test_health_check_service_impl.h", - "test/cpp/end2end/test_service_impl.h", - "test/cpp/util/byte_buffer_proto_helper.h", - "test/cpp/util/channel_trace_proto_helper.h", - "test/cpp/util/create_test_channel.h", - "test/cpp/util/string_ref_helper.h", - "test/cpp/util/subprocess.h", - "test/cpp/util/test_credentials_provider.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "grpc++_test_util", - "src": [ - "test/cpp/end2end/test_health_check_service_impl.cc", - "test/cpp/end2end/test_health_check_service_impl.h", - "test/cpp/end2end/test_service_impl.cc", - "test/cpp/end2end/test_service_impl.h", - "test/cpp/util/byte_buffer_proto_helper.cc", - "test/cpp/util/byte_buffer_proto_helper.h", - "test/cpp/util/channel_trace_proto_helper.cc", - "test/cpp/util/channel_trace_proto_helper.h", - "test/cpp/util/create_test_channel.cc", - "test/cpp/util/create_test_channel.h", - "test/cpp/util/string_ref_helper.cc", - "test/cpp/util/string_ref_helper.h", - "test/cpp/util/subprocess.cc", - "test/cpp/util/subprocess.h", - "test/cpp/util/test_credentials_provider.cc", - "test/cpp/util/test_credentials_provider.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "grpc++_codegen_base", - "grpc++_codegen_base_src", - "grpc++_codegen_proto", - "grpc++_config_proto", - "grpc++_unsecure", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [ - "src/proto/grpc/health/v1/health.grpc.pb.h", - "src/proto/grpc/health/v1/health.pb.h", - "src/proto/grpc/health/v1/health_mock.grpc.pb.h", - "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h", - "src/proto/grpc/testing/duplicate/echo_duplicate.pb.h", - "src/proto/grpc/testing/duplicate/echo_duplicate_mock.grpc.pb.h", - "src/proto/grpc/testing/echo.grpc.pb.h", - "src/proto/grpc/testing/echo.pb.h", - "src/proto/grpc/testing/echo_messages.grpc.pb.h", - "src/proto/grpc/testing/echo_messages.pb.h", - "src/proto/grpc/testing/echo_messages_mock.grpc.pb.h", - "src/proto/grpc/testing/echo_mock.grpc.pb.h", - "src/proto/grpc/testing/simple_messages.grpc.pb.h", - "src/proto/grpc/testing/simple_messages.pb.h", - "src/proto/grpc/testing/simple_messages_mock.grpc.pb.h", - "test/cpp/end2end/test_health_check_service_impl.h", - "test/cpp/end2end/test_service_impl.h", - "test/cpp/util/byte_buffer_proto_helper.h", - "test/cpp/util/string_ref_helper.h", - "test/cpp/util/subprocess.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "grpc++_test_util_unsecure", - "src": [ - "test/cpp/end2end/test_health_check_service_impl.cc", - "test/cpp/end2end/test_health_check_service_impl.h", - "test/cpp/end2end/test_service_impl.cc", - "test/cpp/end2end/test_service_impl.h", - "test/cpp/util/byte_buffer_proto_helper.cc", - "test/cpp/util/byte_buffer_proto_helper.h", - "test/cpp/util/string_ref_helper.cc", - "test/cpp/util/string_ref_helper.h", - "test/cpp/util/subprocess.cc", - "test/cpp/util/subprocess.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "gpr", - "grpc++_base_unsecure", - "grpc++_codegen_base", - "grpc++_codegen_base_src", - "grpc_unsecure" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "grpc++_unsecure", - "src": [ - "src/cpp/client/insecure_credentials.cc", - "src/cpp/common/insecure_create_auth_context.cc", - "src/cpp/server/insecure_server_credentials.cc" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "benchmark", - "grpc++_unsecure", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [ - "test/cpp/microbenchmarks/fullstack_context_mutators.h", - "test/cpp/microbenchmarks/fullstack_fixtures.h", - "test/cpp/microbenchmarks/helpers.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "grpc_benchmark", - "src": [ - "test/cpp/microbenchmarks/fullstack_context_mutators.h", - "test/cpp/microbenchmarks/fullstack_fixtures.h", - "test/cpp/microbenchmarks/helpers.cc", - "test/cpp/microbenchmarks/helpers.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "grpc", - "grpc++", - "grpc++_config_proto", - "grpc++_proto_reflection_desc_db", - "grpc++_reflection_proto" - ], - "headers": [ - "test/cpp/util/cli_call.h", - "test/cpp/util/cli_credentials.h", - "test/cpp/util/config_grpc_cli.h", - "test/cpp/util/grpc_tool.h", - "test/cpp/util/proto_file_parser.h", - "test/cpp/util/service_describer.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "grpc_cli_libs", - "src": [ - "test/cpp/util/cli_call.cc", - "test/cpp/util/cli_call.h", - "test/cpp/util/cli_credentials.cc", - "test/cpp/util/cli_credentials.h", - "test/cpp/util/config_grpc_cli.h", - "test/cpp/util/grpc_tool.cc", - "test/cpp/util/grpc_tool.h", - "test/cpp/util/proto_file_parser.cc", - "test/cpp/util/proto_file_parser.h", - "test/cpp/util/service_describer.cc", - "test/cpp/util/service_describer.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "grpc++_config_proto" - ], - "headers": [ - "src/compiler/config.h", - "src/compiler/config_protobuf.h", - "src/compiler/cpp_generator.h", - "src/compiler/cpp_generator_helpers.h", - "src/compiler/csharp_generator.h", - "src/compiler/csharp_generator_helpers.h", - "src/compiler/generator_helpers.h", - "src/compiler/node_generator.h", - "src/compiler/node_generator_helpers.h", - "src/compiler/objective_c_generator.h", - "src/compiler/objective_c_generator_helpers.h", - "src/compiler/php_generator.h", - "src/compiler/php_generator_helpers.h", - "src/compiler/protobuf_plugin.h", - "src/compiler/python_generator.h", - "src/compiler/python_generator_helpers.h", - "src/compiler/python_private_generator.h", - "src/compiler/ruby_generator.h", - "src/compiler/ruby_generator_helpers-inl.h", - "src/compiler/ruby_generator_map-inl.h", - "src/compiler/ruby_generator_string-inl.h", - "src/compiler/schema_interface.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "grpc_plugin_support", - "src": [ - "src/compiler/config.h", - "src/compiler/config_protobuf.h", - "src/compiler/cpp_generator.cc", - "src/compiler/cpp_generator.h", - "src/compiler/cpp_generator_helpers.h", - "src/compiler/csharp_generator.cc", - "src/compiler/csharp_generator.h", - "src/compiler/csharp_generator_helpers.h", - "src/compiler/generator_helpers.h", - "src/compiler/node_generator.cc", - "src/compiler/node_generator.h", - "src/compiler/node_generator_helpers.h", - "src/compiler/objective_c_generator.cc", - "src/compiler/objective_c_generator.h", - "src/compiler/objective_c_generator_helpers.h", - "src/compiler/php_generator.cc", - "src/compiler/php_generator.h", - "src/compiler/php_generator_helpers.h", - "src/compiler/protobuf_plugin.h", - "src/compiler/python_generator.cc", - "src/compiler/python_generator.h", - "src/compiler/python_generator_helpers.h", - "src/compiler/python_private_generator.h", - "src/compiler/ruby_generator.cc", - "src/compiler/ruby_generator.h", - "src/compiler/ruby_generator_helpers-inl.h", - "src/compiler/ruby_generator_map-inl.h", - "src/compiler/ruby_generator_string-inl.h", - "src/compiler/schema_interface.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "grpc", - "grpc++", - "grpcpp_channelz_proto" - ], - "headers": [ - "include/grpcpp/ext/channelz_service_plugin.h", - "include/grpcpp/ext/channelz_service_plugin_impl.h", - "src/cpp/server/channelz/channelz_service.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "grpcpp_channelz", - "src": [ - "include/grpcpp/ext/channelz_service_plugin.h", - "include/grpcpp/ext/channelz_service_plugin_impl.h", - "src/cpp/server/channelz/channelz_service.cc", - "src/cpp/server/channelz/channelz_service.h", - "src/cpp/server/channelz/channelz_service_plugin.cc" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [ - "src/proto/grpc/testing/empty.grpc.pb.h", - "src/proto/grpc/testing/empty.pb.h", - "src/proto/grpc/testing/empty_mock.grpc.pb.h", - "src/proto/grpc/testing/messages.grpc.pb.h", - "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", - "src/proto/grpc/testing/test.grpc.pb.h", - "src/proto/grpc/testing/test.pb.h", - "src/proto/grpc/testing/test_mock.grpc.pb.h", - "test/cpp/interop/http2_client.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "http2_client_main", - "src": [ - "test/cpp/interop/http2_client.cc", - "test/cpp/interop/http2_client.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [ - "src/proto/grpc/testing/messages.grpc.pb.h", - "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", - "test/cpp/interop/client_helper.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "interop_client_helper", - "src": [ - "test/cpp/interop/client_helper.cc", - "test/cpp/interop/client_helper.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util", - "interop_client_helper" - ], - "headers": [ - "src/proto/grpc/testing/empty.grpc.pb.h", - "src/proto/grpc/testing/empty.pb.h", - "src/proto/grpc/testing/empty_mock.grpc.pb.h", - "src/proto/grpc/testing/messages.grpc.pb.h", - "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", - "src/proto/grpc/testing/test.grpc.pb.h", - "src/proto/grpc/testing/test.pb.h", - "src/proto/grpc/testing/test_mock.grpc.pb.h", - "test/cpp/interop/interop_client.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "interop_client_main", - "src": [ - "test/cpp/interop/client.cc", - "test/cpp/interop/interop_client.cc", - "test/cpp/interop/interop_client.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [ - "test/cpp/interop/server_helper.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "interop_server_helper", - "src": [ - "test/cpp/interop/server_helper.cc", - "test/cpp/interop/server_helper.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++", - "grpc++_test_config", - "grpc++_test_util", - "grpc_test_util", - "interop_server_helper" - ], - "headers": [ - "src/proto/grpc/testing/empty.grpc.pb.h", - "src/proto/grpc/testing/empty.pb.h", - "src/proto/grpc/testing/empty_mock.grpc.pb.h", - "src/proto/grpc/testing/messages.grpc.pb.h", - "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", - "src/proto/grpc/testing/test.grpc.pb.h", - "src/proto/grpc/testing/test.pb.h", - "src/proto/grpc/testing/test_mock.grpc.pb.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "interop_server_lib", - "src": [ - "test/cpp/interop/interop_server.cc" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "interop_server_lib" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "interop_server_main", - "src": [ - "test/cpp/interop/interop_server_bootstrap.cc" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "grpc", - "grpc++", - "grpc++_core_stats", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [ - "src/proto/grpc/testing/benchmark_service.grpc.pb.h", - "src/proto/grpc/testing/benchmark_service.pb.h", - "src/proto/grpc/testing/benchmark_service_mock.grpc.pb.h", - "src/proto/grpc/testing/control.grpc.pb.h", - "src/proto/grpc/testing/control.pb.h", - "src/proto/grpc/testing/control_mock.grpc.pb.h", - "src/proto/grpc/testing/messages.grpc.pb.h", - "src/proto/grpc/testing/messages.pb.h", - "src/proto/grpc/testing/messages_mock.grpc.pb.h", - "src/proto/grpc/testing/payloads.grpc.pb.h", - "src/proto/grpc/testing/payloads.pb.h", - "src/proto/grpc/testing/payloads_mock.grpc.pb.h", - "src/proto/grpc/testing/report_qps_scenario_service.grpc.pb.h", - "src/proto/grpc/testing/report_qps_scenario_service.pb.h", - "src/proto/grpc/testing/report_qps_scenario_service_mock.grpc.pb.h", - "src/proto/grpc/testing/stats.grpc.pb.h", - "src/proto/grpc/testing/stats.pb.h", - "src/proto/grpc/testing/stats_mock.grpc.pb.h", - "src/proto/grpc/testing/worker_service.grpc.pb.h", - "src/proto/grpc/testing/worker_service.pb.h", - "src/proto/grpc/testing/worker_service_mock.grpc.pb.h", - "test/cpp/qps/benchmark_config.h", - "test/cpp/qps/client.h", - "test/cpp/qps/driver.h", - "test/cpp/qps/histogram.h", - "test/cpp/qps/interarrival.h", - "test/cpp/qps/parse_json.h", - "test/cpp/qps/qps_server_builder.h", - "test/cpp/qps/qps_worker.h", - "test/cpp/qps/report.h", - "test/cpp/qps/server.h", - "test/cpp/qps/stats.h", - "test/cpp/qps/usage_timer.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "qps", - "src": [ - "test/cpp/qps/benchmark_config.cc", - "test/cpp/qps/benchmark_config.h", - "test/cpp/qps/client.h", - "test/cpp/qps/client_async.cc", - "test/cpp/qps/client_callback.cc", - "test/cpp/qps/client_sync.cc", - "test/cpp/qps/driver.cc", - "test/cpp/qps/driver.h", - "test/cpp/qps/histogram.h", - "test/cpp/qps/interarrival.h", - "test/cpp/qps/parse_json.cc", - "test/cpp/qps/parse_json.h", - "test/cpp/qps/qps_server_builder.cc", - "test/cpp/qps/qps_server_builder.h", - "test/cpp/qps/qps_worker.cc", - "test/cpp/qps/qps_worker.h", - "test/cpp/qps/report.cc", - "test/cpp/qps/report.h", - "test/cpp/qps/server.h", - "test/cpp/qps/server_async.cc", - "test/cpp/qps/server_callback.cc", - "test/cpp/qps/server_sync.cc", - "test/cpp/qps/stats.h", - "test/cpp/qps/usage_timer.cc", - "test/cpp/qps/usage_timer.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "gpr", - "grpc" - ], - "headers": [], - "is_filegroup": false, - "language": "csharp", - "name": "grpc_csharp_ext", - "src": [ - "src/csharp/ext/grpc_csharp_ext.c" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [], - "headers": [ - "third_party/boringssl/crypto/asn1/asn1_locl.h", - "third_party/boringssl/crypto/bio/internal.h", - "third_party/boringssl/crypto/bytestring/internal.h", - "third_party/boringssl/crypto/cipher_extra/internal.h", - "third_party/boringssl/crypto/conf/conf_def.h", - "third_party/boringssl/crypto/conf/internal.h", - "third_party/boringssl/crypto/err/internal.h", - "third_party/boringssl/crypto/evp/internal.h", - "third_party/boringssl/crypto/fipsmodule/aes/aes.c", - "third_party/boringssl/crypto/fipsmodule/aes/internal.h", - "third_party/boringssl/crypto/fipsmodule/aes/key_wrap.c", - "third_party/boringssl/crypto/fipsmodule/aes/mode_wrappers.c", - "third_party/boringssl/crypto/fipsmodule/bn/add.c", - "third_party/boringssl/crypto/fipsmodule/bn/asm/x86_64-gcc.c", - "third_party/boringssl/crypto/fipsmodule/bn/bn.c", - "third_party/boringssl/crypto/fipsmodule/bn/bytes.c", - "third_party/boringssl/crypto/fipsmodule/bn/cmp.c", - "third_party/boringssl/crypto/fipsmodule/bn/ctx.c", - "third_party/boringssl/crypto/fipsmodule/bn/div.c", - "third_party/boringssl/crypto/fipsmodule/bn/exponentiation.c", - "third_party/boringssl/crypto/fipsmodule/bn/gcd.c", - "third_party/boringssl/crypto/fipsmodule/bn/generic.c", - "third_party/boringssl/crypto/fipsmodule/bn/internal.h", - "third_party/boringssl/crypto/fipsmodule/bn/jacobi.c", - "third_party/boringssl/crypto/fipsmodule/bn/montgomery.c", - "third_party/boringssl/crypto/fipsmodule/bn/montgomery_inv.c", - "third_party/boringssl/crypto/fipsmodule/bn/mul.c", - "third_party/boringssl/crypto/fipsmodule/bn/prime.c", - "third_party/boringssl/crypto/fipsmodule/bn/random.c", - "third_party/boringssl/crypto/fipsmodule/bn/rsaz_exp.c", - "third_party/boringssl/crypto/fipsmodule/bn/rsaz_exp.h", - "third_party/boringssl/crypto/fipsmodule/bn/shift.c", - "third_party/boringssl/crypto/fipsmodule/bn/sqrt.c", - "third_party/boringssl/crypto/fipsmodule/cipher/aead.c", - "third_party/boringssl/crypto/fipsmodule/cipher/cipher.c", - "third_party/boringssl/crypto/fipsmodule/cipher/e_aes.c", - "third_party/boringssl/crypto/fipsmodule/cipher/e_des.c", - "third_party/boringssl/crypto/fipsmodule/cipher/internal.h", - "third_party/boringssl/crypto/fipsmodule/delocate.h", - "third_party/boringssl/crypto/fipsmodule/des/des.c", - "third_party/boringssl/crypto/fipsmodule/des/internal.h", - "third_party/boringssl/crypto/fipsmodule/digest/digest.c", - "third_party/boringssl/crypto/fipsmodule/digest/digests.c", - "third_party/boringssl/crypto/fipsmodule/digest/internal.h", - "third_party/boringssl/crypto/fipsmodule/digest/md32_common.h", - "third_party/boringssl/crypto/fipsmodule/ec/ec.c", - "third_party/boringssl/crypto/fipsmodule/ec/ec_key.c", - "third_party/boringssl/crypto/fipsmodule/ec/ec_montgomery.c", - "third_party/boringssl/crypto/fipsmodule/ec/internal.h", - "third_party/boringssl/crypto/fipsmodule/ec/oct.c", - "third_party/boringssl/crypto/fipsmodule/ec/p224-64.c", - "third_party/boringssl/crypto/fipsmodule/ec/p256-x86_64-table.h", - "third_party/boringssl/crypto/fipsmodule/ec/p256-x86_64.c", - "third_party/boringssl/crypto/fipsmodule/ec/p256-x86_64.h", - "third_party/boringssl/crypto/fipsmodule/ec/simple.c", - "third_party/boringssl/crypto/fipsmodule/ec/util.c", - "third_party/boringssl/crypto/fipsmodule/ec/wnaf.c", - "third_party/boringssl/crypto/fipsmodule/ecdsa/ecdsa.c", - "third_party/boringssl/crypto/fipsmodule/hmac/hmac.c", - "third_party/boringssl/crypto/fipsmodule/md4/md4.c", - "third_party/boringssl/crypto/fipsmodule/md5/md5.c", - "third_party/boringssl/crypto/fipsmodule/modes/cbc.c", - "third_party/boringssl/crypto/fipsmodule/modes/ccm.c", - "third_party/boringssl/crypto/fipsmodule/modes/cfb.c", - "third_party/boringssl/crypto/fipsmodule/modes/ctr.c", - "third_party/boringssl/crypto/fipsmodule/modes/gcm.c", - "third_party/boringssl/crypto/fipsmodule/modes/internal.h", - "third_party/boringssl/crypto/fipsmodule/modes/ofb.c", - "third_party/boringssl/crypto/fipsmodule/modes/polyval.c", - "third_party/boringssl/crypto/fipsmodule/rand/ctrdrbg.c", - "third_party/boringssl/crypto/fipsmodule/rand/internal.h", - "third_party/boringssl/crypto/fipsmodule/rand/rand.c", - "third_party/boringssl/crypto/fipsmodule/rand/urandom.c", - "third_party/boringssl/crypto/fipsmodule/rsa/blinding.c", - "third_party/boringssl/crypto/fipsmodule/rsa/internal.h", - "third_party/boringssl/crypto/fipsmodule/rsa/padding.c", - "third_party/boringssl/crypto/fipsmodule/rsa/rsa.c", - "third_party/boringssl/crypto/fipsmodule/rsa/rsa_impl.c", - "third_party/boringssl/crypto/fipsmodule/self_check/self_check.c", - "third_party/boringssl/crypto/fipsmodule/sha/sha1-altivec.c", - "third_party/boringssl/crypto/fipsmodule/sha/sha1.c", - "third_party/boringssl/crypto/fipsmodule/sha/sha256.c", - "third_party/boringssl/crypto/fipsmodule/sha/sha512.c", - "third_party/boringssl/crypto/fipsmodule/tls/internal.h", - "third_party/boringssl/crypto/fipsmodule/tls/kdf.c", - "third_party/boringssl/crypto/internal.h", - "third_party/boringssl/crypto/obj/obj_dat.h", - "third_party/boringssl/crypto/pkcs7/internal.h", - "third_party/boringssl/crypto/pkcs8/internal.h", - "third_party/boringssl/crypto/poly1305/internal.h", - "third_party/boringssl/crypto/pool/internal.h", - "third_party/boringssl/crypto/x509/charmap.h", - "third_party/boringssl/crypto/x509/internal.h", - "third_party/boringssl/crypto/x509/vpm_int.h", - "third_party/boringssl/crypto/x509v3/ext_dat.h", - "third_party/boringssl/crypto/x509v3/pcy_int.h", - "third_party/boringssl/include/openssl/aead.h", - "third_party/boringssl/include/openssl/aes.h", - "third_party/boringssl/include/openssl/arm_arch.h", - "third_party/boringssl/include/openssl/asn1.h", - "third_party/boringssl/include/openssl/asn1_mac.h", - "third_party/boringssl/include/openssl/asn1t.h", - "third_party/boringssl/include/openssl/base.h", - "third_party/boringssl/include/openssl/base64.h", - "third_party/boringssl/include/openssl/bio.h", - "third_party/boringssl/include/openssl/blowfish.h", - "third_party/boringssl/include/openssl/bn.h", - "third_party/boringssl/include/openssl/buf.h", - "third_party/boringssl/include/openssl/buffer.h", - "third_party/boringssl/include/openssl/bytestring.h", - "third_party/boringssl/include/openssl/cast.h", - "third_party/boringssl/include/openssl/chacha.h", - "third_party/boringssl/include/openssl/cipher.h", - "third_party/boringssl/include/openssl/cmac.h", - "third_party/boringssl/include/openssl/conf.h", - "third_party/boringssl/include/openssl/cpu.h", - "third_party/boringssl/include/openssl/crypto.h", - "third_party/boringssl/include/openssl/curve25519.h", - "third_party/boringssl/include/openssl/des.h", - "third_party/boringssl/include/openssl/dh.h", - "third_party/boringssl/include/openssl/digest.h", - "third_party/boringssl/include/openssl/dsa.h", - "third_party/boringssl/include/openssl/dtls1.h", - "third_party/boringssl/include/openssl/ec.h", - "third_party/boringssl/include/openssl/ec_key.h", - "third_party/boringssl/include/openssl/ecdh.h", - "third_party/boringssl/include/openssl/ecdsa.h", - "third_party/boringssl/include/openssl/engine.h", - "third_party/boringssl/include/openssl/err.h", - "third_party/boringssl/include/openssl/evp.h", - "third_party/boringssl/include/openssl/ex_data.h", - "third_party/boringssl/include/openssl/hkdf.h", - "third_party/boringssl/include/openssl/hmac.h", - "third_party/boringssl/include/openssl/is_boringssl.h", - "third_party/boringssl/include/openssl/lhash.h", - "third_party/boringssl/include/openssl/lhash_macros.h", - "third_party/boringssl/include/openssl/md4.h", - "third_party/boringssl/include/openssl/md5.h", - "third_party/boringssl/include/openssl/mem.h", - "third_party/boringssl/include/openssl/nid.h", - "third_party/boringssl/include/openssl/obj.h", - "third_party/boringssl/include/openssl/obj_mac.h", - "third_party/boringssl/include/openssl/objects.h", - "third_party/boringssl/include/openssl/opensslconf.h", - "third_party/boringssl/include/openssl/opensslv.h", - "third_party/boringssl/include/openssl/ossl_typ.h", - "third_party/boringssl/include/openssl/pem.h", - "third_party/boringssl/include/openssl/pkcs12.h", - "third_party/boringssl/include/openssl/pkcs7.h", - "third_party/boringssl/include/openssl/pkcs8.h", - "third_party/boringssl/include/openssl/poly1305.h", - "third_party/boringssl/include/openssl/pool.h", - "third_party/boringssl/include/openssl/rand.h", - "third_party/boringssl/include/openssl/rc4.h", - "third_party/boringssl/include/openssl/ripemd.h", - "third_party/boringssl/include/openssl/rsa.h", - "third_party/boringssl/include/openssl/safestack.h", - "third_party/boringssl/include/openssl/sha.h", - "third_party/boringssl/include/openssl/span.h", - "third_party/boringssl/include/openssl/srtp.h", - "third_party/boringssl/include/openssl/ssl.h", - "third_party/boringssl/include/openssl/ssl3.h", - "third_party/boringssl/include/openssl/stack.h", - "third_party/boringssl/include/openssl/thread.h", - "third_party/boringssl/include/openssl/tls1.h", - "third_party/boringssl/include/openssl/type_check.h", - "third_party/boringssl/include/openssl/x509.h", - "third_party/boringssl/include/openssl/x509_vfy.h", - "third_party/boringssl/include/openssl/x509v3.h", - "third_party/boringssl/ssl/internal.h", - "third_party/boringssl/third_party/fiat/curve25519_tables.h", - "third_party/boringssl/third_party/fiat/internal.h", - "third_party/boringssl/third_party/fiat/p256.c" - ], - "is_filegroup": false, - "language": "c", - "name": "boringssl", - "src": [ - "src/boringssl/err_data.c" - ], - "third_party": true, - "type": "lib" - }, - { - "deps": [], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "boringssl_test_util", - "src": [], - "third_party": true, - "type": "lib" - }, - { - "deps": [], - "headers": [ - "third_party/benchmark/include/benchmark/benchmark.h", - "third_party/benchmark/src/arraysize.h", - "third_party/benchmark/src/benchmark_api_internal.h", - "third_party/benchmark/src/benchmark_register.h", - "third_party/benchmark/src/check.h", - "third_party/benchmark/src/colorprint.h", - "third_party/benchmark/src/commandlineflags.h", - "third_party/benchmark/src/complexity.h", - "third_party/benchmark/src/counter.h", - "third_party/benchmark/src/cycleclock.h", - "third_party/benchmark/src/internal_macros.h", - "third_party/benchmark/src/log.h", - "third_party/benchmark/src/mutex.h", - "third_party/benchmark/src/re.h", - "third_party/benchmark/src/sleep.h", - "third_party/benchmark/src/statistics.h", - "third_party/benchmark/src/string_util.h", - "third_party/benchmark/src/thread_manager.h", - "third_party/benchmark/src/thread_timer.h", - "third_party/benchmark/src/timers.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "benchmark", - "src": [], - "third_party": false, - "type": "lib" - }, - { - "deps": [], - "headers": [ - "third_party/upb/generated_for_cmake/google/protobuf/descriptor.upb.h", - "third_party/upb/upb/decode.h", - "third_party/upb/upb/def.h", - "third_party/upb/upb/encode.h", - "third_party/upb/upb/handlers.h", - "third_party/upb/upb/msg.h", - "third_party/upb/upb/msgfactory.h", - "third_party/upb/upb/sink.h", - "third_party/upb/upb/upb.h" - ], - "is_filegroup": false, - "language": "c", - "name": "upb", - "src": [], - "third_party": false, - "type": "lib" - }, - { - "deps": [], - "headers": [ - "third_party/zlib/crc32.h", - "third_party/zlib/deflate.h", - "third_party/zlib/gzguts.h", - "third_party/zlib/inffast.h", - "third_party/zlib/inffixed.h", - "third_party/zlib/inflate.h", - "third_party/zlib/inftrees.h", - "third_party/zlib/trees.h", - "third_party/zlib/zconf.h", - "third_party/zlib/zlib.h", - "third_party/zlib/zutil.h" - ], - "is_filegroup": false, - "language": "c", - "name": "z", - "src": [], - "third_party": true, - "type": "lib" - }, - { - "deps": [], - "headers": [ - "third_party/cares/ares_build.h", - "third_party/cares/cares/ares.h", - "third_party/cares/cares/ares_data.h", - "third_party/cares/cares/ares_dns.h", - "third_party/cares/cares/ares_getenv.h", - "third_party/cares/cares/ares_getopt.h", - "third_party/cares/cares/ares_inet_net_pton.h", - "third_party/cares/cares/ares_iphlpapi.h", - "third_party/cares/cares/ares_ipv6.h", - "third_party/cares/cares/ares_library_init.h", - "third_party/cares/cares/ares_llist.h", - "third_party/cares/cares/ares_nowarn.h", - "third_party/cares/cares/ares_platform.h", - "third_party/cares/cares/ares_private.h", - "third_party/cares/cares/ares_rules.h", - "third_party/cares/cares/ares_setup.h", - "third_party/cares/cares/ares_strcasecmp.h", - "third_party/cares/cares/ares_strdup.h", - "third_party/cares/cares/ares_strsplit.h", - "third_party/cares/cares/ares_version.h", - "third_party/cares/cares/bitncmp.h", - "third_party/cares/cares/config-win32.h", - "third_party/cares/cares/setup_once.h", - "third_party/cares/config_darwin/ares_config.h", - "third_party/cares/config_freebsd/ares_config.h", - "third_party/cares/config_linux/ares_config.h", - "third_party/cares/config_openbsd/ares_config.h" - ], - "is_filegroup": false, - "language": "c", - "name": "ares", - "src": [], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [ - "test/core/bad_client/bad_client.h" - ], - "is_filegroup": false, - "language": "c++", - "name": "bad_client_test", - "src": [ - "test/core/bad_client/bad_client.cc", - "test/core/bad_client/bad_client.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [ - "test/core/bad_ssl/server_common.h" - ], - "is_filegroup": false, - "language": "c", - "name": "bad_ssl_test_server", - "src": [ - "test/core/bad_ssl/server_common.cc", - "test/core/bad_ssl/server_common.h" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc_test_util" - ], - "headers": [ - "test/core/end2end/end2end_tests.h", - "test/core/end2end/tests/cancel_test_helpers.h" - ], - "is_filegroup": false, - "language": "c", - "name": "end2end_tests", - "src": [ - "test/core/end2end/end2end_test_utils.cc", - "test/core/end2end/end2end_tests.cc", - "test/core/end2end/end2end_tests.h", - "test/core/end2end/tests/authority_not_supported.cc", - "test/core/end2end/tests/bad_hostname.cc", - "test/core/end2end/tests/bad_ping.cc", - "test/core/end2end/tests/binary_metadata.cc", - "test/core/end2end/tests/call_creds.cc", - "test/core/end2end/tests/call_host_override.cc", - "test/core/end2end/tests/cancel_after_accept.cc", - "test/core/end2end/tests/cancel_after_client_done.cc", - "test/core/end2end/tests/cancel_after_invoke.cc", - "test/core/end2end/tests/cancel_after_round_trip.cc", - "test/core/end2end/tests/cancel_before_invoke.cc", - "test/core/end2end/tests/cancel_in_a_vacuum.cc", - "test/core/end2end/tests/cancel_test_helpers.h", - "test/core/end2end/tests/cancel_with_status.cc", - "test/core/end2end/tests/channelz.cc", - "test/core/end2end/tests/compressed_payload.cc", - "test/core/end2end/tests/connectivity.cc", - "test/core/end2end/tests/default_host.cc", - "test/core/end2end/tests/disappearing_server.cc", - "test/core/end2end/tests/empty_batch.cc", - "test/core/end2end/tests/filter_call_init_fails.cc", - "test/core/end2end/tests/filter_causes_close.cc", - "test/core/end2end/tests/filter_context.cc", - "test/core/end2end/tests/filter_latency.cc", - "test/core/end2end/tests/filter_status_code.cc", - "test/core/end2end/tests/graceful_server_shutdown.cc", - "test/core/end2end/tests/high_initial_seqno.cc", - "test/core/end2end/tests/hpack_size.cc", - "test/core/end2end/tests/idempotent_request.cc", - "test/core/end2end/tests/invoke_large_request.cc", - "test/core/end2end/tests/keepalive_timeout.cc", - "test/core/end2end/tests/large_metadata.cc", - "test/core/end2end/tests/max_concurrent_streams.cc", - "test/core/end2end/tests/max_connection_age.cc", - "test/core/end2end/tests/max_connection_idle.cc", - "test/core/end2end/tests/max_message_length.cc", - "test/core/end2end/tests/negative_deadline.cc", - "test/core/end2end/tests/no_error_on_hotpath.cc", - "test/core/end2end/tests/no_logging.cc", - "test/core/end2end/tests/no_op.cc", - "test/core/end2end/tests/payload.cc", - "test/core/end2end/tests/ping.cc", - "test/core/end2end/tests/ping_pong_streaming.cc", - "test/core/end2end/tests/proxy_auth.cc", - "test/core/end2end/tests/registered_call.cc", - "test/core/end2end/tests/request_with_flags.cc", - "test/core/end2end/tests/request_with_payload.cc", - "test/core/end2end/tests/resource_quota_server.cc", - "test/core/end2end/tests/retry.cc", - "test/core/end2end/tests/retry_cancellation.cc", - "test/core/end2end/tests/retry_disabled.cc", - "test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc", - "test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc", - "test/core/end2end/tests/retry_non_retriable_status.cc", - "test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc", - "test/core/end2end/tests/retry_recv_initial_metadata.cc", - "test/core/end2end/tests/retry_recv_message.cc", - "test/core/end2end/tests/retry_server_pushback_delay.cc", - "test/core/end2end/tests/retry_server_pushback_disabled.cc", - "test/core/end2end/tests/retry_streaming.cc", - "test/core/end2end/tests/retry_streaming_after_commit.cc", - "test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc", - "test/core/end2end/tests/retry_throttled.cc", - "test/core/end2end/tests/retry_too_many_attempts.cc", - "test/core/end2end/tests/server_finishes_request.cc", - "test/core/end2end/tests/shutdown_finishes_calls.cc", - "test/core/end2end/tests/shutdown_finishes_tags.cc", - "test/core/end2end/tests/simple_cacheable_request.cc", - "test/core/end2end/tests/simple_delayed_request.cc", - "test/core/end2end/tests/simple_metadata.cc", - "test/core/end2end/tests/simple_request.cc", - "test/core/end2end/tests/stream_compression_compressed_payload.cc", - "test/core/end2end/tests/stream_compression_payload.cc", - "test/core/end2end/tests/stream_compression_ping_pong_streaming.cc", - "test/core/end2end/tests/streaming_error_response.cc", - "test/core/end2end/tests/trailing_metadata.cc", - "test/core/end2end/tests/workaround_cronet_compression.cc", - "test/core/end2end/tests/write_buffering.cc", - "test/core/end2end/tests/write_buffering_at_end.cc" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "gpr", - "grpc_test_util_unsecure", - "grpc_unsecure" - ], - "headers": [ - "test/core/end2end/end2end_tests.h", - "test/core/end2end/tests/cancel_test_helpers.h" - ], - "is_filegroup": false, - "language": "c", - "name": "end2end_nosec_tests", - "src": [ - "test/core/end2end/end2end_nosec_tests.cc", - "test/core/end2end/end2end_test_utils.cc", - "test/core/end2end/end2end_tests.h", - "test/core/end2end/tests/authority_not_supported.cc", - "test/core/end2end/tests/bad_hostname.cc", - "test/core/end2end/tests/bad_ping.cc", - "test/core/end2end/tests/binary_metadata.cc", - "test/core/end2end/tests/call_host_override.cc", - "test/core/end2end/tests/cancel_after_accept.cc", - "test/core/end2end/tests/cancel_after_client_done.cc", - "test/core/end2end/tests/cancel_after_invoke.cc", - "test/core/end2end/tests/cancel_after_round_trip.cc", - "test/core/end2end/tests/cancel_before_invoke.cc", - "test/core/end2end/tests/cancel_in_a_vacuum.cc", - "test/core/end2end/tests/cancel_test_helpers.h", - "test/core/end2end/tests/cancel_with_status.cc", - "test/core/end2end/tests/channelz.cc", - "test/core/end2end/tests/compressed_payload.cc", - "test/core/end2end/tests/connectivity.cc", - "test/core/end2end/tests/default_host.cc", - "test/core/end2end/tests/disappearing_server.cc", - "test/core/end2end/tests/empty_batch.cc", - "test/core/end2end/tests/filter_call_init_fails.cc", - "test/core/end2end/tests/filter_causes_close.cc", - "test/core/end2end/tests/filter_context.cc", - "test/core/end2end/tests/filter_latency.cc", - "test/core/end2end/tests/filter_status_code.cc", - "test/core/end2end/tests/graceful_server_shutdown.cc", - "test/core/end2end/tests/high_initial_seqno.cc", - "test/core/end2end/tests/hpack_size.cc", - "test/core/end2end/tests/idempotent_request.cc", - "test/core/end2end/tests/invoke_large_request.cc", - "test/core/end2end/tests/keepalive_timeout.cc", - "test/core/end2end/tests/large_metadata.cc", - "test/core/end2end/tests/max_concurrent_streams.cc", - "test/core/end2end/tests/max_connection_age.cc", - "test/core/end2end/tests/max_connection_idle.cc", - "test/core/end2end/tests/max_message_length.cc", - "test/core/end2end/tests/negative_deadline.cc", - "test/core/end2end/tests/no_error_on_hotpath.cc", - "test/core/end2end/tests/no_logging.cc", - "test/core/end2end/tests/no_op.cc", - "test/core/end2end/tests/payload.cc", - "test/core/end2end/tests/ping.cc", - "test/core/end2end/tests/ping_pong_streaming.cc", - "test/core/end2end/tests/proxy_auth.cc", - "test/core/end2end/tests/registered_call.cc", - "test/core/end2end/tests/request_with_flags.cc", - "test/core/end2end/tests/request_with_payload.cc", - "test/core/end2end/tests/resource_quota_server.cc", - "test/core/end2end/tests/retry.cc", - "test/core/end2end/tests/retry_cancellation.cc", - "test/core/end2end/tests/retry_disabled.cc", - "test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc", - "test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc", - "test/core/end2end/tests/retry_non_retriable_status.cc", - "test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc", - "test/core/end2end/tests/retry_recv_initial_metadata.cc", - "test/core/end2end/tests/retry_recv_message.cc", - "test/core/end2end/tests/retry_server_pushback_delay.cc", - "test/core/end2end/tests/retry_server_pushback_disabled.cc", - "test/core/end2end/tests/retry_streaming.cc", - "test/core/end2end/tests/retry_streaming_after_commit.cc", - "test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc", - "test/core/end2end/tests/retry_throttled.cc", - "test/core/end2end/tests/retry_too_many_attempts.cc", - "test/core/end2end/tests/server_finishes_request.cc", - "test/core/end2end/tests/shutdown_finishes_calls.cc", - "test/core/end2end/tests/shutdown_finishes_tags.cc", - "test/core/end2end/tests/simple_cacheable_request.cc", - "test/core/end2end/tests/simple_delayed_request.cc", - "test/core/end2end/tests/simple_metadata.cc", - "test/core/end2end/tests/simple_request.cc", - "test/core/end2end/tests/stream_compression_compressed_payload.cc", - "test/core/end2end/tests/stream_compression_payload.cc", - "test/core/end2end/tests/stream_compression_ping_pong_streaming.cc", - "test/core/end2end/tests/streaming_error_response.cc", - "test/core/end2end/tests/trailing_metadata.cc", - "test/core/end2end/tests/workaround_cronet_compression.cc", - "test/core/end2end/tests/write_buffering.cc", - "test/core/end2end/tests/write_buffering_at_end.cc" - ], - "third_party": false, - "type": "lib" - }, - { - "deps": [ - "nanopb" - ], - "headers": [ - "src/core/tsi/alts/handshaker/altscontext.pb.h", - "src/core/tsi/alts/handshaker/handshaker.pb.h", - "src/core/tsi/alts/handshaker/transport_security_common.pb.h" - ], - "is_filegroup": true, - "language": "c", - "name": "alts_proto", - "src": [ - "src/core/tsi/alts/handshaker/altscontext.pb.c", - "src/core/tsi/alts/handshaker/altscontext.pb.h", - "src/core/tsi/alts/handshaker/handshaker.pb.c", - "src/core/tsi/alts/handshaker/handshaker.pb.h", - "src/core/tsi/alts/handshaker/transport_security_common.pb.c", - "src/core/tsi/alts/handshaker/transport_security_common.pb.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "alts_util", - "gpr", - "grpc_base", - "grpc_shadow_boringssl", - "grpc_transport_chttp2_client_insecure", - "tsi", - "tsi_interface" - ], - "headers": [ - "src/core/tsi/alts/crypt/gsec.h", - "src/core/tsi/alts/frame_protector/alts_counter.h", - "src/core/tsi/alts/frame_protector/alts_crypter.h", - "src/core/tsi/alts/frame_protector/alts_frame_protector.h", - "src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h", - "src/core/tsi/alts/frame_protector/frame_handler.h", - "src/core/tsi/alts/handshaker/alts_handshaker_client.h", - "src/core/tsi/alts/handshaker/alts_shared_resource.h", - "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h", - "src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h", - "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h", - "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h", - "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h", - "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h", - "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h", - "src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h" - ], - "is_filegroup": true, - "language": "c", - "name": "alts_tsi", - "src": [ - "src/core/tsi/alts/crypt/aes_gcm.cc", - "src/core/tsi/alts/crypt/gsec.cc", - "src/core/tsi/alts/crypt/gsec.h", - "src/core/tsi/alts/frame_protector/alts_counter.cc", - "src/core/tsi/alts/frame_protector/alts_counter.h", - "src/core/tsi/alts/frame_protector/alts_crypter.cc", - "src/core/tsi/alts/frame_protector/alts_crypter.h", - "src/core/tsi/alts/frame_protector/alts_frame_protector.cc", - "src/core/tsi/alts/frame_protector/alts_frame_protector.h", - "src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.cc", - "src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h", - "src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc", - "src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc", - "src/core/tsi/alts/frame_protector/frame_handler.cc", - "src/core/tsi/alts/frame_protector/frame_handler.h", - "src/core/tsi/alts/handshaker/alts_handshaker_client.cc", - "src/core/tsi/alts/handshaker/alts_handshaker_client.h", - "src/core/tsi/alts/handshaker/alts_shared_resource.cc", - "src/core/tsi/alts/handshaker/alts_shared_resource.h", - "src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc", - "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h", - "src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h", - "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc", - "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h", - "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc", - "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h", - "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h", - "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc", - "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h", - "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc", - "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h", - "src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc", - "src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [], - "headers": [ - "src/core/ext/upb-generated/altscontext.upb.h", - "src/core/ext/upb-generated/handshaker.upb.h", - "src/core/ext/upb-generated/transport_security_common.upb.h" - ], - "is_filegroup": true, - "language": "c", - "name": "alts_upb", - "src": [ - "src/core/ext/upb-generated/altscontext.upb.c", - "src/core/ext/upb-generated/altscontext.upb.h", - "src/core/ext/upb-generated/handshaker.upb.c", - "src/core/ext/upb-generated/handshaker.upb.h", - "src/core/ext/upb-generated/transport_security_common.upb.c", - "src/core/ext/upb-generated/transport_security_common.upb.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "alts_proto", - "gpr", - "grpc_base", - "nanopb", - "tsi_interface" - ], - "headers": [ - "include/grpc/grpc_security.h", - "src/core/lib/security/credentials/alts/check_gcp_environment.h", - "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api.h", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h", - "src/core/tsi/alts/handshaker/alts_tsi_utils.h", - "src/core/tsi/alts/handshaker/transport_security_common_api.h" - ], - "is_filegroup": true, - "language": "c", - "name": "alts_util", - "src": [ - "include/grpc/grpc_security.h", - "src/core/lib/security/credentials/alts/check_gcp_environment.cc", - "src/core/lib/security/credentials/alts/check_gcp_environment.h", - "src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc", - "src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc", - "src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc", - "src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc", - "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc", - "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h", - "src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api.h", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc", - "src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h", - "src/core/tsi/alts/handshaker/alts_tsi_utils.cc", - "src/core/tsi/alts/handshaker/alts_tsi_utils.h", - "src/core/tsi/alts/handshaker/transport_security_common_api.cc", - "src/core/tsi/alts/handshaker/transport_security_common_api.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base" - ], - "headers": [ - "include/grpc/census.h" - ], - "is_filegroup": true, - "language": "c", - "name": "census", - "src": [ - "include/grpc/census.h", - "src/core/ext/filters/census/grpc_context.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr_base_headers" - ], - "headers": [ - "test/core/util/cmdline.h" - ], - "is_filegroup": true, - "language": "c", - "name": "cmdline", - "src": [ - "test/core/util/cmdline.cc", - "test/core/util/cmdline.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [], - "headers": [ - "src/core/ext/upb-generated/google/protobuf/any.upb.h", - "src/core/ext/upb-generated/google/protobuf/descriptor.upb.h", - "src/core/ext/upb-generated/google/protobuf/duration.upb.h", - "src/core/ext/upb-generated/google/protobuf/empty.upb.h", - "src/core/ext/upb-generated/google/protobuf/struct.upb.h", - "src/core/ext/upb-generated/google/protobuf/timestamp.upb.h", - "src/core/ext/upb-generated/google/protobuf/wrappers.upb.h" - ], - "is_filegroup": true, - "language": "c", - "name": "google_api_upb", - "src": [ - "src/core/ext/upb-generated/google/protobuf/any.upb.c", - "src/core/ext/upb-generated/google/protobuf/any.upb.h", - "src/core/ext/upb-generated/google/protobuf/descriptor.upb.c", - "src/core/ext/upb-generated/google/protobuf/descriptor.upb.h", - "src/core/ext/upb-generated/google/protobuf/duration.upb.c", - "src/core/ext/upb-generated/google/protobuf/duration.upb.h", - "src/core/ext/upb-generated/google/protobuf/empty.upb.c", - "src/core/ext/upb-generated/google/protobuf/empty.upb.h", - "src/core/ext/upb-generated/google/protobuf/struct.upb.c", - "src/core/ext/upb-generated/google/protobuf/struct.upb.h", - "src/core/ext/upb-generated/google/protobuf/timestamp.upb.c", - "src/core/ext/upb-generated/google/protobuf/timestamp.upb.h", - "src/core/ext/upb-generated/google/protobuf/wrappers.upb.c", - "src/core/ext/upb-generated/google/protobuf/wrappers.upb.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr_base_headers" - ], - "headers": [], - "is_filegroup": true, - "language": "c", - "name": "gpr_base", - "src": [ - "src/core/lib/gpr/alloc.cc", - "src/core/lib/gpr/atm.cc", - "src/core/lib/gpr/cpu_iphone.cc", - "src/core/lib/gpr/cpu_linux.cc", - "src/core/lib/gpr/cpu_posix.cc", - "src/core/lib/gpr/cpu_windows.cc", - "src/core/lib/gpr/env_linux.cc", - "src/core/lib/gpr/env_posix.cc", - "src/core/lib/gpr/env_windows.cc", - "src/core/lib/gpr/log.cc", - "src/core/lib/gpr/log_android.cc", - "src/core/lib/gpr/log_linux.cc", - "src/core/lib/gpr/log_posix.cc", - "src/core/lib/gpr/log_windows.cc", - "src/core/lib/gpr/mpscq.cc", - "src/core/lib/gpr/murmur_hash.cc", - "src/core/lib/gpr/string.cc", - "src/core/lib/gpr/string_posix.cc", - "src/core/lib/gpr/string_util_windows.cc", - "src/core/lib/gpr/string_windows.cc", - "src/core/lib/gpr/sync.cc", - "src/core/lib/gpr/sync_posix.cc", - "src/core/lib/gpr/sync_windows.cc", - "src/core/lib/gpr/time.cc", - "src/core/lib/gpr/time_posix.cc", - "src/core/lib/gpr/time_precise.cc", - "src/core/lib/gpr/time_windows.cc", - "src/core/lib/gpr/tls_pthread.cc", - "src/core/lib/gpr/tmpfile_msys.cc", - "src/core/lib/gpr/tmpfile_posix.cc", - "src/core/lib/gpr/tmpfile_windows.cc", - "src/core/lib/gpr/wrap_memcpy.cc", - "src/core/lib/gprpp/arena.cc", - "src/core/lib/gprpp/fork.cc", - "src/core/lib/gprpp/global_config_env.cc", - "src/core/lib/gprpp/host_port.cc", - "src/core/lib/gprpp/thd_posix.cc", - "src/core/lib/gprpp/thd_windows.cc", - "src/core/lib/profiling/basic_timers.cc", - "src/core/lib/profiling/stap_timers.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr_codegen" - ], - "headers": [ - "include/grpc/support/alloc.h", - "include/grpc/support/atm.h", - "include/grpc/support/atm_gcc_atomic.h", - "include/grpc/support/atm_gcc_sync.h", - "include/grpc/support/atm_windows.h", - "include/grpc/support/cpu.h", - "include/grpc/support/log.h", - "include/grpc/support/log_windows.h", - "include/grpc/support/port_platform.h", - "include/grpc/support/string_util.h", - "include/grpc/support/sync.h", - "include/grpc/support/sync_custom.h", - "include/grpc/support/sync_generic.h", - "include/grpc/support/sync_posix.h", - "include/grpc/support/sync_windows.h", - "include/grpc/support/thd_id.h", - "include/grpc/support/time.h", - "src/core/lib/gpr/alloc.h", - "src/core/lib/gpr/arena.h", - "src/core/lib/gpr/env.h", - "src/core/lib/gpr/mpscq.h", - "src/core/lib/gpr/murmur_hash.h", - "src/core/lib/gpr/spinlock.h", - "src/core/lib/gpr/string.h", - "src/core/lib/gpr/string_windows.h", - "src/core/lib/gpr/time_precise.h", - "src/core/lib/gpr/tls.h", - "src/core/lib/gpr/tls_gcc.h", - "src/core/lib/gpr/tls_msvc.h", - "src/core/lib/gpr/tls_pthread.h", - "src/core/lib/gpr/tmpfile.h", - "src/core/lib/gpr/useful.h", - "src/core/lib/gprpp/abstract.h", - "src/core/lib/gprpp/arena.h", - "src/core/lib/gprpp/atomic.h", - "src/core/lib/gprpp/fork.h", - "src/core/lib/gprpp/global_config.h", - "src/core/lib/gprpp/global_config_custom.h", - "src/core/lib/gprpp/global_config_env.h", - "src/core/lib/gprpp/global_config_generic.h", - "src/core/lib/gprpp/host_port.h", - "src/core/lib/gprpp/manual_constructor.h", - "src/core/lib/gprpp/map.h", - "src/core/lib/gprpp/memory.h", - "src/core/lib/gprpp/pair.h", - "src/core/lib/gprpp/sync.h", - "src/core/lib/gprpp/thd.h", - "src/core/lib/profiling/timers.h" - ], - "is_filegroup": true, - "language": "c", - "name": "gpr_base_headers", - "src": [ - "include/grpc/support/alloc.h", - "include/grpc/support/atm.h", - "include/grpc/support/atm_gcc_atomic.h", - "include/grpc/support/atm_gcc_sync.h", - "include/grpc/support/atm_windows.h", - "include/grpc/support/cpu.h", - "include/grpc/support/log.h", - "include/grpc/support/log_windows.h", - "include/grpc/support/port_platform.h", - "include/grpc/support/string_util.h", - "include/grpc/support/sync.h", - "include/grpc/support/sync_custom.h", - "include/grpc/support/sync_generic.h", - "include/grpc/support/sync_posix.h", - "include/grpc/support/sync_windows.h", - "include/grpc/support/thd_id.h", - "include/grpc/support/time.h", - "src/core/lib/gpr/alloc.h", - "src/core/lib/gpr/arena.h", - "src/core/lib/gpr/env.h", - "src/core/lib/gpr/mpscq.h", - "src/core/lib/gpr/murmur_hash.h", - "src/core/lib/gpr/spinlock.h", - "src/core/lib/gpr/string.h", - "src/core/lib/gpr/string_windows.h", - "src/core/lib/gpr/time_precise.h", - "src/core/lib/gpr/tls.h", - "src/core/lib/gpr/tls_gcc.h", - "src/core/lib/gpr/tls_msvc.h", - "src/core/lib/gpr/tls_pthread.h", - "src/core/lib/gpr/tmpfile.h", - "src/core/lib/gpr/useful.h", - "src/core/lib/gprpp/abstract.h", - "src/core/lib/gprpp/arena.h", - "src/core/lib/gprpp/atomic.h", - "src/core/lib/gprpp/fork.h", - "src/core/lib/gprpp/global_config.h", - "src/core/lib/gprpp/global_config_custom.h", - "src/core/lib/gprpp/global_config_env.h", - "src/core/lib/gprpp/global_config_generic.h", - "src/core/lib/gprpp/host_port.h", - "src/core/lib/gprpp/manual_constructor.h", - "src/core/lib/gprpp/map.h", - "src/core/lib/gprpp/memory.h", - "src/core/lib/gprpp/pair.h", - "src/core/lib/gprpp/sync.h", - "src/core/lib/gprpp/thd.h", - "src/core/lib/profiling/timers.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [], - "headers": [ - "include/grpc/impl/codegen/atm.h", - "include/grpc/impl/codegen/atm_gcc_atomic.h", - "include/grpc/impl/codegen/atm_gcc_sync.h", - "include/grpc/impl/codegen/atm_windows.h", - "include/grpc/impl/codegen/fork.h", - "include/grpc/impl/codegen/gpr_slice.h", - "include/grpc/impl/codegen/gpr_types.h", - "include/grpc/impl/codegen/log.h", - "include/grpc/impl/codegen/port_platform.h", - "include/grpc/impl/codegen/sync.h", - "include/grpc/impl/codegen/sync_custom.h", - "include/grpc/impl/codegen/sync_generic.h", - "include/grpc/impl/codegen/sync_posix.h", - "include/grpc/impl/codegen/sync_windows.h" - ], - "is_filegroup": true, - "language": "c", - "name": "gpr_codegen", - "src": [ - "include/grpc/impl/codegen/atm.h", - "include/grpc/impl/codegen/atm_gcc_atomic.h", - "include/grpc/impl/codegen/atm_gcc_sync.h", - "include/grpc/impl/codegen/atm_windows.h", - "include/grpc/impl/codegen/fork.h", - "include/grpc/impl/codegen/gpr_slice.h", - "include/grpc/impl/codegen/gpr_types.h", - "include/grpc/impl/codegen/log.h", - "include/grpc/impl/codegen/port_platform.h", - "include/grpc/impl/codegen/sync.h", - "include/grpc/impl/codegen/sync_custom.h", - "include/grpc/impl/codegen/sync_generic.h", - "include/grpc/impl/codegen/sync_posix.h", - "include/grpc/impl/codegen/sync_windows.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc", - "grpc++_codegen_base", - "grpc++_common" - ], - "headers": [], - "is_filegroup": true, - "language": "c", - "name": "grpc++_base", - "src": [], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc++_codegen_base", - "grpc++_common", - "grpc_unsecure" - ], - "headers": [ - "include/grpc/grpc_security.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc++_base_unsecure", - "src": [ - "include/grpc/grpc_security.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base_headers", - "grpc_codegen", - "grpc_trace" - ], - "headers": [], - "is_filegroup": true, - "language": "c", - "name": "grpc_base", - "src": [ - "src/core/lib/avl/avl.cc", - "src/core/lib/backoff/backoff.cc", - "src/core/lib/channel/channel_args.cc", - "src/core/lib/channel/channel_stack.cc", - "src/core/lib/channel/channel_stack_builder.cc", - "src/core/lib/channel/channel_trace.cc", - "src/core/lib/channel/channelz.cc", - "src/core/lib/channel/channelz_registry.cc", - "src/core/lib/channel/connected_channel.cc", - "src/core/lib/channel/handshaker.cc", - "src/core/lib/channel/handshaker_registry.cc", - "src/core/lib/channel/status_util.cc", - "src/core/lib/compression/compression.cc", - "src/core/lib/compression/compression_args.cc", - "src/core/lib/compression/compression_internal.cc", - "src/core/lib/compression/message_compress.cc", - "src/core/lib/compression/stream_compression.cc", - "src/core/lib/compression/stream_compression_gzip.cc", - "src/core/lib/compression/stream_compression_identity.cc", - "src/core/lib/debug/stats.cc", - "src/core/lib/debug/stats_data.cc", - "src/core/lib/http/format_request.cc", - "src/core/lib/http/httpcli.cc", - "src/core/lib/http/parser.cc", - "src/core/lib/iomgr/buffer_list.cc", - "src/core/lib/iomgr/call_combiner.cc", - "src/core/lib/iomgr/cfstream_handle.cc", - "src/core/lib/iomgr/combiner.cc", - "src/core/lib/iomgr/endpoint.cc", - "src/core/lib/iomgr/endpoint_cfstream.cc", - "src/core/lib/iomgr/endpoint_pair_posix.cc", - "src/core/lib/iomgr/endpoint_pair_uv.cc", - "src/core/lib/iomgr/endpoint_pair_windows.cc", - "src/core/lib/iomgr/error.cc", - "src/core/lib/iomgr/error_cfstream.cc", - "src/core/lib/iomgr/ev_epoll1_linux.cc", - "src/core/lib/iomgr/ev_epollex_linux.cc", - "src/core/lib/iomgr/ev_poll_posix.cc", - "src/core/lib/iomgr/ev_posix.cc", - "src/core/lib/iomgr/ev_windows.cc", - "src/core/lib/iomgr/exec_ctx.cc", - "src/core/lib/iomgr/executor.cc", - "src/core/lib/iomgr/executor/mpmcqueue.cc", - "src/core/lib/iomgr/executor/threadpool.cc", - "src/core/lib/iomgr/fork_posix.cc", - "src/core/lib/iomgr/fork_windows.cc", - "src/core/lib/iomgr/gethostname_fallback.cc", - "src/core/lib/iomgr/gethostname_host_name_max.cc", - "src/core/lib/iomgr/gethostname_sysconf.cc", - "src/core/lib/iomgr/grpc_if_nametoindex_posix.cc", - "src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc", - "src/core/lib/iomgr/internal_errqueue.cc", - "src/core/lib/iomgr/iocp_windows.cc", - "src/core/lib/iomgr/iomgr.cc", - "src/core/lib/iomgr/iomgr_custom.cc", - "src/core/lib/iomgr/iomgr_internal.cc", - "src/core/lib/iomgr/iomgr_posix.cc", - "src/core/lib/iomgr/iomgr_posix_cfstream.cc", - "src/core/lib/iomgr/iomgr_uv.cc", - "src/core/lib/iomgr/iomgr_windows.cc", - "src/core/lib/iomgr/is_epollexclusive_available.cc", - "src/core/lib/iomgr/load_file.cc", - "src/core/lib/iomgr/lockfree_event.cc", - "src/core/lib/iomgr/polling_entity.cc", - "src/core/lib/iomgr/pollset.cc", - "src/core/lib/iomgr/pollset_custom.cc", - "src/core/lib/iomgr/pollset_set.cc", - "src/core/lib/iomgr/pollset_set_custom.cc", - "src/core/lib/iomgr/pollset_set_windows.cc", - "src/core/lib/iomgr/pollset_uv.cc", - "src/core/lib/iomgr/pollset_windows.cc", - "src/core/lib/iomgr/resolve_address.cc", - "src/core/lib/iomgr/resolve_address_custom.cc", - "src/core/lib/iomgr/resolve_address_posix.cc", - "src/core/lib/iomgr/resolve_address_windows.cc", - "src/core/lib/iomgr/resource_quota.cc", - "src/core/lib/iomgr/sockaddr_utils.cc", - "src/core/lib/iomgr/socket_factory_posix.cc", - "src/core/lib/iomgr/socket_mutator.cc", - "src/core/lib/iomgr/socket_utils_common_posix.cc", - "src/core/lib/iomgr/socket_utils_linux.cc", - "src/core/lib/iomgr/socket_utils_posix.cc", - "src/core/lib/iomgr/socket_utils_uv.cc", - "src/core/lib/iomgr/socket_utils_windows.cc", - "src/core/lib/iomgr/socket_windows.cc", - "src/core/lib/iomgr/tcp_client.cc", - "src/core/lib/iomgr/tcp_client_cfstream.cc", - "src/core/lib/iomgr/tcp_client_custom.cc", - "src/core/lib/iomgr/tcp_client_posix.cc", - "src/core/lib/iomgr/tcp_client_windows.cc", - "src/core/lib/iomgr/tcp_custom.cc", - "src/core/lib/iomgr/tcp_posix.cc", - "src/core/lib/iomgr/tcp_server.cc", - "src/core/lib/iomgr/tcp_server_custom.cc", - "src/core/lib/iomgr/tcp_server_posix.cc", - "src/core/lib/iomgr/tcp_server_utils_posix_common.cc", - "src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc", - "src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc", - "src/core/lib/iomgr/tcp_server_windows.cc", - "src/core/lib/iomgr/tcp_uv.cc", - "src/core/lib/iomgr/tcp_windows.cc", - "src/core/lib/iomgr/time_averaged_stats.cc", - "src/core/lib/iomgr/timer.cc", - "src/core/lib/iomgr/timer_custom.cc", - "src/core/lib/iomgr/timer_generic.cc", - "src/core/lib/iomgr/timer_heap.cc", - "src/core/lib/iomgr/timer_manager.cc", - "src/core/lib/iomgr/timer_uv.cc", - "src/core/lib/iomgr/udp_server.cc", - "src/core/lib/iomgr/unix_sockets_posix.cc", - "src/core/lib/iomgr/unix_sockets_posix_noop.cc", - "src/core/lib/iomgr/wakeup_fd_eventfd.cc", - "src/core/lib/iomgr/wakeup_fd_nospecial.cc", - "src/core/lib/iomgr/wakeup_fd_pipe.cc", - "src/core/lib/iomgr/wakeup_fd_posix.cc", - "src/core/lib/json/json.cc", - "src/core/lib/json/json_reader.cc", - "src/core/lib/json/json_string.cc", - "src/core/lib/json/json_writer.cc", - "src/core/lib/slice/b64.cc", - "src/core/lib/slice/percent_encoding.cc", - "src/core/lib/slice/slice.cc", - "src/core/lib/slice/slice_buffer.cc", - "src/core/lib/slice/slice_intern.cc", - "src/core/lib/slice/slice_string_helpers.cc", - "src/core/lib/surface/api_trace.cc", - "src/core/lib/surface/byte_buffer.cc", - "src/core/lib/surface/byte_buffer_reader.cc", - "src/core/lib/surface/call.cc", - "src/core/lib/surface/call_details.cc", - "src/core/lib/surface/call_log_batch.cc", - "src/core/lib/surface/channel.cc", - "src/core/lib/surface/channel_init.cc", - "src/core/lib/surface/channel_ping.cc", - "src/core/lib/surface/channel_stack_type.cc", - "src/core/lib/surface/completion_queue.cc", - "src/core/lib/surface/completion_queue_factory.cc", - "src/core/lib/surface/event_string.cc", - "src/core/lib/surface/lame_client.cc", - "src/core/lib/surface/metadata_array.cc", - "src/core/lib/surface/server.cc", - "src/core/lib/surface/validate_metadata.cc", - "src/core/lib/surface/version.cc", - "src/core/lib/transport/bdp_estimator.cc", - "src/core/lib/transport/byte_stream.cc", - "src/core/lib/transport/connectivity_state.cc", - "src/core/lib/transport/error_utils.cc", - "src/core/lib/transport/metadata.cc", - "src/core/lib/transport/metadata_batch.cc", - "src/core/lib/transport/pid_controller.cc", - "src/core/lib/transport/static_metadata.cc", - "src/core/lib/transport/status_conversion.cc", - "src/core/lib/transport/status_metadata.cc", - "src/core/lib/transport/timeout_encoding.cc", - "src/core/lib/transport/transport.cc", - "src/core/lib/transport/transport_op_string.cc", - "src/core/lib/uri/uri_parser.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_codegen", - "grpc_trace_headers" - ], - "headers": [ - "include/grpc/byte_buffer.h", - "include/grpc/byte_buffer_reader.h", - "include/grpc/compression.h", - "include/grpc/fork.h", - "include/grpc/grpc.h", - "include/grpc/grpc_posix.h", - "include/grpc/grpc_security_constants.h", - "include/grpc/load_reporting.h", - "include/grpc/slice.h", - "include/grpc/slice_buffer.h", - "include/grpc/status.h", - "include/grpc/support/workaround_list.h", - "src/core/lib/avl/avl.h", - "src/core/lib/backoff/backoff.h", - "src/core/lib/channel/channel_args.h", - "src/core/lib/channel/channel_stack.h", - "src/core/lib/channel/channel_stack_builder.h", - "src/core/lib/channel/channel_trace.h", - "src/core/lib/channel/channelz.h", - "src/core/lib/channel/channelz_registry.h", - "src/core/lib/channel/connected_channel.h", - "src/core/lib/channel/context.h", - "src/core/lib/channel/handshaker.h", - "src/core/lib/channel/handshaker_factory.h", - "src/core/lib/channel/handshaker_registry.h", - "src/core/lib/channel/status_util.h", - "src/core/lib/compression/algorithm_metadata.h", - "src/core/lib/compression/compression_args.h", - "src/core/lib/compression/compression_internal.h", - "src/core/lib/compression/message_compress.h", - "src/core/lib/compression/stream_compression.h", - "src/core/lib/compression/stream_compression_gzip.h", - "src/core/lib/compression/stream_compression_identity.h", - "src/core/lib/debug/stats.h", - "src/core/lib/debug/stats_data.h", - "src/core/lib/gprpp/debug_location.h", - "src/core/lib/gprpp/inlined_vector.h", - "src/core/lib/gprpp/optional.h", - "src/core/lib/gprpp/orphanable.h", - "src/core/lib/gprpp/ref_counted.h", - "src/core/lib/gprpp/ref_counted_ptr.h", - "src/core/lib/gprpp/string_view.h", - "src/core/lib/http/format_request.h", - "src/core/lib/http/httpcli.h", - "src/core/lib/http/parser.h", - "src/core/lib/iomgr/block_annotate.h", - "src/core/lib/iomgr/buffer_list.h", - "src/core/lib/iomgr/call_combiner.h", - "src/core/lib/iomgr/cfstream_handle.h", - "src/core/lib/iomgr/closure.h", - "src/core/lib/iomgr/combiner.h", - "src/core/lib/iomgr/dynamic_annotations.h", - "src/core/lib/iomgr/endpoint.h", - "src/core/lib/iomgr/endpoint_cfstream.h", - "src/core/lib/iomgr/endpoint_pair.h", - "src/core/lib/iomgr/error.h", - "src/core/lib/iomgr/error_cfstream.h", - "src/core/lib/iomgr/error_internal.h", - "src/core/lib/iomgr/ev_epoll1_linux.h", - "src/core/lib/iomgr/ev_epollex_linux.h", - "src/core/lib/iomgr/ev_poll_posix.h", - "src/core/lib/iomgr/ev_posix.h", - "src/core/lib/iomgr/exec_ctx.h", - "src/core/lib/iomgr/executor.h", - "src/core/lib/iomgr/executor/mpmcqueue.h", - "src/core/lib/iomgr/executor/threadpool.h", - "src/core/lib/iomgr/gethostname.h", - "src/core/lib/iomgr/grpc_if_nametoindex.h", - "src/core/lib/iomgr/internal_errqueue.h", - "src/core/lib/iomgr/iocp_windows.h", - "src/core/lib/iomgr/iomgr.h", - "src/core/lib/iomgr/iomgr_custom.h", - "src/core/lib/iomgr/iomgr_internal.h", - "src/core/lib/iomgr/iomgr_posix.h", - "src/core/lib/iomgr/is_epollexclusive_available.h", - "src/core/lib/iomgr/load_file.h", - "src/core/lib/iomgr/lockfree_event.h", - "src/core/lib/iomgr/nameser.h", - "src/core/lib/iomgr/polling_entity.h", - "src/core/lib/iomgr/pollset.h", - "src/core/lib/iomgr/pollset_custom.h", - "src/core/lib/iomgr/pollset_set.h", - "src/core/lib/iomgr/pollset_set_custom.h", - "src/core/lib/iomgr/pollset_set_windows.h", - "src/core/lib/iomgr/pollset_windows.h", - "src/core/lib/iomgr/port.h", - "src/core/lib/iomgr/resolve_address.h", - "src/core/lib/iomgr/resolve_address_custom.h", - "src/core/lib/iomgr/resource_quota.h", - "src/core/lib/iomgr/sockaddr.h", - "src/core/lib/iomgr/sockaddr_custom.h", - "src/core/lib/iomgr/sockaddr_posix.h", - "src/core/lib/iomgr/sockaddr_utils.h", - "src/core/lib/iomgr/sockaddr_windows.h", - "src/core/lib/iomgr/socket_factory_posix.h", - "src/core/lib/iomgr/socket_mutator.h", - "src/core/lib/iomgr/socket_utils.h", - "src/core/lib/iomgr/socket_utils_posix.h", - "src/core/lib/iomgr/socket_windows.h", - "src/core/lib/iomgr/sys_epoll_wrapper.h", - "src/core/lib/iomgr/tcp_client.h", - "src/core/lib/iomgr/tcp_client_posix.h", - "src/core/lib/iomgr/tcp_custom.h", - "src/core/lib/iomgr/tcp_posix.h", - "src/core/lib/iomgr/tcp_server.h", - "src/core/lib/iomgr/tcp_server_utils_posix.h", - "src/core/lib/iomgr/tcp_windows.h", - "src/core/lib/iomgr/time_averaged_stats.h", - "src/core/lib/iomgr/timer.h", - "src/core/lib/iomgr/timer_custom.h", - "src/core/lib/iomgr/timer_heap.h", - "src/core/lib/iomgr/timer_manager.h", - "src/core/lib/iomgr/udp_server.h", - "src/core/lib/iomgr/unix_sockets_posix.h", - "src/core/lib/iomgr/wakeup_fd_pipe.h", - "src/core/lib/iomgr/wakeup_fd_posix.h", - "src/core/lib/json/json.h", - "src/core/lib/json/json_common.h", - "src/core/lib/json/json_reader.h", - "src/core/lib/json/json_writer.h", - "src/core/lib/slice/b64.h", - "src/core/lib/slice/percent_encoding.h", - "src/core/lib/slice/slice_hash_table.h", - "src/core/lib/slice/slice_internal.h", - "src/core/lib/slice/slice_string_helpers.h", - "src/core/lib/slice/slice_utils.h", - "src/core/lib/slice/slice_weak_hash_table.h", - "src/core/lib/surface/api_trace.h", - "src/core/lib/surface/call.h", - "src/core/lib/surface/call_test_only.h", - "src/core/lib/surface/channel.h", - "src/core/lib/surface/channel_init.h", - "src/core/lib/surface/channel_stack_type.h", - "src/core/lib/surface/completion_queue.h", - "src/core/lib/surface/completion_queue_factory.h", - "src/core/lib/surface/event_string.h", - "src/core/lib/surface/init.h", - "src/core/lib/surface/lame_client.h", - "src/core/lib/surface/server.h", - "src/core/lib/surface/validate_metadata.h", - "src/core/lib/transport/bdp_estimator.h", - "src/core/lib/transport/byte_stream.h", - "src/core/lib/transport/connectivity_state.h", - "src/core/lib/transport/error_utils.h", - "src/core/lib/transport/http2_errors.h", - "src/core/lib/transport/metadata.h", - "src/core/lib/transport/metadata_batch.h", - "src/core/lib/transport/pid_controller.h", - "src/core/lib/transport/static_metadata.h", - "src/core/lib/transport/status_conversion.h", - "src/core/lib/transport/status_metadata.h", - "src/core/lib/transport/timeout_encoding.h", - "src/core/lib/transport/transport.h", - "src/core/lib/transport/transport_impl.h", - "src/core/lib/uri/uri_parser.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_base_headers", - "src": [ - "include/grpc/byte_buffer.h", - "include/grpc/byte_buffer_reader.h", - "include/grpc/compression.h", - "include/grpc/fork.h", - "include/grpc/grpc.h", - "include/grpc/grpc_posix.h", - "include/grpc/grpc_security_constants.h", - "include/grpc/load_reporting.h", - "include/grpc/slice.h", - "include/grpc/slice_buffer.h", - "include/grpc/status.h", - "include/grpc/support/workaround_list.h", - "src/core/lib/avl/avl.h", - "src/core/lib/backoff/backoff.h", - "src/core/lib/channel/channel_args.h", - "src/core/lib/channel/channel_stack.h", - "src/core/lib/channel/channel_stack_builder.h", - "src/core/lib/channel/channel_trace.h", - "src/core/lib/channel/channelz.h", - "src/core/lib/channel/channelz_registry.h", - "src/core/lib/channel/connected_channel.h", - "src/core/lib/channel/context.h", - "src/core/lib/channel/handshaker.h", - "src/core/lib/channel/handshaker_factory.h", - "src/core/lib/channel/handshaker_registry.h", - "src/core/lib/channel/status_util.h", - "src/core/lib/compression/algorithm_metadata.h", - "src/core/lib/compression/compression_args.h", - "src/core/lib/compression/compression_internal.h", - "src/core/lib/compression/message_compress.h", - "src/core/lib/compression/stream_compression.h", - "src/core/lib/compression/stream_compression_gzip.h", - "src/core/lib/compression/stream_compression_identity.h", - "src/core/lib/debug/stats.h", - "src/core/lib/debug/stats_data.h", - "src/core/lib/gprpp/debug_location.h", - "src/core/lib/gprpp/inlined_vector.h", - "src/core/lib/gprpp/optional.h", - "src/core/lib/gprpp/orphanable.h", - "src/core/lib/gprpp/ref_counted.h", - "src/core/lib/gprpp/ref_counted_ptr.h", - "src/core/lib/gprpp/string_view.h", - "src/core/lib/http/format_request.h", - "src/core/lib/http/httpcli.h", - "src/core/lib/http/parser.h", - "src/core/lib/iomgr/block_annotate.h", - "src/core/lib/iomgr/buffer_list.h", - "src/core/lib/iomgr/call_combiner.h", - "src/core/lib/iomgr/cfstream_handle.h", - "src/core/lib/iomgr/closure.h", - "src/core/lib/iomgr/combiner.h", - "src/core/lib/iomgr/dynamic_annotations.h", - "src/core/lib/iomgr/endpoint.h", - "src/core/lib/iomgr/endpoint_cfstream.h", - "src/core/lib/iomgr/endpoint_pair.h", - "src/core/lib/iomgr/error.h", - "src/core/lib/iomgr/error_cfstream.h", - "src/core/lib/iomgr/error_internal.h", - "src/core/lib/iomgr/ev_epoll1_linux.h", - "src/core/lib/iomgr/ev_epollex_linux.h", - "src/core/lib/iomgr/ev_poll_posix.h", - "src/core/lib/iomgr/ev_posix.h", - "src/core/lib/iomgr/exec_ctx.h", - "src/core/lib/iomgr/executor.h", - "src/core/lib/iomgr/executor/mpmcqueue.h", - "src/core/lib/iomgr/executor/threadpool.h", - "src/core/lib/iomgr/gethostname.h", - "src/core/lib/iomgr/grpc_if_nametoindex.h", - "src/core/lib/iomgr/internal_errqueue.h", - "src/core/lib/iomgr/iocp_windows.h", - "src/core/lib/iomgr/iomgr.h", - "src/core/lib/iomgr/iomgr_custom.h", - "src/core/lib/iomgr/iomgr_internal.h", - "src/core/lib/iomgr/iomgr_posix.h", - "src/core/lib/iomgr/is_epollexclusive_available.h", - "src/core/lib/iomgr/load_file.h", - "src/core/lib/iomgr/lockfree_event.h", - "src/core/lib/iomgr/nameser.h", - "src/core/lib/iomgr/polling_entity.h", - "src/core/lib/iomgr/pollset.h", - "src/core/lib/iomgr/pollset_custom.h", - "src/core/lib/iomgr/pollset_set.h", - "src/core/lib/iomgr/pollset_set_custom.h", - "src/core/lib/iomgr/pollset_set_windows.h", - "src/core/lib/iomgr/pollset_windows.h", - "src/core/lib/iomgr/port.h", - "src/core/lib/iomgr/resolve_address.h", - "src/core/lib/iomgr/resolve_address_custom.h", - "src/core/lib/iomgr/resource_quota.h", - "src/core/lib/iomgr/sockaddr.h", - "src/core/lib/iomgr/sockaddr_custom.h", - "src/core/lib/iomgr/sockaddr_posix.h", - "src/core/lib/iomgr/sockaddr_utils.h", - "src/core/lib/iomgr/sockaddr_windows.h", - "src/core/lib/iomgr/socket_factory_posix.h", - "src/core/lib/iomgr/socket_mutator.h", - "src/core/lib/iomgr/socket_utils.h", - "src/core/lib/iomgr/socket_utils_posix.h", - "src/core/lib/iomgr/socket_windows.h", - "src/core/lib/iomgr/sys_epoll_wrapper.h", - "src/core/lib/iomgr/tcp_client.h", - "src/core/lib/iomgr/tcp_client_posix.h", - "src/core/lib/iomgr/tcp_custom.h", - "src/core/lib/iomgr/tcp_posix.h", - "src/core/lib/iomgr/tcp_server.h", - "src/core/lib/iomgr/tcp_server_utils_posix.h", - "src/core/lib/iomgr/tcp_windows.h", - "src/core/lib/iomgr/time_averaged_stats.h", - "src/core/lib/iomgr/timer.h", - "src/core/lib/iomgr/timer_custom.h", - "src/core/lib/iomgr/timer_heap.h", - "src/core/lib/iomgr/timer_manager.h", - "src/core/lib/iomgr/udp_server.h", - "src/core/lib/iomgr/unix_sockets_posix.h", - "src/core/lib/iomgr/wakeup_fd_pipe.h", - "src/core/lib/iomgr/wakeup_fd_posix.h", - "src/core/lib/json/json.h", - "src/core/lib/json/json_common.h", - "src/core/lib/json/json_reader.h", - "src/core/lib/json/json_writer.h", - "src/core/lib/slice/b64.h", - "src/core/lib/slice/percent_encoding.h", - "src/core/lib/slice/slice_hash_table.h", - "src/core/lib/slice/slice_internal.h", - "src/core/lib/slice/slice_string_helpers.h", - "src/core/lib/slice/slice_utils.h", - "src/core/lib/slice/slice_weak_hash_table.h", - "src/core/lib/surface/api_trace.h", - "src/core/lib/surface/call.h", - "src/core/lib/surface/call_test_only.h", - "src/core/lib/surface/channel.h", - "src/core/lib/surface/channel_init.h", - "src/core/lib/surface/channel_stack_type.h", - "src/core/lib/surface/completion_queue.h", - "src/core/lib/surface/completion_queue_factory.h", - "src/core/lib/surface/event_string.h", - "src/core/lib/surface/init.h", - "src/core/lib/surface/lame_client.h", - "src/core/lib/surface/server.h", - "src/core/lib/surface/validate_metadata.h", - "src/core/lib/transport/bdp_estimator.h", - "src/core/lib/transport/byte_stream.h", - "src/core/lib/transport/connectivity_state.h", - "src/core/lib/transport/error_utils.h", - "src/core/lib/transport/http2_errors.h", - "src/core/lib/transport/metadata.h", - "src/core/lib/transport/metadata_batch.h", - "src/core/lib/transport/pid_controller.h", - "src/core/lib/transport/static_metadata.h", - "src/core/lib/transport/status_conversion.h", - "src/core/lib/transport/status_metadata.h", - "src/core/lib/transport/timeout_encoding.h", - "src/core/lib/transport/transport.h", - "src/core/lib/transport/transport_impl.h", - "src/core/lib/uri/uri_parser.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base" - ], - "headers": [ - "src/core/ext/filters/http/client_authority_filter.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_client_authority_filter", - "src": [ - "src/core/ext/filters/http/client_authority_filter.cc", - "src/core/ext/filters/http/client_authority_filter.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_deadline_filter", - "health_proto" - ], - "headers": [ - "src/core/ext/filters/client_channel/backup_poller.h", - "src/core/ext/filters/client_channel/client_channel.h", - "src/core/ext/filters/client_channel/client_channel_channelz.h", - "src/core/ext/filters/client_channel/client_channel_factory.h", - "src/core/ext/filters/client_channel/connector.h", - "src/core/ext/filters/client_channel/global_subchannel_pool.h", - "src/core/ext/filters/client_channel/health/health_check_client.h", - "src/core/ext/filters/client_channel/http_connect_handshaker.h", - "src/core/ext/filters/client_channel/http_proxy.h", - "src/core/ext/filters/client_channel/lb_policy.h", - "src/core/ext/filters/client_channel/lb_policy_factory.h", - "src/core/ext/filters/client_channel/lb_policy_registry.h", - "src/core/ext/filters/client_channel/local_subchannel_pool.h", - "src/core/ext/filters/client_channel/parse_address.h", - "src/core/ext/filters/client_channel/proxy_mapper.h", - "src/core/ext/filters/client_channel/proxy_mapper_registry.h", - "src/core/ext/filters/client_channel/resolver.h", - "src/core/ext/filters/client_channel/resolver_factory.h", - "src/core/ext/filters/client_channel/resolver_registry.h", - "src/core/ext/filters/client_channel/resolver_result_parsing.h", - "src/core/ext/filters/client_channel/resolving_lb_policy.h", - "src/core/ext/filters/client_channel/retry_throttle.h", - "src/core/ext/filters/client_channel/server_address.h", - "src/core/ext/filters/client_channel/service_config.h", - "src/core/ext/filters/client_channel/subchannel.h", - "src/core/ext/filters/client_channel/subchannel_interface.h", - "src/core/ext/filters/client_channel/subchannel_pool_interface.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_client_channel", - "src": [ - "src/core/ext/filters/client_channel/backup_poller.cc", - "src/core/ext/filters/client_channel/backup_poller.h", - "src/core/ext/filters/client_channel/channel_connectivity.cc", - "src/core/ext/filters/client_channel/client_channel.cc", - "src/core/ext/filters/client_channel/client_channel.h", - "src/core/ext/filters/client_channel/client_channel_channelz.cc", - "src/core/ext/filters/client_channel/client_channel_channelz.h", - "src/core/ext/filters/client_channel/client_channel_factory.cc", - "src/core/ext/filters/client_channel/client_channel_factory.h", - "src/core/ext/filters/client_channel/client_channel_plugin.cc", - "src/core/ext/filters/client_channel/connector.cc", - "src/core/ext/filters/client_channel/connector.h", - "src/core/ext/filters/client_channel/global_subchannel_pool.cc", - "src/core/ext/filters/client_channel/global_subchannel_pool.h", - "src/core/ext/filters/client_channel/health/health_check_client.cc", - "src/core/ext/filters/client_channel/health/health_check_client.h", - "src/core/ext/filters/client_channel/http_connect_handshaker.cc", - "src/core/ext/filters/client_channel/http_connect_handshaker.h", - "src/core/ext/filters/client_channel/http_proxy.cc", - "src/core/ext/filters/client_channel/http_proxy.h", - "src/core/ext/filters/client_channel/lb_policy.cc", - "src/core/ext/filters/client_channel/lb_policy.h", - "src/core/ext/filters/client_channel/lb_policy_factory.h", - "src/core/ext/filters/client_channel/lb_policy_registry.cc", - "src/core/ext/filters/client_channel/lb_policy_registry.h", - "src/core/ext/filters/client_channel/local_subchannel_pool.cc", - "src/core/ext/filters/client_channel/local_subchannel_pool.h", - "src/core/ext/filters/client_channel/parse_address.cc", - "src/core/ext/filters/client_channel/parse_address.h", - "src/core/ext/filters/client_channel/proxy_mapper.cc", - "src/core/ext/filters/client_channel/proxy_mapper.h", - "src/core/ext/filters/client_channel/proxy_mapper_registry.cc", - "src/core/ext/filters/client_channel/proxy_mapper_registry.h", - "src/core/ext/filters/client_channel/resolver.cc", - "src/core/ext/filters/client_channel/resolver.h", - "src/core/ext/filters/client_channel/resolver_factory.h", - "src/core/ext/filters/client_channel/resolver_registry.cc", - "src/core/ext/filters/client_channel/resolver_registry.h", - "src/core/ext/filters/client_channel/resolver_result_parsing.cc", - "src/core/ext/filters/client_channel/resolver_result_parsing.h", - "src/core/ext/filters/client_channel/resolving_lb_policy.cc", - "src/core/ext/filters/client_channel/resolving_lb_policy.h", - "src/core/ext/filters/client_channel/retry_throttle.cc", - "src/core/ext/filters/client_channel/retry_throttle.h", - "src/core/ext/filters/client_channel/server_address.cc", - "src/core/ext/filters/client_channel/server_address.h", - "src/core/ext/filters/client_channel/service_config.cc", - "src/core/ext/filters/client_channel/service_config.h", - "src/core/ext/filters/client_channel/subchannel.cc", - "src/core/ext/filters/client_channel/subchannel.h", - "src/core/ext/filters/client_channel/subchannel_interface.h", - "src/core/ext/filters/client_channel/subchannel_pool_interface.cc", - "src/core/ext/filters/client_channel/subchannel_pool_interface.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base" - ], - "headers": [], - "is_filegroup": true, - "language": "c", - "name": "grpc_client_idle_filter", - "src": [ - "src/core/ext/filters/client_idle/client_idle_filter.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr_codegen" - ], - "headers": [ - "include/grpc/impl/codegen/byte_buffer.h", - "include/grpc/impl/codegen/byte_buffer_reader.h", - "include/grpc/impl/codegen/compression_types.h", - "include/grpc/impl/codegen/connectivity_state.h", - "include/grpc/impl/codegen/grpc_types.h", - "include/grpc/impl/codegen/propagation_bits.h", - "include/grpc/impl/codegen/slice.h", - "include/grpc/impl/codegen/status.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_codegen", - "src": [ - "include/grpc/impl/codegen/byte_buffer.h", - "include/grpc/impl/codegen/byte_buffer_reader.h", - "include/grpc/impl/codegen/compression_types.h", - "include/grpc/impl/codegen/connectivity_state.h", - "include/grpc/impl/codegen/grpc_types.h", - "include/grpc/impl/codegen/propagation_bits.h", - "include/grpc/impl/codegen/slice.h", - "include/grpc/impl/codegen/status.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base" - ], - "headers": [ - "src/core/ext/filters/deadline/deadline_filter.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_deadline_filter", - "src": [ - "src/core/ext/filters/deadline/deadline_filter.cc", - "src/core/ext/filters/deadline/deadline_filter.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [], - "headers": [ - "src/core/ext/upb-generated/grpc/health/v1/health.upb.c" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_health_upb", - "src": [ - "src/core/ext/upb-generated/grpc/health/v1/health.upb.c", - "src/core/ext/upb-generated/grpc/health/v1/health.upb.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base" - ], - "headers": [ - "src/core/ext/filters/http/client/http_client_filter.h", - "src/core/ext/filters/http/message_compress/message_compress_filter.h", - "src/core/ext/filters/http/server/http_server_filter.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_http_filters", - "src": [ - "src/core/ext/filters/http/client/http_client_filter.cc", - "src/core/ext/filters/http/client/http_client_filter.h", - "src/core/ext/filters/http/http_filters_plugin.cc", - "src/core/ext/filters/http/message_compress/message_compress_filter.cc", - "src/core/ext/filters/http/message_compress/message_compress_filter.h", - "src/core/ext/filters/http/server/http_server_filter.cc", - "src/core/ext/filters/http/server/http_server_filter.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_client_channel", - "grpc_resolver_fake", - "grpclb_proto", - "nanopb" - ], - "headers": [ - "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_lb_policy_grpclb", - "src": [ - "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc", - "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc", - "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_client_channel", - "grpc_resolver_fake", - "grpc_secure", - "grpclb_proto", - "nanopb" - ], - "headers": [ - "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_lb_policy_grpclb_secure", - "src": [ - "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc", - "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc", - "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_client_channel", - "grpc_lb_subchannel_list" - ], - "headers": [], - "is_filegroup": true, - "language": "c", - "name": "grpc_lb_policy_pick_first", - "src": [ - "src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_client_channel", - "grpc_lb_subchannel_list" - ], - "headers": [], - "is_filegroup": true, - "language": "c", - "name": "grpc_lb_policy_round_robin", - "src": [ - "src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_client_channel", - "grpc_resolver_fake", - "grpclb_proto", - "nanopb" - ], - "headers": [ - "src/core/ext/filters/client_channel/lb_policy/xds/xds.h", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_lb_policy_xds", - "src": [ - "src/core/ext/filters/client_channel/lb_policy/xds/xds.cc", - "src/core/ext/filters/client_channel/lb_policy/xds/xds.h", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.cc", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_client_channel", - "grpc_resolver_fake", - "grpc_secure", - "grpclb_proto", - "nanopb" - ], - "headers": [ - "src/core/ext/filters/client_channel/lb_policy/xds/xds.h", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_lb_policy_xds_secure", - "src": [ - "src/core/ext/filters/client_channel/lb_policy/xds/xds.cc", - "src/core/ext/filters/client_channel/lb_policy/xds/xds.h", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc", - "src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_client_channel" - ], - "headers": [ - "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_lb_subchannel_list", - "src": [ - "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "google_api_upb" - ], - "headers": [ - "src/core/ext/upb-generated/grpc/lb/v1/load_balancer.upb.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_lb_upb", - "src": [ - "src/core/ext/upb-generated/grpc/lb/v1/load_balancer.upb.c", - "src/core/ext/upb-generated/grpc/lb/v1/load_balancer.upb.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base" - ], - "headers": [ - "src/core/ext/filters/max_age/max_age_filter.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_max_age_filter", - "src": [ - "src/core/ext/filters/max_age/max_age_filter.cc", - "src/core/ext/filters/max_age/max_age_filter.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base" - ], - "headers": [ - "src/core/ext/filters/message_size/message_size_filter.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_message_size_filter", - "src": [ - "src/core/ext/filters/message_size/message_size_filter.cc", - "src/core/ext/filters/message_size/message_size_filter.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_client_channel", - "grpc_resolver_dns_selection" - ], - "headers": [ - "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h", - "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_resolver_dns_ares", - "src": [ - "src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc", - "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc", - "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h", - "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc", - "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc", - "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc", - "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc", - "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h", - "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc", - "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc", - "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc", - "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_client_channel", - "grpc_resolver_dns_selection" - ], - "headers": [], - "is_filegroup": true, - "language": "c", - "name": "grpc_resolver_dns_native", - "src": [ - "src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base" - ], - "headers": [ - "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_resolver_dns_selection", - "src": [ - "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc", - "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_client_channel" - ], - "headers": [ - "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_resolver_fake", - "src": [ - "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc", - "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_client_channel" - ], - "headers": [], - "is_filegroup": true, - "language": "c", - "name": "grpc_resolver_sockaddr", - "src": [ - "src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "alts_tsi", - "gpr", - "grpc_base", - "grpc_shadow_boringssl", - "grpc_transport_chttp2_alpn", - "tsi" - ], - "headers": [ - "include/grpc/grpc_security.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h", - "src/core/ext/filters/client_channel/lb_policy/xds/xds.h", - "src/core/lib/security/context/security_context.h", - "src/core/lib/security/credentials/alts/alts_credentials.h", - "src/core/lib/security/credentials/composite/composite_credentials.h", - "src/core/lib/security/credentials/credentials.h", - "src/core/lib/security/credentials/fake/fake_credentials.h", - "src/core/lib/security/credentials/google_default/google_default_credentials.h", - "src/core/lib/security/credentials/iam/iam_credentials.h", - "src/core/lib/security/credentials/jwt/json_token.h", - "src/core/lib/security/credentials/jwt/jwt_credentials.h", - "src/core/lib/security/credentials/jwt/jwt_verifier.h", - "src/core/lib/security/credentials/local/local_credentials.h", - "src/core/lib/security/credentials/oauth2/oauth2_credentials.h", - "src/core/lib/security/credentials/plugin/plugin_credentials.h", - "src/core/lib/security/credentials/ssl/ssl_credentials.h", - "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h", - "src/core/lib/security/credentials/tls/spiffe_credentials.h", - "src/core/lib/security/security_connector/alts/alts_security_connector.h", - "src/core/lib/security/security_connector/fake/fake_security_connector.h", - "src/core/lib/security/security_connector/load_system_roots.h", - "src/core/lib/security/security_connector/load_system_roots_linux.h", - "src/core/lib/security/security_connector/local/local_security_connector.h", - "src/core/lib/security/security_connector/security_connector.h", - "src/core/lib/security/security_connector/ssl/ssl_security_connector.h", - "src/core/lib/security/security_connector/ssl_utils.h", - "src/core/lib/security/security_connector/tls/spiffe_security_connector.h", - "src/core/lib/security/transport/auth_filters.h", - "src/core/lib/security/transport/secure_endpoint.h", - "src/core/lib/security/transport/security_handshaker.h", - "src/core/lib/security/transport/target_authority_table.h", - "src/core/lib/security/transport/tsi_error.h", - "src/core/lib/security/util/json_util.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_secure", - "src": [ - "include/grpc/grpc_security.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h", - "src/core/ext/filters/client_channel/lb_policy/xds/xds.h", - "src/core/lib/http/httpcli_security_connector.cc", - "src/core/lib/security/context/security_context.cc", - "src/core/lib/security/context/security_context.h", - "src/core/lib/security/credentials/alts/alts_credentials.cc", - "src/core/lib/security/credentials/alts/alts_credentials.h", - "src/core/lib/security/credentials/composite/composite_credentials.cc", - "src/core/lib/security/credentials/composite/composite_credentials.h", - "src/core/lib/security/credentials/credentials.cc", - "src/core/lib/security/credentials/credentials.h", - "src/core/lib/security/credentials/credentials_metadata.cc", - "src/core/lib/security/credentials/fake/fake_credentials.cc", - "src/core/lib/security/credentials/fake/fake_credentials.h", - "src/core/lib/security/credentials/google_default/credentials_generic.cc", - "src/core/lib/security/credentials/google_default/google_default_credentials.cc", - "src/core/lib/security/credentials/google_default/google_default_credentials.h", - "src/core/lib/security/credentials/iam/iam_credentials.cc", - "src/core/lib/security/credentials/iam/iam_credentials.h", - "src/core/lib/security/credentials/jwt/json_token.cc", - "src/core/lib/security/credentials/jwt/json_token.h", - "src/core/lib/security/credentials/jwt/jwt_credentials.cc", - "src/core/lib/security/credentials/jwt/jwt_credentials.h", - "src/core/lib/security/credentials/jwt/jwt_verifier.cc", - "src/core/lib/security/credentials/jwt/jwt_verifier.h", - "src/core/lib/security/credentials/local/local_credentials.cc", - "src/core/lib/security/credentials/local/local_credentials.h", - "src/core/lib/security/credentials/oauth2/oauth2_credentials.cc", - "src/core/lib/security/credentials/oauth2/oauth2_credentials.h", - "src/core/lib/security/credentials/plugin/plugin_credentials.cc", - "src/core/lib/security/credentials/plugin/plugin_credentials.h", - "src/core/lib/security/credentials/ssl/ssl_credentials.cc", - "src/core/lib/security/credentials/ssl/ssl_credentials.h", - "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc", - "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h", - "src/core/lib/security/credentials/tls/spiffe_credentials.cc", - "src/core/lib/security/credentials/tls/spiffe_credentials.h", - "src/core/lib/security/security_connector/alts/alts_security_connector.cc", - "src/core/lib/security/security_connector/alts/alts_security_connector.h", - "src/core/lib/security/security_connector/fake/fake_security_connector.cc", - "src/core/lib/security/security_connector/fake/fake_security_connector.h", - "src/core/lib/security/security_connector/load_system_roots.h", - "src/core/lib/security/security_connector/load_system_roots_fallback.cc", - "src/core/lib/security/security_connector/load_system_roots_linux.cc", - "src/core/lib/security/security_connector/load_system_roots_linux.h", - "src/core/lib/security/security_connector/local/local_security_connector.cc", - "src/core/lib/security/security_connector/local/local_security_connector.h", - "src/core/lib/security/security_connector/security_connector.cc", - "src/core/lib/security/security_connector/security_connector.h", - "src/core/lib/security/security_connector/ssl/ssl_security_connector.cc", - "src/core/lib/security/security_connector/ssl/ssl_security_connector.h", - "src/core/lib/security/security_connector/ssl_utils.cc", - "src/core/lib/security/security_connector/ssl_utils.h", - "src/core/lib/security/security_connector/tls/spiffe_security_connector.cc", - "src/core/lib/security/security_connector/tls/spiffe_security_connector.h", - "src/core/lib/security/transport/auth_filters.h", - "src/core/lib/security/transport/client_auth_filter.cc", - "src/core/lib/security/transport/secure_endpoint.cc", - "src/core/lib/security/transport/secure_endpoint.h", - "src/core/lib/security/transport/security_handshaker.cc", - "src/core/lib/security/transport/security_handshaker.h", - "src/core/lib/security/transport/server_auth_filter.cc", - "src/core/lib/security/transport/target_authority_table.cc", - "src/core/lib/security/transport/target_authority_table.h", - "src/core/lib/security/transport/tsi_error.cc", - "src/core/lib/security/transport/tsi_error.h", - "src/core/lib/security/util/json_util.cc", - "src/core/lib/security/util/json_util.h", - "src/core/lib/surface/init_secure.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base" - ], - "headers": [ - "src/core/ext/filters/workarounds/workaround_utils.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_server_backward_compatibility", - "src": [ - "src/core/ext/filters/workarounds/workaround_utils.cc", - "src/core/ext/filters/workarounds/workaround_utils.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [], - "headers": [ - "src/core/tsi/grpc_shadow_boringssl.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_shadow_boringssl", - "src": [ - "src/core/tsi/grpc_shadow_boringssl.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "cmdline", - "gpr", - "grpc_base", - "grpc_client_channel", - "grpc_transport_chttp2" - ], - "headers": [ - "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h", - "test/core/end2end/cq_verifier.h", - "test/core/end2end/fixtures/http_proxy_fixture.h", - "test/core/end2end/fixtures/local_util.h", - "test/core/end2end/fixtures/proxy.h", - "test/core/iomgr/endpoint_tests.h", - "test/core/util/debugger_macros.h", - "test/core/util/fuzzer_util.h", - "test/core/util/grpc_profiler.h", - "test/core/util/histogram.h", - "test/core/util/memory_counters.h", - "test/core/util/mock_endpoint.h", - "test/core/util/parse_hexstring.h", - "test/core/util/passthru_endpoint.h", - "test/core/util/port.h", - "test/core/util/port_server_client.h", - "test/core/util/slice_splitter.h", - "test/core/util/subprocess.h", - "test/core/util/test_config.h", - "test/core/util/test_lb_policies.h", - "test/core/util/tracer_util.h", - "test/core/util/trickle_endpoint.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_test_util_base", - "src": [ - "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc", - "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h", - "test/core/end2end/cq_verifier.cc", - "test/core/end2end/cq_verifier.h", - "test/core/end2end/fixtures/http_proxy_fixture.cc", - "test/core/end2end/fixtures/http_proxy_fixture.h", - "test/core/end2end/fixtures/local_util.cc", - "test/core/end2end/fixtures/local_util.h", - "test/core/end2end/fixtures/proxy.cc", - "test/core/end2end/fixtures/proxy.h", - "test/core/iomgr/endpoint_tests.cc", - "test/core/iomgr/endpoint_tests.h", - "test/core/util/debugger_macros.cc", - "test/core/util/debugger_macros.h", - "test/core/util/fuzzer_util.cc", - "test/core/util/fuzzer_util.h", - "test/core/util/grpc_profiler.cc", - "test/core/util/grpc_profiler.h", - "test/core/util/histogram.cc", - "test/core/util/histogram.h", - "test/core/util/memory_counters.cc", - "test/core/util/memory_counters.h", - "test/core/util/mock_endpoint.cc", - "test/core/util/mock_endpoint.h", - "test/core/util/parse_hexstring.cc", - "test/core/util/parse_hexstring.h", - "test/core/util/passthru_endpoint.cc", - "test/core/util/passthru_endpoint.h", - "test/core/util/port.cc", - "test/core/util/port.h", - "test/core/util/port_isolated_runtime_environment.cc", - "test/core/util/port_server_client.cc", - "test/core/util/port_server_client.h", - "test/core/util/slice_splitter.cc", - "test/core/util/slice_splitter.h", - "test/core/util/subprocess.h", - "test/core/util/subprocess_posix.cc", - "test/core/util/subprocess_windows.cc", - "test/core/util/test_config.cc", - "test/core/util/test_config.h", - "test/core/util/test_lb_policies.cc", - "test/core/util/test_lb_policies.h", - "test/core/util/tracer_util.cc", - "test/core/util/tracer_util.h", - "test/core/util/trickle_endpoint.cc", - "test/core/util/trickle_endpoint.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base_headers", - "grpc_trace_headers" - ], - "headers": [], - "is_filegroup": true, - "language": "c", - "name": "grpc_trace", - "src": [ - "src/core/lib/debug/trace.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr" - ], - "headers": [ - "src/core/lib/debug/trace.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_trace_headers", - "src": [ - "src/core/lib/debug/trace.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_http_filters", - "grpc_transport_chttp2_alpn" - ], - "headers": [ - "src/core/ext/transport/chttp2/transport/bin_decoder.h", - "src/core/ext/transport/chttp2/transport/bin_encoder.h", - "src/core/ext/transport/chttp2/transport/chttp2_transport.h", - "src/core/ext/transport/chttp2/transport/context_list.h", - "src/core/ext/transport/chttp2/transport/flow_control.h", - "src/core/ext/transport/chttp2/transport/frame.h", - "src/core/ext/transport/chttp2/transport/frame_data.h", - "src/core/ext/transport/chttp2/transport/frame_goaway.h", - "src/core/ext/transport/chttp2/transport/frame_ping.h", - "src/core/ext/transport/chttp2/transport/frame_rst_stream.h", - "src/core/ext/transport/chttp2/transport/frame_settings.h", - "src/core/ext/transport/chttp2/transport/frame_window_update.h", - "src/core/ext/transport/chttp2/transport/hpack_encoder.h", - "src/core/ext/transport/chttp2/transport/hpack_parser.h", - "src/core/ext/transport/chttp2/transport/hpack_table.h", - "src/core/ext/transport/chttp2/transport/http2_settings.h", - "src/core/ext/transport/chttp2/transport/huffsyms.h", - "src/core/ext/transport/chttp2/transport/incoming_metadata.h", - "src/core/ext/transport/chttp2/transport/internal.h", - "src/core/ext/transport/chttp2/transport/stream_map.h", - "src/core/ext/transport/chttp2/transport/varint.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_transport_chttp2", - "src": [ - "src/core/ext/transport/chttp2/transport/bin_decoder.cc", - "src/core/ext/transport/chttp2/transport/bin_decoder.h", - "src/core/ext/transport/chttp2/transport/bin_encoder.cc", - "src/core/ext/transport/chttp2/transport/bin_encoder.h", - "src/core/ext/transport/chttp2/transport/chttp2_plugin.cc", - "src/core/ext/transport/chttp2/transport/chttp2_transport.cc", - "src/core/ext/transport/chttp2/transport/chttp2_transport.h", - "src/core/ext/transport/chttp2/transport/context_list.cc", - "src/core/ext/transport/chttp2/transport/context_list.h", - "src/core/ext/transport/chttp2/transport/flow_control.cc", - "src/core/ext/transport/chttp2/transport/flow_control.h", - "src/core/ext/transport/chttp2/transport/frame.h", - "src/core/ext/transport/chttp2/transport/frame_data.cc", - "src/core/ext/transport/chttp2/transport/frame_data.h", - "src/core/ext/transport/chttp2/transport/frame_goaway.cc", - "src/core/ext/transport/chttp2/transport/frame_goaway.h", - "src/core/ext/transport/chttp2/transport/frame_ping.cc", - "src/core/ext/transport/chttp2/transport/frame_ping.h", - "src/core/ext/transport/chttp2/transport/frame_rst_stream.cc", - "src/core/ext/transport/chttp2/transport/frame_rst_stream.h", - "src/core/ext/transport/chttp2/transport/frame_settings.cc", - "src/core/ext/transport/chttp2/transport/frame_settings.h", - "src/core/ext/transport/chttp2/transport/frame_window_update.cc", - "src/core/ext/transport/chttp2/transport/frame_window_update.h", - "src/core/ext/transport/chttp2/transport/hpack_encoder.cc", - "src/core/ext/transport/chttp2/transport/hpack_encoder.h", - "src/core/ext/transport/chttp2/transport/hpack_parser.cc", - "src/core/ext/transport/chttp2/transport/hpack_parser.h", - "src/core/ext/transport/chttp2/transport/hpack_table.cc", - "src/core/ext/transport/chttp2/transport/hpack_table.h", - "src/core/ext/transport/chttp2/transport/http2_settings.cc", - "src/core/ext/transport/chttp2/transport/http2_settings.h", - "src/core/ext/transport/chttp2/transport/huffsyms.cc", - "src/core/ext/transport/chttp2/transport/huffsyms.h", - "src/core/ext/transport/chttp2/transport/incoming_metadata.cc", - "src/core/ext/transport/chttp2/transport/incoming_metadata.h", - "src/core/ext/transport/chttp2/transport/internal.h", - "src/core/ext/transport/chttp2/transport/parsing.cc", - "src/core/ext/transport/chttp2/transport/stream_lists.cc", - "src/core/ext/transport/chttp2/transport/stream_map.cc", - "src/core/ext/transport/chttp2/transport/stream_map.h", - "src/core/ext/transport/chttp2/transport/varint.cc", - "src/core/ext/transport/chttp2/transport/varint.h", - "src/core/ext/transport/chttp2/transport/writing.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr" - ], - "headers": [ - "src/core/ext/transport/chttp2/alpn/alpn.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_transport_chttp2_alpn", - "src": [ - "src/core/ext/transport/chttp2/alpn/alpn.cc", - "src/core/ext/transport/chttp2/alpn/alpn.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_client_channel", - "grpc_transport_chttp2" - ], - "headers": [ - "src/core/ext/transport/chttp2/client/authority.h", - "src/core/ext/transport/chttp2/client/chttp2_connector.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_transport_chttp2_client_connector", - "src": [ - "src/core/ext/transport/chttp2/client/authority.cc", - "src/core/ext/transport/chttp2/client/authority.h", - "src/core/ext/transport/chttp2/client/chttp2_connector.cc", - "src/core/ext/transport/chttp2/client/chttp2_connector.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_client_channel", - "grpc_transport_chttp2", - "grpc_transport_chttp2_client_connector" - ], - "headers": [], - "is_filegroup": true, - "language": "c", - "name": "grpc_transport_chttp2_client_insecure", - "src": [ - "src/core/ext/transport/chttp2/client/insecure/channel_create.cc", - "src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_client_channel", - "grpc_secure", - "grpc_transport_chttp2", - "grpc_transport_chttp2_client_connector" - ], - "headers": [], - "is_filegroup": true, - "language": "c", - "name": "grpc_transport_chttp2_client_secure", - "src": [ - "src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_transport_chttp2" - ], - "headers": [ - "src/core/ext/transport/chttp2/server/chttp2_server.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_transport_chttp2_server", - "src": [ - "src/core/ext/transport/chttp2/server/chttp2_server.cc", - "src/core/ext/transport/chttp2/server/chttp2_server.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_transport_chttp2", - "grpc_transport_chttp2_server" - ], - "headers": [], - "is_filegroup": true, - "language": "c", - "name": "grpc_transport_chttp2_server_insecure", - "src": [ - "src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc", - "src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_secure", - "grpc_transport_chttp2", - "grpc_transport_chttp2_server" - ], - "headers": [], - "is_filegroup": true, - "language": "c", - "name": "grpc_transport_chttp2_server_secure", - "src": [ - "src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "grpc_base", - "grpc_http_filters", - "grpc_transport_chttp2" - ], - "headers": [ - "include/grpc/grpc_cronet.h", - "include/grpc/grpc_security.h", - "include/grpc/grpc_security_constants.h", - "src/core/ext/transport/cronet/client/secure/cronet_channel_create.h", - "src/core/ext/transport/cronet/transport/cronet_transport.h", - "third_party/objective_c/Cronet/bidirectional_stream_c.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_transport_cronet_client_secure", - "src": [ - "include/grpc/grpc_cronet.h", - "include/grpc/grpc_security.h", - "include/grpc/grpc_security_constants.h", - "src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc", - "src/core/ext/transport/cronet/client/secure/cronet_channel_create.h", - "src/core/ext/transport/cronet/transport/cronet_api_dummy.cc", - "src/core/ext/transport/cronet/transport/cronet_transport.cc", - "src/core/ext/transport/cronet/transport/cronet_transport.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_transport_inproc_headers" - ], - "headers": [], - "is_filegroup": true, - "language": "c", - "name": "grpc_transport_inproc", - "src": [ - "src/core/ext/transport/inproc/inproc_plugin.cc", - "src/core/ext/transport/inproc/inproc_transport.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base_headers" - ], - "headers": [ - "src/core/ext/transport/inproc/inproc_transport.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_transport_inproc_headers", - "src": [ - "src/core/ext/transport/inproc/inproc_transport.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_server_backward_compatibility" - ], - "headers": [ - "src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpc_workaround_cronet_compression_filter", - "src": [ - "src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc", - "src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "nanopb" - ], - "headers": [ - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h" - ], - "is_filegroup": true, - "language": "c", - "name": "grpclb_proto", - "src": [ - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c", - "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "nanopb" - ], - "headers": [ - "src/core/ext/filters/client_channel/health/health.pb.h" - ], - "is_filegroup": true, - "language": "c", - "name": "health_proto", - "src": [ - "src/core/ext/filters/client_channel/health/health.pb.c", - "src/core/ext/filters/client_channel/health/health.pb.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "nanopb_headers" - ], - "headers": [], - "is_filegroup": true, - "language": "c", - "name": "nanopb", - "src": [], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [], - "headers": [ - "third_party/nanopb/pb.h", - "third_party/nanopb/pb_common.h", - "third_party/nanopb/pb_decode.h", - "third_party/nanopb/pb_encode.h" - ], - "is_filegroup": true, - "language": "c", - "name": "nanopb_headers", - "src": [], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "grpc" - ], - "headers": [ - "test/core/tsi/transport_security_test_lib.h" - ], - "is_filegroup": true, - "language": "c", - "name": "transport_security_test_lib", - "src": [ - "test/core/tsi/transport_security_test_lib.cc", - "test/core/tsi/transport_security_test_lib.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_base", - "grpc_shadow_boringssl", - "grpc_trace", - "tsi_interface" - ], - "headers": [ - "src/core/tsi/fake_transport_security.h", - "src/core/tsi/local_transport_security.h", - "src/core/tsi/ssl/session_cache/ssl_session.h", - "src/core/tsi/ssl/session_cache/ssl_session_cache.h", - "src/core/tsi/ssl_transport_security.h", - "src/core/tsi/ssl_types.h", - "src/core/tsi/transport_security_grpc.h" - ], - "is_filegroup": true, - "language": "c", - "name": "tsi", - "src": [ - "src/core/tsi/fake_transport_security.cc", - "src/core/tsi/fake_transport_security.h", - "src/core/tsi/local_transport_security.cc", - "src/core/tsi/local_transport_security.h", - "src/core/tsi/ssl/session_cache/ssl_session.h", - "src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc", - "src/core/tsi/ssl/session_cache/ssl_session_cache.cc", - "src/core/tsi/ssl/session_cache/ssl_session_cache.h", - "src/core/tsi/ssl/session_cache/ssl_session_openssl.cc", - "src/core/tsi/ssl_transport_security.cc", - "src/core/tsi/ssl_transport_security.h", - "src/core/tsi/ssl_types.h", - "src/core/tsi/transport_security_grpc.cc", - "src/core/tsi/transport_security_grpc.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "grpc_trace" - ], - "headers": [ - "src/core/tsi/transport_security.h", - "src/core/tsi/transport_security_interface.h" - ], - "is_filegroup": true, - "language": "c", - "name": "tsi_interface", - "src": [ - "src/core/tsi/transport_security.cc", - "src/core/tsi/transport_security.h", - "src/core/tsi/transport_security_interface.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "grpc++_internal_hdrs_only", - "grpc_codegen" - ], - "headers": [ - "include/grpc++/impl/codegen/async_stream.h", - "include/grpc++/impl/codegen/async_unary_call.h", - "include/grpc++/impl/codegen/byte_buffer.h", - "include/grpc++/impl/codegen/call.h", - "include/grpc++/impl/codegen/call_hook.h", - "include/grpc++/impl/codegen/channel_interface.h", - "include/grpc++/impl/codegen/client_context.h", - "include/grpc++/impl/codegen/client_unary_call.h", - "include/grpc++/impl/codegen/completion_queue.h", - "include/grpc++/impl/codegen/completion_queue_tag.h", - "include/grpc++/impl/codegen/config.h", - "include/grpc++/impl/codegen/core_codegen_interface.h", - "include/grpc++/impl/codegen/create_auth_context.h", - "include/grpc++/impl/codegen/grpc_library.h", - "include/grpc++/impl/codegen/metadata_map.h", - "include/grpc++/impl/codegen/method_handler_impl.h", - "include/grpc++/impl/codegen/rpc_method.h", - "include/grpc++/impl/codegen/rpc_service_method.h", - "include/grpc++/impl/codegen/security/auth_context.h", - "include/grpc++/impl/codegen/serialization_traits.h", - "include/grpc++/impl/codegen/server_context.h", - "include/grpc++/impl/codegen/server_interface.h", - "include/grpc++/impl/codegen/service_type.h", - "include/grpc++/impl/codegen/slice.h", - "include/grpc++/impl/codegen/status.h", - "include/grpc++/impl/codegen/status_code_enum.h", - "include/grpc++/impl/codegen/string_ref.h", - "include/grpc++/impl/codegen/stub_options.h", - "include/grpc++/impl/codegen/sync_stream.h", - "include/grpc++/impl/codegen/time.h", - "include/grpcpp/impl/codegen/async_generic_service.h", - "include/grpcpp/impl/codegen/async_stream.h", - "include/grpcpp/impl/codegen/async_stream_impl.h", - "include/grpcpp/impl/codegen/async_unary_call.h", - "include/grpcpp/impl/codegen/async_unary_call_impl.h", - "include/grpcpp/impl/codegen/byte_buffer.h", - "include/grpcpp/impl/codegen/call.h", - "include/grpcpp/impl/codegen/call_hook.h", - "include/grpcpp/impl/codegen/call_op_set.h", - "include/grpcpp/impl/codegen/call_op_set_interface.h", - "include/grpcpp/impl/codegen/callback_common.h", - "include/grpcpp/impl/codegen/channel_interface.h", - "include/grpcpp/impl/codegen/client_callback.h", - "include/grpcpp/impl/codegen/client_callback_impl.h", - "include/grpcpp/impl/codegen/client_context.h", - "include/grpcpp/impl/codegen/client_context_impl.h", - "include/grpcpp/impl/codegen/client_interceptor.h", - "include/grpcpp/impl/codegen/client_unary_call.h", - "include/grpcpp/impl/codegen/completion_queue.h", - "include/grpcpp/impl/codegen/completion_queue_impl.h", - "include/grpcpp/impl/codegen/completion_queue_tag.h", - "include/grpcpp/impl/codegen/config.h", - "include/grpcpp/impl/codegen/core_codegen_interface.h", - "include/grpcpp/impl/codegen/create_auth_context.h", - "include/grpcpp/impl/codegen/grpc_library.h", - "include/grpcpp/impl/codegen/intercepted_channel.h", - "include/grpcpp/impl/codegen/interceptor.h", - "include/grpcpp/impl/codegen/interceptor_common.h", - "include/grpcpp/impl/codegen/message_allocator.h", - "include/grpcpp/impl/codegen/metadata_map.h", - "include/grpcpp/impl/codegen/method_handler_impl.h", - "include/grpcpp/impl/codegen/rpc_method.h", - "include/grpcpp/impl/codegen/rpc_service_method.h", - "include/grpcpp/impl/codegen/security/auth_context.h", - "include/grpcpp/impl/codegen/serialization_traits.h", - "include/grpcpp/impl/codegen/server_callback.h", - "include/grpcpp/impl/codegen/server_callback_impl.h", - "include/grpcpp/impl/codegen/server_context.h", - "include/grpcpp/impl/codegen/server_context_impl.h", - "include/grpcpp/impl/codegen/server_interceptor.h", - "include/grpcpp/impl/codegen/server_interface.h", - "include/grpcpp/impl/codegen/service_type.h", - "include/grpcpp/impl/codegen/slice.h", - "include/grpcpp/impl/codegen/status.h", - "include/grpcpp/impl/codegen/status_code_enum.h", - "include/grpcpp/impl/codegen/string_ref.h", - "include/grpcpp/impl/codegen/stub_options.h", - "include/grpcpp/impl/codegen/sync_stream.h", - "include/grpcpp/impl/codegen/sync_stream_impl.h", - "include/grpcpp/impl/codegen/time.h" - ], - "is_filegroup": true, - "language": "c++", - "name": "grpc++_codegen_base", - "src": [ - "include/grpc++/impl/codegen/async_stream.h", - "include/grpc++/impl/codegen/async_unary_call.h", - "include/grpc++/impl/codegen/byte_buffer.h", - "include/grpc++/impl/codegen/call.h", - "include/grpc++/impl/codegen/call_hook.h", - "include/grpc++/impl/codegen/channel_interface.h", - "include/grpc++/impl/codegen/client_context.h", - "include/grpc++/impl/codegen/client_unary_call.h", - "include/grpc++/impl/codegen/completion_queue.h", - "include/grpc++/impl/codegen/completion_queue_tag.h", - "include/grpc++/impl/codegen/config.h", - "include/grpc++/impl/codegen/core_codegen_interface.h", - "include/grpc++/impl/codegen/create_auth_context.h", - "include/grpc++/impl/codegen/grpc_library.h", - "include/grpc++/impl/codegen/metadata_map.h", - "include/grpc++/impl/codegen/method_handler_impl.h", - "include/grpc++/impl/codegen/rpc_method.h", - "include/grpc++/impl/codegen/rpc_service_method.h", - "include/grpc++/impl/codegen/security/auth_context.h", - "include/grpc++/impl/codegen/serialization_traits.h", - "include/grpc++/impl/codegen/server_context.h", - "include/grpc++/impl/codegen/server_interface.h", - "include/grpc++/impl/codegen/service_type.h", - "include/grpc++/impl/codegen/slice.h", - "include/grpc++/impl/codegen/status.h", - "include/grpc++/impl/codegen/status_code_enum.h", - "include/grpc++/impl/codegen/string_ref.h", - "include/grpc++/impl/codegen/stub_options.h", - "include/grpc++/impl/codegen/sync_stream.h", - "include/grpc++/impl/codegen/time.h", - "include/grpcpp/impl/codegen/async_generic_service.h", - "include/grpcpp/impl/codegen/async_stream.h", - "include/grpcpp/impl/codegen/async_stream_impl.h", - "include/grpcpp/impl/codegen/async_unary_call.h", - "include/grpcpp/impl/codegen/async_unary_call_impl.h", - "include/grpcpp/impl/codegen/byte_buffer.h", - "include/grpcpp/impl/codegen/call.h", - "include/grpcpp/impl/codegen/call_hook.h", - "include/grpcpp/impl/codegen/call_op_set.h", - "include/grpcpp/impl/codegen/call_op_set_interface.h", - "include/grpcpp/impl/codegen/callback_common.h", - "include/grpcpp/impl/codegen/channel_interface.h", - "include/grpcpp/impl/codegen/client_callback.h", - "include/grpcpp/impl/codegen/client_callback_impl.h", - "include/grpcpp/impl/codegen/client_context.h", - "include/grpcpp/impl/codegen/client_context_impl.h", - "include/grpcpp/impl/codegen/client_interceptor.h", - "include/grpcpp/impl/codegen/client_unary_call.h", - "include/grpcpp/impl/codegen/completion_queue.h", - "include/grpcpp/impl/codegen/completion_queue_impl.h", - "include/grpcpp/impl/codegen/completion_queue_tag.h", - "include/grpcpp/impl/codegen/config.h", - "include/grpcpp/impl/codegen/core_codegen_interface.h", - "include/grpcpp/impl/codegen/create_auth_context.h", - "include/grpcpp/impl/codegen/grpc_library.h", - "include/grpcpp/impl/codegen/intercepted_channel.h", - "include/grpcpp/impl/codegen/interceptor.h", - "include/grpcpp/impl/codegen/interceptor_common.h", - "include/grpcpp/impl/codegen/message_allocator.h", - "include/grpcpp/impl/codegen/metadata_map.h", - "include/grpcpp/impl/codegen/method_handler_impl.h", - "include/grpcpp/impl/codegen/rpc_method.h", - "include/grpcpp/impl/codegen/rpc_service_method.h", - "include/grpcpp/impl/codegen/security/auth_context.h", - "include/grpcpp/impl/codegen/serialization_traits.h", - "include/grpcpp/impl/codegen/server_callback.h", - "include/grpcpp/impl/codegen/server_callback_impl.h", - "include/grpcpp/impl/codegen/server_context.h", - "include/grpcpp/impl/codegen/server_context_impl.h", - "include/grpcpp/impl/codegen/server_interceptor.h", - "include/grpcpp/impl/codegen/server_interface.h", - "include/grpcpp/impl/codegen/service_type.h", - "include/grpcpp/impl/codegen/slice.h", - "include/grpcpp/impl/codegen/status.h", - "include/grpcpp/impl/codegen/status_code_enum.h", - "include/grpcpp/impl/codegen/string_ref.h", - "include/grpcpp/impl/codegen/stub_options.h", - "include/grpcpp/impl/codegen/sync_stream.h", - "include/grpcpp/impl/codegen/sync_stream_impl.h", - "include/grpcpp/impl/codegen/time.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "grpc++_codegen_base" - ], - "headers": [], - "is_filegroup": true, - "language": "c++", - "name": "grpc++_codegen_base_src", - "src": [ - "src/cpp/codegen/codegen_init.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "grpc++_codegen_base", - "grpc++_config_proto" - ], - "headers": [ - "include/grpc++/impl/codegen/proto_utils.h", - "include/grpcpp/impl/codegen/proto_buffer_reader.h", - "include/grpcpp/impl/codegen/proto_buffer_writer.h", - "include/grpcpp/impl/codegen/proto_utils.h" - ], - "is_filegroup": true, - "language": "c++", - "name": "grpc++_codegen_proto", - "src": [ - "include/grpc++/impl/codegen/proto_utils.h", - "include/grpcpp/impl/codegen/proto_buffer_reader.h", - "include/grpcpp/impl/codegen/proto_buffer_writer.h", - "include/grpcpp/impl/codegen/proto_utils.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "gpr", - "gpr_base_headers", - "grpc++_codegen_base", - "grpc++_internal_hdrs_only", - "grpc_base_headers", - "grpc_transport_inproc_headers", - "health_proto", - "nanopb_headers" - ], - "headers": [ - "include/grpc++/alarm.h", - "include/grpc++/channel.h", - "include/grpc++/client_context.h", - "include/grpc++/completion_queue.h", - "include/grpc++/create_channel.h", - "include/grpc++/create_channel_posix.h", - "include/grpc++/ext/health_check_service_server_builder_option.h", - "include/grpc++/generic/async_generic_service.h", - "include/grpc++/generic/generic_stub.h", - "include/grpc++/grpc++.h", - "include/grpc++/health_check_service_interface.h", - "include/grpc++/impl/call.h", - "include/grpc++/impl/channel_argument_option.h", - "include/grpc++/impl/client_unary_call.h", - "include/grpc++/impl/codegen/core_codegen.h", - "include/grpc++/impl/grpc_library.h", - "include/grpc++/impl/method_handler_impl.h", - "include/grpc++/impl/rpc_method.h", - "include/grpc++/impl/rpc_service_method.h", - "include/grpc++/impl/serialization_traits.h", - "include/grpc++/impl/server_builder_option.h", - "include/grpc++/impl/server_builder_plugin.h", - "include/grpc++/impl/server_initializer.h", - "include/grpc++/impl/service_type.h", - "include/grpc++/resource_quota.h", - "include/grpc++/security/auth_context.h", - "include/grpc++/security/auth_metadata_processor.h", - "include/grpc++/security/credentials.h", - "include/grpc++/security/server_credentials.h", - "include/grpc++/server.h", - "include/grpc++/server_builder.h", - "include/grpc++/server_context.h", - "include/grpc++/server_posix.h", - "include/grpc++/support/async_stream.h", - "include/grpc++/support/async_unary_call.h", - "include/grpc++/support/byte_buffer.h", - "include/grpc++/support/channel_arguments.h", - "include/grpc++/support/config.h", - "include/grpc++/support/slice.h", - "include/grpc++/support/status.h", - "include/grpc++/support/status_code_enum.h", - "include/grpc++/support/string_ref.h", - "include/grpc++/support/stub_options.h", - "include/grpc++/support/sync_stream.h", - "include/grpc++/support/time.h", - "include/grpcpp/alarm.h", - "include/grpcpp/alarm_impl.h", - "include/grpcpp/channel.h", - "include/grpcpp/channel_impl.h", - "include/grpcpp/client_context.h", - "include/grpcpp/completion_queue.h", - "include/grpcpp/completion_queue_impl.h", - "include/grpcpp/create_channel.h", - "include/grpcpp/create_channel_impl.h", - "include/grpcpp/create_channel_posix.h", - "include/grpcpp/create_channel_posix_impl.h", - "include/grpcpp/ext/health_check_service_server_builder_option.h", - "include/grpcpp/generic/async_generic_service.h", - "include/grpcpp/generic/generic_stub.h", - "include/grpcpp/generic/generic_stub_impl.h", - "include/grpcpp/grpcpp.h", - "include/grpcpp/health_check_service_interface.h", - "include/grpcpp/health_check_service_interface_impl.h", - "include/grpcpp/impl/call.h", - "include/grpcpp/impl/channel_argument_option.h", - "include/grpcpp/impl/client_unary_call.h", - "include/grpcpp/impl/codegen/core_codegen.h", - "include/grpcpp/impl/grpc_library.h", - "include/grpcpp/impl/method_handler_impl.h", - "include/grpcpp/impl/rpc_method.h", - "include/grpcpp/impl/rpc_service_method.h", - "include/grpcpp/impl/serialization_traits.h", - "include/grpcpp/impl/server_builder_option.h", - "include/grpcpp/impl/server_builder_option_impl.h", - "include/grpcpp/impl/server_builder_plugin.h", - "include/grpcpp/impl/server_initializer.h", - "include/grpcpp/impl/server_initializer_impl.h", - "include/grpcpp/impl/service_type.h", - "include/grpcpp/resource_quota.h", - "include/grpcpp/resource_quota_impl.h", - "include/grpcpp/security/auth_context.h", - "include/grpcpp/security/auth_metadata_processor.h", - "include/grpcpp/security/auth_metadata_processor_impl.h", - "include/grpcpp/security/credentials.h", - "include/grpcpp/security/credentials_impl.h", - "include/grpcpp/security/server_credentials.h", - "include/grpcpp/security/server_credentials_impl.h", - "include/grpcpp/security/tls_credentials_options.h", - "include/grpcpp/server.h", - "include/grpcpp/server_builder.h", - "include/grpcpp/server_builder_impl.h", - "include/grpcpp/server_context.h", - "include/grpcpp/server_impl.h", - "include/grpcpp/server_posix.h", - "include/grpcpp/server_posix_impl.h", - "include/grpcpp/support/async_stream.h", - "include/grpcpp/support/async_stream_impl.h", - "include/grpcpp/support/async_unary_call.h", - "include/grpcpp/support/async_unary_call_impl.h", - "include/grpcpp/support/byte_buffer.h", - "include/grpcpp/support/channel_arguments.h", - "include/grpcpp/support/channel_arguments_impl.h", - "include/grpcpp/support/client_callback.h", - "include/grpcpp/support/client_callback_impl.h", - "include/grpcpp/support/client_interceptor.h", - "include/grpcpp/support/config.h", - "include/grpcpp/support/interceptor.h", - "include/grpcpp/support/message_allocator.h", - "include/grpcpp/support/proto_buffer_reader.h", - "include/grpcpp/support/proto_buffer_writer.h", - "include/grpcpp/support/server_callback.h", - "include/grpcpp/support/server_callback_impl.h", - "include/grpcpp/support/server_interceptor.h", - "include/grpcpp/support/slice.h", - "include/grpcpp/support/status.h", - "include/grpcpp/support/status_code_enum.h", - "include/grpcpp/support/string_ref.h", - "include/grpcpp/support/stub_options.h", - "include/grpcpp/support/sync_stream.h", - "include/grpcpp/support/sync_stream_impl.h", - "include/grpcpp/support/time.h", - "include/grpcpp/support/validate_service_config.h", - "src/cpp/client/create_channel_internal.h", - "src/cpp/common/channel_filter.h", - "src/cpp/server/dynamic_thread_pool.h", - "src/cpp/server/external_connection_acceptor_impl.h", - "src/cpp/server/health/default_health_check_service.h", - "src/cpp/server/thread_pool_interface.h", - "src/cpp/thread_manager/thread_manager.h" - ], - "is_filegroup": true, - "language": "c++", - "name": "grpc++_common", - "src": [ - "include/grpc++/alarm.h", - "include/grpc++/channel.h", - "include/grpc++/client_context.h", - "include/grpc++/completion_queue.h", - "include/grpc++/create_channel.h", - "include/grpc++/create_channel_posix.h", - "include/grpc++/ext/health_check_service_server_builder_option.h", - "include/grpc++/generic/async_generic_service.h", - "include/grpc++/generic/generic_stub.h", - "include/grpc++/grpc++.h", - "include/grpc++/health_check_service_interface.h", - "include/grpc++/impl/call.h", - "include/grpc++/impl/channel_argument_option.h", - "include/grpc++/impl/client_unary_call.h", - "include/grpc++/impl/codegen/core_codegen.h", - "include/grpc++/impl/grpc_library.h", - "include/grpc++/impl/method_handler_impl.h", - "include/grpc++/impl/rpc_method.h", - "include/grpc++/impl/rpc_service_method.h", - "include/grpc++/impl/serialization_traits.h", - "include/grpc++/impl/server_builder_option.h", - "include/grpc++/impl/server_builder_plugin.h", - "include/grpc++/impl/server_initializer.h", - "include/grpc++/impl/service_type.h", - "include/grpc++/resource_quota.h", - "include/grpc++/security/auth_context.h", - "include/grpc++/security/auth_metadata_processor.h", - "include/grpc++/security/credentials.h", - "include/grpc++/security/server_credentials.h", - "include/grpc++/server.h", - "include/grpc++/server_builder.h", - "include/grpc++/server_context.h", - "include/grpc++/server_posix.h", - "include/grpc++/support/async_stream.h", - "include/grpc++/support/async_unary_call.h", - "include/grpc++/support/byte_buffer.h", - "include/grpc++/support/channel_arguments.h", - "include/grpc++/support/config.h", - "include/grpc++/support/slice.h", - "include/grpc++/support/status.h", - "include/grpc++/support/status_code_enum.h", - "include/grpc++/support/string_ref.h", - "include/grpc++/support/stub_options.h", - "include/grpc++/support/sync_stream.h", - "include/grpc++/support/time.h", - "include/grpcpp/alarm.h", - "include/grpcpp/alarm_impl.h", - "include/grpcpp/channel.h", - "include/grpcpp/channel_impl.h", - "include/grpcpp/client_context.h", - "include/grpcpp/completion_queue.h", - "include/grpcpp/completion_queue_impl.h", - "include/grpcpp/create_channel.h", - "include/grpcpp/create_channel_impl.h", - "include/grpcpp/create_channel_posix.h", - "include/grpcpp/create_channel_posix_impl.h", - "include/grpcpp/ext/health_check_service_server_builder_option.h", - "include/grpcpp/generic/async_generic_service.h", - "include/grpcpp/generic/generic_stub.h", - "include/grpcpp/generic/generic_stub_impl.h", - "include/grpcpp/grpcpp.h", - "include/grpcpp/health_check_service_interface.h", - "include/grpcpp/health_check_service_interface_impl.h", - "include/grpcpp/impl/call.h", - "include/grpcpp/impl/channel_argument_option.h", - "include/grpcpp/impl/client_unary_call.h", - "include/grpcpp/impl/codegen/core_codegen.h", - "include/grpcpp/impl/grpc_library.h", - "include/grpcpp/impl/method_handler_impl.h", - "include/grpcpp/impl/rpc_method.h", - "include/grpcpp/impl/rpc_service_method.h", - "include/grpcpp/impl/serialization_traits.h", - "include/grpcpp/impl/server_builder_option.h", - "include/grpcpp/impl/server_builder_option_impl.h", - "include/grpcpp/impl/server_builder_plugin.h", - "include/grpcpp/impl/server_initializer.h", - "include/grpcpp/impl/server_initializer_impl.h", - "include/grpcpp/impl/service_type.h", - "include/grpcpp/resource_quota.h", - "include/grpcpp/resource_quota_impl.h", - "include/grpcpp/security/auth_context.h", - "include/grpcpp/security/auth_metadata_processor.h", - "include/grpcpp/security/auth_metadata_processor_impl.h", - "include/grpcpp/security/credentials.h", - "include/grpcpp/security/credentials_impl.h", - "include/grpcpp/security/server_credentials.h", - "include/grpcpp/security/server_credentials_impl.h", - "include/grpcpp/security/tls_credentials_options.h", - "include/grpcpp/server.h", - "include/grpcpp/server_builder.h", - "include/grpcpp/server_builder_impl.h", - "include/grpcpp/server_context.h", - "include/grpcpp/server_impl.h", - "include/grpcpp/server_posix.h", - "include/grpcpp/server_posix_impl.h", - "include/grpcpp/support/async_stream.h", - "include/grpcpp/support/async_stream_impl.h", - "include/grpcpp/support/async_unary_call.h", - "include/grpcpp/support/async_unary_call_impl.h", - "include/grpcpp/support/byte_buffer.h", - "include/grpcpp/support/channel_arguments.h", - "include/grpcpp/support/channel_arguments_impl.h", - "include/grpcpp/support/client_callback.h", - "include/grpcpp/support/client_callback_impl.h", - "include/grpcpp/support/client_interceptor.h", - "include/grpcpp/support/config.h", - "include/grpcpp/support/interceptor.h", - "include/grpcpp/support/message_allocator.h", - "include/grpcpp/support/proto_buffer_reader.h", - "include/grpcpp/support/proto_buffer_writer.h", - "include/grpcpp/support/server_callback.h", - "include/grpcpp/support/server_callback_impl.h", - "include/grpcpp/support/server_interceptor.h", - "include/grpcpp/support/slice.h", - "include/grpcpp/support/status.h", - "include/grpcpp/support/status_code_enum.h", - "include/grpcpp/support/string_ref.h", - "include/grpcpp/support/stub_options.h", - "include/grpcpp/support/sync_stream.h", - "include/grpcpp/support/sync_stream_impl.h", - "include/grpcpp/support/time.h", - "include/grpcpp/support/validate_service_config.h", - "src/cpp/client/channel_cc.cc", - "src/cpp/client/client_context.cc", - "src/cpp/client/client_interceptor.cc", - "src/cpp/client/create_channel.cc", - "src/cpp/client/create_channel_internal.cc", - "src/cpp/client/create_channel_internal.h", - "src/cpp/client/create_channel_posix.cc", - "src/cpp/client/credentials_cc.cc", - "src/cpp/client/generic_stub.cc", - "src/cpp/common/alarm.cc", - "src/cpp/common/channel_arguments.cc", - "src/cpp/common/channel_filter.cc", - "src/cpp/common/channel_filter.h", - "src/cpp/common/completion_queue_cc.cc", - "src/cpp/common/core_codegen.cc", - "src/cpp/common/resource_quota_cc.cc", - "src/cpp/common/rpc_method.cc", - "src/cpp/common/validate_service_config.cc", - "src/cpp/common/version_cc.cc", - "src/cpp/server/async_generic_service.cc", - "src/cpp/server/channel_argument_option.cc", - "src/cpp/server/create_default_thread_pool.cc", - "src/cpp/server/dynamic_thread_pool.cc", - "src/cpp/server/dynamic_thread_pool.h", - "src/cpp/server/external_connection_acceptor_impl.cc", - "src/cpp/server/external_connection_acceptor_impl.h", - "src/cpp/server/health/default_health_check_service.cc", - "src/cpp/server/health/default_health_check_service.h", - "src/cpp/server/health/health_check_service.cc", - "src/cpp/server/health/health_check_service_server_builder_option.cc", - "src/cpp/server/server_builder.cc", - "src/cpp/server/server_cc.cc", - "src/cpp/server/server_context.cc", - "src/cpp/server/server_credentials.cc", - "src/cpp/server/server_posix.cc", - "src/cpp/server/thread_pool_interface.h", - "src/cpp/thread_manager/thread_manager.cc", - "src/cpp/thread_manager/thread_manager.h", - "src/cpp/util/byte_buffer_cc.cc", - "src/cpp/util/status.cc", - "src/cpp/util/string_ref.cc", - "src/cpp/util/time_cc.cc" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [], - "headers": [ - "include/grpc++/impl/codegen/config_protobuf.h", - "include/grpcpp/impl/codegen/config_protobuf.h" - ], - "is_filegroup": true, - "language": "c++", - "name": "grpc++_config_proto", - "src": [ - "include/grpc++/impl/codegen/config_protobuf.h", - "include/grpcpp/impl/codegen/config_protobuf.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [], - "headers": [ - "include/grpcpp/impl/codegen/sync.h" - ], - "is_filegroup": true, - "language": "c++", - "name": "grpc++_internal_hdrs_only", - "src": [ - "include/grpcpp/impl/codegen/sync.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [], - "headers": [ - "src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h", - "src/proto/grpc/reflection/v1alpha/reflection.pb.h", - "src/proto/grpc/reflection/v1alpha/reflection_mock.grpc.pb.h" - ], - "is_filegroup": true, - "language": "c++", - "name": "grpc++_reflection_proto", - "src": [], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [ - "grpc", - "grpc++" - ], - "headers": [ - "include/grpc++/test/mock_stream.h", - "include/grpc++/test/server_context_test_spouse.h", - "include/grpcpp/test/mock_stream.h", - "include/grpcpp/test/server_context_test_spouse.h" - ], - "is_filegroup": true, - "language": "c++", - "name": "grpc++_test", - "src": [ - "include/grpc++/test/mock_stream.h", - "include/grpc++/test/server_context_test_spouse.h", - "include/grpcpp/test/mock_stream.h", - "include/grpcpp/test/server_context_test_spouse.h" - ], - "third_party": false, - "type": "filegroup" - }, - { - "deps": [], - "headers": [ - "src/proto/grpc/channelz/channelz.grpc.pb.h", - "src/proto/grpc/channelz/channelz.pb.h", - "src/proto/grpc/channelz/channelz_mock.grpc.pb.h" - ], - "is_filegroup": true, - "language": "c++", - "name": "grpcpp_channelz_proto", - "src": [], - "third_party": false, - "type": "filegroup" - } -] diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index f6aac1d8cd0..6dd3f1422e5 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -3251,30 +3251,6 @@ ], "uses_polling": true }, - { - "args": [], - "benchmark": false, - "ci_platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "exclude_iomgrs": [], - "flaky": false, - "gtest": false, - "language": "c++", - "name": "alts_handshaker_service_api_test", - "platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "uses_polling": true - }, { "args": [], "benchmark": false, @@ -3927,6 +3903,28 @@ ], "uses_polling": true }, + { + "args": [], + "benchmark": true, + "ci_platforms": [ + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": false, + "language": "c++", + "name": "bm_threadpool", + "platforms": [ + "linux", + "mac", + "posix" + ], + "uses_polling": false + }, { "args": [], "benchmark": true, @@ -4523,6 +4521,30 @@ ], "uses_polling": false }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "delegating_channel_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": true + }, { "args": [], "benchmark": false, @@ -4789,6 +4811,30 @@ ], "uses_polling": true }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "grpc_spiffe_security_connector_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": true + }, { "args": [], "benchmark": false, diff --git a/tools/run_tests/helper_scripts/run_ruby_end2end_tests.sh b/tools/run_tests/helper_scripts/run_ruby_end2end_tests.sh index 1c48ed20ba6..fc0759fc836 100755 --- a/tools/run_tests/helper_scripts/run_ruby_end2end_tests.sh +++ b/tools/run_tests/helper_scripts/run_ruby_end2end_tests.sh @@ -32,4 +32,7 @@ time ruby src/ruby/end2end/client_memory_usage_driver.rb || EXIT_CODE=1 time ruby src/ruby/end2end/package_with_underscore_checker.rb || EXIT_CODE=1 time ruby src/ruby/end2end/graceful_sig_handling_driver.rb || EXIT_CODE=1 time ruby src/ruby/end2end/graceful_sig_stop_driver.rb || EXIT_CODE=1 +time ruby src/ruby/end2end/errors_load_before_grpc_lib.rb || EXIT_CODE=1 +time ruby src/ruby/end2end/logger_load_before_grpc_lib.rb || EXIT_CODE=1 +time ruby src/ruby/end2end/status_codes_load_before_grpc_lib.rb || EXIT_CODE=1 exit $EXIT_CODE diff --git a/tools/run_tests/performance/process_local_perf_flamegraphs.sh b/tools/run_tests/performance/process_local_perf_flamegraphs.sh index ccb5b19f2a8..b7b05fde3d9 100755 --- a/tools/run_tests/performance/process_local_perf_flamegraphs.sh +++ b/tools/run_tests/performance/process_local_perf_flamegraphs.sh @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -ex + mkdir -p "$OUTPUT_DIR" PERF_DATA_FILE="${PERF_BASE_NAME}-perf.data" @@ -22,4 +24,5 @@ PERF_SCRIPT_OUTPUT="${PERF_BASE_NAME}-out.perf" echo "running perf script on $PERF_DATA_FILE" perf script -i "$PERF_DATA_FILE" > "$PERF_SCRIPT_OUTPUT" +# use https://github.com/brendangregg/FlameGraph ~/FlameGraph/stackcollapse-perf.pl "$PERF_SCRIPT_OUTPUT" | ~/FlameGraph/flamegraph.pl > "${OUTPUT_DIR}/${OUTPUT_FILENAME}.svg" diff --git a/tools/run_tests/performance/process_remote_perf_flamegraphs.sh b/tools/run_tests/performance/process_remote_perf_flamegraphs.sh index 2ea6b4f2a6c..6e42564d5f4 100755 --- a/tools/run_tests/performance/process_remote_perf_flamegraphs.sh +++ b/tools/run_tests/performance/process_remote_perf_flamegraphs.sh @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +set -ex + mkdir -p "$OUTPUT_DIR" PERF_DATA_FILE="${PERF_BASE_NAME}-perf.data" @@ -27,4 +29,5 @@ scp "$USER_AT_HOST:~/performance_workspace/grpc/$PERF_SCRIPT_OUTPUT.gz" . gzip -d -f "$PERF_SCRIPT_OUTPUT.gz" +# use https://github.com/brendangregg/FlameGraph ~/FlameGraph/stackcollapse-perf.pl --kernel "$PERF_SCRIPT_OUTPUT" | ~/FlameGraph/flamegraph.pl --color=java --hash > "${OUTPUT_DIR}/${OUTPUT_FILENAME}.svg" diff --git a/tools/run_tests/run_performance_tests.py b/tools/run_tests/run_performance_tests.py index c6e67eaf563..4ecd6d6efd1 100755 --- a/tools/run_tests/run_performance_tests.py +++ b/tools/run_tests/run_performance_tests.py @@ -328,10 +328,10 @@ def perf_report_processor_job(worker_host, perf_base_name, output_filename, cmd = '' if worker_host != 'localhost': user_at_host = "%s@%s" % (_REMOTE_HOST_USERNAME, worker_host) - cmd = "USER_AT_HOST=%s OUTPUT_FILENAME=%s OUTPUT_DIR=%s PERF_BASE_NAME=%stools/run_tests/performance/process_remote_perf_flamegraphs.sh" % ( + cmd = "USER_AT_HOST=%s OUTPUT_FILENAME=%s OUTPUT_DIR=%s PERF_BASE_NAME=%s tools/run_tests/performance/process_remote_perf_flamegraphs.sh" % ( user_at_host, output_filename, flame_graph_reports, perf_base_name) else: - cmd = "OUTPUT_FILENAME=%s OUTPUT_DIR=%s PERF_BASE_NAME=%stools/run_tests/performance/process_local_perf_flamegraphs.sh" % ( + cmd = "OUTPUT_FILENAME=%s OUTPUT_DIR=%s PERF_BASE_NAME=%s tools/run_tests/performance/process_local_perf_flamegraphs.sh" % ( output_filename, flame_graph_reports, perf_base_name) return jobset.JobSpec( @@ -484,7 +484,7 @@ def run_collect_perf_profile_jobs(hosts_and_base_names, scenario_name, failures, _ = jobset.run( perf_report_jobs, newline_on_success=True, maxjobs=1) jobset.message( - 'END', 'Collecting perf reports from qps workers', do_newline=True) + 'SUCCESS', 'Collecting perf reports from qps workers', do_newline=True) return failures diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index f11927bd5d6..1ff37ca85af 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -1060,18 +1060,20 @@ class ObjCLanguage(object): out = [] out.append( self.config.job_spec( - ['src/objective-c/tests/build_one_example.sh'], + ['src/objective-c/tests/build_one_example_bazel.sh'], timeout_seconds=10 * 60, shortname='ios-buildtest-example-sample', cpu_cost=1e6, environ={ 'SCHEME': 'Sample', - 'EXAMPLE_PATH': 'src/objective-c/examples/Sample' + 'EXAMPLE_PATH': 'src/objective-c/examples/Sample', + 'FRAMEWORKS': 'NO' })) + # Currently not supporting compiling as frameworks in Bazel out.append( self.config.job_spec( ['src/objective-c/tests/build_one_example.sh'], - timeout_seconds=10 * 60, + timeout_seconds=20 * 60, shortname='ios-buildtest-example-sample-frameworks', cpu_cost=1e6, environ={ @@ -1082,13 +1084,35 @@ class ObjCLanguage(object): out.append( self.config.job_spec( ['src/objective-c/tests/build_one_example.sh'], - timeout_seconds=10 * 60, + timeout_seconds=20 * 60, shortname='ios-buildtest-example-switftsample', cpu_cost=1e6, environ={ 'SCHEME': 'SwiftSample', 'EXAMPLE_PATH': 'src/objective-c/examples/SwiftSample' })) + out.append( + self.config.job_spec( + ['src/objective-c/tests/build_one_example_bazel.sh'], + timeout_seconds=10 * 60, + shortname='ios-buildtest-example-tvOS-sample', + cpu_cost=1e6, + environ={ + 'SCHEME': 'tvOS-sample', + 'EXAMPLE_PATH': 'src/objective-c/examples/tvOS-sample', + 'FRAMEWORKS': 'NO' + })) + out.append( + self.config.job_spec( + ['src/objective-c/tests/build_one_example_bazel.sh'], + timeout_seconds=20 * 60, + shortname='ios-buildtest-example-watchOS-sample', + cpu_cost=1e6, + environ={ + 'SCHEME': 'watchOS-sample-WatchKit-App', + 'EXAMPLE_PATH': 'src/objective-c/examples/watchOS-sample', + 'FRAMEWORKS': 'NO' + })) out.append( self.config.job_spec( ['src/objective-c/tests/run_plugin_tests.sh'], @@ -1098,11 +1122,12 @@ class ObjCLanguage(object): environ=_FORCE_ENVIRON_FOR_WRAPPERS)) out.append( self.config.job_spec( - ['test/core/iomgr/ios/CFStreamTests/run_tests.sh'], + ['test/core/iomgr/ios/CFStreamTests/build_and_run_tests.sh'], timeout_seconds=20 * 60, shortname='ios-test-cfstream-tests', cpu_cost=1e6, environ=_FORCE_ENVIRON_FOR_WRAPPERS)) + # TODO: replace with run_one_test_bazel.sh when Bazel-Xcode is stable out.append( self.config.job_spec( ['src/objective-c/tests/run_one_test.sh'], @@ -1130,6 +1155,13 @@ class ObjCLanguage(object): environ={ 'SCHEME': 'CronetTests' })) + out.append( + self.config.job_spec( + ['test/cpp/ios/build_and_run_tests.sh'], + timeout_seconds=20 * 60, + shortname='ios-cpp-test-cronet', + cpu_cost=1e6, + environ=_FORCE_ENVIRON_FOR_WRAPPERS)) out.append( self.config.job_spec( ['src/objective-c/tests/run_one_test.sh'], @@ -1140,6 +1172,16 @@ class ObjCLanguage(object): 'SCHEME': 'MacTests', 'PLATFORM': 'macos' })) + out.append( + self.config.job_spec( + ['src/objective-c/tests/run_one_test.sh'], + timeout_seconds=30 * 60, + shortname='tvos-test-basictests', + cpu_cost=1e6, + environ={ + 'SCHEME': 'TvTests', + 'PLATFORM': 'tvos' + })) return sorted(out) @@ -1147,16 +1189,13 @@ class ObjCLanguage(object): return [] def make_targets(self): - return ['interop_server'] + return [] def make_options(self): return [] def build_steps(self): - return [ - ['src/objective-c/tests/build_tests.sh'], - ['test/core/iomgr/ios/CFStreamTests/build_tests.sh'], - ] + return [] def post_tests_steps(self): return [] diff --git a/tools/run_tests/sanity/check_bazel_workspace.py b/tools/run_tests/sanity/check_bazel_workspace.py index 10fb0ccf6a8..73b13a883d8 100755 --- a/tools/run_tests/sanity/check_bazel_workspace.py +++ b/tools/run_tests/sanity/check_bazel_workspace.py @@ -63,6 +63,7 @@ _GRPC_DEP_NAMES = [ _ZOPEFOUNDATION_ZOPE_INTERFACE_DEP_NAME, _TWISTED_CONSTANTLY_DEP_NAME, 'io_bazel_rules_go', + 'build_bazel_rules_apple', ] _GRPC_BAZEL_ONLY_DEPS = [ @@ -76,6 +77,7 @@ _GRPC_BAZEL_ONLY_DEPS = [ _ZOPEFOUNDATION_ZOPE_INTERFACE_DEP_NAME, _TWISTED_CONSTANTLY_DEP_NAME, 'io_bazel_rules_go', + 'build_bazel_rules_apple', ] @@ -106,6 +108,16 @@ class BazelEvalState(object): return self.names_and_urls[args['name']] = args['url'] + def git_repository(self, **args): + assert self.names_and_urls.get(args['name']) is None + if args['name'] in _GRPC_BAZEL_ONLY_DEPS: + self.names_and_urls[args['name']] = 'dont care' + return + self.names_and_urls[args['name']] = args['remote'] + + def grpc_python_deps(self): + pass + # Parse git hashes from bazel/grpc_deps.bzl {new_}http_archive rules with open(os.path.join('bazel', 'grpc_deps.bzl'), 'r') as f: @@ -121,8 +133,10 @@ build_rules = { 'native': eval_state, 'http_archive': lambda **args: eval_state.http_archive(**args), 'load': lambda a, b: None, + 'git_repository': lambda **args: eval_state.git_repository(**args), + 'grpc_python_deps': lambda: None, } -exec bazel_file in build_rules +exec(bazel_file) in build_rules for name in _GRPC_DEP_NAMES: assert name in names_and_urls.keys() assert len(_GRPC_DEP_NAMES) == len(names_and_urls.keys()) @@ -162,8 +176,10 @@ for name in _GRPC_DEP_NAMES: 'native': state, 'http_archive': lambda **args: state.http_archive(**args), 'load': lambda a, b: None, + 'git_repository': lambda **args: state.git_repository(**args), + 'grpc_python_deps': lambda *args, **kwargs: None, } - exec bazel_file in rules + exec(bazel_file) in rules assert name not in names_and_urls_with_overridden_name.keys() sys.exit(0) diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh index e518e912719..d5eb6677796 100755 --- a/tools/run_tests/sanity/check_submodules.sh +++ b/tools/run_tests/sanity/check_submodules.sh @@ -40,7 +40,7 @@ cat << EOF | awk '{ print $1 }' | sort > "$want_submodules" 9245d481eb3e890f708ff2d7dadf2a10c04748ba third_party/libcxxabi (heads/release_60) 09745575a923640154bcf307fba8aedff47f240a third_party/protobuf (v3.7.0-rc.2-247-g09745575) e143189bf6f37b3957fb31743df6a1bcf4a8c685 third_party/protoc-gen-validate (v0.0.10) - 423ea5ca9ce8da69611e6e95559efcb3a1ba8ad8 third_party/upb (heads/master) + 931bbecbd3230ae7f22efa5d203639facc47f719 third_party/upb (heads/master) cacf7f1d4e3d44d871b605da3b647f07d718623f third_party/zlib (v1.2.11) EOF diff --git a/tools/run_tests/sanity/sanity_tests.yaml b/tools/run_tests/sanity/sanity_tests.yaml index 1c5dc5d4312..222e63a46dc 100644 --- a/tools/run_tests/sanity/sanity_tests.yaml +++ b/tools/run_tests/sanity/sanity_tests.yaml @@ -2,7 +2,9 @@ - script: tools/run_tests/sanity/check_bad_dependencies.sh - script: tools/run_tests/sanity/check_bazel_workspace.py - script: tools/run_tests/sanity/check_cache_mk.sh +- script: tools/run_tests/sanity/check_deprecated_grpc++.py - script: tools/run_tests/sanity/check_owners.sh +- script: tools/run_tests/sanity/check_port_platform.py - script: tools/run_tests/sanity/check_qps_scenario_changes.py - script: tools/run_tests/sanity/check_shellcheck.sh - script: tools/run_tests/sanity/check_submodules.sh @@ -10,19 +12,17 @@ - script: tools/run_tests/sanity/check_tracer_sanity.py - script: tools/run_tests/sanity/core_banned_functions.py - script: tools/run_tests/sanity/core_untyped_structs.sh -- script: tools/run_tests/sanity/check_deprecated_grpc++.py -- script: tools/run_tests/sanity/check_port_platform.py - script: tools/buildgen/generate_projects.sh -j 3 cpu_cost: 3 - script: tools/distrib/check_copyright.py +- script: tools/distrib/check_include_guards.py +- script: tools/distrib/check_trailing_newlines.sh +- script: tools/distrib/check_upb_output.sh - script: tools/distrib/clang_format_code.sh - script: tools/distrib/clang_tidy_code.sh -- script: tools/distrib/check_trailing_newlines.sh -- script: tools/distrib/check_nanopb_output.sh -- script: tools/distrib/check_include_guards.py - script: tools/distrib/pylint_code.sh -- script: tools/distrib/yapf_code.sh - script: tools/distrib/python/check_grpcio_tools.py +- script: tools/distrib/yapf_code.sh cpu_cost: 1000 -- script: tools/distrib/check_shadow_boringssl_symbol_list.sh - script: tools/distrib/check_protobuf_pod_version.sh +- script: tools/distrib/check_shadow_boringssl_symbol_list.sh