Merge remote-tracking branch 'upstream/master' into spiffe1

pull/19778/head
Matthew Stevenson 5 years ago
commit bcc458fb37
  1. 23
      .clang_complete
  2. 33
      .github/ISSUE_TEMPLATE/bug_report.md
  3. 18
      .github/ISSUE_TEMPLATE/cleanup_request.md
  4. 29
      .github/ISSUE_TEMPLATE/feature_request.md
  5. 5
      .github/pull_request_template.md
  6. 3
      .gitignore
  7. 347
      BUILD
  8. 141
      BUILD.gn
  9. 4957
      CMakeLists.txt
  10. 739
      Makefile
  11. 3
      PYTHON-MANIFEST.in
  12. 45
      WORKSPACE
  13. 215
      bazel/generate_objc.bzl
  14. 89
      bazel/grpc_build_system.bzl
  15. 27
      bazel/grpc_deps.bzl
  16. 69
      bazel/grpc_python_deps.bzl
  17. 46
      bazel/grpc_util.bzl
  18. 69
      bazel/objc_grpc_library.bzl
  19. 67
      bazel/protobuf.bzl
  20. 246
      bazel/python_rules.bzl
  21. 2
      bazel/test/python_test_repo/.gitignore
  22. 62
      bazel/test/python_test_repo/BUILD
  23. 5
      bazel/test/python_test_repo/README.md
  24. 17
      bazel/test/python_test_repo/WORKSPACE
  25. 43
      bazel/test/python_test_repo/helloworld.proto
  26. 73
      bazel/test/python_test_repo/helloworld.py
  27. 1
      bazel/test/python_test_repo/tools/bazel
  28. 1608
      build.yaml
  29. 2
      build_config.rb
  30. 18
      cmake/upb.cmake
  31. 79
      config.m4
  32. 100
      config.w32
  33. 3
      doc/g_stands_for.md
  34. 4
      doc/keepalive.md
  35. 38
      doc/statuscodes.md
  36. 20
      examples/BUILD
  37. 119
      examples/objective-c/BUILD
  38. 4
      examples/objective-c/helloworld/main.m
  39. 2
      examples/objective-c/helloworld_macos/HelloWorld/Info.plist
  40. 4
      examples/objective-c/helloworld_macos/main.m
  41. 4
      examples/objective-c/route_guide/ViewControllers.m
  42. 9
      examples/python/auth/BUILD.bazel
  43. 2
      examples/python/auth/customized_auth_client.py
  44. 13
      examples/python/auth/customized_auth_server.py
  45. 6
      examples/python/auth/test/_auth_example_test.py
  46. 81
      examples/python/cancellation/BUILD.bazel
  47. 127
      examples/python/cancellation/README.md
  48. 104
      examples/python/cancellation/client.py
  49. 56
      examples/python/cancellation/hash_name.proto
  50. 148
      examples/python/cancellation/search.py
  51. 124
      examples/python/cancellation/server.py
  52. 87
      examples/python/cancellation/test/_cancellation_example_test.py
  53. 6
      examples/python/compression/BUILD.bazel
  54. 8
      examples/python/compression/server.py
  55. 11
      examples/python/debug/BUILD.bazel
  56. 8
      examples/python/debug/debug_server.py
  57. 10
      examples/python/debug/get_stats.py
  58. 6
      examples/python/errors/BUILD.bazel
  59. 9
      examples/python/errors/server.py
  60. 9
      examples/python/helloworld/greeter_server.py
  61. 9
      examples/python/helloworld/greeter_server_with_reflection.py
  62. 9
      examples/python/interceptors/headers/greeter_server.py
  63. 9
      examples/python/metadata/metadata_server.py
  64. 8
      examples/python/multiplex/multiplex_server.py
  65. 18
      examples/python/multiprocessing/BUILD
  66. 8
      examples/python/route_guide/route_guide_server.py
  67. 3
      examples/python/wait_for_ready/BUILD.bazel
  68. 2
      examples/python/wait_for_ready/wait_for_ready_example.py
  69. 83
      gRPC-C++.podspec
  70. 180
      gRPC-Core.podspec
  71. 3
      gRPC-ProtoRPC.podspec
  72. 3
      gRPC-RxLibrary.podspec
  73. 3
      gRPC.podspec
  74. 2
      grpc.def
  75. 110
      grpc.gemspec
  76. 204
      grpc.gyp
  77. 4
      include/grpc/grpc.h
  78. 24
      include/grpc/grpc_security.h
  79. 11
      include/grpc/impl/codegen/grpc_types.h
  80. 17
      include/grpc/impl/codegen/port_platform.h
  81. 5
      include/grpcpp/impl/codegen/channel_interface.h
  82. 2
      include/grpcpp/impl/codegen/client_context_impl.h
  83. 87
      include/grpcpp/impl/codegen/delegating_channel.h
  84. 7
      include/grpcpp/impl/codegen/proto_utils.h
  85. 114
      package.xml
  86. 21
      setup.py
  87. 5
      src/benchmark/gen_build_yaml.py
  88. 11
      src/boringssl/gen_build_yaml.py
  89. 2
      src/c-ares/gen_build_yaml.py
  90. 4
      src/compiler/csharp_generator.cc
  91. 10
      src/compiler/objective_c_generator_helpers.h
  92. 60
      src/compiler/objective_c_plugin.cc
  93. 14
      src/compiler/ruby_generator.cc
  94. 23
      src/compiler/ruby_generator_string-inl.h
  95. 18
      src/core/ext/filters/client_channel/channel_connectivity.cc
  96. 69
      src/core/ext/filters/client_channel/client_channel.cc
  97. 22
      src/core/ext/filters/client_channel/client_channel_channelz.cc
  98. 12
      src/core/ext/filters/client_channel/client_channel_channelz.h
  99. 12
      src/core/ext/filters/client_channel/connector.h
  100. 23
      src/core/ext/filters/client_channel/health/health.pb.c
  101. Some files were not shown because too many files have changed in this diff Show More

@ -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

@ -1,3 +1,11 @@
---
name: Report a bug
about: Create a report to help us improve
labels: kind/bug
assignees: AspirinSJL
---
<!--
This form is for bug reports and feature requests ONLY!
@ -7,27 +15,26 @@ For general questions and troubleshooting, please ask/look for answers here:
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->
### 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?

@ -0,0 +1,18 @@
---
name: Request a cleanup
about: Suggest a cleanup in our repository
labels: kind/internal cleanup
assignees: AspirinSJL
---
<!--
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers here:
- grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
- StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->

@ -0,0 +1,29 @@
---
name: Request a feature
about: Suggest an idea for this project
labels: kind/enhancement
assignees: AspirinSJL
---
<!--
This form is for bug reports and feature requests ONLY!
For general questions and troubleshooting, please ask/look for answers here:
- grpc.io mailing list: https://groups.google.com/forum/#!forum/grpc-io
- StackOverflow, with "grpc" tag: https://stackoverflow.com/questions/tagged/grpc
Issues specific to *grpc-java*, *grpc-go*, *grpc-node*, *grpc-dart*, *grpc-web* should be created in the repository they belong to (e.g. https://github.com/grpc/grpc-LANGUAGE/issues/new)
-->
### 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.

@ -0,0 +1,5 @@
<!-- Your pull request will be routed to the following person. -->
@AspirinSJL

3
.gitignore vendored

@ -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/
BenchmarkDotNet.Artifacts/

347
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()

@ -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 = [

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -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

@ -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()

@ -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
)

@ -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)

@ -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",
)

@ -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",
],
)

@ -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)

@ -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
)

@ -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
]

@ -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
)

@ -0,0 +1,2 @@
bazel-*
tools/bazel-*

@ -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",
)

@ -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`.

@ -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()

@ -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;
}

@ -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()

@ -0,0 +1 @@
../../../../tools/bazel

File diff suppressed because it is too large Load Diff

@ -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

@ -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")

@ -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

@ -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++) {

@ -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)

@ -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.

@ -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

@ -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"],
)

@ -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"],
)

@ -21,7 +21,11 @@
#import <GRPCClient/GRPCCall+ChannelArg.h>
#import <GRPCClient/GRPCCall+Tests.h>
#if COCOAPODS
#import <HelloWorld/Helloworld.pbrpc.h>
#else
#import "examples/protos/Helloworld.pbrpc.h"
#endif
static NSString * const kHostAddress = @"localhost:50051";

@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>

@ -20,7 +20,11 @@
#import <GRPCClient/GRPCCall+ChannelArg.h>
#import <GRPCClient/GRPCCall+Tests.h>
#if COCOAPODS
#import <HelloWorld/Helloworld.pbrpc.h>
#else
#import "examples/protos/Helloworld.pbrpc.h"
#endif
static NSString * const kHostAddress = @"localhost:50051";

@ -17,7 +17,11 @@
*/
#import <UIKit/UIKit.h>
#if COCOAPODS
#import <RouteGuide/RouteGuide.pbrpc.h>
#else
#import "examples/protos/RouteGuide.pbrpc.h"
#endif
static NSString * const kHostAddress = @"localhost:50051";

@ -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",

@ -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'

@ -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__':

@ -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,

@ -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",
)

@ -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))
<hash_name_pb2.HashNameResponse object at 0x7fe2eb8ce2d0>
```
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.

@ -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()

@ -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) {}
}

@ -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()

@ -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()

@ -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)

@ -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",
)

@ -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():

@ -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",
],
)
)

@ -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__':

@ -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):

@ -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": [],

@ -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():

@ -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__':

@ -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__':

@ -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__':

@ -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__':

@ -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__':

@ -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",

@ -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__':

@ -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",
],
)

@ -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():

@ -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 <nanopb/\\1>;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 <nanopb/\\1>;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 <nanopb/\\1>\\\n#else\\\n #include "\\1"\\\n#endif;g' $(find src/core -type f -print | xargs grep -H -c '#include <nanopb/' | grep 0$ | cut -d':' -f1)
sed -E -i '' 's;#include "(pb(_.*)?\\.h)";#if COCOAPODS==1\\\n #include <nanopb/\\1>\\\n#else\\\n #include "\\1"\\\n#endif;g' $(find src/cpp -type f -print | xargs grep -H -c '#include <nanopb/' | grep 0$ | cut -d':' -f1)
find src/core/ third_party/upb/ -type f \\( -name '*.h' -or -name '*.c' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "upb/(.*)";#if COCOAPODS==1\\\n #include "third_party/upb/upb/\\1"\\\n#else\\\n #include "upb/\\1"\\\n#endif;g'
find src/core/ third_party/upb/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
find src/core/ src/cpp/ -type f \\( -name '*.h' -or -name '*.c' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(.*).upb.h";#if COCOAPODS==1\\\n #include "src/core/ext/upb-generated/\\1.upb.h"\\\n#else\\\n #include "\\1.upb.h"\\\n#endif;g'
find src/core/ src/cpp/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
END_OF_COMMAND
end

@ -22,7 +22,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-Core'
version = '1.23.0-dev'
version = '1.24.0-dev'
s.version = version
s.summary = 'Core cross-platform gRPC library, written in C'
s.homepage = 'https://grpc.io'
@ -41,7 +41,8 @@ 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'
s.requires_arc = false
name = 'grpc'
@ -335,13 +336,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',
@ -374,7 +381,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',
@ -533,13 +540,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',
@ -797,13 +832,17 @@ Pod::Spec.new do |s|
'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',
'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',
@ -836,7 +875,7 @@ Pod::Spec.new do |s|
'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',
@ -855,14 +894,42 @@ Pod::Spec.new do |s|
'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',
@ -878,6 +945,7 @@ Pod::Spec.new do |s|
'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',
@ -994,13 +1062,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',
@ -1033,7 +1107,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',
@ -1192,13 +1266,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',
@ -1229,16 +1331,9 @@ Pod::Spec.new do |s|
ss.source_files = 'src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc',
'src/core/ext/transport/cronet/transport/cronet_transport.cc',
'third_party/nanopb/pb_common.c',
'third_party/nanopb/pb_decode.c',
'third_party/nanopb/pb_encode.c',
'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',
'third_party/nanopb/pb.h',
'third_party/nanopb/pb_common.h',
'third_party/nanopb/pb_decode.h',
'third_party/nanopb/pb_encode.h'
'third_party/objective_c/Cronet/bidirectional_stream_c.h'
end
s.subspec 'Tests' do |ss|
@ -1275,9 +1370,6 @@ Pod::Spec.new do |s|
'test/core/util/tracer_util.cc',
'test/core/util/trickle_endpoint.cc',
'test/core/util/cmdline.cc',
'third_party/nanopb/pb_common.c',
'third_party/nanopb/pb_decode.c',
'third_party/nanopb/pb_encode.c',
'test/core/end2end/data/ssl_test_data.h',
'test/core/security/oauth2_utils.h',
'test/core/end2end/cq_verifier.h',
@ -1302,10 +1394,6 @@ Pod::Spec.new do |s|
'test/core/util/tracer_util.h',
'test/core/util/trickle_endpoint.h',
'test/core/util/cmdline.h',
'third_party/nanopb/pb.h',
'third_party/nanopb/pb_common.h',
'third_party/nanopb/pb_decode.h',
'third_party/nanopb/pb_encode.h',
'test/core/end2end/end2end_tests.cc',
'test/core/end2end/end2end_test_utils.cc',
'test/core/end2end/tests/authority_not_supported.cc',
@ -1394,5 +1482,9 @@ Pod::Spec.new do |s|
s.prepare_command = <<-END_OF_COMMAND
sed -E -i '' 's;#include "(pb(_.*)?\\.h)";#if COCOAPODS==1\\\n #include <nanopb/\\1>\\\n#else\\\n #include "\\1"\\\n#endif;g' $(find src/core -type f -print | xargs grep -H -c '#include <nanopb/' | grep 0$ | cut -d':' -f1)
sed -E -i '' 's;#include <openssl/(.*)>;#if COCOAPODS==1\\\n #include <openssl_grpc/\\1>\\\n#else\\\n #include <openssl/\\1>\\\n#endif;g' $(find src/core -type f \\( -path '*.h' -or -path '*.cc' \\) -print | xargs grep -H -c '#include <openssl_grpc/' | grep 0$ | cut -d':' -f1)
find src/core/ third_party/upb/ -type f \\( -name '*.h' -or -name '*.c' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "upb/(.*)";#if COCOAPODS==1\\\n #include "third_party/upb/upb/\\1"\\\n#else\\\n #include "upb/\\1"\\\n#endif;g'
find src/core/ third_party/upb/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
find src/core/ src/cpp/ -type f \\( -name '*.h' -or -name '*.c' -or -name '*.cc' \\) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(.*).upb.h";#if COCOAPODS==1\\\n #include "src/core/ext/upb-generated/\\1.upb.h"\\\n#else\\\n #include "\\1.upb.h"\\\n#endif;g'
find src/core/ src/cpp/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
END_OF_COMMAND
end

@ -21,7 +21,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-ProtoRPC'
version = '1.23.0-dev'
version = '1.24.0-dev'
s.version = version
s.summary = 'RPC library for Protocol Buffers, based on gRPC'
s.homepage = 'https://grpc.io'
@ -36,6 +36,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'
name = 'ProtoRPC'
s.module_name = name

@ -21,7 +21,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-RxLibrary'
version = '1.23.0-dev'
version = '1.24.0-dev'
s.version = version
s.summary = 'Reactive Extensions library for iOS/OSX.'
s.homepage = 'https://grpc.io'
@ -36,6 +36,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'
name = 'RxLibrary'
s.module_name = name

@ -20,7 +20,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC'
version = '1.23.0-dev'
version = '1.24.0-dev'
s.version = version
s.summary = 'gRPC client library for iOS/OSX'
s.homepage = 'https://grpc.io'
@ -35,6 +35,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'
name = 'GRPCClient'
s.module_name = name

@ -141,6 +141,8 @@ EXPORTS
grpc_tls_credentials_options_set_server_authorization_check_config
grpc_tls_key_materials_config_create
grpc_tls_key_materials_config_set_key_materials
grpc_tls_key_materials_config_set_version
grpc_tls_key_materials_config_get_version
grpc_tls_credential_reload_config_create
grpc_tls_server_authorization_check_config_create
grpc_raw_byte_buffer_create

@ -265,17 +265,19 @@ Gem::Specification.new do |s|
s.files += %w( src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h )
s.files += %w( src/core/lib/security/credentials/alts/check_gcp_environment.h )
s.files += %w( src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h )
s.files += %w( src/core/tsi/alts/handshaker/alts_handshaker_service_api.h )
s.files += %w( src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h )
s.files += %w( src/core/tsi/alts/handshaker/alts_tsi_utils.h )
s.files += %w( src/core/tsi/alts/handshaker/transport_security_common_api.h )
s.files += %w( src/core/tsi/alts/handshaker/altscontext.pb.h )
s.files += %w( src/core/tsi/alts/handshaker/handshaker.pb.h )
s.files += %w( src/core/tsi/alts/handshaker/transport_security_common.pb.h )
s.files += %w( third_party/nanopb/pb.h )
s.files += %w( third_party/nanopb/pb_common.h )
s.files += %w( third_party/nanopb/pb_decode.h )
s.files += %w( third_party/nanopb/pb_encode.h )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h )
s.files += %w( third_party/upb/upb/decode.h )
s.files += %w( third_party/upb/upb/encode.h )
s.files += %w( third_party/upb/upb/generated_util.h )
s.files += %w( third_party/upb/upb/msg.h )
s.files += %w( third_party/upb/upb/port_def.inc )
s.files += %w( third_party/upb/upb/port_undef.inc )
s.files += %w( third_party/upb/upb/table.int.h )
s.files += %w( third_party/upb/upb/upb.h )
s.files += %w( src/core/tsi/transport_security.h )
s.files += %w( src/core/tsi/transport_security_interface.h )
s.files += %w( src/core/ext/transport/chttp2/client/authority.h )
@ -308,7 +310,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/subchannel_interface.h )
s.files += %w( src/core/ext/filters/client_channel/subchannel_pool_interface.h )
s.files += %w( src/core/ext/filters/deadline/deadline_filter.h )
s.files += %w( src/core/ext/filters/client_channel/health/health.pb.h )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h )
s.files += %w( src/core/tsi/fake_transport_security.h )
s.files += %w( src/core/tsi/local_transport_security.h )
s.files += %w( src/core/tsi/ssl/session_cache/ssl_session.h )
@ -467,13 +469,41 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h )
s.files += %w( src/core/ext/upb-generated/google/api/annotations.upb.h )
s.files += %w( src/core/ext/upb-generated/google/api/http.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/any.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/descriptor.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/duration.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/empty.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/struct.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/timestamp.upb.h )
s.files += %w( src/core/ext/upb-generated/google/protobuf/wrappers.upb.h )
s.files += %w( src/core/ext/upb-generated/google/rpc/status.upb.h )
s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cds.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/eds.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/type/percent.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/type/range.upb.h )
s.files += %w( src/core/ext/upb-generated/gogoproto/gogo.upb.h )
s.files += %w( src/core/ext/upb-generated/validate/validate.upb.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/subchannel_list.h )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h )
@ -731,16 +761,17 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc )
s.files += %w( src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc )
s.files += %w( src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc )
s.files += %w( src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc )
s.files += %w( src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc )
s.files += %w( src/core/tsi/alts/handshaker/alts_tsi_utils.cc )
s.files += %w( src/core/tsi/alts/handshaker/transport_security_common_api.cc )
s.files += %w( src/core/tsi/alts/handshaker/altscontext.pb.c )
s.files += %w( src/core/tsi/alts/handshaker/handshaker.pb.c )
s.files += %w( src/core/tsi/alts/handshaker/transport_security_common.pb.c )
s.files += %w( third_party/nanopb/pb_common.c )
s.files += %w( third_party/nanopb/pb_decode.c )
s.files += %w( third_party/nanopb/pb_encode.c )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c )
s.files += %w( third_party/upb/upb/decode.c )
s.files += %w( third_party/upb/upb/encode.c )
s.files += %w( third_party/upb/upb/msg.c )
s.files += %w( third_party/upb/upb/port.c )
s.files += %w( third_party/upb/upb/table.c )
s.files += %w( third_party/upb/upb/upb.c )
s.files += %w( src/core/tsi/transport_security.cc )
s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create.cc )
s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc )
@ -773,7 +804,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/subchannel.cc )
s.files += %w( src/core/ext/filters/client_channel/subchannel_pool_interface.cc )
s.files += %w( src/core/ext/filters/deadline/deadline_filter.cc )
s.files += %w( src/core/ext/filters/client_channel/health/health.pb.c )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c )
s.files += %w( src/core/tsi/fake_transport_security.cc )
s.files += %w( src/core/tsi/local_transport_security.cc )
s.files += %w( src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc )
@ -792,14 +823,42 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc )
s.files += %w( src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c )
s.files += %w( src/core/ext/upb-generated/google/api/annotations.upb.c )
s.files += %w( src/core/ext/upb-generated/google/api/http.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/any.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/descriptor.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/duration.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/empty.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/struct.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/timestamp.upb.c )
s.files += %w( src/core/ext/upb-generated/google/protobuf/wrappers.upb.c )
s.files += %w( src/core/ext/upb-generated/google/rpc/status.upb.c )
s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cds.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/eds.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/type/percent.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/type/range.upb.c )
s.files += %w( src/core/ext/upb-generated/gogoproto/gogo.upb.c )
s.files += %w( src/core/ext/upb-generated/validate/validate.upb.c )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc )
@ -815,6 +874,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc )
s.files += %w( src/core/ext/filters/census/grpc_context.cc )
s.files += %w( src/core/ext/filters/client_idle/client_idle_filter.cc )
s.files += %w( src/core/ext/filters/max_age/max_age_filter.cc )

@ -55,12 +55,22 @@
'-Wall',
'-Wextra',
'-Werror',
'-Wno-unknown-warning-option',
'-Wno-long-long',
'-Wno-unused-parameter',
'-DOSATOMIC_USE_INLINED=1',
'-Wno-deprecated-declarations',
'-Ithird_party/nanopb',
'-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',
],
'ldflags': [
'-g',
@ -136,24 +146,44 @@
'-Wall',
'-Wextra',
'-Werror',
'-Wno-unknown-warning-option',
'-Wno-long-long',
'-Wno-unused-parameter',
'-DOSATOMIC_USE_INLINED=1',
'-Wno-deprecated-declarations',
'-Ithird_party/nanopb',
'-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',
],
'OTHER_CPLUSPLUSFLAGS': [
'-g',
'-Wall',
'-Wextra',
'-Werror',
'-Wno-unknown-warning-option',
'-Wno-long-long',
'-Wno-unused-parameter',
'-DOSATOMIC_USE_INLINED=1',
'-Wno-deprecated-declarations',
'-Ithird_party/nanopb',
'-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',
'-stdlib=libc++',
'-std=c++11',
'-Wno-error=deprecated-declarations',
@ -514,16 +544,17 @@
'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',
@ -556,7 +587,7 @@
'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',
@ -575,14 +606,42 @@
'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',
@ -598,6 +657,7 @@
'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',
@ -831,10 +891,13 @@
'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',
@ -1083,10 +1146,13 @@
'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',
@ -1346,10 +1412,13 @@
'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',
@ -1366,18 +1435,47 @@
'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',
@ -1494,10 +1592,13 @@
'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',
],
},
@ -1651,10 +1752,13 @@
'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',
],
},
@ -2155,24 +2259,6 @@
'third_party/benchmark/src/timers.cc',
],
},
{
'target_name': 'upb',
'type': 'static_library',
'dependencies': [
],
'sources': [
'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',
],
},
{
'target_name': 'z',
'type': 'static_library',

@ -224,7 +224,9 @@ GRPCAPI grpc_call* grpc_channel_create_call(
GRPCAPI void grpc_channel_ping(grpc_channel* channel, grpc_completion_queue* cq,
void* tag, void* reserved);
/** Pre-register a method/host pair on a channel. */
/** Pre-register a method/host pair on a channel.
method and host are not owned and must remain alive while the server is
running. */
GRPCAPI void* grpc_channel_register_call(grpc_channel* channel,
const char* method, const char* host,
void* reserved);

@ -778,6 +778,21 @@ GRPCAPI int grpc_tls_key_materials_config_set_key_materials(
const grpc_ssl_pem_key_cert_pair** pem_key_cert_pairs,
size_t num_key_cert_pairs);
/** Set grpc_tls_key_materials_config instance with a provided version number,
which is used to keep track of the version of key materials.
It returns 1 on success and 0 on failure. It is used for
experimental purpose for now and subject to change.
*/
GRPCAPI int grpc_tls_key_materials_config_set_version(
grpc_tls_key_materials_config* config, int version);
/** Get the version number of a grpc_tls_key_materials_config instance.
It returns the version number on success and -1 on failure.
It is used for experimental purpose for now and subject to change.
*/
GRPCAPI int grpc_tls_key_materials_config_get_version(
grpc_tls_key_materials_config* config);
/** --- TLS credential reload config. ---
It is used for experimental purpose for now and subject to change.*/
@ -793,10 +808,11 @@ typedef void (*grpc_tls_on_credential_reload_done_cb)(
/** A struct containing all information necessary to schedule/cancel
a credential reload request. cb and cb_user_data represent a gRPC-provided
callback and an argument passed to it. key_materials is an in/output
parameter containing currently used/newly reloaded credentials. status and
error_details are used to hold information about errors occurred when a
credential reload request is scheduled/cancelled. It is used for
experimental purpose for now and subject to change. */
parameter containing currently used/newly reloaded credentials. If
credential reload does not result in a new credential, key_materials should
not be modified. status and error_details are used to hold information about
errors occurred when a credential reload request is scheduled/cancelled. It
is used for experimental purpose for now and subject to change. */
struct grpc_tls_credential_reload_arg {
grpc_tls_on_credential_reload_done_cb cb;
void* cb_user_data;

@ -169,11 +169,7 @@ typedef struct {
#define GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS "grpc.max_connection_age_grace_ms"
/** Timeout after the last RPC finishes on the client channel at which the
* channel goes back into IDLE state. Int valued, milliseconds. INT_MAX means
* unlimited. */
/** TODO(qianchengz): Currently the default value is INT_MAX, which means the
* client idle filter is disabled by default. After the client idle filter
* proves no perfomance issue, we will change the default value to a reasonable
* value. */
* unlimited. The default value is 30 minutes and the min value is 1 second. */
#define GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS "grpc.client_idle_timeout_ms"
/** Enable/disable support for per-message compression. Defaults to 1, unless
GRPC_ARG_MINIMAL_STACK is enabled, in which case it defaults to 0. */
@ -330,6 +326,11 @@ typedef struct {
balancer before using fallback backend addresses from the resolver.
If 0, enter fallback mode immediately. Default value is 10000. */
#define GRPC_ARG_XDS_FALLBACK_TIMEOUT_MS "grpc.xds_fallback_timeout_ms"
/* Time in milliseconds to wait before a locality is deleted after it's removed
from the received EDS update. If 0, delete the locality immediately. Default
value is 15 minutes. */
#define GRPC_ARG_LOCALITY_RETENTION_INTERVAL_MS \
"grpc.xds_locality_retention_interval_ms"
/** If non-zero, grpc server's cronet compression workaround will be enabled */
#define GRPC_ARG_WORKAROUND_CRONET_COMPRESSION \
"grpc.workaround.cronet_compression"

@ -463,6 +463,23 @@ typedef unsigned __int64 uint64_t;
#include <stdint.h>
#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__)

@ -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 <class InputMessage, class OutputMessage>
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,

@ -85,6 +85,7 @@ class ClientCallbackReaderImpl;
template <class Request>
class ClientCallbackWriterImpl;
class ClientCallbackUnaryImpl;
class ClientContextAccessor;
} // namespace internal
class CallCredentials;
@ -424,6 +425,7 @@ class ClientContext {
template <class Request>
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) {

@ -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

@ -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;

@ -13,8 +13,8 @@
<date>2018-01-19</date>
<time>16:06:07</time>
<version>
<release>1.23.0dev</release>
<api>1.23.0dev</api>
<release>1.24.0dev</release>
<api>1.24.0dev</api>
</version>
<stability>
<release>beta</release>
@ -270,17 +270,19 @@
<file baseinstalldir="/" name="src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/alts/check_gcp_environment.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/alts/handshaker/alts_handshaker_service_api.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/alts/handshaker/alts_tsi_utils.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/alts/handshaker/transport_security_common_api.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/alts/handshaker/altscontext.pb.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/alts/handshaker/handshaker.pb.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/alts/handshaker/transport_security_common.pb.h" role="src" />
<file baseinstalldir="/" name="third_party/nanopb/pb.h" role="src" />
<file baseinstalldir="/" name="third_party/nanopb/pb_common.h" role="src" />
<file baseinstalldir="/" name="third_party/nanopb/pb_decode.h" role="src" />
<file baseinstalldir="/" name="third_party/nanopb/pb_encode.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/decode.h" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/encode.h" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/generated_util.h" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/msg.h" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/port_def.inc" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/port_undef.inc" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/table.int.h" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/upb.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/transport_security.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/transport_security_interface.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/authority.h" role="src" />
@ -313,7 +315,7 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_interface.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_pool_interface.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/deadline/deadline_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/health/health.pb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/fake_transport_security.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/local_transport_security.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/ssl/session_cache/ssl_session.h" role="src" />
@ -472,13 +474,41 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/annotations.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/http.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/any.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/descriptor.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/duration.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/empty.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/struct.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/timestamp.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/wrappers.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/rpc/status.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/cds.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/eds.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/address.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/percent.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/range.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/gogoproto/gogo.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/validate/validate.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/subchannel_list.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h" role="src" />
@ -736,16 +766,17 @@
<file baseinstalldir="/" name="src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc" role="src" />
<file baseinstalldir="/" name="src/core/tsi/alts/handshaker/alts_handshaker_service_api.cc" role="src" />
<file baseinstalldir="/" name="src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.cc" role="src" />
<file baseinstalldir="/" name="src/core/tsi/alts/handshaker/alts_tsi_utils.cc" role="src" />
<file baseinstalldir="/" name="src/core/tsi/alts/handshaker/transport_security_common_api.cc" role="src" />
<file baseinstalldir="/" name="src/core/tsi/alts/handshaker/altscontext.pb.c" role="src" />
<file baseinstalldir="/" name="src/core/tsi/alts/handshaker/handshaker.pb.c" role="src" />
<file baseinstalldir="/" name="src/core/tsi/alts/handshaker/transport_security_common.pb.c" role="src" />
<file baseinstalldir="/" name="third_party/nanopb/pb_common.c" role="src" />
<file baseinstalldir="/" name="third_party/nanopb/pb_decode.c" role="src" />
<file baseinstalldir="/" name="third_party/nanopb/pb_encode.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/decode.c" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/encode.c" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/msg.c" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/port.c" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/table.c" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/upb.c" role="src" />
<file baseinstalldir="/" name="src/core/tsi/transport_security.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/insecure/channel_create.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc" role="src" />
@ -778,7 +809,7 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_pool_interface.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/deadline/deadline_filter.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/health/health.pb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/tsi/fake_transport_security.cc" role="src" />
<file baseinstalldir="/" name="src/core/tsi/local_transport_security.cc" role="src" />
<file baseinstalldir="/" name="src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc" role="src" />
@ -797,14 +828,42 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/annotations.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/api/http.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/any.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/descriptor.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/duration.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/empty.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/struct.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/timestamp.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/protobuf/wrappers.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/google/rpc/status.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/xds/xds.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/cds.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/eds.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/discovery/v2/ads.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/service/load_stats/v2/lrs.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/percent.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/type/range.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/gogoproto/gogo.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/validate/validate.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc" role="src" />
@ -820,6 +879,7 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/census/grpc_context.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_idle/client_idle_filter.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/max_age/max_age_filter.cc" role="src" />

@ -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:

@ -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))

@ -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')

@ -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",

@ -437,8 +437,8 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service,
"/// <param name=\"channel\">The channel to use to make remote "
"calls.</param>\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");
}

@ -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");
}

@ -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=<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;

@ -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<grpc::string, grpc::string> header_comment_vars = ListToDict({

@ -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) {

@ -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);
}

@ -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<grpc_linked_mdelem*>(
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<Iterator>(batch_->list.head);
}
bool IsEnd(Iterator it) const override {
return reinterpret_cast<grpc_linked_mdelem*>(it) == nullptr;
}
void Next(Iterator* it) const override {
*it = reinterpret_cast<Iterator>(
reinterpret_cast<grpc_linked_mdelem*>(*it)->next);
}
StringView Key(Iterator it) const override {
return StringView(
GRPC_MDKEY(reinterpret_cast<grpc_linked_mdelem*>(it)->md));
}
StringView Value(Iterator it) const override {
return StringView(
GRPC_MDVALUE(reinterpret_cast<grpc_linked_mdelem*>(it)->md));
}
void Erase(Iterator* it) override {
grpc_linked_mdelem* linked_mdelem =
reinterpret_cast<grpc_linked_mdelem*>(*it);
*it = reinterpret_cast<Iterator>(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<ConnectedSubchannel> 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<LoadBalancingPolicy::ChannelControlHelper>(
New<ClientChannelControlHelper>(this));
lb_args.args = channel_args_;
UniquePtr<char> target_uri(strdup(target_uri_.get()));
UniquePtr<char> target_uri(gpr_strdup(target_uri_.get()));
resolving_lb_policy_.reset(New<ResolvingLoadBalancingPolicy>(
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<CallData*>(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 =

@ -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<char>(gpr_strdup(target_address))),
target_(UniquePtr<char>(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<SocketNode> 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<SocketNode> 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;
}

@ -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<SocketNode> socket);
grpc_json* RenderJson() override;
@ -66,7 +65,8 @@ class SubchannelNode : public BaseNode {
void PopulateConnectivityState(grpc_json* json);
Atomic<grpc_connectivity_state> connectivity_state_{GRPC_CHANNEL_IDLE};
Atomic<intptr_t> child_socket_uuid_{0};
Mutex socket_mu_;
RefCountedPtr<SocketNode> child_socket_;
UniquePtr<char> target_;
CallCountingHelper call_counter_;
ChannelTrace trace_;

@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#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<grpc_core::channelz::SocketNode> socket;
void reset() {
transport = nullptr;
channel_args = nullptr;
socket = nullptr;
}
} grpc_connect_out_args;
struct grpc_connector_vtable {

@ -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) */

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save