From 5d710a5dfe7110c73e5f755e842b1b2360969875 Mon Sep 17 00:00:00 2001 From: josh Date: Wed, 18 Oct 2017 22:00:26 -0600 Subject: Update Bazel WORKSPACE file and third_party/cares BUILD files to that Bazel can build gRPC as a dependency. The WORKSPACE file now pulls third_party dependencies directly instead of requiring a git submodule init and update. The git hashes pulled by Bazel are exactly the same as the git submodules checked into third_party. A tiny bit of complexity comes from the c-ares project's use of ares_config.h.cmake and ares_build.c.cmake. The current solution to this problem is to check in a valid ares_config.h and a few valid ares_config.h files. This is the same general approach used still, but ares_config.h and ares_build.h are supplied to cares.BUILD from the only remaining local_repository, which serves only to export these two header files. --- WORKSPACE | 61 ++++++---- third_party/cares/cares.BUILD | 194 +++++++++++++++++------------- third_party/cares/cares_local_files.BUILD | 21 ++++ 3 files changed, 167 insertions(+), 109 deletions(-) create mode 100644 third_party/cares/cares_local_files.BUILD diff --git a/WORKSPACE b/WORKSPACE index 907cef1fca..8734ad1564 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -10,7 +10,7 @@ bind( bind( name = "zlib", - actual = "@submodule_zlib//:z", + actual = "@com_github_madler_zlib//:z", ) bind( @@ -30,22 +30,22 @@ bind( bind( name = "cares", - actual = "@submodule_cares//:ares", + actual = "@com_github_cares_cares//:ares", ) bind( name = "gtest", - actual = "@submodule_gtest//:gtest", + actual = "@com_github_google_googletest//:gtest", ) bind( name = "gmock", - actual = "@submodule_gtest//:gmock", + actual = "@com_github_google_googletest//:gmock", ) bind( name = "benchmark", - actual = "@submodule_benchmark//:benchmark", + actual = "@com_github_google_benchmark//:benchmark", ) bind( @@ -53,47 +53,60 @@ bind( actual = "@com_github_gflags_gflags//:gflags", ) -local_repository( +http_archive( name = "boringssl", - path = "third_party/boringssl-with-bazel", + # on the master-with-bazel branch + url = "https://boringssl.googlesource.com/boringssl/+archive/886e7d75368e3f4fab3f4d0d3584e4abfc557755.tar.gz", ) -new_local_repository( - name = "submodule_zlib", +new_http_archive( + name = "com_github_madler_zlib", build_file = "third_party/zlib.BUILD", - path = "third_party/zlib", + strip_prefix = "zlib-cacf7f1d4e3d44d871b605da3b647f07d718623f", + url = "https://github.com/madler/zlib/archive/cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz", ) -new_local_repository( +http_archive( name = "com_google_protobuf", - build_file = "third_party/protobuf/BUILD", - path = "third_party/protobuf", + strip_prefix = "protobuf-80a37e0782d2d702d52234b62dd4b9ec74fd2c95", + url = "https://github.com/google/protobuf/archive/80a37e0782d2d702d52234b62dd4b9ec74fd2c95.tar.gz", ) -new_local_repository( - name = "submodule_gtest", +new_http_archive( + name = "com_github_google_googletest", build_file = "third_party/gtest.BUILD", - path = "third_party/googletest", + strip_prefix = "googletest-ec44c6c1675c25b9827aacd08c02433cccde7780", + url = "https://github.com/google/googletest/archive/ec44c6c1675c25b9827aacd08c02433cccde7780.tar.gz", ) -local_repository( +http_archive( name = "com_github_gflags_gflags", - path = "third_party/gflags", + strip_prefix = "gflags-30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e", + url = "https://github.com/gflags/gflags/archive/30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e.tar.gz", ) -new_local_repository( - name = "submodule_benchmark", - path = "third_party/benchmark", +new_http_archive( + name = "com_github_google_benchmark", build_file = "third_party/benchmark.BUILD", + strip_prefix = "benchmark-44c25c892a6229b20db7cd9dc05584ea865896de", + url = "https://github.com/google/benchmark/archive/44c25c892a6229b20db7cd9dc05584ea865896de.tar.gz", ) new_local_repository( - name = "submodule_cares", + name = "cares_local_files", + build_file = "third_party/cares/cares_local_files.BUILD", path = "third_party/cares", +) + +new_http_archive( + name = "com_github_cares_cares", build_file = "third_party/cares/cares.BUILD", + strip_prefix = "c-ares-3be1924221e1326df520f8498d704a5c4c8d0cce", + url = "https://github.com/c-ares/c-ares/archive/3be1924221e1326df520f8498d704a5c4c8d0cce.tar.gz", ) -local_repository( +http_archive( name = "com_google_absl", - path = "third_party/abseil-cpp", + strip_prefix = "abseil-cpp-cc4bed2d74f7c8717e31f9579214ab52a9c9c610", + url = "https://github.com/abseil/abseil-cpp/archive/cc4bed2d74f7c8717e31f9579214ab52a9c9c610.tar.gz", ) diff --git a/third_party/cares/cares.BUILD b/third_party/cares/cares.BUILD index 978e9b1ed9..87dcba4063 100644 --- a/third_party/cares/cares.BUILD +++ b/third_party/cares/cares.BUILD @@ -3,97 +3,112 @@ config_setting( values = {"cpu": "darwin"}, ) +genrule( + name = "ares_build", + srcs = ["@cares_local_files//:ares_build_h"], + outs = ["ares_build.h"], + cmd = "cat $(location @cares_local_files//:ares_build_h) > $@", +) + +cc_library( + name = "ares_build_h", + hdrs = ["ares_build.h"], + data = [":ares_build"], + includes = ["."], +) + +genrule( + name = "ares_config", + srcs = ["@cares_local_files//:ares_config_h"], + outs = ["ares_config.h"], + cmd = "cat $(location @cares_local_files//:ares_config_h) > $@", +) + +cc_library( + name = "ares_config_h", + hdrs = ["ares_config.h"], + data = [":ares_config"], + includes = ["."], +) + cc_library( name = "ares", srcs = [ - "cares/ares__close_sockets.c", - "cares/ares__get_hostent.c", - "cares/ares__read_line.c", - "cares/ares__timeval.c", - "cares/ares_cancel.c", - "cares/ares_create_query.c", - "cares/ares_data.c", - "cares/ares_destroy.c", - "cares/ares_expand_name.c", - "cares/ares_expand_string.c", - "cares/ares_fds.c", - "cares/ares_free_hostent.c", - "cares/ares_free_string.c", - "cares/ares_getenv.c", - "cares/ares_gethostbyaddr.c", - "cares/ares_gethostbyname.c", - "cares/ares_getnameinfo.c", - "cares/ares_getopt.c", - "cares/ares_getsock.c", - "cares/ares_init.c", - "cares/ares_library_init.c", - "cares/ares_llist.c", - "cares/ares_mkquery.c", - "cares/ares_nowarn.c", - "cares/ares_options.c", - "cares/ares_parse_a_reply.c", - "cares/ares_parse_aaaa_reply.c", - "cares/ares_parse_mx_reply.c", - "cares/ares_parse_naptr_reply.c", - "cares/ares_parse_ns_reply.c", - "cares/ares_parse_ptr_reply.c", - "cares/ares_parse_soa_reply.c", - "cares/ares_parse_srv_reply.c", - "cares/ares_parse_txt_reply.c", - "cares/ares_platform.c", - "cares/ares_process.c", - "cares/ares_query.c", - "cares/ares_search.c", - "cares/ares_send.c", - "cares/ares_strcasecmp.c", - "cares/ares_strdup.c", - "cares/ares_strerror.c", - "cares/ares_timeout.c", - "cares/ares_version.c", - "cares/ares_writev.c", - "cares/bitncmp.c", - "cares/inet_net_pton.c", - "cares/inet_ntop.c", - "cares/windows_port.c", + "ares__close_sockets.c", + "ares__get_hostent.c", + "ares__read_line.c", + "ares__timeval.c", + "ares_cancel.c", + "ares_create_query.c", + "ares_data.c", + "ares_destroy.c", + "ares_expand_name.c", + "ares_expand_string.c", + "ares_fds.c", + "ares_free_hostent.c", + "ares_free_string.c", + "ares_getenv.c", + "ares_gethostbyaddr.c", + "ares_gethostbyname.c", + "ares_getnameinfo.c", + "ares_getopt.c", + "ares_getsock.c", + "ares_init.c", + "ares_library_init.c", + "ares_llist.c", + "ares_mkquery.c", + "ares_nowarn.c", + "ares_options.c", + "ares_parse_a_reply.c", + "ares_parse_aaaa_reply.c", + "ares_parse_mx_reply.c", + "ares_parse_naptr_reply.c", + "ares_parse_ns_reply.c", + "ares_parse_ptr_reply.c", + "ares_parse_soa_reply.c", + "ares_parse_srv_reply.c", + "ares_parse_txt_reply.c", + "ares_platform.c", + "ares_process.c", + "ares_query.c", + "ares_search.c", + "ares_send.c", + "ares_strcasecmp.c", + "ares_strdup.c", + "ares_strerror.c", + "ares_timeout.c", + "ares_version.c", + "ares_writev.c", + "bitncmp.c", + "inet_net_pton.c", + "inet_ntop.c", + "windows_port.c", ], hdrs = [ + "ares.h", "ares_build.h", - "cares/ares.h", - "cares/ares_data.h", - "cares/ares_dns.h", - "cares/ares_getenv.h", - "cares/ares_getopt.h", - "cares/ares_inet_net_pton.h", - "cares/ares_iphlpapi.h", - "cares/ares_ipv6.h", - "cares/ares_library_init.h", - "cares/ares_llist.h", - "cares/ares_nowarn.h", - "cares/ares_platform.h", - "cares/ares_private.h", - "cares/ares_rules.h", - "cares/ares_setup.h", - "cares/ares_strcasecmp.h", - "cares/ares_strdup.h", - "cares/ares_version.h", - "cares/bitncmp.h", - "cares/config-win32.h", - "cares/nameser.h", - "cares/setup_once.h", - ] + select({ - ":darwin": ["config_darwin/ares_config.h"], - "//conditions:default": ["config_linux/ares_config.h"], - }), - includes = [ - ".", - "cares" - ] + select({ - ":darwin": ["config_darwin"], - "//conditions:default": ["config_linux"], - }), - linkstatic = 1, - visibility = [ - "//visibility:public", + "ares_config.h", + "ares_data.h", + "ares_dns.h", + "ares_getenv.h", + "ares_getopt.h", + "ares_inet_net_pton.h", + "ares_iphlpapi.h", + "ares_ipv6.h", + "ares_library_init.h", + "ares_llist.h", + "ares_nowarn.h", + "ares_platform.h", + "ares_private.h", + "ares_rules.h", + "ares_setup.h", + "ares_strcasecmp.h", + "ares_strdup.h", + "ares_version.h", + "bitncmp.h", + "config-win32.h", + "nameser.h", + "setup_once.h", ], copts = [ "-D_GNU_SOURCE", @@ -101,4 +116,13 @@ cc_library( "-DNOMINMAX", "-DHAVE_CONFIG_H", ], + data = [ + ":ares_build", + ":ares_config", + ], + includes = ["."], + linkstatic = 1, + visibility = [ + "//visibility:public", + ], ) diff --git a/third_party/cares/cares_local_files.BUILD b/third_party/cares/cares_local_files.BUILD new file mode 100644 index 0000000000..0861b6fa6d --- /dev/null +++ b/third_party/cares/cares_local_files.BUILD @@ -0,0 +1,21 @@ +package( + default_visibility = ["//visibility:public"], +) + +config_setting( + name = "darwin", + values = {"cpu": "darwin"}, +) + +filegroup( + name = "ares_build_h", + srcs = ["ares_build.h"], +) + +filegroup( + name = "ares_config_h", + srcs = select({ + ":darwin": ["config_darwin/ares_config.h"], + "//conditions:default": ["config_linux/ares_config.h"], + }), +) -- cgit v1.2.3 From 0c0ebc57e26ffc0579fda10cce65976d8ad06e0f Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Thu, 19 Oct 2017 18:41:01 -0700 Subject: Fix gRPC ObjC void function definition --- src/objective-c/GRPCClient/GRPCCall.m | 6 +++--- .../GRPCClient/private/GRPCConnectivityMonitor.h | 4 ++-- .../GRPCClient/private/GRPCConnectivityMonitor.m | 4 ++-- src/objective-c/GRPCClient/private/GRPCHost.m | 2 +- src/objective-c/GRPCClient/private/GRPCWrappedCall.h | 10 +++++----- src/objective-c/GRPCClient/private/GRPCWrappedCall.m | 14 +++++++------- src/objective-c/RxLibrary/GRXConcurrentWriteable.h | 2 +- src/objective-c/RxLibrary/GRXConcurrentWriteable.m | 2 +- src/objective-c/RxLibrary/GRXImmediateWriter.h | 2 +- src/objective-c/RxLibrary/GRXImmediateWriter.m | 2 +- src/objective-c/RxLibrary/GRXWriter+Immediate.h | 2 +- src/objective-c/RxLibrary/GRXWriter+Immediate.m | 2 +- src/objective-c/RxLibrary/NSEnumerator+GRXUtil.h | 2 +- src/objective-c/RxLibrary/NSEnumerator+GRXUtil.m | 2 +- src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.h | 2 +- src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.m | 4 ++-- 16 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index d6c3a3c165..eb02c21a7a 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -296,7 +296,7 @@ static NSString * const kBearerPrefix = @"Bearer "; // network queue if the write didn't succeed. // If the call is a unary call, parameter \a errorHandler will be ignored and // the error handler of GRPCOpSendClose will be executed in case of error. -- (void)writeMessage:(NSData *)message withErrorHandler:(void (^)())errorHandler { +- (void)writeMessage:(NSData *)message withErrorHandler:(void (^)(void))errorHandler { __weak GRPCCall *weakSelf = self; void(^resumingHandler)(void) = ^{ @@ -342,7 +342,7 @@ static NSString * const kBearerPrefix = @"Bearer "; // Only called from the call queue. The error handler will be called from the // network queue if the requests stream couldn't be closed successfully. -- (void)finishRequestWithErrorHandler:(void (^)())errorHandler { +- (void)finishRequestWithErrorHandler:(void (^)(void))errorHandler { if (!_unaryCall) { [_wrappedCall startBatchWithOperations:@[[[GRPCOpSendClose alloc] init]] errorHandler:errorHandler]; @@ -438,7 +438,7 @@ static NSString * const kBearerPrefix = @"Bearer "; } _connectivityMonitor = [GRPCConnectivityMonitor monitorWithHost:host]; __weak typeof(self) weakSelf = self; - void (^handler)() = ^{ + void (^handler)(void) = ^{ typeof(self) strongSelf = weakSelf; [strongSelf finishWithError:[NSError errorWithDomain:kGRPCErrorDomain code:GRPCErrorCodeUnavailable diff --git a/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.h b/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.h index 8d3c45ee50..cb55e46d70 100644 --- a/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.h +++ b/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.h @@ -57,6 +57,6 @@ * Only one handler is active at a time, so if this method is called again before the previous * handler has been called, it might never be called at all (or yes, if it has already been queued). */ -- (void)handleLossWithHandler:(nullable void (^)())lossHandler - wifiStatusChangeHandler:(nullable void (^)())wifiStatusChangeHandler; +- (void)handleLossWithHandler:(nullable void (^)(void))lossHandler + wifiStatusChangeHandler:(nullable void (^)(void))wifiStatusChangeHandler; @end diff --git a/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.m b/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.m index b322638500..c8e10dd75f 100644 --- a/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.m +++ b/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.m @@ -136,8 +136,8 @@ static void PassFlagsToContextInfoBlock(SCNetworkReachabilityRef target, return returnValue; } -- (void)handleLossWithHandler:(nullable void (^)())lossHandler - wifiStatusChangeHandler:(nullable void (^)())wifiStatusChangeHandler { +- (void)handleLossWithHandler:(nullable void (^)(void))lossHandler + wifiStatusChangeHandler:(nullable void (^)(void))wifiStatusChangeHandler { __weak typeof(self) weakSelf = self; [self startListeningWithHandler:^(GRPCReachabilityFlags *flags) { typeof(self) strongSelf = weakSelf; diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m index f73e9cbc50..a0f4118740 100644 --- a/src/objective-c/GRPCClient/private/GRPCHost.m +++ b/src/objective-c/GRPCClient/private/GRPCHost.m @@ -93,7 +93,7 @@ static GRPCConnectivityMonitor *connectivityMonitor = nil; if (!connectivityMonitor) { connectivityMonitor = [GRPCConnectivityMonitor monitorWithHost:hostURL.host]; - void (^handler)() = ^{ + void (^handler)(void) = ^{ [GRPCHost flushChannelCache]; }; [connectivityMonitor handleLossWithHandler:handler diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.h b/src/objective-c/GRPCClient/private/GRPCWrappedCall.h index 1cd9da8f3e..f569895e7c 100644 --- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.h +++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.h @@ -30,24 +30,24 @@ @interface GRPCOpSendMetadata : GRPCOperation - (instancetype)initWithMetadata:(NSDictionary *)metadata - handler:(void(^)())handler; + handler:(void(^)(void))handler; - (instancetype)initWithMetadata:(NSDictionary *)metadata flags:(uint32_t)flags - handler:(void(^)())handler NS_DESIGNATED_INITIALIZER; + handler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER; @end @interface GRPCOpSendMessage : GRPCOperation - (instancetype)initWithMessage:(NSData *)message - handler:(void(^)())handler NS_DESIGNATED_INITIALIZER; + handler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER; @end @interface GRPCOpSendClose : GRPCOperation -- (instancetype)initWithHandler:(void(^)())handler NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithHandler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER; @end @@ -79,7 +79,7 @@ path:(NSString *)path timeout:(NSTimeInterval)timeout NS_DESIGNATED_INITIALIZER; -- (void)startBatchWithOperations:(NSArray *)ops errorHandler:(void(^)())errorHandler; +- (void)startBatchWithOperations:(NSArray *)ops errorHandler:(void(^)(void))errorHandler; - (void)startBatchWithOperations:(NSArray *)ops; diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m index b0b1223b64..d26d13475d 100644 --- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m +++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m @@ -36,12 +36,12 @@ // Most operation subclasses don't set any flags in the grpc_op, and rely on the flag member being // initialized to zero. grpc_op _op; - void(^_handler)(); + void(^_handler)(void); } - (void)finish { if (_handler) { - void(^handler)() = _handler; + void(^handler)(void) = _handler; _handler = nil; handler(); } @@ -55,13 +55,13 @@ } - (instancetype)initWithMetadata:(NSDictionary *)metadata - handler:(void (^)())handler { + handler:(void (^)(void))handler { return [self initWithMetadata:metadata flags:0 handler:handler]; } - (instancetype)initWithMetadata:(NSDictionary *)metadata flags:(uint32_t)flags - handler:(void (^)())handler { + handler:(void (^)(void))handler { if (self = [super init]) { _op.op = GRPC_OP_SEND_INITIAL_METADATA; _op.data.send_initial_metadata.count = metadata.count; @@ -92,7 +92,7 @@ return [self initWithMessage:nil handler:nil]; } -- (instancetype)initWithMessage:(NSData *)message handler:(void (^)())handler { +- (instancetype)initWithMessage:(NSData *)message handler:(void (^)(void))handler { if (!message) { [NSException raise:NSInvalidArgumentException format:@"message cannot be nil"]; } @@ -116,7 +116,7 @@ return [self initWithHandler:nil]; } -- (instancetype)initWithHandler:(void (^)())handler { +- (instancetype)initWithHandler:(void (^)(void))handler { if (self = [super init]) { _op.op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; _handler = handler; @@ -271,7 +271,7 @@ [self startBatchWithOperations:operations errorHandler:nil]; } -- (void)startBatchWithOperations:(NSArray *)operations errorHandler:(void (^)())errorHandler { +- (void)startBatchWithOperations:(NSArray *)operations errorHandler:(void (^)(void))errorHandler { // Keep logs of op batches when we are running tests. Disabled when in production for improved // performance. #ifdef GRPC_TEST_OBJC diff --git a/src/objective-c/RxLibrary/GRXConcurrentWriteable.h b/src/objective-c/RxLibrary/GRXConcurrentWriteable.h index cec45fae71..f16a3d052a 100644 --- a/src/objective-c/RxLibrary/GRXConcurrentWriteable.h +++ b/src/objective-c/RxLibrary/GRXConcurrentWriteable.h @@ -46,7 +46,7 @@ * Enqueues writeValue: to be sent to the writeable in the main thread. * The passed handler is invoked from the main thread after writeValue: returns. */ -- (void)enqueueValue:(id)value completionHandler:(void (^)())handler; +- (void)enqueueValue:(id)value completionHandler:(void (^)(void))handler; /** * Enqueues writesFinishedWithError:nil to be sent to the writeable in the main thread. After that diff --git a/src/objective-c/RxLibrary/GRXConcurrentWriteable.m b/src/objective-c/RxLibrary/GRXConcurrentWriteable.m index bbfe491783..37bc975f87 100644 --- a/src/objective-c/RxLibrary/GRXConcurrentWriteable.m +++ b/src/objective-c/RxLibrary/GRXConcurrentWriteable.m @@ -50,7 +50,7 @@ dispatchQueue:dispatch_get_main_queue()]; } -- (void)enqueueValue:(id)value completionHandler:(void (^)())handler { +- (void)enqueueValue:(id)value completionHandler:(void (^)(void))handler { dispatch_async(_writeableQueue, ^{ // We're racing a possible cancellation performed by another thread. To turn all already- // enqueued messages into noops, cancellation nillifies the writeable property. If we get it diff --git a/src/objective-c/RxLibrary/GRXImmediateWriter.h b/src/objective-c/RxLibrary/GRXImmediateWriter.h index bdcf5d5937..f88e46b169 100644 --- a/src/objective-c/RxLibrary/GRXImmediateWriter.h +++ b/src/objective-c/RxLibrary/GRXImmediateWriter.h @@ -46,7 +46,7 @@ * Returns a writer that pushes to its writeable the successive values returned by the passed * block. When the block first returns nil, it is released. */ -+ (GRXWriter *)writerWithValueSupplier:(id (^)())block; ++ (GRXWriter *)writerWithValueSupplier:(id (^)(void))block; /** * Returns a writer that iterates over the values of the passed container and pushes them to diff --git a/src/objective-c/RxLibrary/GRXImmediateWriter.m b/src/objective-c/RxLibrary/GRXImmediateWriter.m index d8c6975801..c5d6d1310a 100644 --- a/src/objective-c/RxLibrary/GRXImmediateWriter.m +++ b/src/objective-c/RxLibrary/GRXImmediateWriter.m @@ -52,7 +52,7 @@ return [self writerWithEnumerator:enumerator error:nil]; } -+ (GRXWriter *)writerWithValueSupplier:(id (^)())block { ++ (GRXWriter *)writerWithValueSupplier:(id (^)(void))block { return [self writerWithEnumerator:[NSEnumerator grx_enumeratorWithValueSupplier:block]]; } diff --git a/src/objective-c/RxLibrary/GRXWriter+Immediate.h b/src/objective-c/RxLibrary/GRXWriter+Immediate.h index 292a35f61f..d7935deaa2 100644 --- a/src/objective-c/RxLibrary/GRXWriter+Immediate.h +++ b/src/objective-c/RxLibrary/GRXWriter+Immediate.h @@ -30,7 +30,7 @@ * Returns a writer that pushes to its writeable the successive values returned by the passed * block. When the block first returns nil, it is released. */ -+ (instancetype)writerWithValueSupplier:(id (^)())block; ++ (instancetype)writerWithValueSupplier:(id (^)(void))block; /** * Returns a writer that iterates over the values of the passed container and pushes them to diff --git a/src/objective-c/RxLibrary/GRXWriter+Immediate.m b/src/objective-c/RxLibrary/GRXWriter+Immediate.m index 43aa9c5437..a36a56764d 100644 --- a/src/objective-c/RxLibrary/GRXWriter+Immediate.m +++ b/src/objective-c/RxLibrary/GRXWriter+Immediate.m @@ -27,7 +27,7 @@ return [GRXImmediateWriter writerWithEnumerator:enumerator]; } -+ (instancetype)writerWithValueSupplier:(id (^)())block { ++ (instancetype)writerWithValueSupplier:(id (^)(void))block { return [GRXImmediateWriter writerWithValueSupplier:block]; } diff --git a/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.h b/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.h index 8c72f7858d..38dbaaf9a4 100644 --- a/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.h +++ b/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.h @@ -38,5 +38,5 @@ * Returns a NSEnumerator instance that delegates the invocations of nextObject to the passed block. * When the block first returns nil, it is released. */ -+ (NSEnumerator *)grx_enumeratorWithValueSupplier:(id (^)())block; ++ (NSEnumerator *)grx_enumeratorWithValueSupplier:(id (^)(void))block; @end diff --git a/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.m b/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.m index 309e25ede5..7d8191d0f7 100644 --- a/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.m +++ b/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.m @@ -33,7 +33,7 @@ return [[GRXNSScalarEnumerator alloc] initWithValue:value]; } -+ (NSEnumerator *)grx_enumeratorWithValueSupplier:(id (^)())block { ++ (NSEnumerator *)grx_enumeratorWithValueSupplier:(id (^)(void))block { return [[GRXNSBlockEnumerator alloc] initWithValueSupplier:block]; } @end diff --git a/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.h b/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.h index c45338acdd..c3317b2d04 100644 --- a/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.h +++ b/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.h @@ -27,5 +27,5 @@ * The first time the passed block returns nil, the enumeration will end and the block will be * released. */ -- (instancetype)initWithValueSupplier:(id (^)())block; +- (instancetype)initWithValueSupplier:(id (^)(void))block; @end diff --git a/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.m b/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.m index 7e7cc572b8..eddfd26680 100644 --- a/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.m +++ b/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.m @@ -19,14 +19,14 @@ #import "GRXNSBlockEnumerator.h" @implementation GRXNSBlockEnumerator { - id (^_block)(); + id (^_block)(void); } - (instancetype)init { return [self initWithValueSupplier:nil]; } -- (instancetype)initWithValueSupplier:(id (^)())block { +- (instancetype)initWithValueSupplier:(id (^)(void))block { if ((self = [super init])) { _block = block; } -- cgit v1.2.3 From 739ff08a7f4686306ef8d5b72c2a89b12305e275 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Fri, 20 Oct 2017 14:49:58 -0700 Subject: Fix gRPC Core API void function definition --- include/grpc/grpc_security.h | 2 +- include/grpc/support/alloc.h | 2 +- include/grpc/support/log.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h index 95b1447935..2aede6ee5d 100644 --- a/include/grpc/grpc_security.h +++ b/include/grpc/grpc_security.h @@ -185,7 +185,7 @@ GRPCAPI grpc_call_credentials *grpc_composite_call_credentials_create( GRPCAPI grpc_call_credentials *grpc_google_compute_engine_credentials_create( void *reserved); -GRPCAPI gpr_timespec grpc_max_auth_token_lifetime(); +GRPCAPI gpr_timespec grpc_max_auth_token_lifetime(void); /** Creates a JWT credentials object. May return NULL if the input is invalid. - json_key is the JSON key string containing the client's private key. diff --git a/include/grpc/support/alloc.h b/include/grpc/support/alloc.h index 4b59e137f2..5a01c15976 100644 --- a/include/grpc/support/alloc.h +++ b/include/grpc/support/alloc.h @@ -58,7 +58,7 @@ GPRAPI void gpr_free_aligned(void *ptr); GPRAPI void gpr_set_allocation_functions(gpr_allocation_functions functions); /** Return the family of allocation functions currently in effect. */ -GPRAPI gpr_allocation_functions gpr_get_allocation_functions(); +GPRAPI gpr_allocation_functions gpr_get_allocation_functions(void); #ifdef __cplusplus } diff --git a/include/grpc/support/log.h b/include/grpc/support/log.h index a22fb6a6e2..7190399aca 100644 --- a/include/grpc/support/log.h +++ b/include/grpc/support/log.h @@ -68,7 +68,7 @@ GPRAPI void gpr_log_message(const char *file, int line, /** Set global log verbosity */ GPRAPI void gpr_set_log_verbosity(gpr_log_severity min_severity_to_print); -GPRAPI void gpr_log_verbosity_init(); +GPRAPI void gpr_log_verbosity_init(void); /** Log overrides: applications can use this API to intercept logging calls and use their own implementations */ -- cgit v1.2.3 From 1194782c420bf4c2b4970a460fb2bb5d199441b5 Mon Sep 17 00:00:00 2001 From: kwasimensah Date: Fri, 27 Oct 2017 12:35:55 -0400 Subject: Add logic to work around buggy Android NDKs Old version of the Android NDK have linker issues with thread local support https://github.com/android-ndk/ndk/issues/8 and isn't actually fixed until r12b https://developer.android.com/ndk/downloads/revision_history.html. ABSL's config.h is being updated to catch this case and having gRPC rely on that will make sure it also gets the fix (rather than repeating a somewhat lengthy macro). Since gRPC already has a dependency on ABSL, I figured this wouldn't be an issue. --- include/grpc/impl/codegen/port_platform.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h index fb4bfc3162..324dbe0903 100644 --- a/include/grpc/impl/codegen/port_platform.h +++ b/include/grpc/impl/codegen/port_platform.h @@ -297,6 +297,22 @@ #endif #endif /* GPR_NO_AUTODETECT_PLATFORM */ +// Android specifc logic to detect brokeness around TLS support. +#if defined(__ANDROID__) && defined(__clang__) +#include "third_party/absl/base/config.h" + +#if !defined(ABSL_HAVE_TLS) && defined(GPR_GCC_TLS) +#undef GPR_GCC_TLS +#define GPR_PTHREAD_TLS 1 +#endif //!defined(ABSL_HAVE_TLS) && defined(GPR_GCC_TLS) + +// cpu_posix.cc depends on TLS and cpu_linux.cc doesn't. +#if !defined(GPR_GCC_TLS) && defined(GPR_CPU_POSIX) +#undef GPR_CPU_POSIX +#define GPR_CPU_LINUX 1 +#endif //! defined(GPR_GCC_TLS) && defined(GPR_CPU_POSIX) +#endif // defined(__ANDROID__) && defined(__clang__) + #if defined(__has_include) #if __has_include() #define GRPC_HAS_CXX11_ATOMIC -- cgit v1.2.3 From 51c7bf8425da0761271eab4d330cdbd5fc354d5f Mon Sep 17 00:00:00 2001 From: kwasimensah Date: Fri, 27 Oct 2017 12:39:41 -0400 Subject: Update port_platform.h --- include/grpc/impl/codegen/port_platform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h index 324dbe0903..5784fcee4c 100644 --- a/include/grpc/impl/codegen/port_platform.h +++ b/include/grpc/impl/codegen/port_platform.h @@ -299,7 +299,7 @@ // Android specifc logic to detect brokeness around TLS support. #if defined(__ANDROID__) && defined(__clang__) -#include "third_party/absl/base/config.h" +#include "absl/base/config.h" #if !defined(ABSL_HAVE_TLS) && defined(GPR_GCC_TLS) #undef GPR_GCC_TLS -- cgit v1.2.3 From 9757fd25efd2acd718ef741143516b9eb1113003 Mon Sep 17 00:00:00 2001 From: kwasimensah Date: Fri, 27 Oct 2017 12:41:39 -0400 Subject: Update BUILD --- BUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/BUILD b/BUILD index 99411f955e..e81b485143 100644 --- a/BUILD +++ b/BUILD @@ -551,6 +551,7 @@ grpc_cc_library( "include/grpc/impl/codegen/sync_posix.h", "include/grpc/impl/codegen/sync_windows.h", ], + deps = ["@com_google_absl//absl/base:config"], ) grpc_cc_library( -- cgit v1.2.3 From c58952649f27b064ceabedafc84096b5d137d361 Mon Sep 17 00:00:00 2001 From: kwasimensah Date: Mon, 30 Oct 2017 12:26:46 -0400 Subject: Got cpu_posix.cc to work without tls --- include/grpc/impl/codegen/port_platform.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h index 5784fcee4c..dc5a6ea6e5 100644 --- a/include/grpc/impl/codegen/port_platform.h +++ b/include/grpc/impl/codegen/port_platform.h @@ -306,13 +306,6 @@ #define GPR_PTHREAD_TLS 1 #endif //!defined(ABSL_HAVE_TLS) && defined(GPR_GCC_TLS) -// cpu_posix.cc depends on TLS and cpu_linux.cc doesn't. -#if !defined(GPR_GCC_TLS) && defined(GPR_CPU_POSIX) -#undef GPR_CPU_POSIX -#define GPR_CPU_LINUX 1 -#endif //! defined(GPR_GCC_TLS) && defined(GPR_CPU_POSIX) -#endif // defined(__ANDROID__) && defined(__clang__) - #if defined(__has_include) #if __has_include() #define GRPC_HAS_CXX11_ATOMIC -- cgit v1.2.3 From 62e6b1c444916da1c1e725bb5e5952488b1692ca Mon Sep 17 00:00:00 2001 From: kwasimensah Date: Mon, 30 Oct 2017 12:28:58 -0400 Subject: Use pthreads on posix Use pthreads on posix instead of relying on thread local support --- src/core/lib/support/cpu_posix.cc | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/core/lib/support/cpu_posix.cc b/src/core/lib/support/cpu_posix.cc index 503a96b4c8..c32ca4659c 100644 --- a/src/core/lib/support/cpu_posix.cc +++ b/src/core/lib/support/cpu_posix.cc @@ -18,19 +18,20 @@ #include -#ifdef GPR_CPU_POSIX +#if defined(GPR_CPU_POSIX) #include +#include #include #include +#include + #include #include #include #include -static __thread char magic_thread_local; - static long ncpus = 0; static void init_ncpus() { @@ -52,7 +53,27 @@ unsigned gpr_cpu_current_cpu(void) { most code that's using this is using it to shard across work queues though, so here we use thread identity instead to achieve a similar though not identical effect */ - return (unsigned)GPR_HASH_POINTER(&magic_thread_local, gpr_cpu_num_cores()); + static auto DeleteValue = [](void *value_ptr) { + unsigned int *value = static_cast(value_ptr); + if (value) { + delete value; + } + }; + static pthread_key_t thread_id_key; + static int thread_id_key_create_result __attribute__((unused)) = + pthread_key_create(&thread_id_key, DeleteValue); + // pthread_t isn't portably defined to map to an integral type. So keep track + // of thread identity explicitly so hashing works reliably. + static std::atomic thread_counter(0); + + unsigned int *thread_id = + static_cast(pthread_getspecific(thread_id_key)); + if (thread_id == nullptr) { + thread_id = new unsigned int(thread_counter++); + pthread_setspecific(thread_id_key, thread_id); + } + + return (unsigned)GPR_HASH_POINTER(*thread_id, gpr_cpu_num_cores()); } #endif /* GPR_CPU_POSIX */ -- cgit v1.2.3 From 4b02f3b2b6bf0f186a293e44753c30492584aad0 Mon Sep 17 00:00:00 2001 From: kwasimensah Date: Wed, 1 Nov 2017 13:26:00 -0400 Subject: Updated to use gpr_free and gpr_malloc --- src/core/lib/support/cpu_posix.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/lib/support/cpu_posix.cc b/src/core/lib/support/cpu_posix.cc index c32ca4659c..2be66ef54e 100644 --- a/src/core/lib/support/cpu_posix.cc +++ b/src/core/lib/support/cpu_posix.cc @@ -27,6 +27,7 @@ #include +#include #include #include #include @@ -56,7 +57,7 @@ unsigned gpr_cpu_current_cpu(void) { static auto DeleteValue = [](void *value_ptr) { unsigned int *value = static_cast(value_ptr); if (value) { - delete value; + gpr_free(value); } }; static pthread_key_t thread_id_key; @@ -69,7 +70,8 @@ unsigned gpr_cpu_current_cpu(void) { unsigned int *thread_id = static_cast(pthread_getspecific(thread_id_key)); if (thread_id == nullptr) { - thread_id = new unsigned int(thread_counter++); + thread_id = static_cast(gpr_malloc(sizeof(unsigned int))); + *thread_id = thread_counter++; pthread_setspecific(thread_id_key, thread_id); } -- cgit v1.2.3 From 1a671dea71b133848017e4ab001bfeae6b009ab0 Mon Sep 17 00:00:00 2001 From: kwasimensah Date: Wed, 1 Nov 2017 13:28:48 -0400 Subject: Simplify macro logic here --- include/grpc/impl/codegen/port_platform.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h index dc5a6ea6e5..7dde5c6119 100644 --- a/include/grpc/impl/codegen/port_platform.h +++ b/include/grpc/impl/codegen/port_platform.h @@ -297,8 +297,6 @@ #endif #endif /* GPR_NO_AUTODETECT_PLATFORM */ -// Android specifc logic to detect brokeness around TLS support. -#if defined(__ANDROID__) && defined(__clang__) #include "absl/base/config.h" #if !defined(ABSL_HAVE_TLS) && defined(GPR_GCC_TLS) -- cgit v1.2.3 From 685b5d459f3aedce9a1fb15fae6481b8a585d961 Mon Sep 17 00:00:00 2001 From: kwasimensah Date: Wed, 1 Nov 2017 16:38:44 -0400 Subject: Fixing port_platform Copy over Absl macro to deal with C++/C differences. --- include/grpc/impl/codegen/port_platform.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h index 7dde5c6119..c2ec85d78d 100644 --- a/include/grpc/impl/codegen/port_platform.h +++ b/include/grpc/impl/codegen/port_platform.h @@ -297,12 +297,26 @@ #endif #endif /* GPR_NO_AUTODETECT_PLATFORM */ -#include "absl/base/config.h" - -#if !defined(ABSL_HAVE_TLS) && defined(GPR_GCC_TLS) +/* + * There are platforms for which TLS should not be used even though the compiler + * makes it seem like it's supported (Android NDK < r12b for example). + * This is primarily because of linker problems and toolchain misconfiguration: + * TLS isn't supported until NDK r12b per + * https://developer.android.com/ndk/downloads/revision_history.html + * Since NDK r16, `__NDK_MAJOR__` and `__NDK_MINOR__` are defined in + * . For NDK < r16, users should define these macros, + * e.g. `-D__NDK_MAJOR__=11 -D__NKD_MINOR__=0` for NDK r11. */ +#if defined(__ANDROID__) && defined(__clang__) && defined(GPR_GCC_TLS) +#if __has_include() +#include +#endif /* __has_include() */ +#if defined(__ANDROID__) && defined(__clang__) && defined(__NDK_MAJOR__) && \ + defined(__NDK_MINOR__) && \ + ((__NDK_MAJOR__ < 12) || ((__NDK_MAJOR__ == 12) && (__NDK_MINOR__ < 1))) #undef GPR_GCC_TLS #define GPR_PTHREAD_TLS 1 -#endif //!defined(ABSL_HAVE_TLS) && defined(GPR_GCC_TLS) +#endif +#endif /* defined(__ANDROID__) && defined(__clang__) && defined(GPR_GCC_TLS) */ #if defined(__has_include) #if __has_include() -- cgit v1.2.3 From 221522b455ad02f88e5ca0aa945f4cb7e7388ee8 Mon Sep 17 00:00:00 2001 From: kwasimensah Date: Wed, 1 Nov 2017 16:47:41 -0400 Subject: Revert BUILD change --- BUILD | 1 - 1 file changed, 1 deletion(-) diff --git a/BUILD b/BUILD index e81b485143..99411f955e 100644 --- a/BUILD +++ b/BUILD @@ -551,7 +551,6 @@ grpc_cc_library( "include/grpc/impl/codegen/sync_posix.h", "include/grpc/impl/codegen/sync_windows.h", ], - deps = ["@com_google_absl//absl/base:config"], ) grpc_cc_library( -- cgit v1.2.3 From ac299723bd9c8cee60779cc3513a9acf46e731a6 Mon Sep 17 00:00:00 2001 From: kwasimensah Date: Wed, 1 Nov 2017 19:50:17 -0400 Subject: Making clang format happy --- include/grpc/impl/codegen/port_platform.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h index c2ec85d78d..1906886d5e 100644 --- a/include/grpc/impl/codegen/port_platform.h +++ b/include/grpc/impl/codegen/port_platform.h @@ -298,8 +298,8 @@ #endif /* GPR_NO_AUTODETECT_PLATFORM */ /* - * There are platforms for which TLS should not be used even though the compiler - * makes it seem like it's supported (Android NDK < r12b for example). + * There are platforms for which TLS should not be used even though the + * compiler makes it seem like it's supported (Android NDK < r12b for example). * This is primarily because of linker problems and toolchain misconfiguration: * TLS isn't supported until NDK r12b per * https://developer.android.com/ndk/downloads/revision_history.html @@ -316,7 +316,7 @@ #undef GPR_GCC_TLS #define GPR_PTHREAD_TLS 1 #endif -#endif /* defined(__ANDROID__) && defined(__clang__) && defined(GPR_GCC_TLS) */ +#endif /*defined(__ANDROID__) && defined(__clang__) && defined(GPR_GCC_TLS) */ #if defined(__has_include) #if __has_include() -- cgit v1.2.3 From bd42ca1110c0aff7a91bdb5e2077e6d69721f4f8 Mon Sep 17 00:00:00 2001 From: josh Date: Wed, 1 Nov 2017 22:37:17 -0600 Subject: Adding check_bazel_workspace.py to perform a sanity check that the external repo dependencies expressed via git submodules and those expressed as Bazel WORKSPACE rules agree exactly. --- tools/run_tests/sanity/check_bazel_workspace.py | 49 +++++++++++++++++++++++++ tools/run_tests/sanity/sanity_tests.yaml | 1 + 2 files changed, 50 insertions(+) create mode 100644 tools/run_tests/sanity/check_bazel_workspace.py diff --git a/tools/run_tests/sanity/check_bazel_workspace.py b/tools/run_tests/sanity/check_bazel_workspace.py new file mode 100644 index 0000000000..776c78b03f --- /dev/null +++ b/tools/run_tests/sanity/check_bazel_workspace.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python + +# Copyright 2016 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from __future__ import print_function + +import ast +import os +import re +import subprocess +import sys + +os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '../../..')) + +git_hash_pattern = re.compile('[0-9a-f]{40}') + +# Parse git hashes from submodules +git_submodules = subprocess.check_output('git submodule', shell=True).strip().split('\n') +git_submodule_hashes = {re.search(git_hash_pattern, s).group() for s in git_submodules} + +# Parse git hashes from Bazel WORKSPACE {new_}http_archive rules +with open('WORKSPACE', 'r') as f: + workspace_rules = [expr.value for expr in ast.parse(f.read()).body] + +http_archive_rules = [rule for rule in workspace_rules if rule.func.id.endswith('http_archive')] +archive_urls = [kw.value.s for rule in http_archive_rules for kw in rule.keywords if kw.arg == 'url'] +workspace_git_hashes = {re.search(git_hash_pattern, url).group() for url in archive_urls} + +# Validate the equivalence of the git submodules and Bazel git dependencies. The +# condition we impose is that there is a git submodule for every dependency in +# the workspace, but not necessarily conversely. E.g. Bloaty is a dependency +# not used by any of the targets built by Bazel. +if len(workspace_git_hashes - git_submodule_hashes) > 0: + print("Found discrepancies between git submodules and Bazel WORKSPACE dependencies") + sys.exit(1) + +sys.exit(0) diff --git a/tools/run_tests/sanity/sanity_tests.yaml b/tools/run_tests/sanity/sanity_tests.yaml index 4bc4b7c56f..57292a4f40 100644 --- a/tools/run_tests/sanity/sanity_tests.yaml +++ b/tools/run_tests/sanity/sanity_tests.yaml @@ -1,4 +1,5 @@ # a set of tests that are run in parallel for sanity tests +- script: tools/run_tests/sanity/check_bazel_workspace.py - script: tools/run_tests/sanity/check_cache_mk.sh - script: tools/run_tests/sanity/check_owners.sh - script: tools/run_tests/sanity/check_sources_and_headers.py -- cgit v1.2.3 From cf5a1f2c8162fbfefc0f4aa5d28e6a17d50a840f Mon Sep 17 00:00:00 2001 From: Garret Kelly Date: Tue, 10 Oct 2017 15:58:41 -0400 Subject: Do not interpolate variables in leading comments. There is at least one well-known proto file (plugin.proto) with comments that include variable-like strings that are not actual variables. This leads to DFATAL log statements that clutter the output and don't provide any benefit. --- src/compiler/cpp_generator.cc | 2 +- src/compiler/csharp_generator.cc | 2 +- src/compiler/node_generator.cc | 2 +- src/compiler/objective_c_generator.cc | 2 +- src/compiler/php_generator.cc | 2 +- src/compiler/protobuf_plugin.h | 1 + src/compiler/python_generator.cc | 2 +- src/compiler/ruby_generator.cc | 2 +- src/compiler/schema_interface.h | 1 + 9 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc index 3adf0fa451..dec8cd0f25 100644 --- a/src/compiler/cpp_generator.cc +++ b/src/compiler/cpp_generator.cc @@ -104,7 +104,7 @@ grpc::string GetHeaderPrologue(grpc_generator::File* file, grpc::string leading_comments = file->GetLeadingComments("//"); if (!leading_comments.empty()) { printer->Print(vars, "// Original file comments:\n"); - printer->Print(leading_comments.c_str()); + printer->PrintRaw(leading_comments.c_str()); } printer->Print(vars, "#ifndef GRPC_$filename_identifier$__INCLUDED\n"); printer->Print(vars, "#define GRPC_$filename_identifier$__INCLUDED\n"); diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc index e0957bf9bb..40fe0b054a 100644 --- a/src/compiler/csharp_generator.cc +++ b/src/compiler/csharp_generator.cc @@ -666,7 +666,7 @@ grpc::string GetServices(const FileDescriptor* file, bool generate_client, grpc::string leading_comments = GetCsharpComments(file, true); if (!leading_comments.empty()) { out.Print("// Original file comments:\n"); - out.Print(leading_comments.c_str()); + out.PrintRaw(leading_comments.c_str()); } out.Print("#pragma warning disable 1591\n"); diff --git a/src/compiler/node_generator.cc b/src/compiler/node_generator.cc index ed835b4445..661587cbd6 100644 --- a/src/compiler/node_generator.cc +++ b/src/compiler/node_generator.cc @@ -250,7 +250,7 @@ grpc::string GenerateFile(const FileDescriptor* file) { grpc::string leading_comments = GetNodeComments(file, true); if (!leading_comments.empty()) { out.Print("// Original file comments:\n"); - out.Print(leading_comments.c_str()); + out.PrintRaw(leading_comments.c_str()); } out.Print("'use strict';\n"); diff --git a/src/compiler/objective_c_generator.cc b/src/compiler/objective_c_generator.cc index 349f1dc281..8fe30e97e9 100644 --- a/src/compiler/objective_c_generator.cc +++ b/src/compiler/objective_c_generator.cc @@ -65,7 +65,7 @@ static void PrintAllComments(const DescriptorType* desc, Printer* printer) { printer->Print(" * "); size_t start_pos = it->find_first_not_of(' '); if (start_pos != grpc::string::npos) { - printer->Print(it->c_str() + start_pos); + printer->PrintRaw(it->c_str() + start_pos); } printer->Print("\n"); } diff --git a/src/compiler/php_generator.cc b/src/compiler/php_generator.cc index 1ff9520d7f..d9705e8077 100644 --- a/src/compiler/php_generator.cc +++ b/src/compiler/php_generator.cc @@ -164,7 +164,7 @@ grpc::string GenerateFile(const FileDescriptor* file, grpc::string leading_comments = GetPHPComments(file, "//"); if (!leading_comments.empty()) { out.Print("// Original file comments:\n"); - out.Print(leading_comments.c_str()); + out.PrintRaw(leading_comments.c_str()); } map vars; diff --git a/src/compiler/protobuf_plugin.h b/src/compiler/protobuf_plugin.h index 1551908156..b971af1310 100644 --- a/src/compiler/protobuf_plugin.h +++ b/src/compiler/protobuf_plugin.h @@ -141,6 +141,7 @@ class ProtoBufPrinter : public grpc_generator::Printer { } void Print(const char* string) { printer_.Print(string); } + void PrintRaw(const char* string) { printer_.PrintRaw(string); } void Indent() { printer_.Indent(); } void Outdent() { printer_.Outdent(); } diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc index c1ae7d31ad..8a0b889454 100644 --- a/src/compiler/python_generator.cc +++ b/src/compiler/python_generator.cc @@ -101,7 +101,7 @@ void PrivateGenerator::PrintAllComments(StringVector comments, ++it) { size_t start_pos = it->find_first_not_of(' '); if (start_pos != grpc::string::npos) { - out->Print(it->c_str() + start_pos); + out->PrintRaw(it->c_str() + start_pos); } out->Print("\n"); } diff --git a/src/compiler/ruby_generator.cc b/src/compiler/ruby_generator.cc index ed7e074b47..e81dea603b 100644 --- a/src/compiler/ruby_generator.cc +++ b/src/compiler/ruby_generator.cc @@ -174,7 +174,7 @@ grpc::string GetServices(const FileDescriptor* file) { grpc::string leading_comments = GetRubyComments(file, true); if (!leading_comments.empty()) { out.Print("# Original file comments:\n"); - out.Print(leading_comments.c_str()); + out.PrintRaw(leading_comments.c_str()); } out.Print("\n"); diff --git a/src/compiler/schema_interface.h b/src/compiler/schema_interface.h index b2021f2926..c000478e68 100644 --- a/src/compiler/schema_interface.h +++ b/src/compiler/schema_interface.h @@ -86,6 +86,7 @@ struct Printer { virtual void Print(const std::map& vars, const char* template_string) = 0; virtual void Print(const char* string) = 0; + virtual void PrintRaw(const char* string) = 0; virtual void Indent() = 0; virtual void Outdent() = 0; }; -- cgit v1.2.3 From d4e296b36b7379aae98cfe5aa72700e47b7bbb71 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Wed, 8 Nov 2017 14:13:44 -0800 Subject: Transport explainer --- doc/core/transport_explainer.md | 197 +++++++++++++++++++++++++++++++++++ tools/doxygen/Doxyfile.core | 1 + tools/doxygen/Doxyfile.core.internal | 1 + 3 files changed, 199 insertions(+) create mode 100644 doc/core/transport_explainer.md diff --git a/doc/core/transport_explainer.md b/doc/core/transport_explainer.md new file mode 100644 index 0000000000..f48fa0f3b1 --- /dev/null +++ b/doc/core/transport_explainer.md @@ -0,0 +1,197 @@ +# Transport Explainer + +@vjpai + +## Existing Transports + +[gRPC +transports](https://github.com/grpc/grpc/tree/master/src/core/ext/transport) +plug in below the core API (one level below the C++ or other wrapped-language +API). You can write your transport in C or C++ though; currently (Nov 2017) all +the transports are nominally written in C++ though they are idiomatically C. The +existing transports are: + +* [HTTP/2](https://github.com/grpc/grpc/tree/master/src/core/ext/transport/chttp2) +* [Cronet](https://github.com/grpc/grpc/tree/master/src/core/ext/transport/cronet) +* [In-process](https://github.com/grpc/grpc/tree/master/src/core/ext/transport/inproc) + +Among these, the in-process is likely the easiest to understand, though arguably +also the least similar to a "real" sockets-based transport since it is only used +in a single process. + +## Transport stream ops + +In the gRPC core implementation, a fundamental struct is the +`grpc_transport_stream_op_batch` which represents a collection of stream +operations sent to a transport. (Note that in gRPC, _stream_ and _RPC_ are used +synonymously since all RPCs are actually streams internally.) The ops in a batch +can include: + +* send\_initial\_metadata + - Client: initate an RPC + - Server: supply response headers +* recv\_initial\_metadata + - Client: get response headers + - Server: accept an RPC +* send\_message (zero or more) : send a data buffer +* recv\_message (zero or more) : receive a data buffer +* send\_trailing\_metadata + - Client: half-close indicating that no more messages will be coming + - Server: full-close providing final status for the RPC +* recv\_trailing\_metadata: get final status for the RPC + - Server extra: This op shouldn't actually be considered complete until the + server has also sent trailing metadata to provide the other side with final + status +* cancel\_stream: Attempt to cancel an RPC +* collect\_stats: Get stats + +The fundamental responsibility of the transport is to transform between this +internal format and an actual wire format, so the processing of these operations +is largely transport-specific. + +One or more of these ops are grouped into a batch. Applications can start all of +a call's ops in a single batch, or they can split them up into multiple +batches. Results of each batch are returned asynchronously via a completion +queue. + +Internally, we use callbacks to indicate completion. The surface layer creates a +callback when starting a new batch and sends it down the filter stack along with +the batch. The transport must invoke this callback when the batch is complete, +and then the surface layer returns an event to the application via the +completion queue. Each batch can have up to 3 callbacks: + +* recv\_initial\_metadata\_ready (called by the transport when the + recv\_initial\_metadata op is complete) +* recv\_message\_ready (called by the transport when the recv_message op is + complete) +* on\_complete (called by the transport when the entire batch is complete) + +## Timelines of transport stream op batches + +The transport's job is to sequence and interpret various possible interleavings +of the basic stream ops. For example, a sample timeline of batches would be: + +1. Client send\_initial\_metadata: Initiate an RPC with a path (method) and authority +1. Server recv\_initial\_metadata: accept an RPC +1. Client send\_message: Supply the input proto for the RPC +1. Server recv\_message: Get the input proto from the RPC +1. Client send\_trailing\_metadata: This is a half-close indicating that the + client will not be sending any more messages +1. Server recv\_trailing\_metadata: The server sees this from the client and + knows that it will not get any more messages. This won't complete yet though, + as described above. +1. Server send\_initial\_metadata, send\_message, send\_trailing\_metadata: A + batch can contain multiple ops, and this batch provides the RPC response + headers, response content, and status. Note that sending the trailing + metadata will also complete the server's receive of trailing metadata. +1. Client recv\_initial\_metadata: The number of ops in one side of the batch + has no relation with the number of ops on the other side of the batch. In + this case, the client is just collecting the response headers. +1. Client recv\_message, recv\_trailing\_metadata: Get the data response and + status + + +There are other possible sample timelines. For example, for client-side streaming, a "typical" sequence would be: + +1. Server: recv\_initial\_metadata + - At API-level, that would be the server requesting an RPC +1. Server: recv\_trailing\_metadata + - This is for when the server wants to know the final completion of the RPC + through an `AsyncNotifyWhenDone` API in C++ +1. Client: send\_initial\_metadata, recv\_message, recv\_trailing\_metadata + - At API-level, that's a client invoking a client-side streaming call. The + send\_initial\_metadata is the call invocation, the recv\_message colects + the final response from the server, and the recv\_trailing\_metadata gets + the `grpc::Status` value that will be returned from the call +1. Client: send\_message / Server: recv\_message + - Repeat the above step numerous times; these correspond to a client issuing + `Write` in a loop and a server doing `Read` in a loop until `Read` fails +1. Client: send\_trailing\_metadata / Server: recv\_message that indicates doneness (NULL) + - These correspond to a client issuing `WritesDone` which causes the server's + `Read` to fail +1. Server: send\_message, send\_trailing\_metadata + - These correpond to the server doing `Finish` + +The sends on one side will call their own callbacks when complete, and they will +in turn trigger actions that cause the other side's recv operations to +complete. In some transports, a send can sometimes complete before the recv on +the other side (e.g., in HTTP/2 if there is sufficient flow-control buffer space +available) + +## Other transport duties + +In addition to these basic stream ops, the transport must handle cancellations +of a stream at any time and pass their effects to the other side. For example, +in HTTP/2, this triggers a `RST_STREAM` being sent on the wire. The transport +must perform operations like pings and statistics that are used to shape +transport-level characteristics like flow control (see, for example, their use +in the HTTP/2 transport). + +## Putting things together with detail: Sending Metadata + +* API layer: `map` that is specific to this RPC +* Core surface layer: array of `{slice, slice}` pairs where each slice + references an underlying string +* [Core transport + layer](https://github.com/grpc/grpc/tree/master/src/core/lib/transport): list + of `{slice, slice}` pairs that includes the above plus possibly some general + metadata (e.g., Method and Authority for initial metadata) +* [Specific transport + layer](https://github.com/grpc/grpc/tree/master/src/core/ext/transport): + - Either send it to the other side using transport-specific API (e.g., Cronet) + - Or have it sent through the [iomgr/endpoint + layer](https://github.com/grpc/grpc/tree/master/src/core/lib/iomgr) (e.g., + HTTP/2) + - Or just manipulate pointers to get it from one side to the other (e.g., + In-process) + +## Requirements for any transport + +Each transport implements several operations in a vtbl (may change to actual +virtual functions as transport moves to idiomatic C++). + +The most important and common one is `perform_stream_op`. This function +processes a single stream op batch on a specific stream that is associated with +a specific transport: + +* Gets the 6 ops/cancel passed down from the surface +* Pass metadata from one side to the other as described above +* Transform messages between slice buffer structure and stream of bytes to pass + to other side + - May require insertion of extra bytes (e.g., per-message headers in HTTP/2) +* React to metadata to preserve expected orderings (*) +* Schedule invocation of completion callbacks + +There are other functions in the vtbl as well. + +* `perform_transport_op` + - Configure the transport instance for the connectivity state change notifier + or the server-side accept callback + - Disconnect transport or set up a goaway for later streams +* `init_stream` + - Starts a stream from the client-side + - (*) Server-side of the transport must call `accept_stream_cb` when a new + stream is available + * Triggers request-matcher +* `destroy_stream`, `destroy_transport` + - Free up data related to a stream or transport +* `set_pollset`, `set_pollset_set`, `get_endpoint` + - Map each specific instance of the transport to FDs being used by iomgr (for + HTTP/2) + - Get a pointer to the endpoint structure that actually moves the data + (wrapper around a socket for HTTP/2) + +## Book-keeping responsibilities of the transport layer + +A given transport must keep all of its transport and streams ref-counted. This +is essential to make sure that no struct disappears before it is done being +used. + +A transport must also preserve relevant orders for the different categories of +ops on a stream, as described above. A transport must also make sure that all +relevant batch operations have completed before scheduling the `on_complete` +closure for a batch. Further examples include the idea that the server logic +expects to not complete recv\_trailing\_metadata until after it actually sends +trailing metadata since it would have already found this out by seeing a NULL’ed +recv\_message. This is considered part of the transport's duties in preserving +orders. diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core index c8fd2ee48b..ef5fb90a93 100644 --- a/tools/doxygen/Doxyfile.core +++ b/tools/doxygen/Doxyfile.core @@ -774,6 +774,7 @@ doc/connectivity-semantics-and-api.md \ doc/core/grpc-error.md \ doc/core/moving-to-c++.md \ doc/core/pending_api_cleanups.md \ +doc/core/transport_explainer.md \ doc/cpp-style-guide.md \ doc/environment_variables.md \ doc/epoll-polling-engine.md \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index b9844f8b89..f8835e1047 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -774,6 +774,7 @@ doc/connectivity-semantics-and-api.md \ doc/core/grpc-error.md \ doc/core/moving-to-c++.md \ doc/core/pending_api_cleanups.md \ +doc/core/transport_explainer.md \ doc/cpp-style-guide.md \ doc/environment_variables.md \ doc/epoll-polling-engine.md \ -- cgit v1.2.3 From ad5bec0ee9436e91684b6eed042837473ccbaea7 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Mon, 13 Nov 2017 09:40:18 +0100 Subject: Formatting. --- src/core/lib/support/cpu_posix.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/lib/support/cpu_posix.cc b/src/core/lib/support/cpu_posix.cc index 2be66ef54e..a9284d8047 100644 --- a/src/core/lib/support/cpu_posix.cc +++ b/src/core/lib/support/cpu_posix.cc @@ -54,8 +54,8 @@ unsigned gpr_cpu_current_cpu(void) { most code that's using this is using it to shard across work queues though, so here we use thread identity instead to achieve a similar though not identical effect */ - static auto DeleteValue = [](void *value_ptr) { - unsigned int *value = static_cast(value_ptr); + static auto DeleteValue = [](void* value_ptr) { + unsigned int* value = static_cast(value_ptr); if (value) { gpr_free(value); } @@ -67,10 +67,10 @@ unsigned gpr_cpu_current_cpu(void) { // of thread identity explicitly so hashing works reliably. static std::atomic thread_counter(0); - unsigned int *thread_id = - static_cast(pthread_getspecific(thread_id_key)); + unsigned int* thread_id = + static_cast(pthread_getspecific(thread_id_key)); if (thread_id == nullptr) { - thread_id = static_cast(gpr_malloc(sizeof(unsigned int))); + thread_id = static_cast(gpr_malloc(sizeof(unsigned int))); *thread_id = thread_counter++; pthread_setspecific(thread_id_key, thread_id); } -- cgit v1.2.3 From 40737d67ee93f3c60be1f0ff6486d6f045646312 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Mon, 13 Nov 2017 08:02:35 -0800 Subject: Add error string to recv status API --- include/grpc++/impl/codegen/call.h | 2 ++ include/grpc/impl/codegen/grpc_types.h | 1 + .../transport/chttp2/transport/chttp2_transport.cc | 9 +++--- src/core/lib/channel/channel_stack.h | 1 + src/core/lib/surface/call.cc | 34 +++++++++++++--------- src/core/lib/transport/error_utils.cc | 8 +++-- src/core/lib/transport/error_utils.h | 8 +++-- test/cpp/microbenchmarks/bm_error.cc | 6 ++-- 8 files changed, 43 insertions(+), 26 deletions(-) diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h index 1a988297dc..91f45b3147 100644 --- a/include/grpc++/impl/codegen/call.h +++ b/include/grpc++/impl/codegen/call.h @@ -579,6 +579,7 @@ class CallOpClientRecvStatus { op->data.recv_status_on_client.trailing_metadata = metadata_map_->arr(); op->data.recv_status_on_client.status = &status_code_; op->data.recv_status_on_client.status_details = &error_message_; + op->data.recv_status_on_client.error_string = &error_string_; op->flags = 0; op->reserved = NULL; } @@ -605,6 +606,7 @@ class CallOpClientRecvStatus { Status* recv_status_; grpc_status_code status_code_; grpc_slice error_message_; + const char* error_string_; }; /// An abstract collection of call ops, used to generate the diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h index 03be610d25..83b35b1dc4 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -558,6 +558,7 @@ typedef struct grpc_op { grpc_metadata_array* trailing_metadata; grpc_status_code* status; grpc_slice* status_details; + const char** error_string; } recv_status_on_client; struct grpc_op_recv_close_on_server { /** out argument, set to 1 if the call failed in any way (seen as a diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 034e6ed8ca..d5c61d80ae 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -1756,7 +1756,7 @@ static void send_goaway(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t, grpc_http2_error_code http_error; grpc_slice slice; grpc_error_get_status(exec_ctx, error, GRPC_MILLIS_INF_FUTURE, NULL, &slice, - &http_error); + &http_error, NULL); grpc_chttp2_goaway_append(t->last_new_stream_id, (uint32_t)http_error, grpc_slice_ref_internal(slice), &t->qbuf); grpc_chttp2_initiate_write(exec_ctx, t, @@ -2059,7 +2059,7 @@ void grpc_chttp2_cancel_stream(grpc_exec_ctx* exec_ctx, if (s->id != 0) { grpc_http2_error_code http_error; grpc_error_get_status(exec_ctx, due_to_error, s->deadline, NULL, NULL, - &http_error); + &http_error, NULL); grpc_slice_buffer_add( &t->qbuf, grpc_chttp2_rst_stream_create(s->id, (uint32_t)http_error, &s->stats.outgoing)); @@ -2077,7 +2077,8 @@ void grpc_chttp2_fake_status(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t, grpc_chttp2_stream* s, grpc_error* error) { grpc_status_code status; grpc_slice slice; - grpc_error_get_status(exec_ctx, error, s->deadline, &status, &slice, NULL); + grpc_error_get_status(exec_ctx, error, s->deadline, &status, &slice, NULL, + NULL); if (status != GRPC_STATUS_OK) { s->seen_error = true; @@ -2243,7 +2244,7 @@ static void close_from_api(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t, grpc_status_code grpc_status; grpc_slice slice; grpc_error_get_status(exec_ctx, error, s->deadline, &grpc_status, &slice, - NULL); + NULL, NULL); GPR_ASSERT(grpc_status >= 0 && (int)grpc_status < 100); diff --git a/src/core/lib/channel/channel_stack.h b/src/core/lib/channel/channel_stack.h index aa993112a0..41851382ae 100644 --- a/src/core/lib/channel/channel_stack.h +++ b/src/core/lib/channel/channel_stack.h @@ -84,6 +84,7 @@ typedef struct { typedef struct { grpc_call_stats stats; grpc_status_code final_status; + const char* error_string; } grpc_call_final_info; /* Channel filters specify: diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc index 9fd4fdbef9..4ce494872a 100644 --- a/src/core/lib/surface/call.cc +++ b/src/core/lib/surface/call.cc @@ -234,6 +234,7 @@ struct grpc_call { struct { grpc_status_code* status; grpc_slice* status_details; + const char** error_string; } client; struct { int* cancelled; @@ -286,7 +287,8 @@ static void receiving_slice_ready(grpc_exec_ctx* exec_ctx, void* bctlp, static void get_final_status(grpc_exec_ctx* exec_ctx, grpc_call* call, void (*set_value)(grpc_status_code code, void* user_data), - void* set_value_user_data, grpc_slice* details); + void* set_value_user_data, grpc_slice* details, + const char** error_string); static void set_status_value_directly(grpc_status_code status, void* dest); static void set_status_from_error(grpc_exec_ctx* exec_ctx, grpc_call* call, status_source source, grpc_error* error); @@ -548,7 +550,8 @@ static void destroy_call(grpc_exec_ctx* exec_ctx, void* call, } get_final_status(exec_ctx, c, set_status_value_directly, - &c->final_info.final_status, NULL); + &c->final_info.final_status, NULL, + &c->final_info.error_string); c->final_info.stats.latency = gpr_time_sub(gpr_now(GPR_CLOCK_MONOTONIC), c->start_time); @@ -734,16 +737,15 @@ static void cancel_with_status(grpc_exec_ctx* exec_ctx, grpc_call* c, * FINAL STATUS CODE MANIPULATION */ -static bool get_final_status_from(grpc_exec_ctx* exec_ctx, grpc_call* call, - grpc_error* error, bool allow_ok_status, - void (*set_value)(grpc_status_code code, - void* user_data), - void* set_value_user_data, - grpc_slice* details) { +static bool get_final_status_from( + grpc_exec_ctx* exec_ctx, grpc_call* call, grpc_error* error, + bool allow_ok_status, + void (*set_value)(grpc_status_code code, void* user_data), + void* set_value_user_data, grpc_slice* details, const char** error_string) { grpc_status_code code; grpc_slice slice = grpc_empty_slice(); grpc_error_get_status(exec_ctx, error, call->send_deadline, &code, &slice, - NULL); + NULL, error_string); if (code == GRPC_STATUS_OK && !allow_ok_status) { return false; } @@ -758,7 +760,8 @@ static bool get_final_status_from(grpc_exec_ctx* exec_ctx, grpc_call* call, static void get_final_status(grpc_exec_ctx* exec_ctx, grpc_call* call, void (*set_value)(grpc_status_code code, void* user_data), - void* set_value_user_data, grpc_slice* details) { + void* set_value_user_data, grpc_slice* details, + const char** error_string) { int i; received_status status[STATUS_SOURCE_COUNT]; for (i = 0; i < STATUS_SOURCE_COUNT; i++) { @@ -782,7 +785,7 @@ static void get_final_status(grpc_exec_ctx* exec_ctx, grpc_call* call, grpc_error_has_clear_grpc_status(status[i].error)) { if (get_final_status_from(exec_ctx, call, status[i].error, allow_ok_status != 0, set_value, - set_value_user_data, details)) { + set_value_user_data, details, error_string)) { return; } } @@ -792,7 +795,7 @@ static void get_final_status(grpc_exec_ctx* exec_ctx, grpc_call* call, if (status[i].is_set) { if (get_final_status_from(exec_ctx, call, status[i].error, allow_ok_status != 0, set_value, - set_value_user_data, details)) { + set_value_user_data, details, error_string)) { return; } } @@ -1333,10 +1336,11 @@ static void post_batch_completion(grpc_exec_ctx* exec_ctx, if (call->is_client) { get_final_status(exec_ctx, call, set_status_value_directly, call->final_op.client.status, - call->final_op.client.status_details); + call->final_op.client.status_details, + call->final_op.client.error_string); } else { get_final_status(exec_ctx, call, set_cancelled_value, - call->final_op.server.cancelled, NULL); + call->final_op.server.cancelled, NULL, NULL); } GRPC_ERROR_UNREF(error); @@ -1993,6 +1997,8 @@ static grpc_call_error call_start_batch(grpc_exec_ctx* exec_ctx, call->final_op.client.status = op->data.recv_status_on_client.status; call->final_op.client.status_details = op->data.recv_status_on_client.status_details; + call->final_op.client.error_string = + op->data.recv_status_on_client.error_string; stream_op->recv_trailing_metadata = true; stream_op->collect_stats = true; stream_op_payload->recv_trailing_metadata.recv_trailing_metadata = diff --git a/src/core/lib/transport/error_utils.cc b/src/core/lib/transport/error_utils.cc index d968b04fd8..15f9875270 100644 --- a/src/core/lib/transport/error_utils.cc +++ b/src/core/lib/transport/error_utils.cc @@ -41,8 +41,12 @@ static grpc_error* recursively_find_error_with_field(grpc_error* error, void grpc_error_get_status(grpc_exec_ctx* exec_ctx, grpc_error* error, grpc_millis deadline, grpc_status_code* code, - grpc_slice* slice, - grpc_http2_error_code* http_error) { + grpc_slice* slice, grpc_http2_error_code* http_error, + const char** full_error_details) { + if (full_error_details != NULL) { + *full_error_details = grpc_error_string(error); + } + // Start with the parent error and recurse through the tree of children // until we find the first one that has a status code. grpc_error* found_error = diff --git a/src/core/lib/transport/error_utils.h b/src/core/lib/transport/error_utils.h index 690e42058a..d47c4f2a3b 100644 --- a/src/core/lib/transport/error_utils.h +++ b/src/core/lib/transport/error_utils.h @@ -30,13 +30,15 @@ extern "C" { /// A utility function to get the status code and message to be returned /// to the application. If not set in the top-level message, looks /// through child errors until it finds the first one with these attributes. -/// All attributes are pulled from the same child error. If any of the -/// attributes (code, msg, http_status) are unneeded, they can be passed as +/// All attributes are pulled from the same child error. full_error_details will +/// be populated with the entire error string. If any of the attributes (code, +/// msg, http_status, full_error_details) are unneeded, they can be passed as /// NULL. void grpc_error_get_status(grpc_exec_ctx* exec_ctx, grpc_error* error, grpc_millis deadline, grpc_status_code* code, grpc_slice* slice, - grpc_http2_error_code* http_status); + grpc_http2_error_code* http_status, + const char** full_error_details); /// A utility function to check whether there is a clear status code that /// doesn't need to be guessed in \a error. This means that \a error or some diff --git a/test/cpp/microbenchmarks/bm_error.cc b/test/cpp/microbenchmarks/bm_error.cc index 56b80dfcf6..955cdf5a17 100644 --- a/test/cpp/microbenchmarks/bm_error.cc +++ b/test/cpp/microbenchmarks/bm_error.cc @@ -253,7 +253,7 @@ static void BM_ErrorGetStatus(benchmark::State& state) { grpc_status_code status; grpc_slice slice; grpc_error_get_status(&exec_ctx, fixture.error(), fixture.deadline(), - &status, &slice, NULL); + &status, &slice, NULL, NULL); } grpc_exec_ctx_finish(&exec_ctx); track_counters.Finish(state); @@ -267,7 +267,7 @@ static void BM_ErrorGetStatusCode(benchmark::State& state) { while (state.KeepRunning()) { grpc_status_code status; grpc_error_get_status(&exec_ctx, fixture.error(), fixture.deadline(), - &status, NULL, NULL); + &status, NULL, NULL, NULL); } grpc_exec_ctx_finish(&exec_ctx); track_counters.Finish(state); @@ -281,7 +281,7 @@ static void BM_ErrorHttpError(benchmark::State& state) { while (state.KeepRunning()) { grpc_http2_error_code error; grpc_error_get_status(&exec_ctx, fixture.error(), fixture.deadline(), NULL, - NULL, &error); + NULL, &error, NULL); } grpc_exec_ctx_finish(&exec_ctx); track_counters.Finish(state); -- cgit v1.2.3 From 344553c27cd8bbc915f0f3a3831438ac05a07387 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Mon, 6 Nov 2017 19:59:39 -0800 Subject: Add POC example of inheritance for testing --- .../ext/transport/chttp2/transport/chttp2_transport.cc | 3 +++ src/core/ext/transport/chttp2/transport/internal.h | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index a955ec2589..8bf5167286 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -274,6 +274,9 @@ static void init_transport(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t, GPR_ASSERT(strlen(GRPC_CHTTP2_CLIENT_CONNECT_STRING) == GRPC_CHTTP2_CLIENT_CONNECT_STRLEN); + t->abstract = new D1; + t->abstract->foo(); + t->base.vtable = get_vtable(); t->ep = ep; /* one ref is for destroy */ diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 60cc280c43..dab0bd830e 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -237,12 +237,26 @@ typedef enum { GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED, } grpc_chttp2_keepalive_state; +class AbstractBase { + public: + AbstractBase() {} + virtual void foo() { gpr_log(GPR_ERROR, "base"); } +}; + +class D1 : public AbstractBase { + public: + D1() {} + void foo() override { gpr_log(GPR_ERROR, "derived"); } +}; + struct grpc_chttp2_transport { grpc_transport base; /* must be first */ gpr_refcount refs; grpc_endpoint* ep; char* peer_string; + AbstractBase* abstract; + grpc_combiner* combiner; /** write execution state of the transport */ -- cgit v1.2.3 From 0a69e1ef0932a5148098ca6d688696e9fc2fc998 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Mon, 6 Nov 2017 20:07:39 -0800 Subject: Change manual ctor to be polymorphic --- .../transport/chttp2/transport/chttp2_transport.cc | 2 +- src/core/ext/transport/chttp2/transport/internal.h | 6 +- src/core/lib/support/manual_constructor.h | 125 +++++++++++++++++++++ 3 files changed, 129 insertions(+), 4 deletions(-) diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 8bf5167286..16500ce05c 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -274,7 +274,7 @@ static void init_transport(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t, GPR_ASSERT(strlen(GRPC_CHTTP2_CLIENT_CONNECT_STRING) == GRPC_CHTTP2_CLIENT_CONNECT_STRLEN); - t->abstract = new D1; + t->abstract.Init(); t->abstract->foo(); t->base.vtable = get_vtable(); diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index dab0bd830e..f3b10e56ad 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -243,9 +243,9 @@ class AbstractBase { virtual void foo() { gpr_log(GPR_ERROR, "base"); } }; -class D1 : public AbstractBase { +class Derived : public AbstractBase { public: - D1() {} + Derived() {} void foo() override { gpr_log(GPR_ERROR, "derived"); } }; @@ -255,7 +255,7 @@ struct grpc_chttp2_transport { grpc_endpoint* ep; char* peer_string; - AbstractBase* abstract; + grpc_core::PolymorphicManualConstructor abstract; grpc_combiner* combiner; diff --git a/src/core/lib/support/manual_constructor.h b/src/core/lib/support/manual_constructor.h index d753cf98a0..56e8fd18b9 100644 --- a/src/core/lib/support/manual_constructor.h +++ b/src/core/lib/support/manual_constructor.h @@ -22,12 +22,137 @@ // manually construct a region of memory with some type #include +#include #include #include #include namespace grpc_core { +#define ASSERT(x) \ + if ((x)) \ + ; \ + else \ + abort() + +template +class is_one_of; + +template +class is_one_of { + public: + static constexpr const bool value = true; +}; + +template +class is_one_of { + public: + static constexpr const bool value = is_one_of::value; +}; + +template +class is_one_of { + public: + static constexpr const bool value = false; +}; + +template +class max_size_of; + +template +class max_size_of { + public: + static constexpr const size_t value = sizeof(A); +}; + +template +class max_size_of { + public: + static constexpr const size_t value = sizeof(A) > max_size_of::value + ? sizeof(A) + : max_size_of::value; +}; + +template +class max_align_of; + +template +class max_align_of { + public: + static constexpr const size_t value = alignof(A); +}; + +template +class max_align_of { + public: + static constexpr const size_t value = alignof(A) > max_align_of::value + ? alignof(A) + : max_align_of::value; +}; + +template +class PolymorphicManualConstructor { + public: + // No constructor or destructor because one of the most useful uses of + // this class is as part of a union, and members of a union could not have + // constructors or destructors till C++11. And, anyway, the whole point of + // this class is to bypass constructor and destructor. + + BaseType* get() { return reinterpret_cast(&space_); } + const BaseType* get() const { + return reinterpret_cast(&space_); + } + + BaseType* operator->() { return get(); } + const BaseType* operator->() const { return get(); } + + BaseType& operator*() { return *get(); } + const BaseType& operator*() const { return *get(); } + + template + void Init() { + FinishInit(new (&space_) DerivedType); + } + + // Init() constructs the Type instance using the given arguments + // (which are forwarded to Type's constructor). + // + // Note that Init() with no arguments performs default-initialization, + // not zero-initialization (i.e it behaves the same as "new Type;", not + // "new Type();"), so it will leave non-class types uninitialized. + template + void Init(Ts&&... args) { + FinishInit(new (&space_) DerivedType(std::forward(args)...)); + } + + // Init() that is equivalent to copy and move construction. + // Enables usage like this: + // ManualConstructor> v; + // v.Init({1, 2, 3}); + template + void Init(const DerivedType& x) { + FinishInit(new (&space_) DerivedType(x)); + } + template + void Init(DerivedType&& x) { + FinishInit(new (&space_) DerivedType(std::move(x))); + } + + void Destroy() { get()->~BaseType(); } + + private: + template + void FinishInit(DerivedType* p) { + static_assert(is_one_of::value, + "DerivedType must be one of the predeclared DerivedTypes"); + ASSERT(reinterpret_cast(static_cast(p)) == p); + } + + typename std::aligned_storage< + grpc_core::max_size_of::value, + grpc_core::max_align_of::value>::type space_; +}; + template class ManualConstructor { public: -- cgit v1.2.3 From e66ad3b3cb63f8762d4f6d97677c2df110d7ec6a Mon Sep 17 00:00:00 2001 From: ncteisen Date: Mon, 6 Nov 2017 20:22:48 -0800 Subject: Add GRPC_ABSTRACT_BASE_CLASS --- build.yaml | 1 + src/core/ext/transport/chttp2/transport/internal.h | 4 ++++ src/core/lib/support/abstract.h | 28 ++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 src/core/lib/support/abstract.h diff --git a/build.yaml b/build.yaml index cd6486ea29..23ce245efb 100644 --- a/build.yaml +++ b/build.yaml @@ -104,6 +104,7 @@ filegroups: - include/grpc/support/useful.h headers: - src/core/lib/profiling/timers.h + - src/core/lib/support/abstract.h - src/core/lib/support/arena.h - src/core/lib/support/atomic.h - src/core/lib/support/atomic_with_atm.h diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index f3b10e56ad..d883170a23 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -38,6 +38,7 @@ #include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/iomgr/timer.h" +#include "src/core/lib/support/abstract.h" #include "src/core/lib/support/manual_constructor.h" #include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/transport_impl.h" @@ -240,12 +241,15 @@ typedef enum { class AbstractBase { public: AbstractBase() {} + virtual ~AbstractBase() { gpr_log(GPR_ERROR, "base dtor"); } virtual void foo() { gpr_log(GPR_ERROR, "base"); } + GRPC_ABSTRACT_BASE_CLASS }; class Derived : public AbstractBase { public: Derived() {} + virtual ~Derived() { gpr_log(GPR_ERROR, "derived dtor"); } void foo() override { gpr_log(GPR_ERROR, "derived"); } }; diff --git a/src/core/lib/support/abstract.h b/src/core/lib/support/abstract.h new file mode 100644 index 0000000000..e8b8c09458 --- /dev/null +++ b/src/core/lib/support/abstract.h @@ -0,0 +1,28 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef GRPC_CORE_LIB_SUPPORT_ABSTRACT_H +#define GRPC_CORE_LIB_SUPPORT_ABSTRACT_H + +// This is needed to support abstract base classes in the c core. Since gRPC +// doesn't have a c++ runtime, it will hit a linker error on delete unless +// a we define a virtual operator delete. See this blog for more info: +// https://eli.thegreenplace.net/2015/c-deleting-destructors-and-virtual-operator-delete/ +#define GRPC_ABSTRACT_BASE_CLASS static void operator delete(void *p) { abort(); } + +#endif /* GRPC_CORE_LIB_SUPPORT_ABSTRACT_H */ -- cgit v1.2.3 From 0b37f03991b85a363fe4a47665affa4aa3132b9a Mon Sep 17 00:00:00 2001 From: ncteisen Date: Mon, 6 Nov 2017 20:24:21 -0800 Subject: Regenerate projects --- gRPC-Core.podspec | 2 ++ grpc.gemspec | 1 + package.xml | 1 + tools/doxygen/Doxyfile.c++.internal | 1 + tools/doxygen/Doxyfile.core.internal | 1 + tools/run_tests/generated/sources_and_headers.json | 2 ++ 6 files changed, 8 insertions(+) diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 01b8d65977..3df6d766a2 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -187,6 +187,7 @@ Pod::Spec.new do |s| # To save you from scrolling, this is the last part of the podspec. ss.source_files = 'src/core/lib/profiling/timers.h', + 'src/core/lib/support/abstract.h', 'src/core/lib/support/arena.h', 'src/core/lib/support/atomic.h', 'src/core/lib/support/atomic_with_atm.h', @@ -707,6 +708,7 @@ Pod::Spec.new do |s| 'src/core/plugin_registry/grpc_plugin_registry.cc' ss.private_header_files = 'src/core/lib/profiling/timers.h', + 'src/core/lib/support/abstract.h', 'src/core/lib/support/arena.h', 'src/core/lib/support/atomic.h', 'src/core/lib/support/atomic_with_atm.h', diff --git a/grpc.gemspec b/grpc.gemspec index 2fe2536cc7..4d594cfa0d 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -84,6 +84,7 @@ Gem::Specification.new do |s| s.files += %w( include/grpc/impl/codegen/sync_posix.h ) s.files += %w( include/grpc/impl/codegen/sync_windows.h ) s.files += %w( src/core/lib/profiling/timers.h ) + s.files += %w( src/core/lib/support/abstract.h ) s.files += %w( src/core/lib/support/arena.h ) s.files += %w( src/core/lib/support/atomic.h ) s.files += %w( src/core/lib/support/atomic_with_atm.h ) diff --git a/package.xml b/package.xml index 9dee62f871..4bf496f698 100644 --- a/package.xml +++ b/package.xml @@ -96,6 +96,7 @@ + diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index c9c64399f7..3c564e203a 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -1026,6 +1026,7 @@ src/core/lib/slice/percent_encoding.h \ src/core/lib/slice/slice_hash_table.h \ src/core/lib/slice/slice_internal.h \ src/core/lib/slice/slice_string_helpers.h \ +src/core/lib/support/abstract.h \ src/core/lib/support/arena.h \ src/core/lib/support/atomic.h \ src/core/lib/support/atomic_with_atm.h \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index b9844f8b89..29efb3d063 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1268,6 +1268,7 @@ src/core/lib/slice/slice_intern.cc \ src/core/lib/slice/slice_internal.h \ src/core/lib/slice/slice_string_helpers.cc \ src/core/lib/slice/slice_string_helpers.h \ +src/core/lib/support/abstract.h \ src/core/lib/support/alloc.cc \ src/core/lib/support/arena.cc \ src/core/lib/support/arena.h \ diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 6cd9a04056..70818558a7 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -7766,6 +7766,7 @@ "include/grpc/support/tls_pthread.h", "include/grpc/support/useful.h", "src/core/lib/profiling/timers.h", + "src/core/lib/support/abstract.h", "src/core/lib/support/arena.h", "src/core/lib/support/atomic.h", "src/core/lib/support/atomic_with_atm.h", @@ -7814,6 +7815,7 @@ "include/grpc/support/tls_pthread.h", "include/grpc/support/useful.h", "src/core/lib/profiling/timers.h", + "src/core/lib/support/abstract.h", "src/core/lib/support/arena.h", "src/core/lib/support/atomic.h", "src/core/lib/support/atomic_with_atm.h", -- cgit v1.2.3 From f9d7c278be36c16fd13c12c6665c90793451e24f Mon Sep 17 00:00:00 2001 From: ncteisen Date: Mon, 6 Nov 2017 20:32:57 -0800 Subject: Add no-rtti to all of core --- Makefile | 11 +++++++++++ build.yaml | 1 + templates/Makefile.template | 12 +++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1e3418e410..664b5973fb 100644 --- a/Makefile +++ b/Makefile @@ -328,6 +328,7 @@ ifeq ($(SYSTEM),Darwin) CXXFLAGS += -stdlib=libc++ endif CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp +COREFLAGS += -fno-rtti -fno-exceptions LDFLAGS += -g CPPFLAGS += $(CPPFLAGS_$(CONFIG)) @@ -2570,6 +2571,16 @@ $(OBJDIR)/$(CONFIG)/src/compiler/%.o : src/compiler/%.cc $(Q) mkdir -p `dirname $@` $(Q) $(HOST_CXX) $(HOST_CXXFLAGS) $(HOST_CPPFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< +$(OBJDIR)/$(CONFIG)/src/core/%.o : src/core/%.cc + $(E) "[CXX] Compiling $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(COREFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< + +$(OBJDIR)/$(CONFIG)/test/core/%.o : test/core/%.cc + $(E) "[CXX] Compiling $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(COREFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< + $(OBJDIR)/$(CONFIG)/%.o : %.cc $(E) "[CXX] Compiling $<" $(Q) mkdir -p `dirname $@` diff --git a/build.yaml b/build.yaml index 23ce245efb..483b425e8e 100644 --- a/build.yaml +++ b/build.yaml @@ -4930,6 +4930,7 @@ defaults: CPPFLAGS: -Ithird_party/boringssl/include -fvisibility=hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0 -DNOMINMAX global: + COREFLAGS: -fno-rtti -fno-exceptions CPPFLAGS: -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp LDFLAGS: -g diff --git a/templates/Makefile.template b/templates/Makefile.template index 0588787910..3eb838857a 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -215,7 +215,7 @@ ifeq ($(SYSTEM),Darwin) CXXFLAGS += -stdlib=libc++ endif - % for arg in ['CFLAGS', 'CXXFLAGS', 'CPPFLAGS', 'LDFLAGS', 'DEFINES']: + % for arg in ['CFLAGS', 'CXXFLAGS', 'CPPFLAGS', 'COREFLAGS', 'LDFLAGS', 'DEFINES']: % if defaults.get('global', []).get(arg, None) is not None: ${arg} += ${defaults.get('global').get(arg)} % endif @@ -1268,6 +1268,16 @@ $(Q) mkdir -p `dirname $@` $(Q) $(HOST_CXX) $(HOST_CXXFLAGS) $(HOST_CPPFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< + $(OBJDIR)/$(CONFIG)/src/core/%.o : src/core/%.cc + $(E) "[CXX] Compiling $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(COREFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< + + $(OBJDIR)/$(CONFIG)/test/core/%.o : test/core/%.cc + $(E) "[CXX] Compiling $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(COREFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< + $(OBJDIR)/$(CONFIG)/%.o : %.cc $(E) "[CXX] Compiling $<" $(Q) mkdir -p `dirname $@` -- cgit v1.2.3 From f2132f1c5def84f3bea405c6f5337d656e6b558d Mon Sep 17 00:00:00 2001 From: ncteisen Date: Tue, 7 Nov 2017 11:14:33 -0800 Subject: Fix no logging tests --- src/core/ext/transport/chttp2/transport/chttp2_transport.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 16500ce05c..a6a9fea996 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -275,7 +275,6 @@ static void init_transport(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t, GRPC_CHTTP2_CLIENT_CONNECT_STRLEN); t->abstract.Init(); - t->abstract->foo(); t->base.vtable = get_vtable(); t->ep = ep; -- cgit v1.2.3 From 215209087eb6f1f432da2015688484532f3f2e7a Mon Sep 17 00:00:00 2001 From: ncteisen Date: Tue, 7 Nov 2017 11:17:41 -0800 Subject: clang-fmt --- src/core/lib/support/abstract.h | 3 ++- src/core/lib/support/manual_constructor.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/lib/support/abstract.h b/src/core/lib/support/abstract.h index e8b8c09458..ddf472bc37 100644 --- a/src/core/lib/support/abstract.h +++ b/src/core/lib/support/abstract.h @@ -23,6 +23,7 @@ // doesn't have a c++ runtime, it will hit a linker error on delete unless // a we define a virtual operator delete. See this blog for more info: // https://eli.thegreenplace.net/2015/c-deleting-destructors-and-virtual-operator-delete/ -#define GRPC_ABSTRACT_BASE_CLASS static void operator delete(void *p) { abort(); } +#define GRPC_ABSTRACT_BASE_CLASS \ + static void operator delete(void* p) { abort(); } #endif /* GRPC_CORE_LIB_SUPPORT_ABSTRACT_H */ diff --git a/src/core/lib/support/manual_constructor.h b/src/core/lib/support/manual_constructor.h index 56e8fd18b9..8160ad56d5 100644 --- a/src/core/lib/support/manual_constructor.h +++ b/src/core/lib/support/manual_constructor.h @@ -33,7 +33,7 @@ namespace grpc_core { if ((x)) \ ; \ else \ - abort() + abort() template class is_one_of; -- cgit v1.2.3 From 8d224c1c28abfd553b707d77740faec95b2c77ec Mon Sep 17 00:00:00 2001 From: ncteisen Date: Thu, 9 Nov 2017 11:51:58 -0800 Subject: Address github comments --- src/core/lib/support/manual_constructor.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/core/lib/support/manual_constructor.h b/src/core/lib/support/manual_constructor.h index 8160ad56d5..6f7ec83c1e 100644 --- a/src/core/lib/support/manual_constructor.h +++ b/src/core/lib/support/manual_constructor.h @@ -29,12 +29,12 @@ namespace grpc_core { -#define ASSERT(x) \ - if ((x)) \ - ; \ - else \ - abort() +// this contains templated helpers needed to implement the ManualConstructors +// in this file. +namespace manual_ctor_impl { +// is_one_of returns true it a class, Needle, is present in a variadic list of +// classes, Haystack. template class is_one_of; @@ -56,6 +56,8 @@ class is_one_of { static constexpr const bool value = false; }; +// max_size_of returns sizeof(Type) for the largest type in the variadic list +// of classes, Types. template class max_size_of; @@ -73,6 +75,8 @@ class max_size_of { : max_size_of::value; }; +// max_size_of returns alignof(Type) for the largest type in the variadic list +// of classes, Types. template class max_align_of; @@ -90,6 +94,8 @@ class max_align_of { : max_align_of::value; }; +} // namespace manual_ctor_impl + template class PolymorphicManualConstructor { public: @@ -143,14 +149,14 @@ class PolymorphicManualConstructor { private: template void FinishInit(DerivedType* p) { - static_assert(is_one_of::value, + static_assert(manual_ctor_impl::is_one_of::value, "DerivedType must be one of the predeclared DerivedTypes"); - ASSERT(reinterpret_cast(static_cast(p)) == p); + GPR_ASSERT(reinterpret_cast(static_cast(p)) == p); } typename std::aligned_storage< - grpc_core::max_size_of::value, - grpc_core::max_align_of::value>::type space_; + grpc_core::manual_ctor_impl::max_size_of::value, + grpc_core::manual_ctor_impl::max_align_of::value>::type space_; }; template -- cgit v1.2.3 From 4d9c98b14690c508f0e877439c0a53e61f596733 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Thu, 9 Nov 2017 12:43:15 -0800 Subject: split POC into real test --- CMakeLists.txt | 29 +++++++ Makefile | 36 ++++++++ build.yaml | 10 +++ .../transport/chttp2/transport/chttp2_transport.cc | 2 - src/core/ext/transport/chttp2/transport/internal.h | 17 ---- src/core/lib/support/manual_constructor.h | 2 + test/core/support/manual_constructor_test.cc | 97 ++++++++++++++++++++++ tools/run_tests/generated/sources_and_headers.json | 15 ++++ tools/run_tests/generated/tests.json | 24 ++++++ 9 files changed, 213 insertions(+), 19 deletions(-) create mode 100644 test/core/support/manual_constructor_test.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index 4daff95efd..4c632c14ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -430,6 +430,7 @@ add_dependencies(buildtests_c gpr_env_test) add_dependencies(buildtests_c gpr_histogram_test) add_dependencies(buildtests_c gpr_host_port_test) add_dependencies(buildtests_c gpr_log_test) +add_dependencies(buildtests_c gpr_manual_constructor_test) add_dependencies(buildtests_c gpr_mpscq_test) add_dependencies(buildtests_c gpr_spinlock_test) add_dependencies(buildtests_c gpr_stack_lockfree_test) @@ -6390,6 +6391,34 @@ target_link_libraries(gpr_log_test endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) +add_executable(gpr_manual_constructor_test + test/core/support/manual_constructor_test.cc +) + + +target_include_directories(gpr_manual_constructor_test + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + PRIVATE ${BORINGSSL_ROOT_DIR}/include + PRIVATE ${PROTOBUF_ROOT_DIR}/src + PRIVATE ${BENCHMARK_ROOT_DIR}/include + PRIVATE ${ZLIB_ROOT_DIR} + PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib + PRIVATE ${CARES_INCLUDE_DIR} + PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares + PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp +) + +target_link_libraries(gpr_manual_constructor_test + ${_gRPC_ALLTARGETS_LIBRARIES} + gpr_test_util + gpr +) + +endif (gRPC_BUILD_TESTS) +if (gRPC_BUILD_TESTS) + add_executable(gpr_mpscq_test test/core/support/mpscq_test.cc ) diff --git a/Makefile b/Makefile index 664b5973fb..d17afad155 100644 --- a/Makefile +++ b/Makefile @@ -991,6 +991,7 @@ gpr_env_test: $(BINDIR)/$(CONFIG)/gpr_env_test gpr_histogram_test: $(BINDIR)/$(CONFIG)/gpr_histogram_test gpr_host_port_test: $(BINDIR)/$(CONFIG)/gpr_host_port_test gpr_log_test: $(BINDIR)/$(CONFIG)/gpr_log_test +gpr_manual_constructor_test: $(BINDIR)/$(CONFIG)/gpr_manual_constructor_test gpr_mpscq_test: $(BINDIR)/$(CONFIG)/gpr_mpscq_test gpr_spinlock_test: $(BINDIR)/$(CONFIG)/gpr_spinlock_test gpr_stack_lockfree_test: $(BINDIR)/$(CONFIG)/gpr_stack_lockfree_test @@ -1383,6 +1384,7 @@ buildtests_c: privatelibs_c \ $(BINDIR)/$(CONFIG)/gpr_histogram_test \ $(BINDIR)/$(CONFIG)/gpr_host_port_test \ $(BINDIR)/$(CONFIG)/gpr_log_test \ + $(BINDIR)/$(CONFIG)/gpr_manual_constructor_test \ $(BINDIR)/$(CONFIG)/gpr_mpscq_test \ $(BINDIR)/$(CONFIG)/gpr_spinlock_test \ $(BINDIR)/$(CONFIG)/gpr_stack_lockfree_test \ @@ -1827,6 +1829,8 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/gpr_host_port_test || ( echo test gpr_host_port_test failed ; exit 1 ) $(E) "[RUN] Testing gpr_log_test" $(Q) $(BINDIR)/$(CONFIG)/gpr_log_test || ( echo test gpr_log_test failed ; exit 1 ) + $(E) "[RUN] Testing gpr_manual_constructor_test" + $(Q) $(BINDIR)/$(CONFIG)/gpr_manual_constructor_test || ( echo test gpr_manual_constructor_test failed ; exit 1 ) $(E) "[RUN] Testing gpr_mpscq_test" $(Q) $(BINDIR)/$(CONFIG)/gpr_mpscq_test || ( echo test gpr_mpscq_test failed ; exit 1 ) $(E) "[RUN] Testing gpr_spinlock_test" @@ -10153,6 +10157,38 @@ endif endif +GPR_MANUAL_CONSTRUCTOR_TEST_SRC = \ + test/core/support/manual_constructor_test.cc \ + +GPR_MANUAL_CONSTRUCTOR_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_MANUAL_CONSTRUCTOR_TEST_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/gpr_manual_constructor_test: openssl_dep_error + +else + + + +$(BINDIR)/$(CONFIG)/gpr_manual_constructor_test: $(GPR_MANUAL_CONSTRUCTOR_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LD) $(LDFLAGS) $(GPR_MANUAL_CONSTRUCTOR_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gpr_manual_constructor_test + +endif + +$(OBJDIR)/$(CONFIG)/test/core/support/manual_constructor_test.o: $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_gpr_manual_constructor_test: $(GPR_MANUAL_CONSTRUCTOR_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(GPR_MANUAL_CONSTRUCTOR_TEST_OBJS:.o=.dep) +endif +endif + + GPR_MPSCQ_TEST_SRC = \ test/core/support/mpscq_test.cc \ diff --git a/build.yaml b/build.yaml index 483b425e8e..d0c2bec106 100644 --- a/build.yaml +++ b/build.yaml @@ -2215,6 +2215,16 @@ targets: - gpr_test_util - gpr uses_polling: false +- name: gpr_manual_constructor_test + cpu_cost: 3 + build: test + language: c + src: + - test/core/support/manual_constructor_test.cc + deps: + - gpr_test_util + - gpr + uses_polling: false - name: gpr_mpscq_test cpu_cost: 30 build: test diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index a6a9fea996..a955ec2589 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -274,8 +274,6 @@ static void init_transport(grpc_exec_ctx* exec_ctx, grpc_chttp2_transport* t, GPR_ASSERT(strlen(GRPC_CHTTP2_CLIENT_CONNECT_STRING) == GRPC_CHTTP2_CLIENT_CONNECT_STRLEN); - t->abstract.Init(); - t->base.vtable = get_vtable(); t->ep = ep; /* one ref is for destroy */ diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index d883170a23..5bca566dc2 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -38,7 +38,6 @@ #include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/iomgr/timer.h" -#include "src/core/lib/support/abstract.h" #include "src/core/lib/support/manual_constructor.h" #include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/transport_impl.h" @@ -238,20 +237,6 @@ typedef enum { GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED, } grpc_chttp2_keepalive_state; -class AbstractBase { - public: - AbstractBase() {} - virtual ~AbstractBase() { gpr_log(GPR_ERROR, "base dtor"); } - virtual void foo() { gpr_log(GPR_ERROR, "base"); } - GRPC_ABSTRACT_BASE_CLASS -}; - -class Derived : public AbstractBase { - public: - Derived() {} - virtual ~Derived() { gpr_log(GPR_ERROR, "derived dtor"); } - void foo() override { gpr_log(GPR_ERROR, "derived"); } -}; struct grpc_chttp2_transport { grpc_transport base; /* must be first */ @@ -259,8 +244,6 @@ struct grpc_chttp2_transport { grpc_endpoint* ep; char* peer_string; - grpc_core::PolymorphicManualConstructor abstract; - grpc_combiner* combiner; /** write execution state of the transport */ diff --git a/src/core/lib/support/manual_constructor.h b/src/core/lib/support/manual_constructor.h index 6f7ec83c1e..5ad07a6709 100644 --- a/src/core/lib/support/manual_constructor.h +++ b/src/core/lib/support/manual_constructor.h @@ -27,6 +27,8 @@ #include #include +#include + namespace grpc_core { // this contains templated helpers needed to implement the ManualConstructors diff --git a/test/core/support/manual_constructor_test.cc b/test/core/support/manual_constructor_test.cc new file mode 100644 index 0000000000..13368ee62b --- /dev/null +++ b/test/core/support/manual_constructor_test.cc @@ -0,0 +1,97 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/* Test of gpr synchronization support. */ + +#include "src/core/lib/support/abstract.h" +#include "src/core/lib/support/manual_constructor.h" +#include +#include +#include +#include +#include +#include +#include +#include "test/core/util/test_config.h" + +class A { + public: + A() {} + virtual ~A() {} + virtual const char* foo() { return "A_foo"; } + virtual const char* bar() { return "A_bar"; } + GRPC_ABSTRACT_BASE_CLASS +}; + +class B : public A { + public: + B() {} + ~B() {} + const char* foo() override { return "B_foo"; } + char get_junk() { return junk[0]; } + private: + char junk[1000]; +}; + +class C : public B { + public: + C() {} + ~C() {} + virtual const char* bar() { return "C_bar"; } + char get_more_junk() { return more_junk[0]; } + private: + char more_junk[1000]; +}; + +class D : public A { + public: + virtual const char* bar() { return "D_bar"; } +}; + +static void basic_test() { + grpc_core::PolymorphicManualConstructor poly; + poly.Init(); + GPR_ASSERT(!strcmp(poly->foo(), "B_foo")); + GPR_ASSERT(!strcmp(poly->bar(), "A_bar")); +} + +static void complex_test() { + grpc_core::PolymorphicManualConstructor polyB; + polyB.Init(); + GPR_ASSERT(!strcmp(polyB->foo(), "B_foo")); + GPR_ASSERT(!strcmp(polyB->bar(), "A_bar")); + + grpc_core::PolymorphicManualConstructor polyC; + polyC.Init(); + GPR_ASSERT(!strcmp(polyC->foo(), "B_foo")); + GPR_ASSERT(!strcmp(polyC->bar(), "C_bar")); + + grpc_core::PolymorphicManualConstructor polyD; + polyD.Init(); + GPR_ASSERT(!strcmp(polyD->foo(), "A_foo")); + GPR_ASSERT(!strcmp(polyD->bar(), "D_bar")); +} + +/* ------------------------------------------------- */ + +int main(int argc, char* argv[]) { + grpc_test_init(argc, argv); + basic_test(); + complex_test(); + return 0; +} diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 70818558a7..a1a5020b42 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -748,6 +748,21 @@ "third_party": false, "type": "target" }, + { + "deps": [ + "gpr", + "gpr_test_util" + ], + "headers": [], + "is_filegroup": false, + "language": "c", + "name": "gpr_manual_constructor_test", + "src": [ + "test/core/support/manual_constructor_test.cc" + ], + "third_party": false, + "type": "target" + }, { "deps": [ "gpr", diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 5df5a7477b..70b452453d 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -911,6 +911,30 @@ ], "uses_polling": false }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 3, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": false, + "language": "c", + "name": "gpr_manual_constructor_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": false + }, { "args": [], "benchmark": false, -- cgit v1.2.3 From f0798b4873ab72a374c141d84a4c4d5ceec2b638 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Thu, 9 Nov 2017 12:55:34 -0800 Subject: Fix Bazel build --- BUILD | 1 + test/core/support/BUILD | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/BUILD b/BUILD index 6a514496f6..ba927582c1 100644 --- a/BUILD +++ b/BUILD @@ -480,6 +480,7 @@ grpc_cc_library( ], hdrs = [ "src/core/lib/profiling/timers.h", + "src/core/lib/support/abstract.h", "src/core/lib/support/arena.h", "src/core/lib/support/atomic.h", "src/core/lib/support/atomic_with_atm.h", diff --git a/test/core/support/BUILD b/test/core/support/BUILD index 9d042fdc9f..69512cd9a9 100644 --- a/test/core/support/BUILD +++ b/test/core/support/BUILD @@ -138,6 +138,16 @@ grpc_cc_test( ], ) +grpc_cc_test( + name = "manual_constructor_test", + srcs = ["manual_constructor_test.cc"], + language = "C++", + deps = [ + "//:gpr", + "//test/core/util:gpr_test_util", + ], +) + grpc_cc_test( name = "spinlock_test", srcs = ["spinlock_test.cc"], -- cgit v1.2.3 From 684f15b210fe4442b714dc93053f05a75431629e Mon Sep 17 00:00:00 2001 From: ncteisen Date: Fri, 10 Nov 2017 16:23:44 -0800 Subject: clang fmt --- src/core/ext/transport/chttp2/transport/internal.h | 1 - src/core/lib/support/manual_constructor.h | 8 +++++--- test/core/support/manual_constructor_test.cc | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 5bca566dc2..60cc280c43 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -237,7 +237,6 @@ typedef enum { GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED, } grpc_chttp2_keepalive_state; - struct grpc_chttp2_transport { grpc_transport base; /* must be first */ gpr_refcount refs; diff --git a/src/core/lib/support/manual_constructor.h b/src/core/lib/support/manual_constructor.h index 5ad07a6709..25731936b1 100644 --- a/src/core/lib/support/manual_constructor.h +++ b/src/core/lib/support/manual_constructor.h @@ -151,14 +151,16 @@ class PolymorphicManualConstructor { private: template void FinishInit(DerivedType* p) { - static_assert(manual_ctor_impl::is_one_of::value, - "DerivedType must be one of the predeclared DerivedTypes"); + static_assert( + manual_ctor_impl::is_one_of::value, + "DerivedType must be one of the predeclared DerivedTypes"); GPR_ASSERT(reinterpret_cast(static_cast(p)) == p); } typename std::aligned_storage< grpc_core::manual_ctor_impl::max_size_of::value, - grpc_core::manual_ctor_impl::max_align_of::value>::type space_; + grpc_core::manual_ctor_impl::max_align_of::value>::type + space_; }; template diff --git a/test/core/support/manual_constructor_test.cc b/test/core/support/manual_constructor_test.cc index 13368ee62b..714f8b21a0 100644 --- a/test/core/support/manual_constructor_test.cc +++ b/test/core/support/manual_constructor_test.cc @@ -18,7 +18,6 @@ /* Test of gpr synchronization support. */ -#include "src/core/lib/support/abstract.h" #include "src/core/lib/support/manual_constructor.h" #include #include @@ -27,6 +26,7 @@ #include #include #include +#include "src/core/lib/support/abstract.h" #include "test/core/util/test_config.h" class A { @@ -44,6 +44,7 @@ class B : public A { ~B() {} const char* foo() override { return "B_foo"; } char get_junk() { return junk[0]; } + private: char junk[1000]; }; @@ -54,6 +55,7 @@ class C : public B { ~C() {} virtual const char* bar() { return "C_bar"; } char get_more_junk() { return more_junk[0]; } + private: char more_junk[1000]; }; -- cgit v1.2.3 From 348b334f4b3545a89372652b47ee7030502910d0 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 13 Nov 2017 15:16:03 -0800 Subject: Back-out absl dependency for now --- CMakeLists.txt | 359 --------------------- Makefile | 50 +-- build.yaml | 16 - gRPC-Core.podspec | 2 - grpc.gemspec | 1 - grpc.gyp | 3 - package.xml | 1 - templates/CMakeLists.txt.template | 2 - tools/doxygen/Doxyfile.c++.internal | 1 - tools/doxygen/Doxyfile.core.internal | 1 - tools/run_tests/generated/sources_and_headers.json | 21 -- tools/run_tests/generated/tests.json | 24 -- 12 files changed, 1 insertion(+), 480 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4daff95efd..bbb2d5b2b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -756,7 +756,6 @@ add_dependencies(buildtests_cxx stress_test) add_dependencies(buildtests_cxx thread_manager_test) add_dependencies(buildtests_cxx thread_stress_test) add_dependencies(buildtests_cxx transport_pid_controller_test) -add_dependencies(buildtests_cxx vector_test) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_cxx writes_per_rpc_test) endif() @@ -849,7 +848,6 @@ target_include_directories(gpr PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr @@ -942,7 +940,6 @@ target_include_directories(gpr_test_util PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr_test_util @@ -1229,7 +1226,6 @@ target_include_directories(grpc PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc @@ -1541,7 +1537,6 @@ target_include_directories(grpc_cronet PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_cronet @@ -1825,7 +1820,6 @@ target_include_directories(grpc_test_util PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_test_util @@ -2091,7 +2085,6 @@ target_include_directories(grpc_test_util_unsecure PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_test_util_unsecure @@ -2378,7 +2371,6 @@ target_include_directories(grpc_unsecure PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_unsecure @@ -2469,7 +2461,6 @@ target_include_directories(reconnect_server PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(reconnect_server @@ -2512,7 +2503,6 @@ target_include_directories(test_tcp_server PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(test_tcp_server @@ -2594,7 +2584,6 @@ target_include_directories(grpc++ PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -2797,7 +2786,6 @@ target_include_directories(grpc++_core_stats PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -3079,7 +3067,6 @@ target_include_directories(grpc++_cronet PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -3281,7 +3268,6 @@ target_include_directories(grpc++_error_details PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -3347,7 +3333,6 @@ target_include_directories(grpc++_proto_reflection_desc_db PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -3409,7 +3394,6 @@ target_include_directories(grpc++_reflection PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -3468,7 +3452,6 @@ target_include_directories(grpc++_test_config PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -3547,7 +3530,6 @@ target_include_directories(grpc++_test_util PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -3688,7 +3670,6 @@ target_include_directories(grpc++_test_util_unsecure PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -3831,7 +3812,6 @@ target_include_directories(grpc++_unsecure PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -4024,7 +4004,6 @@ target_include_directories(grpc_benchmark PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -4084,7 +4063,6 @@ target_include_directories(grpc_cli_libs PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -4145,7 +4123,6 @@ target_include_directories(grpc_plugin_support PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -4224,7 +4201,6 @@ target_include_directories(http2_client_main PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -4280,7 +4256,6 @@ target_include_directories(interop_client_helper PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -4351,7 +4326,6 @@ target_include_directories(interop_client_main PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -4403,7 +4377,6 @@ target_include_directories(interop_server_helper PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -4473,7 +4446,6 @@ target_include_directories(interop_server_lib PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -4525,7 +4497,6 @@ target_include_directories(interop_server_main PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -4614,7 +4585,6 @@ target_include_directories(qps PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -4662,7 +4632,6 @@ target_include_directories(grpc_csharp_ext PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_csharp_ext @@ -4758,7 +4727,6 @@ target_include_directories(ares PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(ares @@ -4797,7 +4765,6 @@ target_include_directories(bad_client_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(bad_client_test @@ -4839,7 +4806,6 @@ target_include_directories(bad_ssl_test_server PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(bad_ssl_test_server @@ -4941,7 +4907,6 @@ target_include_directories(end2end_tests PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(end2end_tests @@ -5043,7 +5008,6 @@ target_include_directories(end2end_nosec_tests PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(end2end_nosec_tests @@ -5075,7 +5039,6 @@ target_include_directories(alarm_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(alarm_test @@ -5105,7 +5068,6 @@ target_include_directories(algorithm_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(algorithm_test @@ -5135,7 +5097,6 @@ target_include_directories(alloc_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(alloc_test @@ -5163,7 +5124,6 @@ target_include_directories(alpn_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(alpn_test @@ -5193,7 +5153,6 @@ target_include_directories(arena_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(arena_test @@ -5221,7 +5180,6 @@ target_include_directories(backoff_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(backoff_test @@ -5251,7 +5209,6 @@ target_include_directories(bad_server_response_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(bad_server_response_test @@ -5282,7 +5239,6 @@ target_include_directories(bin_decoder_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(bin_decoder_test @@ -5310,7 +5266,6 @@ target_include_directories(bin_encoder_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(bin_encoder_test @@ -5338,7 +5293,6 @@ target_include_directories(byte_stream_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(byte_stream_test @@ -5368,7 +5322,6 @@ target_include_directories(channel_create_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(channel_create_test @@ -5397,7 +5350,6 @@ target_include_directories(check_epollexclusive PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(check_epollexclusive @@ -5433,7 +5385,6 @@ target_include_directories(chttp2_hpack_encoder_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(chttp2_hpack_encoder_test @@ -5463,7 +5414,6 @@ target_include_directories(chttp2_stream_map_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(chttp2_stream_map_test @@ -5493,7 +5443,6 @@ target_include_directories(chttp2_varint_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(chttp2_varint_test @@ -5523,7 +5472,6 @@ target_include_directories(combiner_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(combiner_test @@ -5553,7 +5501,6 @@ target_include_directories(compression_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(compression_test @@ -5583,7 +5530,6 @@ target_include_directories(concurrent_connectivity_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(concurrent_connectivity_test @@ -5613,7 +5559,6 @@ target_include_directories(connection_refused_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(connection_refused_test @@ -5643,7 +5588,6 @@ target_include_directories(dns_resolver_connectivity_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(dns_resolver_connectivity_test @@ -5673,7 +5617,6 @@ target_include_directories(dns_resolver_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(dns_resolver_test @@ -5704,7 +5647,6 @@ target_include_directories(dualstack_socket_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(dualstack_socket_test @@ -5735,7 +5677,6 @@ target_include_directories(endpoint_pair_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(endpoint_pair_test @@ -5765,7 +5706,6 @@ target_include_directories(error_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(error_test @@ -5796,7 +5736,6 @@ target_include_directories(ev_epollsig_linux_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(ev_epollsig_linux_test @@ -5827,7 +5766,6 @@ target_include_directories(fake_resolver_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(fake_resolver_test @@ -5859,7 +5797,6 @@ target_include_directories(fake_transport_security_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(fake_transport_security_test @@ -5890,7 +5827,6 @@ target_include_directories(fd_conservation_posix_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(fd_conservation_posix_test @@ -5922,7 +5858,6 @@ target_include_directories(fd_posix_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(fd_posix_test @@ -5953,7 +5888,6 @@ target_include_directories(fling_client PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(fling_client @@ -5983,7 +5917,6 @@ target_include_directories(fling_server PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(fling_server @@ -6014,7 +5947,6 @@ target_include_directories(fling_stream_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(fling_stream_test @@ -6046,7 +5978,6 @@ target_include_directories(fling_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(fling_test @@ -6076,7 +6007,6 @@ target_include_directories(gen_hpack_tables PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gen_hpack_tables @@ -6111,7 +6041,6 @@ target_include_directories(gen_legal_metadata_characters PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gen_legal_metadata_characters @@ -6144,7 +6073,6 @@ target_include_directories(gen_percent_encoding_tables PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gen_percent_encoding_tables @@ -6179,7 +6107,6 @@ target_include_directories(goaway_server_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(goaway_server_test @@ -6210,7 +6137,6 @@ target_include_directories(gpr_avl_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr_avl_test @@ -6238,7 +6164,6 @@ target_include_directories(gpr_cmdline_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr_cmdline_test @@ -6266,7 +6191,6 @@ target_include_directories(gpr_cpu_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr_cpu_test @@ -6294,7 +6218,6 @@ target_include_directories(gpr_env_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr_env_test @@ -6322,7 +6245,6 @@ target_include_directories(gpr_histogram_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr_histogram_test @@ -6350,7 +6272,6 @@ target_include_directories(gpr_host_port_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr_host_port_test @@ -6378,7 +6299,6 @@ target_include_directories(gpr_log_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr_log_test @@ -6406,7 +6326,6 @@ target_include_directories(gpr_mpscq_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr_mpscq_test @@ -6434,7 +6353,6 @@ target_include_directories(gpr_spinlock_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr_spinlock_test @@ -6462,7 +6380,6 @@ target_include_directories(gpr_stack_lockfree_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr_stack_lockfree_test @@ -6490,7 +6407,6 @@ target_include_directories(gpr_string_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr_string_test @@ -6518,7 +6434,6 @@ target_include_directories(gpr_sync_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr_sync_test @@ -6546,7 +6461,6 @@ target_include_directories(gpr_thd_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr_thd_test @@ -6574,7 +6488,6 @@ target_include_directories(gpr_time_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr_time_test @@ -6602,7 +6515,6 @@ target_include_directories(gpr_tls_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr_tls_test @@ -6630,7 +6542,6 @@ target_include_directories(gpr_useful_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(gpr_useful_test @@ -6658,7 +6569,6 @@ target_include_directories(grpc_auth_context_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_auth_context_test @@ -6688,7 +6598,6 @@ target_include_directories(grpc_b64_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_b64_test @@ -6718,7 +6627,6 @@ target_include_directories(grpc_byte_buffer_reader_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_byte_buffer_reader_test @@ -6748,7 +6656,6 @@ target_include_directories(grpc_channel_args_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_channel_args_test @@ -6778,7 +6685,6 @@ target_include_directories(grpc_channel_stack_builder_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_channel_stack_builder_test @@ -6808,7 +6714,6 @@ target_include_directories(grpc_channel_stack_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_channel_stack_test @@ -6838,7 +6743,6 @@ target_include_directories(grpc_completion_queue_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_completion_queue_test @@ -6868,7 +6772,6 @@ target_include_directories(grpc_completion_queue_threading_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_completion_queue_threading_test @@ -6897,7 +6800,6 @@ target_include_directories(grpc_create_jwt PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_create_jwt @@ -6934,7 +6836,6 @@ target_include_directories(grpc_credentials_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_credentials_test @@ -6964,7 +6865,6 @@ target_include_directories(grpc_fetch_oauth2 PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_fetch_oauth2 @@ -6994,7 +6894,6 @@ target_include_directories(grpc_invalid_channel_args_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_invalid_channel_args_test @@ -7025,7 +6924,6 @@ target_include_directories(grpc_json_token_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_json_token_test @@ -7056,7 +6954,6 @@ target_include_directories(grpc_jwt_verifier_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_jwt_verifier_test @@ -7085,7 +6982,6 @@ target_include_directories(grpc_print_google_default_creds_token PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_print_google_default_creds_token @@ -7121,7 +7017,6 @@ target_include_directories(grpc_security_connector_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_security_connector_test @@ -7151,7 +7046,6 @@ target_include_directories(grpc_ssl_credentials_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_ssl_credentials_test @@ -7180,7 +7074,6 @@ target_include_directories(grpc_verify_jwt PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(grpc_verify_jwt @@ -7217,7 +7110,6 @@ target_include_directories(handshake_client PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(handshake_client @@ -7250,7 +7142,6 @@ target_include_directories(handshake_server PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(handshake_server @@ -7282,7 +7173,6 @@ target_include_directories(hpack_parser_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(hpack_parser_test @@ -7312,7 +7202,6 @@ target_include_directories(hpack_table_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(hpack_table_test @@ -7342,7 +7231,6 @@ target_include_directories(http_parser_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(http_parser_test @@ -7372,7 +7260,6 @@ target_include_directories(httpcli_format_request_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(httpcli_format_request_test @@ -7403,7 +7290,6 @@ target_include_directories(httpcli_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(httpcli_test @@ -7435,7 +7321,6 @@ target_include_directories(httpscli_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(httpscli_test @@ -7466,7 +7351,6 @@ target_include_directories(init_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(init_test @@ -7496,7 +7380,6 @@ target_include_directories(invalid_call_argument_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(invalid_call_argument_test @@ -7526,7 +7409,6 @@ target_include_directories(json_rewrite PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(json_rewrite @@ -7554,7 +7436,6 @@ target_include_directories(json_rewrite_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(json_rewrite_test @@ -7584,7 +7465,6 @@ target_include_directories(json_stream_error_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(json_stream_error_test @@ -7614,7 +7494,6 @@ target_include_directories(json_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(json_test @@ -7644,7 +7523,6 @@ target_include_directories(lame_client_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(lame_client_test @@ -7674,7 +7552,6 @@ target_include_directories(lb_policies_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(lb_policies_test @@ -7704,7 +7581,6 @@ target_include_directories(load_file_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(load_file_test @@ -7734,7 +7610,6 @@ target_include_directories(memory_profile_client PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(memory_profile_client @@ -7764,7 +7639,6 @@ target_include_directories(memory_profile_server PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(memory_profile_server @@ -7795,7 +7669,6 @@ target_include_directories(memory_profile_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(memory_profile_test @@ -7826,7 +7699,6 @@ target_include_directories(message_compress_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(message_compress_test @@ -7856,7 +7728,6 @@ target_include_directories(minimal_stack_is_minimal_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(minimal_stack_is_minimal_test @@ -7886,7 +7757,6 @@ target_include_directories(multiple_server_queues_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(multiple_server_queues_test @@ -7916,7 +7786,6 @@ target_include_directories(murmur_hash_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(murmur_hash_test @@ -7944,7 +7813,6 @@ target_include_directories(no_server_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(no_server_test @@ -7974,7 +7842,6 @@ target_include_directories(num_external_connectivity_watchers_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(num_external_connectivity_watchers_test @@ -8004,7 +7871,6 @@ target_include_directories(parse_address_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(parse_address_test @@ -8034,7 +7900,6 @@ target_include_directories(percent_encoding_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(percent_encoding_test @@ -8065,7 +7930,6 @@ target_include_directories(pollset_set_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(pollset_set_test @@ -8097,7 +7961,6 @@ target_include_directories(resolve_address_posix_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(resolve_address_posix_test @@ -8128,7 +7991,6 @@ target_include_directories(resolve_address_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(resolve_address_test @@ -8158,7 +8020,6 @@ target_include_directories(resource_quota_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(resource_quota_test @@ -8188,7 +8049,6 @@ target_include_directories(secure_channel_create_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(secure_channel_create_test @@ -8218,7 +8078,6 @@ target_include_directories(secure_endpoint_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(secure_endpoint_test @@ -8248,7 +8107,6 @@ target_include_directories(sequential_connectivity_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(sequential_connectivity_test @@ -8278,7 +8136,6 @@ target_include_directories(server_chttp2_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(server_chttp2_test @@ -8308,7 +8165,6 @@ target_include_directories(server_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(server_test @@ -8338,7 +8194,6 @@ target_include_directories(slice_buffer_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(slice_buffer_test @@ -8368,7 +8223,6 @@ target_include_directories(slice_hash_table_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(slice_hash_table_test @@ -8398,7 +8252,6 @@ target_include_directories(slice_string_helpers_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(slice_string_helpers_test @@ -8428,7 +8281,6 @@ target_include_directories(slice_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(slice_test @@ -8458,7 +8310,6 @@ target_include_directories(sockaddr_resolver_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(sockaddr_resolver_test @@ -8488,7 +8339,6 @@ target_include_directories(sockaddr_utils_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(sockaddr_utils_test @@ -8519,7 +8369,6 @@ target_include_directories(socket_utils_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(socket_utils_test @@ -8552,7 +8401,6 @@ target_include_directories(ssl_transport_security_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(ssl_transport_security_test @@ -8582,7 +8430,6 @@ target_include_directories(status_conversion_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(status_conversion_test @@ -8612,7 +8459,6 @@ target_include_directories(stream_compression_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(stream_compression_test @@ -8642,7 +8488,6 @@ target_include_directories(stream_owned_slice_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(stream_owned_slice_test @@ -8673,7 +8518,6 @@ target_include_directories(tcp_client_posix_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(tcp_client_posix_test @@ -8704,7 +8548,6 @@ target_include_directories(tcp_client_uv_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(tcp_client_uv_test @@ -8735,7 +8578,6 @@ target_include_directories(tcp_posix_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(tcp_posix_test @@ -8767,7 +8609,6 @@ target_include_directories(tcp_server_posix_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(tcp_server_posix_test @@ -8798,7 +8639,6 @@ target_include_directories(tcp_server_uv_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(tcp_server_uv_test @@ -8828,7 +8668,6 @@ target_include_directories(time_averaged_stats_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(time_averaged_stats_test @@ -8858,7 +8697,6 @@ target_include_directories(timeout_encoding_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(timeout_encoding_test @@ -8888,7 +8726,6 @@ target_include_directories(timer_heap_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(timer_heap_test @@ -8918,7 +8755,6 @@ target_include_directories(timer_list_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(timer_list_test @@ -8948,7 +8784,6 @@ target_include_directories(transport_connectivity_state_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(transport_connectivity_state_test @@ -8978,7 +8813,6 @@ target_include_directories(transport_metadata_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(transport_metadata_test @@ -9009,7 +8843,6 @@ target_include_directories(transport_security_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(transport_security_test @@ -9041,7 +8874,6 @@ target_include_directories(udp_server_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(udp_server_test @@ -9072,7 +8904,6 @@ target_include_directories(uri_parser_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(uri_parser_test @@ -9103,7 +8934,6 @@ target_include_directories(wakeup_fd_cv_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(wakeup_fd_cv_test @@ -9136,7 +8966,6 @@ target_include_directories(alarm_cpp_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9177,7 +9006,6 @@ target_include_directories(async_end2end_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9218,7 +9046,6 @@ target_include_directories(auth_property_iterator_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9259,7 +9086,6 @@ target_include_directories(bdp_estimator_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9301,7 +9127,6 @@ target_include_directories(bm_arena PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9346,7 +9171,6 @@ target_include_directories(bm_call_create PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9391,7 +9215,6 @@ target_include_directories(bm_chttp2_hpack PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9436,7 +9259,6 @@ target_include_directories(bm_chttp2_transport PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9481,7 +9303,6 @@ target_include_directories(bm_closure PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9526,7 +9347,6 @@ target_include_directories(bm_cq PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9571,7 +9391,6 @@ target_include_directories(bm_cq_multiple_threads PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9616,7 +9435,6 @@ target_include_directories(bm_error PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9661,7 +9479,6 @@ target_include_directories(bm_fullstack_streaming_ping_pong PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9706,7 +9523,6 @@ target_include_directories(bm_fullstack_streaming_pump PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9751,7 +9567,6 @@ target_include_directories(bm_fullstack_trickle PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9797,7 +9612,6 @@ target_include_directories(bm_fullstack_unary_ping_pong PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9842,7 +9656,6 @@ target_include_directories(bm_metadata PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9887,7 +9700,6 @@ target_include_directories(bm_pollset PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9931,7 +9743,6 @@ target_include_directories(channel_arguments_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -9969,7 +9780,6 @@ target_include_directories(channel_filter_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10007,7 +9817,6 @@ target_include_directories(cli_call_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10050,7 +9859,6 @@ target_include_directories(client_crash_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10092,7 +9900,6 @@ target_include_directories(client_crash_test_server PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10133,7 +9940,6 @@ target_include_directories(client_lb_end2end_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10209,7 +10015,6 @@ target_include_directories(codegen_test_full PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10284,7 +10089,6 @@ target_include_directories(codegen_test_minimal PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10322,7 +10126,6 @@ target_include_directories(credentials_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10360,7 +10163,6 @@ target_include_directories(cxx_byte_buffer_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10400,7 +10202,6 @@ target_include_directories(cxx_slice_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10440,7 +10241,6 @@ target_include_directories(cxx_string_ref_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10477,7 +10277,6 @@ target_include_directories(cxx_time_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10517,7 +10316,6 @@ target_include_directories(end2end_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10565,7 +10363,6 @@ target_include_directories(error_details_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10602,7 +10399,6 @@ target_include_directories(filter_end2end_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10643,7 +10439,6 @@ target_include_directories(generic_end2end_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10691,7 +10486,6 @@ target_include_directories(golden_file_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10729,7 +10523,6 @@ target_include_directories(grpc_cli PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -10767,7 +10560,6 @@ target_include_directories(grpc_cpp_plugin PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -10804,7 +10596,6 @@ target_include_directories(grpc_csharp_plugin PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -10841,7 +10632,6 @@ target_include_directories(grpc_node_plugin PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -10878,7 +10668,6 @@ target_include_directories(grpc_objective_c_plugin PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -10915,7 +10704,6 @@ target_include_directories(grpc_php_plugin PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -10952,7 +10740,6 @@ target_include_directories(grpc_python_plugin PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -10989,7 +10776,6 @@ target_include_directories(grpc_ruby_plugin PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE ${_gRPC_PROTO_GENS_DIR} ) @@ -11043,7 +10829,6 @@ target_include_directories(grpc_tool_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11094,7 +10879,6 @@ target_include_directories(grpclb_api_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11140,7 +10924,6 @@ target_include_directories(grpclb_end2end_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11188,7 +10971,6 @@ target_include_directories(grpclb_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11229,7 +11011,6 @@ target_include_directories(h2_ssl_cert_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11269,7 +11050,6 @@ target_include_directories(health_service_end2end_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11310,7 +11090,6 @@ target_include_directories(http2_client PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11352,7 +11131,6 @@ target_include_directories(hybrid_end2end_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11394,7 +11172,6 @@ target_include_directories(inproc_sync_unary_ping_pong_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11439,7 +11216,6 @@ target_include_directories(interop_client PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11484,7 +11260,6 @@ target_include_directories(interop_server PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11531,7 +11306,6 @@ target_include_directories(interop_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11573,7 +11347,6 @@ target_include_directories(json_run_localhost PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11616,7 +11389,6 @@ target_include_directories(memory_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11663,7 +11435,6 @@ target_include_directories(metrics_client PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11702,7 +11473,6 @@ target_include_directories(mock_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11743,7 +11513,6 @@ target_include_directories(noop-benchmark PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11779,7 +11548,6 @@ target_include_directories(proto_server_reflection_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11822,7 +11590,6 @@ target_include_directories(proto_utils_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11860,7 +11627,6 @@ target_include_directories(qps_interarrival_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11904,7 +11670,6 @@ target_include_directories(qps_json_driver PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11949,7 +11714,6 @@ target_include_directories(qps_openloop_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -11994,7 +11758,6 @@ target_include_directories(qps_worker PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12059,7 +11822,6 @@ target_include_directories(reconnect_interop_client PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12122,7 +11884,6 @@ target_include_directories(reconnect_interop_server PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12166,7 +11927,6 @@ target_include_directories(secure_auth_context_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12208,7 +11968,6 @@ target_include_directories(secure_sync_unary_ping_pong_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12253,7 +12012,6 @@ target_include_directories(server_builder_plugin_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12308,7 +12066,6 @@ target_include_directories(server_builder_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12349,7 +12106,6 @@ target_include_directories(server_context_test_spouse_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12390,7 +12146,6 @@ target_include_directories(server_crash_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12432,7 +12187,6 @@ target_include_directories(server_crash_test_client PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12487,7 +12241,6 @@ target_include_directories(server_request_call_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12528,7 +12281,6 @@ target_include_directories(shutdown_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12569,7 +12321,6 @@ target_include_directories(stats_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12609,7 +12360,6 @@ target_include_directories(status_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12650,7 +12400,6 @@ target_include_directories(streaming_throughput_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12723,7 +12472,6 @@ target_include_directories(stress_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12765,7 +12513,6 @@ target_include_directories(thread_manager_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12804,7 +12551,6 @@ target_include_directories(thread_stress_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12845,7 +12591,6 @@ target_include_directories(transport_pid_controller_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12865,46 +12610,6 @@ target_link_libraries(transport_pid_controller_test ${_gRPC_GFLAGS_LIBRARIES} ) -endif (gRPC_BUILD_TESTS) -if (gRPC_BUILD_TESTS) - -add_executable(vector_test - test/core/support/vector_test.cc - third_party/googletest/googletest/src/gtest-all.cc - third_party/googletest/googlemock/src/gmock-all.cc -) - - -target_include_directories(vector_test - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${BORINGSSL_ROOT_DIR}/include - PRIVATE ${PROTOBUF_ROOT_DIR}/src - PRIVATE ${BENCHMARK_ROOT_DIR}/include - PRIVATE ${ZLIB_ROOT_DIR} - PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib - PRIVATE ${CARES_INCLUDE_DIR} - PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares - PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp - PRIVATE third_party/googletest/googletest/include - PRIVATE third_party/googletest/googletest - PRIVATE third_party/googletest/googlemock/include - PRIVATE third_party/googletest/googlemock - PRIVATE ${_gRPC_PROTO_GENS_DIR} -) - -target_link_libraries(vector_test - ${_gRPC_PROTOBUF_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - grpc_test_util - grpc++ - grpc - gpr_test_util - gpr - ${_gRPC_GFLAGS_LIBRARIES} -) - endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) @@ -12927,7 +12632,6 @@ target_include_directories(writes_per_rpc_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -12967,7 +12671,6 @@ target_include_directories(public_headers_must_be_c89 PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(public_headers_must_be_c89 @@ -12995,7 +12698,6 @@ target_include_directories(badreq_bad_client_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(badreq_bad_client_test @@ -13027,7 +12729,6 @@ target_include_directories(connection_prefix_bad_client_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(connection_prefix_bad_client_test @@ -13059,7 +12760,6 @@ target_include_directories(head_of_line_blocking_bad_client_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(head_of_line_blocking_bad_client_test @@ -13091,7 +12791,6 @@ target_include_directories(headers_bad_client_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(headers_bad_client_test @@ -13123,7 +12822,6 @@ target_include_directories(initial_settings_frame_bad_client_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(initial_settings_frame_bad_client_test @@ -13155,7 +12853,6 @@ target_include_directories(server_registered_method_bad_client_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(server_registered_method_bad_client_test @@ -13187,7 +12884,6 @@ target_include_directories(simple_request_bad_client_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(simple_request_bad_client_test @@ -13219,7 +12915,6 @@ target_include_directories(unknown_frame_bad_client_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(unknown_frame_bad_client_test @@ -13251,7 +12946,6 @@ target_include_directories(window_overflow_bad_client_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(window_overflow_bad_client_test @@ -13284,7 +12978,6 @@ target_include_directories(bad_ssl_cert_server PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(bad_ssl_cert_server @@ -13317,7 +13010,6 @@ target_include_directories(bad_ssl_cert_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(bad_ssl_cert_test @@ -13348,7 +13040,6 @@ target_include_directories(h2_census_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_census_test @@ -13379,7 +13070,6 @@ target_include_directories(h2_compress_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_compress_test @@ -13410,7 +13100,6 @@ target_include_directories(h2_fakesec_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_fakesec_test @@ -13442,7 +13131,6 @@ target_include_directories(h2_fd_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_fd_test @@ -13474,7 +13162,6 @@ target_include_directories(h2_full_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_full_test @@ -13506,7 +13193,6 @@ target_include_directories(h2_full+pipe_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_full+pipe_test @@ -13538,7 +13224,6 @@ target_include_directories(h2_full+trace_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_full+trace_test @@ -13569,7 +13254,6 @@ target_include_directories(h2_full+workarounds_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_full+workarounds_test @@ -13600,7 +13284,6 @@ target_include_directories(h2_http_proxy_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_http_proxy_test @@ -13631,7 +13314,6 @@ target_include_directories(h2_load_reporting_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_load_reporting_test @@ -13662,7 +13344,6 @@ target_include_directories(h2_oauth2_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_oauth2_test @@ -13693,7 +13374,6 @@ target_include_directories(h2_proxy_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_proxy_test @@ -13724,7 +13404,6 @@ target_include_directories(h2_sockpair_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_sockpair_test @@ -13755,7 +13434,6 @@ target_include_directories(h2_sockpair+trace_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_sockpair+trace_test @@ -13786,7 +13464,6 @@ target_include_directories(h2_sockpair_1byte_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_sockpair_1byte_test @@ -13817,7 +13494,6 @@ target_include_directories(h2_ssl_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_ssl_test @@ -13848,7 +13524,6 @@ target_include_directories(h2_ssl_proxy_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_ssl_proxy_test @@ -13880,7 +13555,6 @@ target_include_directories(h2_uds_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_uds_test @@ -13912,7 +13586,6 @@ target_include_directories(inproc_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(inproc_test @@ -13943,7 +13616,6 @@ target_include_directories(h2_census_nosec_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_census_nosec_test @@ -13974,7 +13646,6 @@ target_include_directories(h2_compress_nosec_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_compress_nosec_test @@ -14006,7 +13677,6 @@ target_include_directories(h2_fd_nosec_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_fd_nosec_test @@ -14038,7 +13708,6 @@ target_include_directories(h2_full_nosec_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_full_nosec_test @@ -14070,7 +13739,6 @@ target_include_directories(h2_full+pipe_nosec_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_full+pipe_nosec_test @@ -14102,7 +13770,6 @@ target_include_directories(h2_full+trace_nosec_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_full+trace_nosec_test @@ -14133,7 +13800,6 @@ target_include_directories(h2_full+workarounds_nosec_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_full+workarounds_nosec_test @@ -14164,7 +13830,6 @@ target_include_directories(h2_http_proxy_nosec_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_http_proxy_nosec_test @@ -14195,7 +13860,6 @@ target_include_directories(h2_load_reporting_nosec_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_load_reporting_nosec_test @@ -14226,7 +13890,6 @@ target_include_directories(h2_proxy_nosec_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_proxy_nosec_test @@ -14257,7 +13920,6 @@ target_include_directories(h2_sockpair_nosec_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_sockpair_nosec_test @@ -14288,7 +13950,6 @@ target_include_directories(h2_sockpair+trace_nosec_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_sockpair+trace_nosec_test @@ -14319,7 +13980,6 @@ target_include_directories(h2_sockpair_1byte_nosec_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_sockpair_1byte_nosec_test @@ -14351,7 +14011,6 @@ target_include_directories(h2_uds_nosec_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(h2_uds_nosec_test @@ -14383,7 +14042,6 @@ target_include_directories(inproc_nosec_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(inproc_nosec_test @@ -14417,7 +14075,6 @@ target_include_directories(resolver_component_test_unsecure PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14461,7 +14118,6 @@ target_include_directories(resolver_component_test PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14505,7 +14161,6 @@ target_include_directories(resolver_component_tests_runner_invoker_unsecure PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14549,7 +14204,6 @@ target_include_directories(resolver_component_tests_runner_invoker PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest PRIVATE third_party/googletest/googlemock/include @@ -14591,7 +14245,6 @@ target_include_directories(api_fuzzer_one_entry PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(api_fuzzer_one_entry @@ -14622,7 +14275,6 @@ target_include_directories(client_fuzzer_one_entry PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(client_fuzzer_one_entry @@ -14653,7 +14305,6 @@ target_include_directories(hpack_parser_fuzzer_test_one_entry PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(hpack_parser_fuzzer_test_one_entry @@ -14684,7 +14335,6 @@ target_include_directories(http_request_fuzzer_test_one_entry PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(http_request_fuzzer_test_one_entry @@ -14715,7 +14365,6 @@ target_include_directories(http_response_fuzzer_test_one_entry PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(http_response_fuzzer_test_one_entry @@ -14746,7 +14395,6 @@ target_include_directories(json_fuzzer_test_one_entry PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(json_fuzzer_test_one_entry @@ -14777,7 +14425,6 @@ target_include_directories(nanopb_fuzzer_response_test_one_entry PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(nanopb_fuzzer_response_test_one_entry @@ -14808,7 +14455,6 @@ target_include_directories(nanopb_fuzzer_serverlist_test_one_entry PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(nanopb_fuzzer_serverlist_test_one_entry @@ -14839,7 +14485,6 @@ target_include_directories(percent_decode_fuzzer_one_entry PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(percent_decode_fuzzer_one_entry @@ -14870,7 +14515,6 @@ target_include_directories(percent_encode_fuzzer_one_entry PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(percent_encode_fuzzer_one_entry @@ -14901,7 +14545,6 @@ target_include_directories(server_fuzzer_one_entry PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(server_fuzzer_one_entry @@ -14932,7 +14575,6 @@ target_include_directories(ssl_server_fuzzer_one_entry PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(ssl_server_fuzzer_one_entry @@ -14963,7 +14605,6 @@ target_include_directories(uri_fuzzer_test_one_entry PRIVATE ${CARES_INCLUDE_DIR} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp ) target_link_libraries(uri_fuzzer_test_one_entry diff --git a/Makefile b/Makefile index 1e3418e410..8b263b2a09 100644 --- a/Makefile +++ b/Makefile @@ -327,7 +327,7 @@ CXXFLAGS += -std=c++11 ifeq ($(SYSTEM),Darwin) CXXFLAGS += -stdlib=libc++ endif -CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp +CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 LDFLAGS += -g CPPFLAGS += $(CPPFLAGS_$(CONFIG)) @@ -1177,7 +1177,6 @@ stress_test: $(BINDIR)/$(CONFIG)/stress_test thread_manager_test: $(BINDIR)/$(CONFIG)/thread_manager_test thread_stress_test: $(BINDIR)/$(CONFIG)/thread_stress_test transport_pid_controller_test: $(BINDIR)/$(CONFIG)/transport_pid_controller_test -vector_test: $(BINDIR)/$(CONFIG)/vector_test writes_per_rpc_test: $(BINDIR)/$(CONFIG)/writes_per_rpc_test public_headers_must_be_c89: $(BINDIR)/$(CONFIG)/public_headers_must_be_c89 boringssl_aes_test: $(BINDIR)/$(CONFIG)/boringssl_aes_test @@ -1610,7 +1609,6 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/thread_manager_test \ $(BINDIR)/$(CONFIG)/thread_stress_test \ $(BINDIR)/$(CONFIG)/transport_pid_controller_test \ - $(BINDIR)/$(CONFIG)/vector_test \ $(BINDIR)/$(CONFIG)/writes_per_rpc_test \ $(BINDIR)/$(CONFIG)/boringssl_aes_test \ $(BINDIR)/$(CONFIG)/boringssl_asn1_test \ @@ -1735,7 +1733,6 @@ buildtests_cxx: privatelibs_cxx \ $(BINDIR)/$(CONFIG)/thread_manager_test \ $(BINDIR)/$(CONFIG)/thread_stress_test \ $(BINDIR)/$(CONFIG)/transport_pid_controller_test \ - $(BINDIR)/$(CONFIG)/vector_test \ $(BINDIR)/$(CONFIG)/writes_per_rpc_test \ $(BINDIR)/$(CONFIG)/resolver_component_test_unsecure \ $(BINDIR)/$(CONFIG)/resolver_component_test \ @@ -2144,8 +2141,6 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/thread_stress_test || ( echo test thread_stress_test failed ; exit 1 ) $(E) "[RUN] Testing transport_pid_controller_test" $(Q) $(BINDIR)/$(CONFIG)/transport_pid_controller_test || ( echo test transport_pid_controller_test failed ; exit 1 ) - $(E) "[RUN] Testing vector_test" - $(Q) $(BINDIR)/$(CONFIG)/vector_test || ( echo test vector_test failed ; exit 1 ) $(E) "[RUN] Testing writes_per_rpc_test" $(Q) $(BINDIR)/$(CONFIG)/writes_per_rpc_test || ( echo test writes_per_rpc_test failed ; exit 1 ) $(E) "[RUN] Testing resolver_component_tests_runner_invoker_unsecure" @@ -17085,49 +17080,6 @@ endif endif -VECTOR_TEST_SRC = \ - test/core/support/vector_test.cc \ - -VECTOR_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(VECTOR_TEST_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/vector_test: openssl_dep_error - -else - - - - -ifeq ($(NO_PROTOBUF),true) - -# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+. - -$(BINDIR)/$(CONFIG)/vector_test: protobuf_dep_error - -else - -$(BINDIR)/$(CONFIG)/vector_test: $(PROTOBUF_DEP) $(VECTOR_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(VECTOR_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/vector_test - -endif - -endif - -$(OBJDIR)/$(CONFIG)/test/core/support/vector_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a - -deps_vector_test: $(VECTOR_TEST_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(VECTOR_TEST_OBJS:.o=.dep) -endif -endif - - WRITES_PER_RPC_TEST_SRC = \ test/cpp/performance/writes_per_rpc_test.cc \ diff --git a/build.yaml b/build.yaml index cd6486ea29..36c0a9dcc0 100644 --- a/build.yaml +++ b/build.yaml @@ -393,7 +393,6 @@ filegroups: - src/core/lib/slice/slice_hash_table.h - src/core/lib/slice/slice_internal.h - src/core/lib/slice/slice_string_helpers.h - - src/core/lib/support/vector.h - src/core/lib/surface/alarm_internal.h - src/core/lib/surface/api_trace.h - src/core/lib/surface/call.h @@ -4735,20 +4734,6 @@ targets: - grpc - gpr_test_util - gpr -- name: vector_test - gtest: true - build: test - language: c++ - src: - - test/core/support/vector_test.cc - deps: - - grpc_test_util - - grpc++ - - grpc - - gpr_test_util - - gpr - uses: - - grpc++_test - name: writes_per_rpc_test gtest: true cpu_cost: 0.5 @@ -4930,7 +4915,6 @@ defaults: -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0 -DNOMINMAX global: CPPFLAGS: -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 - -Ithird_party/abseil-cpp LDFLAGS: -g zlib: CFLAGS: -Wno-sign-conversion -Wno-conversion -Wno-unused-value -Wno-implicit-function-declaration diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 01b8d65977..222a34af64 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -412,7 +412,6 @@ Pod::Spec.new do |s| 'src/core/lib/slice/slice_hash_table.h', 'src/core/lib/slice/slice_internal.h', 'src/core/lib/slice/slice_string_helpers.h', - 'src/core/lib/support/vector.h', 'src/core/lib/surface/alarm_internal.h', 'src/core/lib/surface/api_trace.h', 'src/core/lib/surface/call.h', @@ -887,7 +886,6 @@ Pod::Spec.new do |s| 'src/core/lib/slice/slice_hash_table.h', 'src/core/lib/slice/slice_internal.h', 'src/core/lib/slice/slice_string_helpers.h', - 'src/core/lib/support/vector.h', 'src/core/lib/surface/alarm_internal.h', 'src/core/lib/surface/api_trace.h', 'src/core/lib/surface/call.h', diff --git a/grpc.gemspec b/grpc.gemspec index 2fe2536cc7..d256b68ed7 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -343,7 +343,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/slice/slice_hash_table.h ) s.files += %w( src/core/lib/slice/slice_internal.h ) s.files += %w( src/core/lib/slice/slice_string_helpers.h ) - s.files += %w( src/core/lib/support/vector.h ) s.files += %w( src/core/lib/surface/alarm_internal.h ) s.files += %w( src/core/lib/surface/api_trace.h ) s.files += %w( src/core/lib/surface/call.h ) diff --git a/grpc.gyp b/grpc.gyp index 7075aa9afd..e79e9c7ebc 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -57,7 +57,6 @@ '-Wno-long-long', '-Wno-unused-parameter', '-DOSATOMIC_USE_INLINED=1', - '-Ithird_party/abseil-cpp', ], 'ldflags': [ '-g', @@ -135,7 +134,6 @@ '-Wno-long-long', '-Wno-unused-parameter', '-DOSATOMIC_USE_INLINED=1', - '-Ithird_party/abseil-cpp', ], 'OTHER_CPLUSPLUSFLAGS': [ '-g', @@ -145,7 +143,6 @@ '-Wno-long-long', '-Wno-unused-parameter', '-DOSATOMIC_USE_INLINED=1', - '-Ithird_party/abseil-cpp', '-stdlib=libc++', '-std=c++11', '-Wno-error=deprecated-declarations' diff --git a/package.xml b/package.xml index 9dee62f871..2a059012c5 100644 --- a/package.xml +++ b/package.xml @@ -355,7 +355,6 @@ - diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index 2ed7c90757..0be5d14cfe 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -522,7 +522,6 @@ PRIVATE <%text>${CARES_INCLUDE_DIR} PRIVATE <%text>${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE <%text>${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE <%text>${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp % if lib.build in ['test', 'private'] and lib.language == 'c++': PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest @@ -594,7 +593,6 @@ PRIVATE <%text>${CARES_INCLUDE_DIR} PRIVATE <%text>${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE <%text>${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE <%text>${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp % if tgt.build in ['test', 'private'] and tgt.language == 'c++': PRIVATE third_party/googletest/googletest/include PRIVATE third_party/googletest/googletest diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index c9c64399f7..bcf91e7b05 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -1041,7 +1041,6 @@ src/core/lib/support/string.h \ src/core/lib/support/string_windows.h \ src/core/lib/support/time_precise.h \ src/core/lib/support/tmpfile.h \ -src/core/lib/support/vector.h \ src/core/lib/surface/alarm_internal.h \ src/core/lib/surface/api_trace.h \ src/core/lib/surface/call.h \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index b9844f8b89..f535d60fa0 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1325,7 +1325,6 @@ src/core/lib/support/tmpfile.h \ src/core/lib/support/tmpfile_msys.cc \ src/core/lib/support/tmpfile_posix.cc \ src/core/lib/support/tmpfile_windows.cc \ -src/core/lib/support/vector.h \ src/core/lib/support/wrap_memcpy.cc \ src/core/lib/surface/README.md \ src/core/lib/surface/alarm.cc \ diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 6cd9a04056..b4513f2f60 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -4198,25 +4198,6 @@ "third_party": false, "type": "target" }, - { - "deps": [ - "gpr", - "gpr_test_util", - "grpc", - "grpc++", - "grpc++_test", - "grpc_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c++", - "name": "vector_test", - "src": [ - "test/core/support/vector_test.cc" - ], - "third_party": false, - "type": "target" - }, { "deps": [ "gpr", @@ -8156,7 +8137,6 @@ "src/core/lib/slice/slice_hash_table.h", "src/core/lib/slice/slice_internal.h", "src/core/lib/slice/slice_string_helpers.h", - "src/core/lib/support/vector.h", "src/core/lib/surface/alarm_internal.h", "src/core/lib/surface/api_trace.h", "src/core/lib/surface/call.h", @@ -8292,7 +8272,6 @@ "src/core/lib/slice/slice_hash_table.h", "src/core/lib/slice/slice_internal.h", "src/core/lib/slice/slice_string_helpers.h", - "src/core/lib/support/vector.h", "src/core/lib/surface/alarm_internal.h", "src/core/lib/surface/api_trace.h", "src/core/lib/surface/call.h", diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 5df5a7477b..c8c07cf0b5 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -4388,30 +4388,6 @@ ], "uses_polling": true }, - { - "args": [], - "benchmark": false, - "ci_platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "exclude_iomgrs": [], - "flaky": false, - "gtest": true, - "language": "c++", - "name": "vector_test", - "platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "uses_polling": true - }, { "args": [], "benchmark": false, -- cgit v1.2.3 From 30321c96d3deb9f0736648e85b8f6774082badaa Mon Sep 17 00:00:00 2001 From: josh Date: Mon, 13 Nov 2017 22:02:38 -0700 Subject: Update the git hash of the Google Benchmark dependency in the Bazel WORKSPACE --- WORKSPACE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 6ce7b9de14..6df24e9c2f 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -93,8 +93,8 @@ http_archive( new_http_archive( name = "com_github_google_benchmark", build_file = "third_party/benchmark.BUILD", - strip_prefix = "benchmark-44c25c892a6229b20db7cd9dc05584ea865896de", - url = "https://github.com/google/benchmark/archive/44c25c892a6229b20db7cd9dc05584ea865896de.tar.gz", + strip_prefix = "benchmark-5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8", + url = "https://github.com/google/benchmark/archive/5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8.tar.gz", ) new_local_repository( -- cgit v1.2.3 From 0d12c0ceabe7e91538451beb5a0363655148b404 Mon Sep 17 00:00:00 2001 From: kwasimensah Date: Tue, 14 Nov 2017 15:53:45 -0500 Subject: Update to not depend on c++ runtime --- src/core/lib/support/cpu_posix.cc | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/core/lib/support/cpu_posix.cc b/src/core/lib/support/cpu_posix.cc index 0d57d46131..832818aac5 100644 --- a/src/core/lib/support/cpu_posix.cc +++ b/src/core/lib/support/cpu_posix.cc @@ -25,8 +25,6 @@ #include #include -#include - #include #include #include @@ -35,6 +33,8 @@ static long ncpus = 0; +static pthread_key_t thread_id_key; + static void init_ncpus() { ncpus = sysconf(_SC_NPROCESSORS_ONLN); if (ncpus < 1 || ncpus > INT32_MAX) { @@ -49,33 +49,33 @@ unsigned gpr_cpu_num_cores(void) { return (unsigned)ncpus; } +static void delete_thread_id_key(void *value) { + if (value) { + gpr_free(value); + } + pthread_key_delete(thread_id_key); +} + +static void init_thread_id_key(void) { + pthread_key_create(&thread_id_key, delete_thread_id_key); +} + unsigned gpr_cpu_current_cpu(void) { /* NOTE: there's no way I know to return the actual cpu index portably... most code that's using this is using it to shard across work queues though, so here we use thread identity instead to achieve a similar though not identical effect */ - static auto DeleteValue = [](void* value_ptr) { - unsigned int* value = static_cast(value_ptr); - if (value) { - gpr_free(value); - } - }; - static pthread_key_t thread_id_key; - static int thread_id_key_create_result __attribute__((unused)) = - pthread_key_create(&thread_id_key, DeleteValue); - // pthread_t isn't portably defined to map to an integral type. So keep track - // of thread identity explicitly so hashing works reliably. - static std::atomic thread_counter(0); - - unsigned int* thread_id = - static_cast(pthread_getspecific(thread_id_key)); + static gpr_once once = GPR_ONCE_INIT; + gpr_once_init(&once, init_thread_id_key); + + unsigned int *thread_id = + static_cast(pthread_getspecific(thread_id_key)); if (thread_id == nullptr) { - thread_id = static_cast(gpr_malloc(sizeof(unsigned int))); - *thread_id = thread_counter++; + thread_id = static_cast(gpr_malloc(sizeof(unsigned int))); pthread_setspecific(thread_id_key, thread_id); } - return (unsigned)GPR_HASH_POINTER(*thread_id, gpr_cpu_num_cores()); + return (unsigned)GPR_HASH_POINTER(thread_id, gpr_cpu_num_cores()); } #endif /* GPR_CPU_POSIX */ -- cgit v1.2.3 From 254cb369a6b65023ccb9cdb16200a3043dab0259 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Wed, 15 Nov 2017 20:32:00 +0000 Subject: Require port and server_port interop flags Also sort arguments to ArgumentParser.add_argument in idiomatic order. --- src/python/grpcio_tests/tests/interop/client.py | 31 ++++++++++++++----------- src/python/grpcio_tests/tests/interop/server.py | 7 +++--- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/python/grpcio_tests/tests/interop/client.py b/src/python/grpcio_tests/tests/interop/client.py index e520c08290..383b5f033d 100644 --- a/src/python/grpcio_tests/tests/interop/client.py +++ b/src/python/grpcio_tests/tests/interop/client.py @@ -29,37 +29,40 @@ def _args(): parser = argparse.ArgumentParser() parser.add_argument( '--server_host', - help='the host to which to connect', + default="localhost", type=str, - default="localhost") + help='the host to which to connect') parser.add_argument( - '--server_port', help='the port to which to connect', type=int) + '--server_port', + type=int, + required=True, + help='the port to which to connect') parser.add_argument( '--test_case', - help='the test case to execute', + default='large_unary', type=str, - default="large_unary") + help='the test case to execute') parser.add_argument( '--use_tls', - help='require a secure connection', default=False, - type=resources.parse_bool) + type=resources.parse_bool, + help='require a secure connection') parser.add_argument( '--use_test_ca', - help='replace platform root CAs with ca.pem', default=False, - type=resources.parse_bool) + type=resources.parse_bool, + help='replace platform root CAs with ca.pem') parser.add_argument( '--server_host_override', default="foo.test.google.fr", - help='the server host to which to claim to connect', - type=str) + type=str, + help='the server host to which to claim to connect') parser.add_argument( - '--oauth_scope', help='scope for OAuth tokens', type=str) + '--oauth_scope', type=str, help='scope for OAuth tokens') parser.add_argument( '--default_service_account', - help='email address of the default service account', - type=str) + type=str, + help='email address of the default service account') return parser.parse_args() diff --git a/src/python/grpcio_tests/tests/interop/server.py b/src/python/grpcio_tests/tests/interop/server.py index 8ad1f5f7cd..eeb41a21d2 100644 --- a/src/python/grpcio_tests/tests/interop/server.py +++ b/src/python/grpcio_tests/tests/interop/server.py @@ -29,12 +29,13 @@ _ONE_DAY_IN_SECONDS = 60 * 60 * 24 def serve(): parser = argparse.ArgumentParser() - parser.add_argument('--port', help='the port on which to serve', type=int) + parser.add_argument( + '--port', type=int, required=True, help='the port on which to serve') parser.add_argument( '--use_tls', - help='require a secure connection', default=False, - type=resources.parse_bool) + type=resources.parse_bool, + help='require a secure connection') args = parser.parse_args() server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) -- cgit v1.2.3 From 901c47c96bb53dc1cad2d2572d3c17a300f9769d Mon Sep 17 00:00:00 2001 From: ncteisen Date: Wed, 15 Nov 2017 15:21:23 -0800 Subject: Fix artifact builds --- src/core/ext/transport/chttp2/transport/flow_control.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/ext/transport/chttp2/transport/flow_control.h b/src/core/ext/transport/chttp2/transport/flow_control.h index 7dd348ed5f..c0dd76bdf7 100644 --- a/src/core/ext/transport/chttp2/transport/flow_control.h +++ b/src/core/ext/transport/chttp2/transport/flow_control.h @@ -19,6 +19,7 @@ #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FLOW_CONTROL_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FLOW_CONTROL_H +#include #include #include -- cgit v1.2.3 From 8c1f338b4ab55455d064920526127495bab96e6c Mon Sep 17 00:00:00 2001 From: ncteisen Date: Wed, 15 Nov 2017 17:00:24 -0800 Subject: Add comment --- include/grpc/impl/codegen/grpc_types.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h index 83b35b1dc4..c8c1437c91 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -558,6 +558,9 @@ typedef struct grpc_op { grpc_metadata_array* trailing_metadata; grpc_status_code* status; grpc_slice* status_details; + /** If this is not nullptr, it will be populated with the full fidelity + * error string for debugging purposes. The application is responsible + * for freeing the data. */ const char** error_string; } recv_status_on_client; struct grpc_op_recv_close_on_server { -- cgit v1.2.3 From d21b96cbc75e7f9d6684907585a490b61325b63f Mon Sep 17 00:00:00 2001 From: ncteisen Date: Wed, 15 Nov 2017 17:05:47 -0800 Subject: Dup the memory --- src/core/lib/transport/error_utils.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/lib/transport/error_utils.cc b/src/core/lib/transport/error_utils.cc index 061445d44c..bcaedeeac9 100644 --- a/src/core/lib/transport/error_utils.cc +++ b/src/core/lib/transport/error_utils.cc @@ -18,6 +18,7 @@ #include "src/core/lib/transport/error_utils.h" +#include #include "src/core/lib/iomgr/error_internal.h" #include "src/core/lib/transport/status_conversion.h" @@ -44,7 +45,7 @@ void grpc_error_get_status(grpc_exec_ctx* exec_ctx, grpc_error* error, grpc_slice* slice, grpc_http2_error_code* http_error, const char** full_error_details) { if (full_error_details != NULL) { - *full_error_details = grpc_error_string(error); + *full_error_details = gpr_strdup(grpc_error_string(error)); } // Start with the parent error and recurse through the tree of children -- cgit v1.2.3 From 0354c22d402647b5ba532038511a4849c53b2b0b Mon Sep 17 00:00:00 2001 From: ncteisen Date: Wed, 15 Nov 2017 18:22:11 -0800 Subject: Save C++ for follow up PR --- include/grpc++/impl/codegen/call.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h index 91f45b3147..1a988297dc 100644 --- a/include/grpc++/impl/codegen/call.h +++ b/include/grpc++/impl/codegen/call.h @@ -579,7 +579,6 @@ class CallOpClientRecvStatus { op->data.recv_status_on_client.trailing_metadata = metadata_map_->arr(); op->data.recv_status_on_client.status = &status_code_; op->data.recv_status_on_client.status_details = &error_message_; - op->data.recv_status_on_client.error_string = &error_string_; op->flags = 0; op->reserved = NULL; } @@ -606,7 +605,6 @@ class CallOpClientRecvStatus { Status* recv_status_; grpc_status_code status_code_; grpc_slice error_message_; - const char* error_string_; }; /// An abstract collection of call ops, used to generate the -- cgit v1.2.3 From 3039b37a0ecf68d7b99fa84df21bb6691a174289 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Wed, 15 Nov 2017 18:24:05 -0800 Subject: Fix bad merge --- test/cpp/microbenchmarks/bm_error.cc | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/test/cpp/microbenchmarks/bm_error.cc b/test/cpp/microbenchmarks/bm_error.cc index 66f9fe3704..bbd8b3c339 100644 --- a/test/cpp/microbenchmarks/bm_error.cc +++ b/test/cpp/microbenchmarks/bm_error.cc @@ -251,11 +251,7 @@ static void BM_ErrorGetStatus(benchmark::State& state) { grpc_status_code status; grpc_slice slice; grpc_error_get_status(&exec_ctx, fixture.error(), fixture.deadline(), -<<<<<<< HEAD - &status, &slice, NULL, NULL); -======= - &status, &slice, nullptr); ->>>>>>> ff2edb3eba20b30f232ded7769cab8cd20ff5009 + &status, &slice, nullptr, nullptr); } grpc_exec_ctx_finish(&exec_ctx); track_counters.Finish(state); @@ -269,11 +265,7 @@ static void BM_ErrorGetStatusCode(benchmark::State& state) { while (state.KeepRunning()) { grpc_status_code status; grpc_error_get_status(&exec_ctx, fixture.error(), fixture.deadline(), -<<<<<<< HEAD - &status, NULL, NULL, NULL); -======= - &status, nullptr, nullptr); ->>>>>>> ff2edb3eba20b30f232ded7769cab8cd20ff5009 + &status, nullptr, nullptr, nullptr); } grpc_exec_ctx_finish(&exec_ctx); track_counters.Finish(state); @@ -286,13 +278,8 @@ static void BM_ErrorHttpError(benchmark::State& state) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; while (state.KeepRunning()) { grpc_http2_error_code error; -<<<<<<< HEAD - grpc_error_get_status(&exec_ctx, fixture.error(), fixture.deadline(), NULL, - NULL, &error, NULL); -======= grpc_error_get_status(&exec_ctx, fixture.error(), fixture.deadline(), - nullptr, nullptr, &error); ->>>>>>> ff2edb3eba20b30f232ded7769cab8cd20ff5009 + nullptr, nullptr, &error, nullptr); } grpc_exec_ctx_finish(&exec_ctx); track_counters.Finish(state); -- cgit v1.2.3 From 14c60f1d12dd9b4ac67ab8addae0c27f5971e55a Mon Sep 17 00:00:00 2001 From: ncteisen Date: Wed, 15 Nov 2017 20:26:50 -0800 Subject: Fix segfault --- include/grpc++/impl/codegen/call.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h index 1a988297dc..41e95866cf 100644 --- a/include/grpc++/impl/codegen/call.h +++ b/include/grpc++/impl/codegen/call.h @@ -579,6 +579,7 @@ class CallOpClientRecvStatus { op->data.recv_status_on_client.trailing_metadata = metadata_map_->arr(); op->data.recv_status_on_client.status = &status_code_; op->data.recv_status_on_client.status_details = &error_message_; + op->data.recv_status_on_client.error_string = nullptr; op->flags = 0; op->reserved = NULL; } -- cgit v1.2.3 From 9e2be4998e453ef66a595b230519a006ca257529 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Wed, 15 Nov 2017 23:52:55 -0800 Subject: Only alloc if status <> ok --- src/core/lib/transport/error_utils.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/lib/transport/error_utils.cc b/src/core/lib/transport/error_utils.cc index bcaedeeac9..723663a6d7 100644 --- a/src/core/lib/transport/error_utils.cc +++ b/src/core/lib/transport/error_utils.cc @@ -44,10 +44,6 @@ void grpc_error_get_status(grpc_exec_ctx* exec_ctx, grpc_error* error, grpc_millis deadline, grpc_status_code* code, grpc_slice* slice, grpc_http2_error_code* http_error, const char** full_error_details) { - if (full_error_details != NULL) { - *full_error_details = gpr_strdup(grpc_error_string(error)); - } - // Start with the parent error and recurse through the tree of children // until we find the first one that has a status code. grpc_error* found_error = @@ -74,6 +70,10 @@ void grpc_error_get_status(grpc_exec_ctx* exec_ctx, grpc_error* error, } if (code != nullptr) *code = status; + if (full_error_details != NULL && status != GRPC_STATUS_OK) { + *full_error_details = gpr_strdup(grpc_error_string(error)); + } + if (http_error != nullptr) { if (grpc_error_get_int(found_error, GRPC_ERROR_INT_HTTP2_ERROR, &integer)) { *http_error = (grpc_http2_error_code)integer; -- cgit v1.2.3 From d87f2ba4e4979e2c8def4922d927243503a80e7b Mon Sep 17 00:00:00 2001 From: Nicolas Lopez Date: Thu, 16 Nov 2017 12:58:31 -0500 Subject: change directory input to use of native.glob use of directory as input to data is not supported with experimental remote execution build service. --- test/core/util/grpc_fuzzer.bzl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/core/util/grpc_fuzzer.bzl b/test/core/util/grpc_fuzzer.bzl index 55b6f1c1a5..b8b270ecd0 100644 --- a/test/core/util/grpc_fuzzer.bzl +++ b/test/core/util/grpc_fuzzer.bzl @@ -19,8 +19,7 @@ def grpc_fuzzer(name, corpus, srcs = [], deps = [], **kwargs): name = name, srcs = srcs, deps = deps + ["//test/core/util:fuzzer_corpus_test"], - data = [corpus], - args = ['--directory', '$(location %s)' % corpus], + data = native.glob([corpus + "/**"]), external_deps = [ 'gtest', ], -- cgit v1.2.3 From 0bf12cfd32f72be119a4c64433f8de13b9354847 Mon Sep 17 00:00:00 2001 From: kwasimensah Date: Thu, 16 Nov 2017 15:07:00 -0500 Subject: Fix clang-format issues --- src/core/lib/support/cpu_posix.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/lib/support/cpu_posix.cc b/src/core/lib/support/cpu_posix.cc index 832818aac5..c9dbc0d5d9 100644 --- a/src/core/lib/support/cpu_posix.cc +++ b/src/core/lib/support/cpu_posix.cc @@ -49,7 +49,7 @@ unsigned gpr_cpu_num_cores(void) { return (unsigned)ncpus; } -static void delete_thread_id_key(void *value) { +static void delete_thread_id_key(void* value) { if (value) { gpr_free(value); } @@ -68,10 +68,10 @@ unsigned gpr_cpu_current_cpu(void) { static gpr_once once = GPR_ONCE_INIT; gpr_once_init(&once, init_thread_id_key); - unsigned int *thread_id = - static_cast(pthread_getspecific(thread_id_key)); + unsigned int* thread_id = + static_cast(pthread_getspecific(thread_id_key)); if (thread_id == nullptr) { - thread_id = static_cast(gpr_malloc(sizeof(unsigned int))); + thread_id = static_cast(gpr_malloc(sizeof(unsigned int))); pthread_setspecific(thread_id_key, thread_id); } -- cgit v1.2.3 From 9b7484867663018e2b362cf01567dd9a77341f00 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Fri, 17 Nov 2017 23:11:13 +0800 Subject: forward declare pbobjc.h --- src/compiler/objective_c_plugin.cc | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc index 53ff81f94a..d5d488e84d 100644 --- a/src/compiler/objective_c_plugin.cc +++ b/src/compiler/objective_c_plugin.cc @@ -51,12 +51,15 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { { // Generate .pbrpc.h - ::grpc::string imports = ::grpc::string("#import \"") + file_name + - ".pbobjc.h\"\n\n" - "#import \n" - "#import \n" - "#import \n" - "#import \n"; + ::grpc::string imports = + ::grpc::string("#if !GPB_GRPC_FORWARD_DECLARE_MESSAGE_PROTO\n") + + "#import \"" + file_name + + ".pbobjc.h\"\n" + "#endif\n\n" + "#import \n" + "#import \n" + "#import \n" + "#import \n"; ::grpc::string proto_imports; proto_imports += "#if GPB_GRPC_FORWARD_DECLARE_MESSAGE_PROTO\n" + @@ -105,7 +108,10 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { // Generate .pbrpc.m ::grpc::string imports = ::grpc::string("#import \"") + file_name + - ".pbrpc.h\"\n\n" + ".pbrpc.h\"\n" + "#import \"" + + file_name + + ".pbobjc.h\"\n\n" "#import \n" "#import \n"; for (int i = 0; i < file->dependency_count(); i++) { -- cgit v1.2.3 From 1de0d69fd92918a20a60c8d7d75e5d1effe42966 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 17 Nov 2017 15:55:47 +0100 Subject: add GCStats to microbenchmarks --- src/csharp/Grpc.Microbenchmarks/GCStats.cs | 69 ++++++++++++++++++++++ .../Grpc.Microbenchmarks/ThreadedBenchmark.cs | 3 +- 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 src/csharp/Grpc.Microbenchmarks/GCStats.cs diff --git a/src/csharp/Grpc.Microbenchmarks/GCStats.cs b/src/csharp/Grpc.Microbenchmarks/GCStats.cs new file mode 100644 index 0000000000..ca7051ec4e --- /dev/null +++ b/src/csharp/Grpc.Microbenchmarks/GCStats.cs @@ -0,0 +1,69 @@ +#region Copyright notice and license + +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#endregion + +using System; +using Grpc.Core; +using Grpc.Core.Internal; + +namespace Grpc.Microbenchmarks +{ + internal class GCStats + { + readonly object myLock = new object(); + GCStatsSnapshot lastSnapshot; + + public GCStats() + { + lastSnapshot = new GCStatsSnapshot(GC.CollectionCount(0), GC.CollectionCount(1), GC.CollectionCount(2)); + } + + public GCStatsSnapshot GetSnapshot(bool reset = false) + { + lock (myLock) + { + var newSnapshot = new GCStatsSnapshot(GC.CollectionCount(0) - lastSnapshot.Gen0, + GC.CollectionCount(1) - lastSnapshot.Gen1, + GC.CollectionCount(2) - lastSnapshot.Gen2); + if (reset) + { + lastSnapshot = newSnapshot; + } + return newSnapshot; + } + } + } + + public class GCStatsSnapshot + { + public GCStatsSnapshot(int gen0, int gen1, int gen2) + { + this.Gen0 = gen0; + this.Gen1 = gen1; + this.Gen2 = gen2; + } + + public int Gen0 { get; } + public int Gen1 { get; } + public int Gen2 { get; } + + public override string ToString() + { + return string.Format("[GCCollectionCount: gen0 {0}, gen1 {1}, gen2 {2}]", Gen0, Gen1, Gen2); + } + } +} diff --git a/src/csharp/Grpc.Microbenchmarks/ThreadedBenchmark.cs b/src/csharp/Grpc.Microbenchmarks/ThreadedBenchmark.cs index feac8d1690..95b9aaaf3f 100644 --- a/src/csharp/Grpc.Microbenchmarks/ThreadedBenchmark.cs +++ b/src/csharp/Grpc.Microbenchmarks/ThreadedBenchmark.cs @@ -46,6 +46,7 @@ namespace Grpc.Microbenchmarks public void Run() { Console.WriteLine("Running threads."); + var gcStats = new GCStats(); var threads = new List(); for (int i = 0; i < runners.Count; i++) { @@ -58,7 +59,7 @@ namespace Grpc.Microbenchmarks { thread.Join(); } - Console.WriteLine("All threads finished."); + Console.WriteLine("All threads finished (GC Stats Delta: " + gcStats.GetSnapshot() + ")"); } } } -- cgit v1.2.3 From ef69907cff00c8fabde2c112925196778c39fbef Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 17 Nov 2017 17:38:18 +0100 Subject: add CompletionRegistry microbenchmark --- .../CompletionRegistryBenchmark.cs | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs diff --git a/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs b/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs new file mode 100644 index 0000000000..810de119a8 --- /dev/null +++ b/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs @@ -0,0 +1,69 @@ +#region Copyright notice and license + +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#endregion + +using System; +using System.Runtime.InteropServices; +using System.Threading; +using Grpc.Core; +using Grpc.Core.Internal; +using System.Collections.Generic; +using System.Diagnostics; + +namespace Grpc.Microbenchmarks +{ + public class CompletionRegistryBenchmark + { + GrpcEnvironment environment; + + public void Init() + { + environment = GrpcEnvironment.AddRef(); + } + + public void Cleanup() + { + GrpcEnvironment.ReleaseAsync().Wait(); + } + + public void Run(int threadCount, int iterations) + { + Console.WriteLine(string.Format("CompletionRegistryBenchmark: threads={0}, iterations={1}", threadCount, iterations)); + var threadedBenchmark = new ThreadedBenchmark(threadCount, () => ThreadBody(iterations)); + threadedBenchmark.Run(); + // TODO: parametrize by number of pending completions + } + + private void ThreadBody(int iterations) + { + var completionRegistry = new CompletionRegistry(environment); + var ctx = BatchContextSafeHandle.Create(); + var completionDelegate = new OpCompletionDelegate((success) => {}); + + var stopwatch = Stopwatch.StartNew(); + for (int i = 0; i < iterations; i++) + { + completionRegistry.Register(ctx.DangerousGetHandle(), completionDelegate); + var callback = completionRegistry.Extract(completionRegistry.LastRegisteredKey); + } + stopwatch.Stop(); + Console.WriteLine("Elapsed millis: " + stopwatch.ElapsedMilliseconds); + + ctx.Dispose(); + } + } +} -- cgit v1.2.3 From 74a723f20da288fc4087f75a7a42cdc4b33adbe4 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 17 Nov 2017 17:39:01 +0100 Subject: add PInvokeByteArray microbenchmark --- .../PInvokeByteArrayBenchmark.cs | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/csharp/Grpc.Microbenchmarks/PInvokeByteArrayBenchmark.cs diff --git a/src/csharp/Grpc.Microbenchmarks/PInvokeByteArrayBenchmark.cs b/src/csharp/Grpc.Microbenchmarks/PInvokeByteArrayBenchmark.cs new file mode 100644 index 0000000000..787b5508fb --- /dev/null +++ b/src/csharp/Grpc.Microbenchmarks/PInvokeByteArrayBenchmark.cs @@ -0,0 +1,64 @@ +#region Copyright notice and license + +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#endregion + +using System; +using System.Runtime.InteropServices; +using System.Threading; +using Grpc.Core; +using Grpc.Core.Internal; +using System.Collections.Generic; +using System.Diagnostics; + +namespace Grpc.Microbenchmarks +{ + public class PInvokeByteArrayBenchmark + { + static readonly NativeMethods Native = NativeMethods.Get(); + + public void Init() + { + } + + public void Cleanup() + { + } + + public void Run(int threadCount, int iterations, int payloadSize) + { + Console.WriteLine(string.Format("PInvokeByteArrayBenchmark: threads={0}, iterations={1}, payloadSize={2}", threadCount, iterations, payloadSize)); + var threadedBenchmark = new ThreadedBenchmark(threadCount, () => ThreadBody(iterations, payloadSize)); + threadedBenchmark.Run(); + } + + private void ThreadBody(int iterations, int payloadSize) + { + var payload = new byte[payloadSize]; + + var stopwatch = Stopwatch.StartNew(); + for (int i = 0; i < iterations; i++) + { + var gcHandle = GCHandle.Alloc(payload, GCHandleType.Pinned); + var payloadPtr = gcHandle.AddrOfPinnedObject(); + Native.grpcsharp_test_nop(payloadPtr); + gcHandle.Free(); + } + stopwatch.Stop(); + Console.WriteLine("Elapsed millis: " + stopwatch.ElapsedMilliseconds); + } + } +} -- cgit v1.2.3 From 8aeaacc220cb5238c9cab91c91fc5878ab3b4775 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 17 Nov 2017 17:39:29 +0100 Subject: generalize invocation of C# microbenchmarks --- .../Grpc.Microbenchmarks.csproj | 4 ++ src/csharp/Grpc.Microbenchmarks/Program.cs | 67 ++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj b/src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj index 108357e4eb..8a629f9748 100644 --- a/src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj +++ b/src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj @@ -15,6 +15,10 @@ + + + + diff --git a/src/csharp/Grpc.Microbenchmarks/Program.cs b/src/csharp/Grpc.Microbenchmarks/Program.cs index d07d4187c4..79ec308501 100644 --- a/src/csharp/Grpc.Microbenchmarks/Program.cs +++ b/src/csharp/Grpc.Microbenchmarks/Program.cs @@ -20,14 +20,81 @@ using System; using Grpc.Core; using Grpc.Core.Internal; using Grpc.Core.Logging; +using CommandLine; +using CommandLine.Text; namespace Grpc.Microbenchmarks { class Program { + public enum MicrobenchmarkType + { + CompletionRegistry, + PInvokeByteArray, + SendMessage + } + + private class BenchmarkOptions + { + [Option("benchmark", Required = true, HelpText = "Benchmark to run")] + public MicrobenchmarkType Benchmark { get; set; } + } + public static void Main(string[] args) { GrpcEnvironment.SetLogger(new ConsoleLogger()); + var parserResult = Parser.Default.ParseArguments(args) + .WithNotParsed(errors => { + Console.WriteLine("Supported benchmarks:"); + foreach (var enumValue in Enum.GetValues(typeof(MicrobenchmarkType))) + { + Console.WriteLine(" " + enumValue); + } + Environment.Exit(1); + }) + .WithParsed(options => + { + switch (options.Benchmark) + { + case MicrobenchmarkType.CompletionRegistry: + RunCompletionRegistryBenchmark(); + break; + case MicrobenchmarkType.PInvokeByteArray: + RunPInvokeByteArrayBenchmark(); + break; + case MicrobenchmarkType.SendMessage: + RunSendMessageBenchmark(); + break; + default: + throw new ArgumentException("Unsupported benchmark."); + } + }); + } + + static void RunCompletionRegistryBenchmark() + { + var benchmark = new CompletionRegistryBenchmark(); + benchmark.Init(); + foreach (int threadCount in new int[] {1, 1, 2, 4, 8, 12}) + { + benchmark.Run(threadCount, 4 * 1000 * 1000); + } + benchmark.Cleanup(); + } + + static void RunPInvokeByteArrayBenchmark() + { + var benchmark = new PInvokeByteArrayBenchmark(); + benchmark.Init(); + foreach (int threadCount in new int[] {1, 1, 2, 4, 8, 12}) + { + benchmark.Run(threadCount, 4 * 1000 * 1000, 0); + } + benchmark.Cleanup(); + } + + static void RunSendMessageBenchmark() + { var benchmark = new SendMessageBenchmark(); benchmark.Init(); foreach (int threadCount in new int[] {1, 1, 2, 4, 8, 12}) -- cgit v1.2.3 From f852c060384027ae1c82b1ea5d8dae62c9c5ea3c Mon Sep 17 00:00:00 2001 From: ncteisen Date: Fri, 17 Nov 2017 16:50:12 -0800 Subject: Fix TSAN attempt --- src/core/lib/transport/error_utils.cc | 9 ++++++--- src/core/lib/transport/error_utils.h | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/core/lib/transport/error_utils.cc b/src/core/lib/transport/error_utils.cc index 723663a6d7..acac1330b5 100644 --- a/src/core/lib/transport/error_utils.cc +++ b/src/core/lib/transport/error_utils.cc @@ -43,7 +43,7 @@ static grpc_error* recursively_find_error_with_field(grpc_error* error, void grpc_error_get_status(grpc_exec_ctx* exec_ctx, grpc_error* error, grpc_millis deadline, grpc_status_code* code, grpc_slice* slice, grpc_http2_error_code* http_error, - const char** full_error_details) { + const char** error_string) { // Start with the parent error and recurse through the tree of children // until we find the first one that has a status code. grpc_error* found_error = @@ -70,8 +70,11 @@ void grpc_error_get_status(grpc_exec_ctx* exec_ctx, grpc_error* error, } if (code != nullptr) *code = status; - if (full_error_details != NULL && status != GRPC_STATUS_OK) { - *full_error_details = gpr_strdup(grpc_error_string(error)); + if (error_string != NULL && status != GRPC_STATUS_OK) { + const char* str = grpc_error_string(error); + if (str != nullptr) { + *error_string = gpr_strdup(str); + } } if (http_error != nullptr) { diff --git a/src/core/lib/transport/error_utils.h b/src/core/lib/transport/error_utils.h index d47c4f2a3b..6f21f484e5 100644 --- a/src/core/lib/transport/error_utils.h +++ b/src/core/lib/transport/error_utils.h @@ -30,15 +30,15 @@ extern "C" { /// A utility function to get the status code and message to be returned /// to the application. If not set in the top-level message, looks /// through child errors until it finds the first one with these attributes. -/// All attributes are pulled from the same child error. full_error_details will +/// All attributes are pulled from the same child error. error_string will /// be populated with the entire error string. If any of the attributes (code, -/// msg, http_status, full_error_details) are unneeded, they can be passed as +/// msg, http_status, error_string) are unneeded, they can be passed as /// NULL. void grpc_error_get_status(grpc_exec_ctx* exec_ctx, grpc_error* error, grpc_millis deadline, grpc_status_code* code, grpc_slice* slice, grpc_http2_error_code* http_status, - const char** full_error_details); + const char** error_string); /// A utility function to check whether there is a clear status code that /// doesn't need to be guessed in \a error. This means that \a error or some -- cgit v1.2.3 From 518236d4587642003a52468355d9851463c35b3a Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Fri, 17 Nov 2017 17:00:14 -0800 Subject: Remove unnecessary if condition in public_headers_must_be_c89 --- .../surface/public_headers_must_be_c89.c.template | 8 +- test/core/surface/public_headers_must_be_c89.c | 564 ++++++++++----------- 2 files changed, 284 insertions(+), 288 deletions(-) diff --git a/templates/test/core/surface/public_headers_must_be_c89.c.template b/templates/test/core/surface/public_headers_must_be_c89.c.template index e2d3b1810a..6e4a83666e 100644 --- a/templates/test/core/surface/public_headers_must_be_c89.c.template +++ b/templates/test/core/surface/public_headers_must_be_c89.c.template @@ -48,10 +48,8 @@ #include int main(int argc, char **argv) { - if(argc == 12345678) { - % for fn in fns: - printf("%lx", (unsigned long) ${fn}); - % endfor - } + % for fn in fns: + printf("%lx", (unsigned long) ${fn}); + % endfor return 0; } diff --git a/test/core/surface/public_headers_must_be_c89.c b/test/core/surface/public_headers_must_be_c89.c index db9f902dbf..b5a83c8eed 100644 --- a/test/core/surface/public_headers_must_be_c89.c +++ b/test/core/surface/public_headers_must_be_c89.c @@ -66,288 +66,286 @@ #include int main(int argc, char **argv) { - if(argc == 12345678) { - printf("%lx", (unsigned long) grpc_compression_algorithm_parse); - printf("%lx", (unsigned long) grpc_compression_algorithm_name); - printf("%lx", (unsigned long) grpc_stream_compression_algorithm_name); - printf("%lx", (unsigned long) grpc_compression_algorithm_for_level); - printf("%lx", (unsigned long) grpc_stream_compression_algorithm_for_level); - printf("%lx", (unsigned long) grpc_compression_options_init); - printf("%lx", (unsigned long) grpc_compression_options_enable_algorithm); - printf("%lx", (unsigned long) grpc_compression_options_disable_algorithm); - printf("%lx", (unsigned long) grpc_compression_options_is_algorithm_enabled); - printf("%lx", (unsigned long) grpc_compression_options_is_stream_compression_algorithm_enabled); - printf("%lx", (unsigned long) grpc_metadata_array_init); - printf("%lx", (unsigned long) grpc_metadata_array_destroy); - printf("%lx", (unsigned long) grpc_call_details_init); - printf("%lx", (unsigned long) grpc_call_details_destroy); - printf("%lx", (unsigned long) grpc_register_plugin); - printf("%lx", (unsigned long) grpc_init); - printf("%lx", (unsigned long) grpc_shutdown); - printf("%lx", (unsigned long) grpc_version_string); - printf("%lx", (unsigned long) grpc_g_stands_for); - printf("%lx", (unsigned long) grpc_completion_queue_factory_lookup); - printf("%lx", (unsigned long) grpc_completion_queue_create_for_next); - printf("%lx", (unsigned long) grpc_completion_queue_create_for_pluck); - printf("%lx", (unsigned long) grpc_completion_queue_create); - printf("%lx", (unsigned long) grpc_completion_queue_next); - printf("%lx", (unsigned long) grpc_completion_queue_pluck); - printf("%lx", (unsigned long) grpc_completion_queue_shutdown); - printf("%lx", (unsigned long) grpc_completion_queue_destroy); - printf("%lx", (unsigned long) grpc_completion_queue_thread_local_cache_init); - printf("%lx", (unsigned long) grpc_completion_queue_thread_local_cache_flush); - printf("%lx", (unsigned long) grpc_alarm_create); - printf("%lx", (unsigned long) grpc_alarm_set); - printf("%lx", (unsigned long) grpc_alarm_cancel); - printf("%lx", (unsigned long) grpc_alarm_destroy); - printf("%lx", (unsigned long) grpc_channel_check_connectivity_state); - printf("%lx", (unsigned long) grpc_channel_num_external_connectivity_watchers); - printf("%lx", (unsigned long) grpc_channel_watch_connectivity_state); - printf("%lx", (unsigned long) grpc_channel_support_connectivity_watcher); - printf("%lx", (unsigned long) grpc_channel_create_call); - printf("%lx", (unsigned long) grpc_channel_ping); - printf("%lx", (unsigned long) grpc_channel_register_call); - printf("%lx", (unsigned long) grpc_channel_create_registered_call); - printf("%lx", (unsigned long) grpc_call_arena_alloc); - printf("%lx", (unsigned long) grpc_call_start_batch); - printf("%lx", (unsigned long) grpc_call_get_peer); - printf("%lx", (unsigned long) grpc_census_call_set_context); - printf("%lx", (unsigned long) grpc_census_call_get_context); - printf("%lx", (unsigned long) grpc_channel_get_target); - printf("%lx", (unsigned long) grpc_channel_get_info); - printf("%lx", (unsigned long) grpc_insecure_channel_create); - printf("%lx", (unsigned long) grpc_lame_client_channel_create); - printf("%lx", (unsigned long) grpc_channel_destroy); - printf("%lx", (unsigned long) grpc_call_cancel); - printf("%lx", (unsigned long) grpc_call_cancel_with_status); - printf("%lx", (unsigned long) grpc_call_ref); - printf("%lx", (unsigned long) grpc_call_unref); - printf("%lx", (unsigned long) grpc_server_request_call); - printf("%lx", (unsigned long) grpc_server_register_method); - printf("%lx", (unsigned long) grpc_server_request_registered_call); - printf("%lx", (unsigned long) grpc_server_create); - printf("%lx", (unsigned long) grpc_server_register_completion_queue); - printf("%lx", (unsigned long) grpc_server_add_insecure_http2_port); - printf("%lx", (unsigned long) grpc_server_start); - printf("%lx", (unsigned long) grpc_server_shutdown_and_notify); - printf("%lx", (unsigned long) grpc_server_cancel_all_calls); - printf("%lx", (unsigned long) grpc_server_destroy); - printf("%lx", (unsigned long) grpc_tracer_set_enabled); - printf("%lx", (unsigned long) grpc_header_key_is_legal); - printf("%lx", (unsigned long) grpc_header_nonbin_value_is_legal); - printf("%lx", (unsigned long) grpc_is_binary_header); - printf("%lx", (unsigned long) grpc_call_error_to_string); - printf("%lx", (unsigned long) grpc_resource_quota_create); - printf("%lx", (unsigned long) grpc_resource_quota_ref); - printf("%lx", (unsigned long) grpc_resource_quota_unref); - printf("%lx", (unsigned long) grpc_resource_quota_resize); - printf("%lx", (unsigned long) grpc_resource_quota_arg_vtable); - printf("%lx", (unsigned long) grpc_auth_property_iterator_next); - printf("%lx", (unsigned long) grpc_auth_context_property_iterator); - printf("%lx", (unsigned long) grpc_auth_context_peer_identity); - printf("%lx", (unsigned long) grpc_auth_context_find_properties_by_name); - printf("%lx", (unsigned long) grpc_auth_context_peer_identity_property_name); - printf("%lx", (unsigned long) grpc_auth_context_peer_is_authenticated); - printf("%lx", (unsigned long) grpc_call_auth_context); - printf("%lx", (unsigned long) grpc_auth_context_release); - printf("%lx", (unsigned long) grpc_auth_context_add_property); - printf("%lx", (unsigned long) grpc_auth_context_add_cstring_property); - printf("%lx", (unsigned long) grpc_auth_context_set_peer_identity_property_name); - printf("%lx", (unsigned long) grpc_channel_credentials_release); - printf("%lx", (unsigned long) grpc_google_default_credentials_create); - printf("%lx", (unsigned long) grpc_set_ssl_roots_override_callback); - printf("%lx", (unsigned long) grpc_ssl_credentials_create); - printf("%lx", (unsigned long) grpc_call_credentials_release); - printf("%lx", (unsigned long) grpc_composite_channel_credentials_create); - printf("%lx", (unsigned long) grpc_composite_call_credentials_create); - printf("%lx", (unsigned long) grpc_google_compute_engine_credentials_create); - printf("%lx", (unsigned long) grpc_max_auth_token_lifetime); - printf("%lx", (unsigned long) grpc_service_account_jwt_access_credentials_create); - printf("%lx", (unsigned long) grpc_google_refresh_token_credentials_create); - printf("%lx", (unsigned long) grpc_access_token_credentials_create); - printf("%lx", (unsigned long) grpc_google_iam_credentials_create); - printf("%lx", (unsigned long) grpc_metadata_credentials_create_from_plugin); - printf("%lx", (unsigned long) grpc_secure_channel_create); - printf("%lx", (unsigned long) grpc_server_credentials_release); - printf("%lx", (unsigned long) grpc_ssl_server_certificate_config_create); - printf("%lx", (unsigned long) grpc_ssl_server_certificate_config_destroy); - printf("%lx", (unsigned long) grpc_ssl_server_credentials_create); - printf("%lx", (unsigned long) grpc_ssl_server_credentials_create_ex); - printf("%lx", (unsigned long) grpc_ssl_server_credentials_create_options_using_config); - printf("%lx", (unsigned long) grpc_ssl_server_credentials_create_options_using_config_fetcher); - printf("%lx", (unsigned long) grpc_ssl_server_credentials_options_destroy); - printf("%lx", (unsigned long) grpc_ssl_server_credentials_create_with_options); - printf("%lx", (unsigned long) grpc_server_add_secure_http2_port); - printf("%lx", (unsigned long) grpc_call_set_credentials); - printf("%lx", (unsigned long) grpc_server_credentials_set_auth_metadata_processor); - printf("%lx", (unsigned long) grpc_raw_byte_buffer_create); - printf("%lx", (unsigned long) grpc_raw_compressed_byte_buffer_create); - printf("%lx", (unsigned long) grpc_byte_buffer_copy); - printf("%lx", (unsigned long) grpc_byte_buffer_length); - printf("%lx", (unsigned long) grpc_byte_buffer_destroy); - printf("%lx", (unsigned long) grpc_byte_buffer_reader_init); - printf("%lx", (unsigned long) grpc_byte_buffer_reader_destroy); - printf("%lx", (unsigned long) grpc_byte_buffer_reader_next); - printf("%lx", (unsigned long) grpc_byte_buffer_reader_readall); - printf("%lx", (unsigned long) grpc_raw_byte_buffer_from_reader); - printf("%lx", (unsigned long) grpc_slice_ref); - printf("%lx", (unsigned long) grpc_slice_unref); - printf("%lx", (unsigned long) grpc_slice_copy); - printf("%lx", (unsigned long) grpc_slice_new); - printf("%lx", (unsigned long) grpc_slice_new_with_user_data); - printf("%lx", (unsigned long) grpc_slice_new_with_len); - printf("%lx", (unsigned long) grpc_slice_malloc); - printf("%lx", (unsigned long) grpc_slice_malloc_large); - printf("%lx", (unsigned long) grpc_slice_intern); - printf("%lx", (unsigned long) grpc_slice_from_copied_string); - printf("%lx", (unsigned long) grpc_slice_from_copied_buffer); - printf("%lx", (unsigned long) grpc_slice_from_static_string); - printf("%lx", (unsigned long) grpc_slice_from_static_buffer); - printf("%lx", (unsigned long) grpc_slice_sub); - printf("%lx", (unsigned long) grpc_slice_sub_no_ref); - printf("%lx", (unsigned long) grpc_slice_split_tail); - printf("%lx", (unsigned long) grpc_slice_split_tail_maybe_ref); - printf("%lx", (unsigned long) grpc_slice_split_head); - printf("%lx", (unsigned long) grpc_empty_slice); - printf("%lx", (unsigned long) grpc_slice_default_hash_impl); - printf("%lx", (unsigned long) grpc_slice_default_eq_impl); - printf("%lx", (unsigned long) grpc_slice_eq); - printf("%lx", (unsigned long) grpc_slice_cmp); - printf("%lx", (unsigned long) grpc_slice_str_cmp); - printf("%lx", (unsigned long) grpc_slice_buf_start_eq); - printf("%lx", (unsigned long) grpc_slice_rchr); - printf("%lx", (unsigned long) grpc_slice_chr); - printf("%lx", (unsigned long) grpc_slice_slice); - printf("%lx", (unsigned long) grpc_slice_hash); - printf("%lx", (unsigned long) grpc_slice_is_equivalent); - printf("%lx", (unsigned long) grpc_slice_dup); - printf("%lx", (unsigned long) grpc_slice_to_c_string); - printf("%lx", (unsigned long) grpc_slice_buffer_init); - printf("%lx", (unsigned long) grpc_slice_buffer_destroy); - printf("%lx", (unsigned long) grpc_slice_buffer_add); - printf("%lx", (unsigned long) grpc_slice_buffer_add_indexed); - printf("%lx", (unsigned long) grpc_slice_buffer_addn); - printf("%lx", (unsigned long) grpc_slice_buffer_tiny_add); - printf("%lx", (unsigned long) grpc_slice_buffer_pop); - printf("%lx", (unsigned long) grpc_slice_buffer_reset_and_unref); - printf("%lx", (unsigned long) grpc_slice_buffer_swap); - printf("%lx", (unsigned long) grpc_slice_buffer_move_into); - printf("%lx", (unsigned long) grpc_slice_buffer_trim_end); - printf("%lx", (unsigned long) grpc_slice_buffer_move_first); - printf("%lx", (unsigned long) grpc_slice_buffer_move_first_no_ref); - printf("%lx", (unsigned long) grpc_slice_buffer_move_first_into_buffer); - printf("%lx", (unsigned long) grpc_slice_buffer_take_first); - printf("%lx", (unsigned long) grpc_slice_buffer_undo_take_first); - printf("%lx", (unsigned long) gpr_malloc); - printf("%lx", (unsigned long) gpr_zalloc); - printf("%lx", (unsigned long) gpr_free); - printf("%lx", (unsigned long) gpr_realloc); - printf("%lx", (unsigned long) gpr_malloc_aligned); - printf("%lx", (unsigned long) gpr_free_aligned); - printf("%lx", (unsigned long) gpr_set_allocation_functions); - printf("%lx", (unsigned long) gpr_get_allocation_functions); - printf("%lx", (unsigned long) gpr_avl_create); - printf("%lx", (unsigned long) gpr_avl_ref); - printf("%lx", (unsigned long) gpr_avl_unref); - printf("%lx", (unsigned long) gpr_avl_add); - printf("%lx", (unsigned long) gpr_avl_remove); - printf("%lx", (unsigned long) gpr_avl_get); - printf("%lx", (unsigned long) gpr_avl_maybe_get); - printf("%lx", (unsigned long) gpr_avl_is_empty); - printf("%lx", (unsigned long) gpr_cmdline_create); - printf("%lx", (unsigned long) gpr_cmdline_add_int); - printf("%lx", (unsigned long) gpr_cmdline_add_flag); - printf("%lx", (unsigned long) gpr_cmdline_add_string); - printf("%lx", (unsigned long) gpr_cmdline_on_extra_arg); - printf("%lx", (unsigned long) gpr_cmdline_set_survive_failure); - printf("%lx", (unsigned long) gpr_cmdline_parse); - printf("%lx", (unsigned long) gpr_cmdline_destroy); - printf("%lx", (unsigned long) gpr_cmdline_usage_string); - printf("%lx", (unsigned long) gpr_cpu_num_cores); - printf("%lx", (unsigned long) gpr_cpu_current_cpu); - printf("%lx", (unsigned long) gpr_histogram_create); - printf("%lx", (unsigned long) gpr_histogram_destroy); - printf("%lx", (unsigned long) gpr_histogram_add); - printf("%lx", (unsigned long) gpr_histogram_merge); - printf("%lx", (unsigned long) gpr_histogram_percentile); - printf("%lx", (unsigned long) gpr_histogram_mean); - printf("%lx", (unsigned long) gpr_histogram_stddev); - printf("%lx", (unsigned long) gpr_histogram_variance); - printf("%lx", (unsigned long) gpr_histogram_maximum); - printf("%lx", (unsigned long) gpr_histogram_minimum); - printf("%lx", (unsigned long) gpr_histogram_count); - printf("%lx", (unsigned long) gpr_histogram_sum); - printf("%lx", (unsigned long) gpr_histogram_sum_of_squares); - printf("%lx", (unsigned long) gpr_histogram_get_contents); - printf("%lx", (unsigned long) gpr_histogram_merge_contents); - printf("%lx", (unsigned long) gpr_join_host_port); - printf("%lx", (unsigned long) gpr_split_host_port); - printf("%lx", (unsigned long) gpr_log_severity_string); - printf("%lx", (unsigned long) gpr_log); - printf("%lx", (unsigned long) gpr_log_message); - printf("%lx", (unsigned long) gpr_set_log_verbosity); - printf("%lx", (unsigned long) gpr_log_verbosity_init); - printf("%lx", (unsigned long) gpr_set_log_function); - printf("%lx", (unsigned long) gpr_strdup); - printf("%lx", (unsigned long) gpr_asprintf); - printf("%lx", (unsigned long) gpr_subprocess_binary_extension); - printf("%lx", (unsigned long) gpr_subprocess_create); - printf("%lx", (unsigned long) gpr_subprocess_destroy); - printf("%lx", (unsigned long) gpr_subprocess_join); - printf("%lx", (unsigned long) gpr_subprocess_interrupt); - printf("%lx", (unsigned long) gpr_mu_init); - printf("%lx", (unsigned long) gpr_mu_destroy); - printf("%lx", (unsigned long) gpr_mu_lock); - printf("%lx", (unsigned long) gpr_mu_unlock); - printf("%lx", (unsigned long) gpr_mu_trylock); - printf("%lx", (unsigned long) gpr_cv_init); - printf("%lx", (unsigned long) gpr_cv_destroy); - printf("%lx", (unsigned long) gpr_cv_wait); - printf("%lx", (unsigned long) gpr_cv_signal); - printf("%lx", (unsigned long) gpr_cv_broadcast); - printf("%lx", (unsigned long) gpr_once_init); - printf("%lx", (unsigned long) gpr_event_init); - printf("%lx", (unsigned long) gpr_event_set); - printf("%lx", (unsigned long) gpr_event_get); - printf("%lx", (unsigned long) gpr_event_wait); - printf("%lx", (unsigned long) gpr_ref_init); - printf("%lx", (unsigned long) gpr_ref); - printf("%lx", (unsigned long) gpr_ref_non_zero); - printf("%lx", (unsigned long) gpr_refn); - printf("%lx", (unsigned long) gpr_unref); - printf("%lx", (unsigned long) gpr_ref_is_unique); - printf("%lx", (unsigned long) gpr_stats_init); - printf("%lx", (unsigned long) gpr_stats_inc); - printf("%lx", (unsigned long) gpr_stats_read); - printf("%lx", (unsigned long) gpr_thd_new); - printf("%lx", (unsigned long) gpr_thd_options_default); - printf("%lx", (unsigned long) gpr_thd_options_set_detached); - printf("%lx", (unsigned long) gpr_thd_options_set_joinable); - printf("%lx", (unsigned long) gpr_thd_options_is_detached); - printf("%lx", (unsigned long) gpr_thd_options_is_joinable); - printf("%lx", (unsigned long) gpr_thd_currentid); - printf("%lx", (unsigned long) gpr_thd_join); - printf("%lx", (unsigned long) gpr_time_0); - printf("%lx", (unsigned long) gpr_inf_future); - printf("%lx", (unsigned long) gpr_inf_past); - printf("%lx", (unsigned long) gpr_time_init); - printf("%lx", (unsigned long) gpr_now); - printf("%lx", (unsigned long) gpr_convert_clock_type); - printf("%lx", (unsigned long) gpr_time_cmp); - printf("%lx", (unsigned long) gpr_time_max); - printf("%lx", (unsigned long) gpr_time_min); - printf("%lx", (unsigned long) gpr_time_add); - printf("%lx", (unsigned long) gpr_time_sub); - printf("%lx", (unsigned long) gpr_time_from_micros); - printf("%lx", (unsigned long) gpr_time_from_nanos); - printf("%lx", (unsigned long) gpr_time_from_millis); - printf("%lx", (unsigned long) gpr_time_from_seconds); - printf("%lx", (unsigned long) gpr_time_from_minutes); - printf("%lx", (unsigned long) gpr_time_from_hours); - printf("%lx", (unsigned long) gpr_time_to_millis); - printf("%lx", (unsigned long) gpr_time_similar); - printf("%lx", (unsigned long) gpr_sleep_until); - printf("%lx", (unsigned long) gpr_timespec_to_micros); - } + printf("%lx", (unsigned long) grpc_compression_algorithm_parse); + printf("%lx", (unsigned long) grpc_compression_algorithm_name); + printf("%lx", (unsigned long) grpc_stream_compression_algorithm_name); + printf("%lx", (unsigned long) grpc_compression_algorithm_for_level); + printf("%lx", (unsigned long) grpc_stream_compression_algorithm_for_level); + printf("%lx", (unsigned long) grpc_compression_options_init); + printf("%lx", (unsigned long) grpc_compression_options_enable_algorithm); + printf("%lx", (unsigned long) grpc_compression_options_disable_algorithm); + printf("%lx", (unsigned long) grpc_compression_options_is_algorithm_enabled); + printf("%lx", (unsigned long) grpc_compression_options_is_stream_compression_algorithm_enabled); + printf("%lx", (unsigned long) grpc_metadata_array_init); + printf("%lx", (unsigned long) grpc_metadata_array_destroy); + printf("%lx", (unsigned long) grpc_call_details_init); + printf("%lx", (unsigned long) grpc_call_details_destroy); + printf("%lx", (unsigned long) grpc_register_plugin); + printf("%lx", (unsigned long) grpc_init); + printf("%lx", (unsigned long) grpc_shutdown); + printf("%lx", (unsigned long) grpc_version_string); + printf("%lx", (unsigned long) grpc_g_stands_for); + printf("%lx", (unsigned long) grpc_completion_queue_factory_lookup); + printf("%lx", (unsigned long) grpc_completion_queue_create_for_next); + printf("%lx", (unsigned long) grpc_completion_queue_create_for_pluck); + printf("%lx", (unsigned long) grpc_completion_queue_create); + printf("%lx", (unsigned long) grpc_completion_queue_next); + printf("%lx", (unsigned long) grpc_completion_queue_pluck); + printf("%lx", (unsigned long) grpc_completion_queue_shutdown); + printf("%lx", (unsigned long) grpc_completion_queue_destroy); + printf("%lx", (unsigned long) grpc_completion_queue_thread_local_cache_init); + printf("%lx", (unsigned long) grpc_completion_queue_thread_local_cache_flush); + printf("%lx", (unsigned long) grpc_alarm_create); + printf("%lx", (unsigned long) grpc_alarm_set); + printf("%lx", (unsigned long) grpc_alarm_cancel); + printf("%lx", (unsigned long) grpc_alarm_destroy); + printf("%lx", (unsigned long) grpc_channel_check_connectivity_state); + printf("%lx", (unsigned long) grpc_channel_num_external_connectivity_watchers); + printf("%lx", (unsigned long) grpc_channel_watch_connectivity_state); + printf("%lx", (unsigned long) grpc_channel_support_connectivity_watcher); + printf("%lx", (unsigned long) grpc_channel_create_call); + printf("%lx", (unsigned long) grpc_channel_ping); + printf("%lx", (unsigned long) grpc_channel_register_call); + printf("%lx", (unsigned long) grpc_channel_create_registered_call); + printf("%lx", (unsigned long) grpc_call_arena_alloc); + printf("%lx", (unsigned long) grpc_call_start_batch); + printf("%lx", (unsigned long) grpc_call_get_peer); + printf("%lx", (unsigned long) grpc_census_call_set_context); + printf("%lx", (unsigned long) grpc_census_call_get_context); + printf("%lx", (unsigned long) grpc_channel_get_target); + printf("%lx", (unsigned long) grpc_channel_get_info); + printf("%lx", (unsigned long) grpc_insecure_channel_create); + printf("%lx", (unsigned long) grpc_lame_client_channel_create); + printf("%lx", (unsigned long) grpc_channel_destroy); + printf("%lx", (unsigned long) grpc_call_cancel); + printf("%lx", (unsigned long) grpc_call_cancel_with_status); + printf("%lx", (unsigned long) grpc_call_ref); + printf("%lx", (unsigned long) grpc_call_unref); + printf("%lx", (unsigned long) grpc_server_request_call); + printf("%lx", (unsigned long) grpc_server_register_method); + printf("%lx", (unsigned long) grpc_server_request_registered_call); + printf("%lx", (unsigned long) grpc_server_create); + printf("%lx", (unsigned long) grpc_server_register_completion_queue); + printf("%lx", (unsigned long) grpc_server_add_insecure_http2_port); + printf("%lx", (unsigned long) grpc_server_start); + printf("%lx", (unsigned long) grpc_server_shutdown_and_notify); + printf("%lx", (unsigned long) grpc_server_cancel_all_calls); + printf("%lx", (unsigned long) grpc_server_destroy); + printf("%lx", (unsigned long) grpc_tracer_set_enabled); + printf("%lx", (unsigned long) grpc_header_key_is_legal); + printf("%lx", (unsigned long) grpc_header_nonbin_value_is_legal); + printf("%lx", (unsigned long) grpc_is_binary_header); + printf("%lx", (unsigned long) grpc_call_error_to_string); + printf("%lx", (unsigned long) grpc_resource_quota_create); + printf("%lx", (unsigned long) grpc_resource_quota_ref); + printf("%lx", (unsigned long) grpc_resource_quota_unref); + printf("%lx", (unsigned long) grpc_resource_quota_resize); + printf("%lx", (unsigned long) grpc_resource_quota_arg_vtable); + printf("%lx", (unsigned long) grpc_auth_property_iterator_next); + printf("%lx", (unsigned long) grpc_auth_context_property_iterator); + printf("%lx", (unsigned long) grpc_auth_context_peer_identity); + printf("%lx", (unsigned long) grpc_auth_context_find_properties_by_name); + printf("%lx", (unsigned long) grpc_auth_context_peer_identity_property_name); + printf("%lx", (unsigned long) grpc_auth_context_peer_is_authenticated); + printf("%lx", (unsigned long) grpc_call_auth_context); + printf("%lx", (unsigned long) grpc_auth_context_release); + printf("%lx", (unsigned long) grpc_auth_context_add_property); + printf("%lx", (unsigned long) grpc_auth_context_add_cstring_property); + printf("%lx", (unsigned long) grpc_auth_context_set_peer_identity_property_name); + printf("%lx", (unsigned long) grpc_channel_credentials_release); + printf("%lx", (unsigned long) grpc_google_default_credentials_create); + printf("%lx", (unsigned long) grpc_set_ssl_roots_override_callback); + printf("%lx", (unsigned long) grpc_ssl_credentials_create); + printf("%lx", (unsigned long) grpc_call_credentials_release); + printf("%lx", (unsigned long) grpc_composite_channel_credentials_create); + printf("%lx", (unsigned long) grpc_composite_call_credentials_create); + printf("%lx", (unsigned long) grpc_google_compute_engine_credentials_create); + printf("%lx", (unsigned long) grpc_max_auth_token_lifetime); + printf("%lx", (unsigned long) grpc_service_account_jwt_access_credentials_create); + printf("%lx", (unsigned long) grpc_google_refresh_token_credentials_create); + printf("%lx", (unsigned long) grpc_access_token_credentials_create); + printf("%lx", (unsigned long) grpc_google_iam_credentials_create); + printf("%lx", (unsigned long) grpc_metadata_credentials_create_from_plugin); + printf("%lx", (unsigned long) grpc_secure_channel_create); + printf("%lx", (unsigned long) grpc_server_credentials_release); + printf("%lx", (unsigned long) grpc_ssl_server_certificate_config_create); + printf("%lx", (unsigned long) grpc_ssl_server_certificate_config_destroy); + printf("%lx", (unsigned long) grpc_ssl_server_credentials_create); + printf("%lx", (unsigned long) grpc_ssl_server_credentials_create_ex); + printf("%lx", (unsigned long) grpc_ssl_server_credentials_create_options_using_config); + printf("%lx", (unsigned long) grpc_ssl_server_credentials_create_options_using_config_fetcher); + printf("%lx", (unsigned long) grpc_ssl_server_credentials_options_destroy); + printf("%lx", (unsigned long) grpc_ssl_server_credentials_create_with_options); + printf("%lx", (unsigned long) grpc_server_add_secure_http2_port); + printf("%lx", (unsigned long) grpc_call_set_credentials); + printf("%lx", (unsigned long) grpc_server_credentials_set_auth_metadata_processor); + printf("%lx", (unsigned long) grpc_raw_byte_buffer_create); + printf("%lx", (unsigned long) grpc_raw_compressed_byte_buffer_create); + printf("%lx", (unsigned long) grpc_byte_buffer_copy); + printf("%lx", (unsigned long) grpc_byte_buffer_length); + printf("%lx", (unsigned long) grpc_byte_buffer_destroy); + printf("%lx", (unsigned long) grpc_byte_buffer_reader_init); + printf("%lx", (unsigned long) grpc_byte_buffer_reader_destroy); + printf("%lx", (unsigned long) grpc_byte_buffer_reader_next); + printf("%lx", (unsigned long) grpc_byte_buffer_reader_readall); + printf("%lx", (unsigned long) grpc_raw_byte_buffer_from_reader); + printf("%lx", (unsigned long) grpc_slice_ref); + printf("%lx", (unsigned long) grpc_slice_unref); + printf("%lx", (unsigned long) grpc_slice_copy); + printf("%lx", (unsigned long) grpc_slice_new); + printf("%lx", (unsigned long) grpc_slice_new_with_user_data); + printf("%lx", (unsigned long) grpc_slice_new_with_len); + printf("%lx", (unsigned long) grpc_slice_malloc); + printf("%lx", (unsigned long) grpc_slice_malloc_large); + printf("%lx", (unsigned long) grpc_slice_intern); + printf("%lx", (unsigned long) grpc_slice_from_copied_string); + printf("%lx", (unsigned long) grpc_slice_from_copied_buffer); + printf("%lx", (unsigned long) grpc_slice_from_static_string); + printf("%lx", (unsigned long) grpc_slice_from_static_buffer); + printf("%lx", (unsigned long) grpc_slice_sub); + printf("%lx", (unsigned long) grpc_slice_sub_no_ref); + printf("%lx", (unsigned long) grpc_slice_split_tail); + printf("%lx", (unsigned long) grpc_slice_split_tail_maybe_ref); + printf("%lx", (unsigned long) grpc_slice_split_head); + printf("%lx", (unsigned long) grpc_empty_slice); + printf("%lx", (unsigned long) grpc_slice_default_hash_impl); + printf("%lx", (unsigned long) grpc_slice_default_eq_impl); + printf("%lx", (unsigned long) grpc_slice_eq); + printf("%lx", (unsigned long) grpc_slice_cmp); + printf("%lx", (unsigned long) grpc_slice_str_cmp); + printf("%lx", (unsigned long) grpc_slice_buf_start_eq); + printf("%lx", (unsigned long) grpc_slice_rchr); + printf("%lx", (unsigned long) grpc_slice_chr); + printf("%lx", (unsigned long) grpc_slice_slice); + printf("%lx", (unsigned long) grpc_slice_hash); + printf("%lx", (unsigned long) grpc_slice_is_equivalent); + printf("%lx", (unsigned long) grpc_slice_dup); + printf("%lx", (unsigned long) grpc_slice_to_c_string); + printf("%lx", (unsigned long) grpc_slice_buffer_init); + printf("%lx", (unsigned long) grpc_slice_buffer_destroy); + printf("%lx", (unsigned long) grpc_slice_buffer_add); + printf("%lx", (unsigned long) grpc_slice_buffer_add_indexed); + printf("%lx", (unsigned long) grpc_slice_buffer_addn); + printf("%lx", (unsigned long) grpc_slice_buffer_tiny_add); + printf("%lx", (unsigned long) grpc_slice_buffer_pop); + printf("%lx", (unsigned long) grpc_slice_buffer_reset_and_unref); + printf("%lx", (unsigned long) grpc_slice_buffer_swap); + printf("%lx", (unsigned long) grpc_slice_buffer_move_into); + printf("%lx", (unsigned long) grpc_slice_buffer_trim_end); + printf("%lx", (unsigned long) grpc_slice_buffer_move_first); + printf("%lx", (unsigned long) grpc_slice_buffer_move_first_no_ref); + printf("%lx", (unsigned long) grpc_slice_buffer_move_first_into_buffer); + printf("%lx", (unsigned long) grpc_slice_buffer_take_first); + printf("%lx", (unsigned long) grpc_slice_buffer_undo_take_first); + printf("%lx", (unsigned long) gpr_malloc); + printf("%lx", (unsigned long) gpr_zalloc); + printf("%lx", (unsigned long) gpr_free); + printf("%lx", (unsigned long) gpr_realloc); + printf("%lx", (unsigned long) gpr_malloc_aligned); + printf("%lx", (unsigned long) gpr_free_aligned); + printf("%lx", (unsigned long) gpr_set_allocation_functions); + printf("%lx", (unsigned long) gpr_get_allocation_functions); + printf("%lx", (unsigned long) gpr_avl_create); + printf("%lx", (unsigned long) gpr_avl_ref); + printf("%lx", (unsigned long) gpr_avl_unref); + printf("%lx", (unsigned long) gpr_avl_add); + printf("%lx", (unsigned long) gpr_avl_remove); + printf("%lx", (unsigned long) gpr_avl_get); + printf("%lx", (unsigned long) gpr_avl_maybe_get); + printf("%lx", (unsigned long) gpr_avl_is_empty); + printf("%lx", (unsigned long) gpr_cmdline_create); + printf("%lx", (unsigned long) gpr_cmdline_add_int); + printf("%lx", (unsigned long) gpr_cmdline_add_flag); + printf("%lx", (unsigned long) gpr_cmdline_add_string); + printf("%lx", (unsigned long) gpr_cmdline_on_extra_arg); + printf("%lx", (unsigned long) gpr_cmdline_set_survive_failure); + printf("%lx", (unsigned long) gpr_cmdline_parse); + printf("%lx", (unsigned long) gpr_cmdline_destroy); + printf("%lx", (unsigned long) gpr_cmdline_usage_string); + printf("%lx", (unsigned long) gpr_cpu_num_cores); + printf("%lx", (unsigned long) gpr_cpu_current_cpu); + printf("%lx", (unsigned long) gpr_histogram_create); + printf("%lx", (unsigned long) gpr_histogram_destroy); + printf("%lx", (unsigned long) gpr_histogram_add); + printf("%lx", (unsigned long) gpr_histogram_merge); + printf("%lx", (unsigned long) gpr_histogram_percentile); + printf("%lx", (unsigned long) gpr_histogram_mean); + printf("%lx", (unsigned long) gpr_histogram_stddev); + printf("%lx", (unsigned long) gpr_histogram_variance); + printf("%lx", (unsigned long) gpr_histogram_maximum); + printf("%lx", (unsigned long) gpr_histogram_minimum); + printf("%lx", (unsigned long) gpr_histogram_count); + printf("%lx", (unsigned long) gpr_histogram_sum); + printf("%lx", (unsigned long) gpr_histogram_sum_of_squares); + printf("%lx", (unsigned long) gpr_histogram_get_contents); + printf("%lx", (unsigned long) gpr_histogram_merge_contents); + printf("%lx", (unsigned long) gpr_join_host_port); + printf("%lx", (unsigned long) gpr_split_host_port); + printf("%lx", (unsigned long) gpr_log_severity_string); + printf("%lx", (unsigned long) gpr_log); + printf("%lx", (unsigned long) gpr_log_message); + printf("%lx", (unsigned long) gpr_set_log_verbosity); + printf("%lx", (unsigned long) gpr_log_verbosity_init); + printf("%lx", (unsigned long) gpr_set_log_function); + printf("%lx", (unsigned long) gpr_strdup); + printf("%lx", (unsigned long) gpr_asprintf); + printf("%lx", (unsigned long) gpr_subprocess_binary_extension); + printf("%lx", (unsigned long) gpr_subprocess_create); + printf("%lx", (unsigned long) gpr_subprocess_destroy); + printf("%lx", (unsigned long) gpr_subprocess_join); + printf("%lx", (unsigned long) gpr_subprocess_interrupt); + printf("%lx", (unsigned long) gpr_mu_init); + printf("%lx", (unsigned long) gpr_mu_destroy); + printf("%lx", (unsigned long) gpr_mu_lock); + printf("%lx", (unsigned long) gpr_mu_unlock); + printf("%lx", (unsigned long) gpr_mu_trylock); + printf("%lx", (unsigned long) gpr_cv_init); + printf("%lx", (unsigned long) gpr_cv_destroy); + printf("%lx", (unsigned long) gpr_cv_wait); + printf("%lx", (unsigned long) gpr_cv_signal); + printf("%lx", (unsigned long) gpr_cv_broadcast); + printf("%lx", (unsigned long) gpr_once_init); + printf("%lx", (unsigned long) gpr_event_init); + printf("%lx", (unsigned long) gpr_event_set); + printf("%lx", (unsigned long) gpr_event_get); + printf("%lx", (unsigned long) gpr_event_wait); + printf("%lx", (unsigned long) gpr_ref_init); + printf("%lx", (unsigned long) gpr_ref); + printf("%lx", (unsigned long) gpr_ref_non_zero); + printf("%lx", (unsigned long) gpr_refn); + printf("%lx", (unsigned long) gpr_unref); + printf("%lx", (unsigned long) gpr_ref_is_unique); + printf("%lx", (unsigned long) gpr_stats_init); + printf("%lx", (unsigned long) gpr_stats_inc); + printf("%lx", (unsigned long) gpr_stats_read); + printf("%lx", (unsigned long) gpr_thd_new); + printf("%lx", (unsigned long) gpr_thd_options_default); + printf("%lx", (unsigned long) gpr_thd_options_set_detached); + printf("%lx", (unsigned long) gpr_thd_options_set_joinable); + printf("%lx", (unsigned long) gpr_thd_options_is_detached); + printf("%lx", (unsigned long) gpr_thd_options_is_joinable); + printf("%lx", (unsigned long) gpr_thd_currentid); + printf("%lx", (unsigned long) gpr_thd_join); + printf("%lx", (unsigned long) gpr_time_0); + printf("%lx", (unsigned long) gpr_inf_future); + printf("%lx", (unsigned long) gpr_inf_past); + printf("%lx", (unsigned long) gpr_time_init); + printf("%lx", (unsigned long) gpr_now); + printf("%lx", (unsigned long) gpr_convert_clock_type); + printf("%lx", (unsigned long) gpr_time_cmp); + printf("%lx", (unsigned long) gpr_time_max); + printf("%lx", (unsigned long) gpr_time_min); + printf("%lx", (unsigned long) gpr_time_add); + printf("%lx", (unsigned long) gpr_time_sub); + printf("%lx", (unsigned long) gpr_time_from_micros); + printf("%lx", (unsigned long) gpr_time_from_nanos); + printf("%lx", (unsigned long) gpr_time_from_millis); + printf("%lx", (unsigned long) gpr_time_from_seconds); + printf("%lx", (unsigned long) gpr_time_from_minutes); + printf("%lx", (unsigned long) gpr_time_from_hours); + printf("%lx", (unsigned long) gpr_time_to_millis); + printf("%lx", (unsigned long) gpr_time_similar); + printf("%lx", (unsigned long) gpr_sleep_until); + printf("%lx", (unsigned long) gpr_timespec_to_micros); return 0; } -- cgit v1.2.3 From 1d5737feb3d1b1fa3f1bbc1d166a0ff04fa7ef3f Mon Sep 17 00:00:00 2001 From: Alex Polcyn Date: Fri, 17 Nov 2017 17:03:06 -0800 Subject: Fix error when a language skips a certain version --- tools/interop_matrix/run_interop_matrix_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/interop_matrix/run_interop_matrix_tests.py b/tools/interop_matrix/run_interop_matrix_tests.py index dce1033add..4265bc5355 100755 --- a/tools/interop_matrix/run_interop_matrix_tests.py +++ b/tools/interop_matrix/run_interop_matrix_tests.py @@ -100,7 +100,7 @@ def find_all_images_for_lang(lang): jobset.message('SKIPPED', '%s for %s is not defined' % (args.release, lang), do_newline=True) - return [] + return {} releases = [args.release] # Images tuples keyed by runtime. -- cgit v1.2.3 From 26521b38d235c9587ed391e285a3f5d34979df75 Mon Sep 17 00:00:00 2001 From: yang-g Date: Fri, 17 Nov 2017 17:15:37 -0800 Subject: Avoid calling dtor on grpc_fd before putting it in freelist --- src/core/lib/iomgr/ev_epoll1_linux.cc | 10 ++++++---- src/core/lib/iomgr/ev_epollex_linux.cc | 10 ++++++---- src/core/lib/iomgr/ev_epollsig_linux.cc | 10 ++++++---- src/core/lib/iomgr/lockfree_event.cc | 6 ++++-- src/core/lib/iomgr/lockfree_event.h | 4 +++- 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/core/lib/iomgr/ev_epoll1_linux.cc b/src/core/lib/iomgr/ev_epoll1_linux.cc index 918bc6f933..dddd52c49f 100644 --- a/src/core/lib/iomgr/ev_epoll1_linux.cc +++ b/src/core/lib/iomgr/ev_epoll1_linux.cc @@ -263,11 +263,13 @@ static grpc_fd* fd_create(int fd, const char* name) { if (new_fd == nullptr) { new_fd = (grpc_fd*)gpr_malloc(sizeof(grpc_fd)); + new_fd->read_closure.Init(); + new_fd->write_closure.Init(); } new_fd->fd = fd; - new_fd->read_closure.Init(); - new_fd->write_closure.Init(); + new_fd->read_closure->Init(); + new_fd->write_closure->Init(); gpr_atm_no_barrier_store(&new_fd->read_notifier_pollset, (gpr_atm)NULL); new_fd->freelist_next = nullptr; @@ -336,8 +338,8 @@ static void fd_orphan(grpc_exec_ctx* exec_ctx, grpc_fd* fd, GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_REF(error)); grpc_iomgr_unregister_object(&fd->iomgr_object); - fd->read_closure.Destroy(); - fd->write_closure.Destroy(); + fd->read_closure->Destroy(); + fd->write_closure->Destroy(); gpr_mu_lock(&fd_freelist_mu); fd->freelist_next = fd_freelist; diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc index bfd2ac4326..d2192731bf 100644 --- a/src/core/lib/iomgr/ev_epollex_linux.cc +++ b/src/core/lib/iomgr/ev_epollex_linux.cc @@ -288,8 +288,8 @@ static void fd_destroy(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { fd->freelist_next = fd_freelist; fd_freelist = fd; - fd->read_closure.Destroy(); - fd->write_closure.Destroy(); + fd->read_closure->Destroy(); + fd->write_closure->Destroy(); gpr_mu_unlock(&fd_freelist_mu); } @@ -342,6 +342,8 @@ static grpc_fd* fd_create(int fd, const char* name) { if (new_fd == nullptr) { new_fd = (grpc_fd*)gpr_malloc(sizeof(grpc_fd)); + new_fd->read_closure.Init(); + new_fd->write_closure.Init(); } gpr_mu_init(&new_fd->pollable_mu); @@ -349,8 +351,8 @@ static grpc_fd* fd_create(int fd, const char* name) { new_fd->pollable_obj = nullptr; gpr_atm_rel_store(&new_fd->refst, (gpr_atm)1); new_fd->fd = fd; - new_fd->read_closure.Init(); - new_fd->write_closure.Init(); + new_fd->read_closure->Init(); + new_fd->write_closure->Init(); gpr_atm_no_barrier_store(&new_fd->read_notifier_pollset, (gpr_atm)NULL); new_fd->freelist_next = nullptr; diff --git a/src/core/lib/iomgr/ev_epollsig_linux.cc b/src/core/lib/iomgr/ev_epollsig_linux.cc index 5b4a7ba19c..25c0a93897 100644 --- a/src/core/lib/iomgr/ev_epollsig_linux.cc +++ b/src/core/lib/iomgr/ev_epollsig_linux.cc @@ -767,8 +767,8 @@ static void unref_by(grpc_fd* fd, int n) { fd_freelist = fd; grpc_iomgr_unregister_object(&fd->iomgr_object); - fd->read_closure.Destroy(); - fd->write_closure.Destroy(); + fd->read_closure->Destroy(); + fd->write_closure->Destroy(); gpr_mu_unlock(&fd_freelist_mu); } else { @@ -819,6 +819,8 @@ static grpc_fd* fd_create(int fd, const char* name) { if (new_fd == nullptr) { new_fd = (grpc_fd*)gpr_malloc(sizeof(grpc_fd)); gpr_mu_init(&new_fd->po.mu); + new_fd->read_closure.Init(); + new_fd->write_closure.Init(); } /* Note: It is not really needed to get the new_fd->po.mu lock here. If this @@ -833,8 +835,8 @@ static grpc_fd* fd_create(int fd, const char* name) { gpr_atm_rel_store(&new_fd->refst, (gpr_atm)1); new_fd->fd = fd; new_fd->orphaned = false; - new_fd->read_closure.Init(); - new_fd->write_closure.Init(); + new_fd->read_closure->Init(); + new_fd->write_closure->Init(); gpr_atm_no_barrier_store(&new_fd->read_notifier_pollset, (gpr_atm)NULL); new_fd->freelist_next = nullptr; diff --git a/src/core/lib/iomgr/lockfree_event.cc b/src/core/lib/iomgr/lockfree_event.cc index 40e2ed6219..57a81fb5b2 100644 --- a/src/core/lib/iomgr/lockfree_event.cc +++ b/src/core/lib/iomgr/lockfree_event.cc @@ -57,7 +57,9 @@ extern grpc_tracer_flag grpc_polling_trace; namespace grpc_core { -LockfreeEvent::LockfreeEvent() { +LockfreeEvent::LockfreeEvent() { Init(); } + +void LockfreeEvent::Init() { /* Perform an atomic store to start the state machine. Note carefully that LockfreeEvent *MAY* be used whilst in a destroyed @@ -67,7 +69,7 @@ LockfreeEvent::LockfreeEvent() { gpr_atm_no_barrier_store(&state_, kClosureNotReady); } -LockfreeEvent::~LockfreeEvent() { +void LockfreeEvent::Destroy() { gpr_atm curr; do { curr = gpr_atm_no_barrier_load(&state_); diff --git a/src/core/lib/iomgr/lockfree_event.h b/src/core/lib/iomgr/lockfree_event.h index c667dcd3bc..b9490f5458 100644 --- a/src/core/lib/iomgr/lockfree_event.h +++ b/src/core/lib/iomgr/lockfree_event.h @@ -30,11 +30,13 @@ namespace grpc_core { class LockfreeEvent { public: LockfreeEvent(); - ~LockfreeEvent(); LockfreeEvent(const LockfreeEvent&) = delete; LockfreeEvent& operator=(const LockfreeEvent&) = delete; + void Init(); + void Destroy(); + bool IsShutdown() const { return (gpr_atm_no_barrier_load(&state_) & kShutdownBit) != 0; } -- cgit v1.2.3 From 84a066bf29180bb2d48d118e8bd17362a649dffa Mon Sep 17 00:00:00 2001 From: josh Date: Fri, 17 Nov 2017 20:11:56 -0700 Subject: Turning on executable bit for tools/run_tests/sanity/check_bazel_workspace.py --- tools/run_tests/sanity/check_bazel_workspace.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/run_tests/sanity/check_bazel_workspace.py diff --git a/tools/run_tests/sanity/check_bazel_workspace.py b/tools/run_tests/sanity/check_bazel_workspace.py old mode 100644 new mode 100755 -- cgit v1.2.3 From 9f4a8eeced218423db60f90a9a307061943e9fb4 Mon Sep 17 00:00:00 2001 From: Marko Bogdanović Date: Thu, 26 Oct 2017 14:34:45 +0200 Subject: Add HealthChecker helpers for setting statuses --- src/ruby/pb/grpc/health/checker.rb | 14 ++++++++++++++ src/ruby/spec/pb/health/checker_spec.rb | 29 +++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/src/ruby/pb/grpc/health/checker.rb b/src/ruby/pb/grpc/health/checker.rb index f23db39da5..c492455d8f 100644 --- a/src/ruby/pb/grpc/health/checker.rb +++ b/src/ruby/pb/grpc/health/checker.rb @@ -48,6 +48,20 @@ module Grpc @status_mutex.synchronize { @statuses["#{service}"] = status } end + # Adds given health status for all given services + def set_status_for_services(status, *services) + @status_mutex.synchronize do + services.each { |service| @statuses["#{service}"] = status } + end + end + + # Adds health status for each service given within hash + def add_statuses(service_statuses = {}) + @status_mutex.synchronize do + service_statuses.each_pair { |service, status| @statuses["#{service}"] = status } + end + end + # Clears the status for the given service. def clear_status(service) @status_mutex.synchronize { @statuses.delete("#{service}") } diff --git a/src/ruby/spec/pb/health/checker_spec.rb b/src/ruby/spec/pb/health/checker_spec.rb index 6c9e206c3f..c79ccfd2e0 100644 --- a/src/ruby/spec/pb/health/checker_spec.rb +++ b/src/ruby/spec/pb/health/checker_spec.rb @@ -99,6 +99,35 @@ describe Grpc::Health::Checker do end end + context 'method `add_statuses`' do + it 'should add status to each service' do + checker = Grpc::Health::Checker.new + checker.add_statuses( + 'service1' => ServingStatus::SERVING, + 'service2' => ServingStatus::NOT_SERVING + ) + service1_health = checker.check(HCReq.new(service: 'service1'), nil) + service2_health = checker.check(HCReq.new(service: 'service2'), nil) + expect(service1_health).to eq(HCResp.new(status: ServingStatus::SERVING)) + expect(service2_health).to eq(HCResp.new(status: ServingStatus::NOT_SERVING)) + end + end + + context 'method `set_status_for_services`' do + it 'should add given status to all given services' do + checker = Grpc::Health::Checker.new + checker.set_status_for_services( + ServingStatus::SERVING, + 'service1', + 'service2' + ) + service1_health = checker.check(HCReq.new(service: 'service1'), nil) + service2_health = checker.check(HCReq.new(service: 'service2'), nil) + expect(service1_health).to eq(HCResp.new(status: ServingStatus::SERVING)) + expect(service2_health).to eq(HCResp.new(status: ServingStatus::SERVING)) + end + end + context 'method `check`' do success_tests.each do |t| it "should fail with NOT_FOUND when #{t[:desc]}" do -- cgit v1.2.3 From 8abe26237e0060d2601b789ffcbf52437bd67a7d Mon Sep 17 00:00:00 2001 From: kwasimensah Date: Sun, 19 Nov 2017 16:01:50 -0500 Subject: Fix pthread cleanup logic Don't delete the key in the pthread_key_create destructor. The key isn't specific to instances of values. --- src/core/lib/support/cpu_posix.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/lib/support/cpu_posix.cc b/src/core/lib/support/cpu_posix.cc index c9dbc0d5d9..bca14a0c12 100644 --- a/src/core/lib/support/cpu_posix.cc +++ b/src/core/lib/support/cpu_posix.cc @@ -49,15 +49,14 @@ unsigned gpr_cpu_num_cores(void) { return (unsigned)ncpus; } -static void delete_thread_id_key(void* value) { +static void delete_thread_id(void* value) { if (value) { gpr_free(value); } - pthread_key_delete(thread_id_key); } static void init_thread_id_key(void) { - pthread_key_create(&thread_id_key, delete_thread_id_key); + pthread_key_create(&thread_id_key, delete_thread_id); } unsigned gpr_cpu_current_cpu(void) { -- cgit v1.2.3 From 9b4315682bcc5ab581e3deeab41c76e336010a19 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Mon, 20 Nov 2017 10:46:28 -0800 Subject: Do not require bazel for check_grpcio_tools.py The `make_grpcio_tools.py` rube-goldberg machinery relies on `bazel` to extract the list of files required to compile the `grpcio-tools` package that are provided by the `protobuf` submodule. In order to ensure that list is up to date, `check_grpcio_tools.py` sanity check does the same `bazel` query, and checks the full contents against the already existing list in the repository. This has the downside of requiring `bazel` to run that particular check at sanity test time, and flakiness has been seen there. This commit changes the code generation process to include the git hash of the submodule at the time `make_grpcio_tools.py` is invoked and stores it in the generated file and instead of doing the whole process at test time, the `check_grpcio_tools.py` sanity test simply checks the submodule version at test time and verifies it against the version included in the file by `make_grpcio_tools.py` thus removing the `bazel` dependency at test time and increasing test robustness and speed. --- tools/distrib/python/check_grpcio_tools.py | 20 ++++++++++++-------- tools/distrib/python/grpcio_tools/protoc_lib_deps.py | 4 +++- tools/distrib/python/make_grpcio_tools.py | 20 ++++++++++++++++++-- 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/tools/distrib/python/check_grpcio_tools.py b/tools/distrib/python/check_grpcio_tools.py index c5afa713e6..b56ccaea7a 100755 --- a/tools/distrib/python/check_grpcio_tools.py +++ b/tools/distrib/python/check_grpcio_tools.py @@ -14,17 +14,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -import cStringIO - -import make_grpcio_tools as make +import make_grpcio_tools as _make OUT_OF_DATE_MESSAGE = """file {} is out of date Have you called tools/distrib/python/make_grpcio_tools.py since upgrading protobuf?""" -check_protoc_lib_deps_content = make.get_deps() +submodule_commit_hash = _make.protobuf_submodule_commit_hash() + +with open(_make.GRPC_PYTHON_PROTOC_LIB_DEPS, 'r') as _protoc_lib_deps_file: + content = _protoc_lib_deps_file.read().splitlines() + +testString = (_make.COMMIT_HASH_PREFIX + + submodule_commit_hash + + _make.COMMIT_HASH_SUFFIX) -with open(make.GRPC_PYTHON_PROTOC_LIB_DEPS, 'r') as protoc_lib_deps_file: - if protoc_lib_deps_file.read() != check_protoc_lib_deps_content: - print(OUT_OF_DATE_MESSAGE.format(make.GRPC_PYTHON_PROTOC_LIB_DEPS)) - raise SystemExit(1) +if testString not in content: + print(OUT_OF_DATE_MESSAGE.format(_make.GRPC_PYTHON_PROTOC_LIB_DEPS)) + raise SystemExit(1) diff --git a/tools/distrib/python/grpcio_tools/protoc_lib_deps.py b/tools/distrib/python/grpcio_tools/protoc_lib_deps.py index 18470d59d5..2a42a518fc 100644 --- a/tools/distrib/python/grpcio_tools/protoc_lib_deps.py +++ b/tools/distrib/python/grpcio_tools/protoc_lib_deps.py @@ -1,5 +1,5 @@ -# Copyright 2016 gRPC authors. +# Copyright 2017 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,3 +19,5 @@ PROTO_FILES=['google/protobuf/wrappers.proto', 'google/protobuf/type.proto', 'go CC_INCLUDE='third_party/protobuf/src' PROTO_INCLUDE='third_party/protobuf/src' + +PROTOBUF_SUBMODULE_VERSION="80a37e0782d2d702d52234b62dd4b9ec74fd2c95" diff --git a/tools/distrib/python/make_grpcio_tools.py b/tools/distrib/python/make_grpcio_tools.py index 5bc07ff360..c865f0bcc0 100755 --- a/tools/distrib/python/make_grpcio_tools.py +++ b/tools/distrib/python/make_grpcio_tools.py @@ -28,7 +28,7 @@ import traceback import uuid DEPS_FILE_CONTENT=""" -# Copyright 2016 gRPC authors. +# Copyright 2017 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,8 +48,13 @@ PROTO_FILES={proto_files} CC_INCLUDE={cc_include} PROTO_INCLUDE={proto_include} + +{commit_hash} """ +COMMIT_HASH_PREFIX = 'PROTOBUF_SUBMODULE_VERSION="' +COMMIT_HASH_SUFFIX = '"' + # Bazel query result prefix for expected source files in protobuf. PROTOBUF_CC_PREFIX = '//:src/' PROTOBUF_PROTO_PREFIX = '//:src/' @@ -63,6 +68,7 @@ GRPC_PYTHON_ROOT = os.path.join(GRPC_ROOT, 'tools', 'distrib', GRPC_PYTHON_PROTOBUF_RELATIVE_ROOT = os.path.join('third_party', 'protobuf', 'src') GRPC_PROTOBUF = os.path.join(GRPC_ROOT, GRPC_PYTHON_PROTOBUF_RELATIVE_ROOT) +GRPC_PROTOBUF_SUBMODULE_ROOT = os.path.join(GRPC_ROOT, 'third_party', 'protobuf') GRPC_PROTOC_PLUGINS = os.path.join(GRPC_ROOT, 'src', 'compiler') GRPC_PYTHON_PROTOBUF = os.path.join(GRPC_PYTHON_ROOT, 'third_party', 'protobuf', 'src') @@ -78,6 +84,14 @@ BAZEL_DEPS = os.path.join(GRPC_ROOT, 'tools', 'distrib', 'python', 'bazel_deps.s BAZEL_DEPS_PROTOC_LIB_QUERY = '//:protoc_lib' BAZEL_DEPS_COMMON_PROTOS_QUERY = '//:well_known_protos' +def protobuf_submodule_commit_hash(): + """Gets the commit hash for the HEAD of the protobuf submodule currently + checked out.""" + cwd = os.getcwd() + os.chdir(GRPC_PROTOBUF_SUBMODULE_ROOT) + output = subprocess.check_output(['git', 'rev-parse', 'HEAD']) + os.chdir(cwd) + return output.splitlines()[0].strip() def bazel_query(query): output = subprocess.check_output([BAZEL_DEPS, query]) @@ -94,11 +108,13 @@ def get_deps(): proto_files = [ name[len(PROTOBUF_PROTO_PREFIX):] for name in proto_files_output if name.endswith('.proto') and name.startswith(PROTOBUF_PROTO_PREFIX)] + commit_hash = protobuf_submodule_commit_hash() deps_file_content = DEPS_FILE_CONTENT.format( cc_files=cc_files, proto_files=proto_files, cc_include=repr(GRPC_PYTHON_PROTOBUF_RELATIVE_ROOT), - proto_include=repr(GRPC_PYTHON_PROTOBUF_RELATIVE_ROOT)) + proto_include=repr(GRPC_PYTHON_PROTOBUF_RELATIVE_ROOT), + commit_hash=COMMIT_HASH_PREFIX + commit_hash + COMMIT_HASH_SUFFIX) return deps_file_content def long_path(path): -- cgit v1.2.3 From 8d1a3ca5fc909899b4895733d496fb563c02dae9 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Mon, 20 Nov 2017 15:32:51 -0500 Subject: use aquire release --- src/core/lib/iomgr/error.cc | 2 +- src/core/lib/transport/error_utils.cc | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/core/lib/iomgr/error.cc b/src/core/lib/iomgr/error.cc index 581b903f1a..5fe6514802 100644 --- a/src/core/lib/iomgr/error.cc +++ b/src/core/lib/iomgr/error.cc @@ -754,7 +754,7 @@ const char* grpc_error_string(grpc_error* err) { if (!gpr_atm_rel_cas(&err->atomics.error_string, 0, (gpr_atm)out)) { gpr_free(out); - out = (char*)gpr_atm_no_barrier_load(&err->atomics.error_string); + out = (char*)gpr_atm_acq_load(&err->atomics.error_string); } GPR_TIMER_END("grpc_error_string", 0); diff --git a/src/core/lib/transport/error_utils.cc b/src/core/lib/transport/error_utils.cc index acac1330b5..69c8ae6de3 100644 --- a/src/core/lib/transport/error_utils.cc +++ b/src/core/lib/transport/error_utils.cc @@ -71,10 +71,7 @@ void grpc_error_get_status(grpc_exec_ctx* exec_ctx, grpc_error* error, if (code != nullptr) *code = status; if (error_string != NULL && status != GRPC_STATUS_OK) { - const char* str = grpc_error_string(error); - if (str != nullptr) { - *error_string = gpr_strdup(str); - } + *error_string = gpr_strdup(grpc_error_string(error)); } if (http_error != nullptr) { -- cgit v1.2.3 From ed49fe5510780a96bf128bc6397f0d7d5394f669 Mon Sep 17 00:00:00 2001 From: yang-g Date: Mon, 20 Nov 2017 13:49:54 -0800 Subject: Resolve comments --- src/core/lib/iomgr/ev_epoll1_linux.cc | 8 ++++---- src/core/lib/iomgr/ev_epollex_linux.cc | 8 ++++---- src/core/lib/iomgr/ev_epollsig_linux.cc | 8 ++++---- src/core/lib/iomgr/lockfree_event.cc | 6 +++--- src/core/lib/iomgr/lockfree_event.h | 7 +++++-- 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/core/lib/iomgr/ev_epoll1_linux.cc b/src/core/lib/iomgr/ev_epoll1_linux.cc index dddd52c49f..8aada4e953 100644 --- a/src/core/lib/iomgr/ev_epoll1_linux.cc +++ b/src/core/lib/iomgr/ev_epoll1_linux.cc @@ -268,8 +268,8 @@ static grpc_fd* fd_create(int fd, const char* name) { } new_fd->fd = fd; - new_fd->read_closure->Init(); - new_fd->write_closure->Init(); + new_fd->read_closure->InitEvent(); + new_fd->write_closure->InitEvent(); gpr_atm_no_barrier_store(&new_fd->read_notifier_pollset, (gpr_atm)NULL); new_fd->freelist_next = nullptr; @@ -338,8 +338,8 @@ static void fd_orphan(grpc_exec_ctx* exec_ctx, grpc_fd* fd, GRPC_CLOSURE_SCHED(exec_ctx, on_done, GRPC_ERROR_REF(error)); grpc_iomgr_unregister_object(&fd->iomgr_object); - fd->read_closure->Destroy(); - fd->write_closure->Destroy(); + fd->read_closure->DestroyEvent(); + fd->write_closure->DestroyEvent(); gpr_mu_lock(&fd_freelist_mu); fd->freelist_next = fd_freelist; diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc index d2192731bf..a6f069e294 100644 --- a/src/core/lib/iomgr/ev_epollex_linux.cc +++ b/src/core/lib/iomgr/ev_epollex_linux.cc @@ -288,8 +288,8 @@ static void fd_destroy(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { fd->freelist_next = fd_freelist; fd_freelist = fd; - fd->read_closure->Destroy(); - fd->write_closure->Destroy(); + fd->read_closure->DestroyEvent(); + fd->write_closure->DestroyEvent(); gpr_mu_unlock(&fd_freelist_mu); } @@ -351,8 +351,8 @@ static grpc_fd* fd_create(int fd, const char* name) { new_fd->pollable_obj = nullptr; gpr_atm_rel_store(&new_fd->refst, (gpr_atm)1); new_fd->fd = fd; - new_fd->read_closure->Init(); - new_fd->write_closure->Init(); + new_fd->read_closure->InitEvent(); + new_fd->write_closure->InitEvent(); gpr_atm_no_barrier_store(&new_fd->read_notifier_pollset, (gpr_atm)NULL); new_fd->freelist_next = nullptr; diff --git a/src/core/lib/iomgr/ev_epollsig_linux.cc b/src/core/lib/iomgr/ev_epollsig_linux.cc index 25c0a93897..d51c665e8c 100644 --- a/src/core/lib/iomgr/ev_epollsig_linux.cc +++ b/src/core/lib/iomgr/ev_epollsig_linux.cc @@ -767,8 +767,8 @@ static void unref_by(grpc_fd* fd, int n) { fd_freelist = fd; grpc_iomgr_unregister_object(&fd->iomgr_object); - fd->read_closure->Destroy(); - fd->write_closure->Destroy(); + fd->read_closure->DestroyEvent(); + fd->write_closure->DestroyEvent(); gpr_mu_unlock(&fd_freelist_mu); } else { @@ -835,8 +835,8 @@ static grpc_fd* fd_create(int fd, const char* name) { gpr_atm_rel_store(&new_fd->refst, (gpr_atm)1); new_fd->fd = fd; new_fd->orphaned = false; - new_fd->read_closure->Init(); - new_fd->write_closure->Init(); + new_fd->read_closure->InitEvent(); + new_fd->write_closure->InitEvent(); gpr_atm_no_barrier_store(&new_fd->read_notifier_pollset, (gpr_atm)NULL); new_fd->freelist_next = nullptr; diff --git a/src/core/lib/iomgr/lockfree_event.cc b/src/core/lib/iomgr/lockfree_event.cc index 57a81fb5b2..edd997ff30 100644 --- a/src/core/lib/iomgr/lockfree_event.cc +++ b/src/core/lib/iomgr/lockfree_event.cc @@ -57,9 +57,9 @@ extern grpc_tracer_flag grpc_polling_trace; namespace grpc_core { -LockfreeEvent::LockfreeEvent() { Init(); } +LockfreeEvent::LockfreeEvent() { InitEvent(); } -void LockfreeEvent::Init() { +void LockfreeEvent::InitEvent() { /* Perform an atomic store to start the state machine. Note carefully that LockfreeEvent *MAY* be used whilst in a destroyed @@ -69,7 +69,7 @@ void LockfreeEvent::Init() { gpr_atm_no_barrier_store(&state_, kClosureNotReady); } -void LockfreeEvent::Destroy() { +void LockfreeEvent::DestroyEvent() { gpr_atm curr; do { curr = gpr_atm_no_barrier_load(&state_); diff --git a/src/core/lib/iomgr/lockfree_event.h b/src/core/lib/iomgr/lockfree_event.h index b9490f5458..aec67a3399 100644 --- a/src/core/lib/iomgr/lockfree_event.h +++ b/src/core/lib/iomgr/lockfree_event.h @@ -34,8 +34,11 @@ class LockfreeEvent { LockfreeEvent(const LockfreeEvent&) = delete; LockfreeEvent& operator=(const LockfreeEvent&) = delete; - void Init(); - void Destroy(); + // These methods are used to initialize and destroy the internal state. These + // cannot be done in constructor and destructor because SetReady may be called + // when the event is destroyed and put in a freelist. + void InitEvent(); + void DestroyEvent(); bool IsShutdown() const { return (gpr_atm_no_barrier_load(&state_) & kShutdownBit) != 0; -- cgit v1.2.3 From bcf083fa9099e5c919f1bdbc7694705665468d3c Mon Sep 17 00:00:00 2001 From: Giang Nguyen Date: Mon, 30 Oct 2017 10:19:17 -0500 Subject: Add Python support for server SSL cert reloading Previously, a secure server is configured with SSL credentials during initialization, and those credentials will be used for the lifetime of the server. If the user wants the server to use new credentials, the user has to restart the server, resulting in server downtime. This change enables the user to optionally configure the server with a "certificiate config fetcher," such that on every new client connection, the server will call the config fetcher before performing the handshake, allowing the user application to optionally specify new certificate configuration for the server to use (the fetcher can return a "no change" and the server continues to use its current certificate configuration). --- src/python/grpcio/grpc/__init__.py | 85 +++- .../grpc/_cython/_cygrpc/credentials.pxd.pxi | 15 + .../grpc/_cython/_cygrpc/credentials.pyx.pxi | 110 ++++- src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi | 40 +- .../grpcio/grpc/_cython/_cygrpc/server.pyx.pxi | 36 ++ src/python/grpcio_tests/tests/tests.json | 4 + src/python/grpcio_tests/tests/unit/_api_test.py | 19 +- .../tests/unit/_server_ssl_cert_config_test.py | 520 +++++++++++++++++++++ .../grpcio_tests/tests/unit/credentials/README | 1 - .../grpcio_tests/tests/unit/credentials/README.md | 15 + .../certificate_hierarchy_1/certs/ca.cert.pem | 31 ++ .../intermediate/certs/client.cert.pem | 28 ++ .../intermediate/certs/intermediate.cert.pem | 31 ++ .../intermediate/certs/localhost-1.cert.pem | 30 ++ .../intermediate/private/client.key.pem | 27 ++ .../intermediate/private/localhost-1.key.pem | 27 ++ .../certificate_hierarchy_2/certs/ca.cert.pem | 31 ++ .../intermediate/certs/client.cert.pem | 28 ++ .../intermediate/certs/intermediate.cert.pem | 31 ++ .../intermediate/certs/localhost-1.cert.pem | 30 ++ .../intermediate/private/client.key.pem | 27 ++ .../intermediate/private/localhost-1.key.pem | 27 ++ src/python/grpcio_tests/tests/unit/resources.py | 80 +++- 23 files changed, 1231 insertions(+), 42 deletions(-) create mode 100644 src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py delete mode 100644 src/python/grpcio_tests/tests/unit/credentials/README create mode 100644 src/python/grpcio_tests/tests/unit/credentials/README.md create mode 100644 src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/certs/ca.cert.pem create mode 100644 src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/certs/client.cert.pem create mode 100644 src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/certs/intermediate.cert.pem create mode 100644 src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/certs/localhost-1.cert.pem create mode 100644 src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/private/client.key.pem create mode 100644 src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/private/localhost-1.key.pem create mode 100644 src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/certs/ca.cert.pem create mode 100644 src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/certs/client.cert.pem create mode 100644 src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/certs/intermediate.cert.pem create mode 100644 src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/certs/localhost-1.cert.pem create mode 100644 src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/private/client.key.pem create mode 100644 src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/private/localhost-1.key.pem diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py index c9f9ac27d9..70558a699a 100644 --- a/src/python/grpcio/grpc/__init__.py +++ b/src/python/grpcio/grpc/__init__.py @@ -424,6 +424,19 @@ class ServerCredentials(object): self._credentials = credentials +class ServerCertificateConfig(object): + """A certificate config for use with an SSL-enabled Server, e.g., can + be returned in the certificate config fetching callback. + + This class has no supported interface -- it exists to define the + type of its instances and its instances exist to be passed to + other functions. + """ + + def __init__(self, cert_config): + self._cert_config = cert_config + + ######################## Multi-Callable Interfaces ########################### @@ -1252,6 +1265,60 @@ def ssl_server_credentials(private_key_certificate_chain_pairs, ], require_client_auth)) +def ssl_server_certificate_config(private_key_certificate_chain_pairs, + root_certificates=None): + """Creates a ServerCertificateConfig for use with an SSL-enabled Server. + + Args: + private_key_certificate_chain_pairs: A collection of pairs of + the form [PEM-encoded private key, PEM-encoded certificate + chain]. + root_certificates: An optional byte string of PEM-encoded client root + certificates that the server will use to verify client authentication. + + Returns: + A ServerCertificateConfig that can be returned in the certificate config + fetching callback. + """ + if len(private_key_certificate_chain_pairs) == 0: + raise ValueError( + 'At least one private key-certificate chain pair is required!') + else: + return ServerCertificateConfig( + _cygrpc.server_certificate_config_ssl(root_certificates, [ + _cygrpc.SslPemKeyCertPair(key, pem) + for key, pem in private_key_certificate_chain_pairs + ])) + + +def ssl_server_credentials_dynamic_cert_config(initial_cert_config, + cert_config_fetcher, + require_client_auth=False): + """Creates a ServerCredentials for use with an SSL-enabled Server. + + Args: + initial_cert_config (ServerCertificateConfig): the certificate + config with which the server will be initialized. + cert_config_fetcher (callable): a callable that takes no + arguments and should return a ServerCertificateConfig to + replace the server's current cert, or None for no change + (i.e., the server will continue its current certificate + config). The library will call this callback on *every* new + client connection before starting the TLS handshake with the + client, thus allowing the user application to optionally + return a new ServerCertificateConfig that the server will then + use for the handshake. + require_client_auth: A boolean indicating whether or not to + require clients to be authenticated. + + Returns: + A ServerCredentials. + """ + return ServerCredentials( + _cygrpc.server_credentials_ssl_dynamic_cert_config( + initial_cert_config, cert_config_fetcher, require_client_auth)) + + def channel_ready_future(channel): """Creates a Future that tracks when a Channel is ready. @@ -1334,18 +1401,20 @@ __all__ = ('FutureTimeoutError', 'FutureCancelledError', 'Future', 'ChannelConnectivity', 'StatusCode', 'RpcError', 'RpcContext', 'Call', 'ChannelCredentials', 'CallCredentials', 'AuthMetadataContext', 'AuthMetadataPluginCallback', - 'AuthMetadataPlugin', 'ServerCredentials', 'UnaryUnaryMultiCallable', - 'UnaryStreamMultiCallable', 'StreamUnaryMultiCallable', - 'StreamStreamMultiCallable', 'Channel', 'ServicerContext', - 'RpcMethodHandler', 'HandlerCallDetails', 'GenericRpcHandler', - 'ServiceRpcHandler', 'Server', 'unary_unary_rpc_method_handler', - 'unary_stream_rpc_method_handler', 'stream_unary_rpc_method_handler', + 'AuthMetadataPlugin', 'ServerCertificateConfig', 'ServerCredentials', + 'UnaryUnaryMultiCallable', 'UnaryStreamMultiCallable', + 'StreamUnaryMultiCallable', 'StreamStreamMultiCallable', 'Channel', + 'ServicerContext', 'RpcMethodHandler', 'HandlerCallDetails', + 'GenericRpcHandler', 'ServiceRpcHandler', 'Server', + 'unary_unary_rpc_method_handler', 'unary_stream_rpc_method_handler', + 'stream_unary_rpc_method_handler', 'stream_stream_rpc_method_handler', 'method_handlers_generic_handler', 'ssl_channel_credentials', 'metadata_call_credentials', 'access_token_call_credentials', 'composite_call_credentials', 'composite_channel_credentials', - 'ssl_server_credentials', 'channel_ready_future', 'insecure_channel', - 'secure_channel', 'server',) + 'ssl_server_credentials', 'ssl_server_certificate_config', + 'ssl_server_credentials_dynamic_cert_config', 'channel_ready_future', + 'insecure_channel', 'secure_channel', 'server',) ############################### Extension Shims ################################ diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi index 41975cbe9e..bc0f185c77 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi @@ -28,12 +28,27 @@ cdef class CallCredentials: cdef list references +cdef class ServerCertificateConfig: + + cdef grpc_ssl_server_certificate_config *c_cert_config + cdef const char *c_pem_root_certs + cdef grpc_ssl_pem_key_cert_pair *c_ssl_pem_key_cert_pairs + cdef size_t c_ssl_pem_key_cert_pairs_count + cdef list references + + cdef class ServerCredentials: cdef grpc_server_credentials *c_credentials cdef grpc_ssl_pem_key_cert_pair *c_ssl_pem_key_cert_pairs cdef size_t c_ssl_pem_key_cert_pairs_count cdef list references + # the cert config related state is used only if this credentials is + # created with cert config/fetcher + cdef object initial_cert_config + cdef object cert_config_fetcher + # whether C-core has asked for the initial_cert_config + cdef bint initial_cert_config_fetched cdef class CredentialsMetadataPlugin: diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi index 0fabda19ce..db813b7243 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi @@ -14,6 +14,7 @@ cimport cpython +import grpc import threading import traceback @@ -58,12 +59,30 @@ cdef class CallCredentials: grpc_shutdown() +cdef class ServerCertificateConfig: + + def __cinit__(self): + grpc_init() + self.c_cert_config = NULL + self.c_pem_root_certs = NULL + self.c_ssl_pem_key_cert_pairs = NULL + self.references = [] + + def __dealloc__(self): + grpc_ssl_server_certificate_config_destroy(self.c_cert_config) + gpr_free(self.c_ssl_pem_key_cert_pairs) + grpc_shutdown() + + cdef class ServerCredentials: def __cinit__(self): grpc_init() self.c_credentials = NULL self.references = [] + self.initial_cert_config = None + self.cert_config_fetcher = None + self.initial_cert_config_fetched = False def __dealloc__(self): if self.c_credentials != NULL: @@ -254,34 +273,85 @@ def call_credentials_metadata_plugin(CredentialsMetadataPlugin plugin): credentials.references.append(plugin) return credentials -def server_credentials_ssl(pem_root_certs, pem_key_cert_pairs, - bint force_client_auth): - pem_root_certs = str_to_bytes(pem_root_certs) +cdef const char* _get_c_pem_root_certs(pem_root_certs): cdef char *c_pem_root_certs = NULL - if pem_root_certs is not None: + if pem_root_certs is not None: c_pem_root_certs = pem_root_certs - pem_key_cert_pairs = list(pem_key_cert_pairs) + return c_pem_root_certs + +cdef grpc_ssl_pem_key_cert_pair* _create_c_ssl_pem_key_cert_pairs(pem_key_cert_pairs): + # return a malloc'ed grpc_ssl_pem_key_cert_pair from a _list_ of SslPemKeyCertPair for pair in pem_key_cert_pairs: if not isinstance(pair, SslPemKeyCertPair): raise TypeError("expected pem_key_cert_pairs to be sequence of " "SslPemKeyCertPair") + cdef size_t c_ssl_pem_key_cert_pairs_count = len(pem_key_cert_pairs) + cdef grpc_ssl_pem_key_cert_pair* c_ssl_pem_key_cert_pairs = NULL + with nogil: + c_ssl_pem_key_cert_pairs = ( + gpr_malloc( + sizeof(grpc_ssl_pem_key_cert_pair) * c_ssl_pem_key_cert_pairs_count)) + for i in range(c_ssl_pem_key_cert_pairs_count): + c_ssl_pem_key_cert_pairs[i] = ( + (pem_key_cert_pairs[i]).c_pair) + return c_ssl_pem_key_cert_pairs + +def server_credentials_ssl(pem_root_certs, pem_key_cert_pairs, + bint force_client_auth): + pem_root_certs = str_to_bytes(pem_root_certs) + pem_key_cert_pairs = list(pem_key_cert_pairs) cdef ServerCredentials credentials = ServerCredentials() - credentials.references.append(pem_key_cert_pairs) credentials.references.append(pem_root_certs) + credentials.references.append(pem_key_cert_pairs) + cdef char * c_pem_root_certs = _get_c_pem_root_certs(pem_root_certs) credentials.c_ssl_pem_key_cert_pairs_count = len(pem_key_cert_pairs) - with nogil: - credentials.c_ssl_pem_key_cert_pairs = ( - gpr_malloc( - sizeof(grpc_ssl_pem_key_cert_pair) * - credentials.c_ssl_pem_key_cert_pairs_count - )) - for i in range(credentials.c_ssl_pem_key_cert_pairs_count): - credentials.c_ssl_pem_key_cert_pairs[i] = ( - (pem_key_cert_pairs[i]).c_pair) - credentials.c_credentials = grpc_ssl_server_credentials_create( - c_pem_root_certs, credentials.c_ssl_pem_key_cert_pairs, - credentials.c_ssl_pem_key_cert_pairs_count, - GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY if force_client_auth else GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE, - NULL) + credentials.c_ssl_pem_key_cert_pairs = _create_c_ssl_pem_key_cert_pairs(pem_key_cert_pairs) + cdef grpc_ssl_server_certificate_config *c_cert_config = NULL + c_cert_config = grpc_ssl_server_certificate_config_create( + c_pem_root_certs, credentials.c_ssl_pem_key_cert_pairs, + credentials.c_ssl_pem_key_cert_pairs_count) + cdef grpc_ssl_server_credentials_options* c_options = NULL + # C-core assumes ownership of c_cert_config + c_options = grpc_ssl_server_credentials_create_options_using_config( + GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY + if force_client_auth else + GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE, + c_cert_config) + # C-core assumes ownership of c_options + credentials.c_credentials = grpc_ssl_server_credentials_create_with_options(c_options) return credentials +def server_certificate_config_ssl(pem_root_certs, pem_key_cert_pairs): + pem_root_certs = str_to_bytes(pem_root_certs) + pem_key_cert_pairs = list(pem_key_cert_pairs) + cdef ServerCertificateConfig cert_config = ServerCertificateConfig() + cert_config.references.append(pem_root_certs) + cert_config.references.append(pem_key_cert_pairs) + cert_config.c_pem_root_certs = _get_c_pem_root_certs(pem_root_certs) + cert_config.c_ssl_pem_key_cert_pairs_count = len(pem_key_cert_pairs) + cert_config.c_ssl_pem_key_cert_pairs = _create_c_ssl_pem_key_cert_pairs(pem_key_cert_pairs) + cert_config.c_cert_config = grpc_ssl_server_certificate_config_create( + cert_config.c_pem_root_certs, cert_config.c_ssl_pem_key_cert_pairs, + cert_config.c_ssl_pem_key_cert_pairs_count) + return cert_config + +def server_credentials_ssl_dynamic_cert_config(initial_cert_config, + cert_config_fetcher, + bint force_client_auth): + if not isinstance(initial_cert_config, grpc.ServerCertificateConfig): + raise TypeError('initial_cert_config must be a grpc.ServerCertificateConfig') + if not callable(cert_config_fetcher): + raise TypeError('cert_config_fetcher must be callable') + cdef ServerCredentials credentials = ServerCredentials() + credentials.initial_cert_config = initial_cert_config + credentials.cert_config_fetcher = cert_config_fetcher + cdef grpc_ssl_server_credentials_options* c_options = NULL + c_options = grpc_ssl_server_credentials_create_options_using_config_fetcher( + GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY + if force_client_auth else + GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE, + _server_cert_config_fetcher_wrapper, + credentials) + # C-core assumes ownership of c_options + credentials.c_credentials = grpc_ssl_server_credentials_create_with_options(c_options) + return credentials diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi index f115106e60..660263fc09 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi @@ -391,6 +391,42 @@ cdef extern from "grpc/grpc_security.h": GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY + ctypedef enum grpc_ssl_certificate_config_reload_status: + GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED + GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW + GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL + + ctypedef struct grpc_ssl_server_certificate_config: + # We don't care about the internals + pass + + ctypedef struct grpc_ssl_server_credentials_options: + # We don't care about the internals + pass + + grpc_ssl_server_certificate_config * grpc_ssl_server_certificate_config_create( + const char *pem_root_certs, + const grpc_ssl_pem_key_cert_pair *pem_key_cert_pairs, + size_t num_key_cert_pairs) + + void grpc_ssl_server_certificate_config_destroy(grpc_ssl_server_certificate_config *config) + + ctypedef grpc_ssl_certificate_config_reload_status (*grpc_ssl_server_certificate_config_callback)( + void *user_data, + grpc_ssl_server_certificate_config **config) + + grpc_ssl_server_credentials_options *grpc_ssl_server_credentials_create_options_using_config( + grpc_ssl_client_certificate_request_type client_certificate_request, + grpc_ssl_server_certificate_config *certificate_config) + + grpc_ssl_server_credentials_options* grpc_ssl_server_credentials_create_options_using_config_fetcher( + grpc_ssl_client_certificate_request_type client_certificate_request, + grpc_ssl_server_certificate_config_callback cb, + void *user_data) + + grpc_server_credentials *grpc_ssl_server_credentials_create_with_options( + grpc_ssl_server_credentials_options *options) + ctypedef struct grpc_ssl_pem_key_cert_pair: const char *private_key const char *certificate_chain "cert_chain" @@ -440,10 +476,6 @@ cdef extern from "grpc/grpc_security.h": # We don't care about the internals (and in fact don't know them) pass - grpc_server_credentials *grpc_ssl_server_credentials_create( - const char *pem_root_certs, - grpc_ssl_pem_key_cert_pair *pem_key_cert_pairs, - size_t num_key_cert_pairs, int force_client_auth, void *reserved) void grpc_server_credentials_release(grpc_server_credentials *creds) nogil int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr, diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi index b8db27469f..66565d084b 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi @@ -14,8 +14,44 @@ cimport cpython +import logging import time +import grpc +cdef grpc_ssl_certificate_config_reload_status _server_cert_config_fetcher_wrapper( + void* user_data, grpc_ssl_server_certificate_config **config) with gil: + # This is a credentials.ServerCertificateConfig + cdef ServerCertificateConfig cert_config = None + if not user_data: + raise ValueError('internal error: user_data must be specified') + credentials = user_data + if not credentials.initial_cert_config_fetched: + # C-core is asking for the initial cert config + credentials.initial_cert_config_fetched = True + cert_config = credentials.initial_cert_config._cert_config + else: + user_cb = credentials.cert_config_fetcher + try: + cert_config_wrapper = user_cb() + except Exception: + logging.exception('Error fetching certificate config') + return GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL + if cert_config_wrapper is None: + return GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED + elif not isinstance(cert_config_wrapper, grpc.ServerCertificateConfig): + logging.error('Error fetching certificate config: certificate ' + 'config must be of type grpc.ServerCertificateConfig, ' + 'not %s' % type(cert_config_wrapper).__name__) + return GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL + else: + cert_config = cert_config_wrapper._cert_config + config[0] = cert_config.c_cert_config + # our caller will assume ownership of memory, so we have to recreate + # a copy of c_cert_config here + cert_config.c_cert_config = grpc_ssl_server_certificate_config_create( + cert_config.c_pem_root_certs, cert_config.c_ssl_pem_key_cert_pairs, + cert_config.c_ssl_pem_key_cert_pairs_count) + return GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW cdef class Server: diff --git a/src/python/grpcio_tests/tests/tests.json b/src/python/grpcio_tests/tests/tests.json index 8512d5b96f..e277a3ea1d 100644 --- a/src/python/grpcio_tests/tests/tests.json +++ b/src/python/grpcio_tests/tests/tests.json @@ -46,6 +46,10 @@ "unit._reconnect_test.ReconnectTest", "unit._resource_exhausted_test.ResourceExhaustedTest", "unit._rpc_test.RPCTest", + "unit._server_ssl_cert_config_test.ServerSSLCertConfigFetcherParamsChecks", + "unit._server_ssl_cert_config_test.ServerSSLCertReloadTestCertConfigReuse", + "unit._server_ssl_cert_config_test.ServerSSLCertReloadTestWithClientAuth", + "unit._server_ssl_cert_config_test.ServerSSLCertReloadTestWithoutClientAuth", "unit._thread_cleanup_test.CleanupThreadTest", "unit.beta._beta_features_test.BetaFeaturesTest", "unit.beta._beta_features_test.ContextManagementAndLifecycleTest", diff --git a/src/python/grpcio_tests/tests/unit/_api_test.py b/src/python/grpcio_tests/tests/unit/_api_test.py index a3351aab50..d877e0f993 100644 --- a/src/python/grpcio_tests/tests/unit/_api_test.py +++ b/src/python/grpcio_tests/tests/unit/_api_test.py @@ -30,19 +30,22 @@ class AllTest(unittest.TestCase): 'ChannelConnectivity', 'StatusCode', 'RpcError', 'RpcContext', 'Call', 'ChannelCredentials', 'CallCredentials', 'AuthMetadataContext', 'AuthMetadataPluginCallback', - 'AuthMetadataPlugin', 'ServerCredentials', - 'UnaryUnaryMultiCallable', 'UnaryStreamMultiCallable', - 'StreamUnaryMultiCallable', 'StreamStreamMultiCallable', 'Channel', - 'ServicerContext', 'RpcMethodHandler', 'HandlerCallDetails', - 'GenericRpcHandler', 'ServiceRpcHandler', 'Server', - 'unary_unary_rpc_method_handler', 'unary_stream_rpc_method_handler', + 'AuthMetadataPlugin', 'ServerCertificateConfig', + 'ServerCredentials', 'UnaryUnaryMultiCallable', + 'UnaryStreamMultiCallable', 'StreamUnaryMultiCallable', + 'StreamStreamMultiCallable', 'Channel', 'ServicerContext', + 'RpcMethodHandler', 'HandlerCallDetails', 'GenericRpcHandler', + 'ServiceRpcHandler', 'Server', 'unary_unary_rpc_method_handler', + 'unary_stream_rpc_method_handler', 'stream_unary_rpc_method_handler', 'stream_stream_rpc_method_handler', 'method_handlers_generic_handler', 'ssl_channel_credentials', 'metadata_call_credentials', 'access_token_call_credentials', 'composite_call_credentials', 'composite_channel_credentials', - 'ssl_server_credentials', 'channel_ready_future', - 'insecure_channel', 'secure_channel', 'server',) + 'ssl_server_credentials', 'ssl_server_certificate_config', + 'ssl_server_credentials_dynamic_cert_config', + 'channel_ready_future', 'insecure_channel', 'secure_channel', + 'server',) six.assertCountEqual(self, expected_grpc_code_elements, _from_grpc_import_star.GRPC_ELEMENTS) diff --git a/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py b/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py new file mode 100644 index 0000000000..d2f9f114a5 --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py @@ -0,0 +1,520 @@ +# Copyright 2017 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +This tests server certificate rotation support. + +Here we test various aspects of gRPC Python, and in some cases C-core +by extension, support for server certificate rotation. + +* ServerSSLCertReloadTestWithClientAuth: test ability to rotate + server's SSL cert for use in future channels with clients while not + affecting any existing channel. The server requires client + authentication. + +* ServerSSLCertReloadTestWithoutClientAuth: like + ServerSSLCertReloadTestWithClientAuth except that the server does + not authenticate the client. + +* ServerSSLCertReloadTestCertConfigReuse: tests gRPC Python's ability + to deal with user's reuse of ServerCertificateConfig instances. +""" + +import abc +import collections +import os +import six +import threading +import unittest + +from concurrent import futures + +import grpc +from tests.unit import resources +from tests.testing import _application_common +from tests.testing import _server_application +from tests.testing.proto import services_pb2_grpc + +CA_1_PEM = resources.cert_hier_1_root_ca_cert() +CA_2_PEM = resources.cert_hier_2_root_ca_cert() + +CLIENT_KEY_1_PEM = resources.cert_hier_1_client_1_key() +CLIENT_CERT_CHAIN_1_PEM = (resources.cert_hier_1_client_1_cert() + + resources.cert_hier_1_intermediate_ca_cert()) + +CLIENT_KEY_2_PEM = resources.cert_hier_2_client_1_key() +CLIENT_CERT_CHAIN_2_PEM = (resources.cert_hier_2_client_1_cert() + + resources.cert_hier_2_intermediate_ca_cert()) + +SERVER_KEY_1_PEM = resources.cert_hier_1_server_1_key() +SERVER_CERT_CHAIN_1_PEM = (resources.cert_hier_1_server_1_cert() + + resources.cert_hier_1_intermediate_ca_cert()) + +SERVER_KEY_2_PEM = resources.cert_hier_2_server_1_key() +SERVER_CERT_CHAIN_2_PEM = (resources.cert_hier_2_server_1_cert() + + resources.cert_hier_2_intermediate_ca_cert()) + +# for use with the CertConfigFetcher. Roughly a simple custom mock +# implementation +Call = collections.namedtuple('Call', ['did_raise', 'returned_cert_config']) + + +def _create_client_stub( + port, + expect_success, + root_certificates=None, + private_key=None, + certificate_chain=None,): + channel = grpc.secure_channel('localhost:{}'.format(port), + grpc.ssl_channel_credentials( + root_certificates=root_certificates, + private_key=private_key, + certificate_chain=certificate_chain)) + if expect_success: + # per Nathaniel: there's some robustness issue if we start + # using a channel without waiting for it to be actually ready + grpc.channel_ready_future(channel).result(timeout=10) + return services_pb2_grpc.FirstServiceStub(channel) + + +class CertConfigFetcher(object): + + def __init__(self): + self._lock = threading.Lock() + self._calls = [] + self._should_raise = False + self._cert_config = None + + def reset(self): + with self._lock: + self._calls = [] + self._should_raise = False + self._cert_config = None + + def configure(self, should_raise, cert_config): + assert not (should_raise and cert_config), ( + "should not specify both should_raise and a cert_config at the same time" + ) + with self._lock: + self._should_raise = should_raise + self._cert_config = cert_config + + def getCalls(self): + with self._lock: + return self._calls + + def __call__(self): + with self._lock: + if self._should_raise: + self._calls.append(Call(True, None)) + raise ValueError('just for fun, should not affect the test') + else: + self._calls.append(Call(False, self._cert_config)) + return self._cert_config + + +class _ServerSSLCertReloadTest( + six.with_metaclass(abc.ABCMeta, unittest.TestCase)): + + def __init__(self, *args, **kwargs): + super(_ServerSSLCertReloadTest, self).__init__(*args, **kwargs) + self.server = None + self.port = None + + @abc.abstractmethod + def require_client_auth(self): + raise NotImplementedError() + + def setUp(self): + self.server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) + services_pb2_grpc.add_FirstServiceServicer_to_server( + _server_application.FirstServiceServicer(), self.server) + switch_cert_on_client_num = 10 + initial_cert_config = grpc.ssl_server_certificate_config( + [(SERVER_KEY_1_PEM, SERVER_CERT_CHAIN_1_PEM)], + root_certificates=CA_2_PEM) + self.cert_config_fetcher = CertConfigFetcher() + server_credentials = grpc.ssl_server_credentials_dynamic_cert_config( + initial_cert_config, + self.cert_config_fetcher, + require_client_auth=self.require_client_auth()) + self.port = self.server.add_secure_port('[::]:0', server_credentials) + self.server.start() + + def tearDown(self): + if self.server: + self.server.stop(None) + + def _perform_rpc(self, client_stub, expect_success): + # we don't care about the actual response of the rpc; only + # whether we can perform it or not, and if not, the status + # code must be UNAVAILABLE + request = _application_common.UNARY_UNARY_REQUEST + if expect_success: + response = client_stub.UnUn(request) + self.assertEqual(response, _application_common.UNARY_UNARY_RESPONSE) + else: + with self.assertRaises(grpc.RpcError) as exception_context: + client_stub.UnUn(request) + self.assertEqual(exception_context.exception.code(), + grpc.StatusCode.UNAVAILABLE) + + def _do_one_shot_client_rpc(self, + expect_success, + root_certificates=None, + private_key=None, + certificate_chain=None): + client_stub = _create_client_stub( + self.port, + expect_success, + root_certificates=root_certificates, + private_key=private_key, + certificate_chain=certificate_chain) + self._perform_rpc(client_stub, expect_success) + del client_stub + + def _test(self): + # things should work... + self.cert_config_fetcher.configure(False, None) + self._do_one_shot_client_rpc( + True, + root_certificates=CA_1_PEM, + private_key=CLIENT_KEY_2_PEM, + certificate_chain=CLIENT_CERT_CHAIN_2_PEM) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertEqual(len(actual_calls), 1) + self.assertFalse(actual_calls[0].did_raise) + self.assertIsNone(actual_calls[0].returned_cert_config) + + # client should reject server... + # fails because client trusts ca2 and so will reject server + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(False, None) + self._do_one_shot_client_rpc( + False, + root_certificates=CA_2_PEM, + private_key=CLIENT_KEY_2_PEM, + certificate_chain=CLIENT_CERT_CHAIN_2_PEM) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertGreaterEqual(len(actual_calls), 1) + self.assertFalse(actual_calls[0].did_raise) + for i, call in enumerate(actual_calls): + self.assertFalse(call.did_raise, 'i= {}'.format(i)) + self.assertIsNone(call.returned_cert_config, 'i= {}'.format(i)) + + # should work again... + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(True, None) + self._do_one_shot_client_rpc( + True, + root_certificates=CA_1_PEM, + private_key=CLIENT_KEY_2_PEM, + certificate_chain=CLIENT_CERT_CHAIN_2_PEM) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertEqual(len(actual_calls), 1) + self.assertTrue(actual_calls[0].did_raise) + self.assertIsNone(actual_calls[0].returned_cert_config) + + # if with_client_auth, then client should be rejected by + # server because client uses key/cert1, but server trusts ca2, + # so server will reject + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(False, None) + self._do_one_shot_client_rpc( + not self.require_client_auth(), + root_certificates=CA_1_PEM, + private_key=CLIENT_KEY_1_PEM, + certificate_chain=CLIENT_CERT_CHAIN_1_PEM) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertGreaterEqual(len(actual_calls), 1) + for i, call in enumerate(actual_calls): + self.assertFalse(call.did_raise, 'i= {}'.format(i)) + self.assertIsNone(call.returned_cert_config, 'i= {}'.format(i)) + + # should work again... + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(False, None) + self._do_one_shot_client_rpc( + True, + root_certificates=CA_1_PEM, + private_key=CLIENT_KEY_2_PEM, + certificate_chain=CLIENT_CERT_CHAIN_2_PEM) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertEqual(len(actual_calls), 1) + self.assertFalse(actual_calls[0].did_raise) + self.assertIsNone(actual_calls[0].returned_cert_config) + + # now create the "persistent" clients + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(False, None) + persistent_client_stub_A = _create_client_stub( + self.port, + True, + root_certificates=CA_1_PEM, + private_key=CLIENT_KEY_2_PEM, + certificate_chain=CLIENT_CERT_CHAIN_2_PEM) + self._perform_rpc(persistent_client_stub_A, True) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertEqual(len(actual_calls), 1) + self.assertFalse(actual_calls[0].did_raise) + self.assertIsNone(actual_calls[0].returned_cert_config) + + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(False, None) + persistent_client_stub_B = _create_client_stub( + self.port, + True, + root_certificates=CA_1_PEM, + private_key=CLIENT_KEY_2_PEM, + certificate_chain=CLIENT_CERT_CHAIN_2_PEM) + self._perform_rpc(persistent_client_stub_B, True) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertEqual(len(actual_calls), 1) + self.assertFalse(actual_calls[0].did_raise) + self.assertIsNone(actual_calls[0].returned_cert_config) + + # moment of truth!! client should reject server because the + # server switch cert... + cert_config = grpc.ssl_server_certificate_config( + [(SERVER_KEY_2_PEM, SERVER_CERT_CHAIN_2_PEM)], + root_certificates=CA_1_PEM) + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(False, cert_config) + self._do_one_shot_client_rpc( + False, + root_certificates=CA_1_PEM, + private_key=CLIENT_KEY_2_PEM, + certificate_chain=CLIENT_CERT_CHAIN_2_PEM) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertGreaterEqual(len(actual_calls), 1) + self.assertFalse(actual_calls[0].did_raise) + for i, call in enumerate(actual_calls): + self.assertFalse(call.did_raise, 'i= {}'.format(i)) + self.assertEqual(call.returned_cert_config, cert_config, + 'i= {}'.format(i)) + + # now should work again... + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(False, None) + self._do_one_shot_client_rpc( + True, + root_certificates=CA_2_PEM, + private_key=CLIENT_KEY_1_PEM, + certificate_chain=CLIENT_CERT_CHAIN_1_PEM) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertEqual(len(actual_calls), 1) + self.assertFalse(actual_calls[0].did_raise) + self.assertIsNone(actual_calls[0].returned_cert_config) + + # client should be rejected by server if with_client_auth + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(False, None) + self._do_one_shot_client_rpc( + not self.require_client_auth(), + root_certificates=CA_2_PEM, + private_key=CLIENT_KEY_2_PEM, + certificate_chain=CLIENT_CERT_CHAIN_2_PEM) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertGreaterEqual(len(actual_calls), 1) + for i, call in enumerate(actual_calls): + self.assertFalse(call.did_raise, 'i= {}'.format(i)) + self.assertIsNone(call.returned_cert_config, 'i= {}'.format(i)) + + # here client should reject server... + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(False, None) + self._do_one_shot_client_rpc( + False, + root_certificates=CA_1_PEM, + private_key=CLIENT_KEY_2_PEM, + certificate_chain=CLIENT_CERT_CHAIN_2_PEM) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertGreaterEqual(len(actual_calls), 1) + for i, call in enumerate(actual_calls): + self.assertFalse(call.did_raise, 'i= {}'.format(i)) + self.assertIsNone(call.returned_cert_config, 'i= {}'.format(i)) + + # persistent clients should continue to work + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(False, None) + self._perform_rpc(persistent_client_stub_A, True) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertEqual(len(actual_calls), 0) + + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(False, None) + self._perform_rpc(persistent_client_stub_B, True) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertEqual(len(actual_calls), 0) + + +class ServerSSLCertConfigFetcherParamsChecks(unittest.TestCase): + + def test_check_on_initial_config(self): + with self.assertRaises(TypeError): + grpc.ssl_server_credentials_dynamic_cert_config(None, str) + with self.assertRaises(TypeError): + grpc.ssl_server_credentials_dynamic_cert_config(1, str) + + def test_check_on_config_fetcher(self): + cert_config = grpc.ssl_server_certificate_config( + [(SERVER_KEY_2_PEM, SERVER_CERT_CHAIN_2_PEM)], + root_certificates=CA_1_PEM) + with self.assertRaises(TypeError): + grpc.ssl_server_credentials_dynamic_cert_config(cert_config, None) + with self.assertRaises(TypeError): + grpc.ssl_server_credentials_dynamic_cert_config(cert_config, 1) + + +class ServerSSLCertReloadTestWithClientAuth(_ServerSSLCertReloadTest): + + def require_client_auth(self): + return True + + test = _ServerSSLCertReloadTest._test + + +class ServerSSLCertReloadTestWithoutClientAuth(_ServerSSLCertReloadTest): + + def require_client_auth(self): + return False + + test = _ServerSSLCertReloadTest._test + + +class ServerSSLCertReloadTestCertConfigReuse(_ServerSSLCertReloadTest): + """Ensures that `ServerCertificateConfig` instances can be reused. + + Because C-core takes ownership of the + `grpc_ssl_server_certificate_config` encapsulated by + `ServerCertificateConfig`, this test reuses the same + `ServerCertificateConfig` instances multiple times to make sure + gRPC Python takes care of maintaining the validity of + `ServerCertificateConfig` instances, so that such instances can be + re-used by user application. + """ + + def require_client_auth(self): + return True + + def setUp(self): + self.server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) + services_pb2_grpc.add_FirstServiceServicer_to_server( + _server_application.FirstServiceServicer(), self.server) + self.cert_config_A = grpc.ssl_server_certificate_config( + [(SERVER_KEY_1_PEM, SERVER_CERT_CHAIN_1_PEM)], + root_certificates=CA_2_PEM) + self.cert_config_B = grpc.ssl_server_certificate_config( + [(SERVER_KEY_2_PEM, SERVER_CERT_CHAIN_2_PEM)], + root_certificates=CA_1_PEM) + self.cert_config_fetcher = CertConfigFetcher() + server_credentials = grpc.ssl_server_credentials_dynamic_cert_config( + self.cert_config_A, + self.cert_config_fetcher, + require_client_auth=True) + self.port = self.server.add_secure_port('[::]:0', server_credentials) + self.server.start() + + def test_cert_config_reuse(self): + + # succeed with A + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(False, self.cert_config_A) + self._do_one_shot_client_rpc( + True, + root_certificates=CA_1_PEM, + private_key=CLIENT_KEY_2_PEM, + certificate_chain=CLIENT_CERT_CHAIN_2_PEM) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertEqual(len(actual_calls), 1) + self.assertFalse(actual_calls[0].did_raise) + self.assertEqual(actual_calls[0].returned_cert_config, + self.cert_config_A) + + # fail with A + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(False, self.cert_config_A) + self._do_one_shot_client_rpc( + False, + root_certificates=CA_2_PEM, + private_key=CLIENT_KEY_1_PEM, + certificate_chain=CLIENT_CERT_CHAIN_1_PEM) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertGreaterEqual(len(actual_calls), 1) + self.assertFalse(actual_calls[0].did_raise) + for i, call in enumerate(actual_calls): + self.assertFalse(call.did_raise, 'i= {}'.format(i)) + self.assertEqual(call.returned_cert_config, self.cert_config_A, + 'i= {}'.format(i)) + + # succeed again with A + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(False, self.cert_config_A) + self._do_one_shot_client_rpc( + True, + root_certificates=CA_1_PEM, + private_key=CLIENT_KEY_2_PEM, + certificate_chain=CLIENT_CERT_CHAIN_2_PEM) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertEqual(len(actual_calls), 1) + self.assertFalse(actual_calls[0].did_raise) + self.assertEqual(actual_calls[0].returned_cert_config, + self.cert_config_A) + + # succeed with B + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(False, self.cert_config_B) + self._do_one_shot_client_rpc( + True, + root_certificates=CA_2_PEM, + private_key=CLIENT_KEY_1_PEM, + certificate_chain=CLIENT_CERT_CHAIN_1_PEM) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertEqual(len(actual_calls), 1) + self.assertFalse(actual_calls[0].did_raise) + self.assertEqual(actual_calls[0].returned_cert_config, + self.cert_config_B) + + # fail with B + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(False, self.cert_config_B) + self._do_one_shot_client_rpc( + False, + root_certificates=CA_1_PEM, + private_key=CLIENT_KEY_2_PEM, + certificate_chain=CLIENT_CERT_CHAIN_2_PEM) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertGreaterEqual(len(actual_calls), 1) + self.assertFalse(actual_calls[0].did_raise) + for i, call in enumerate(actual_calls): + self.assertFalse(call.did_raise, 'i= {}'.format(i)) + self.assertEqual(call.returned_cert_config, self.cert_config_B, + 'i= {}'.format(i)) + + # succeed again with B + self.cert_config_fetcher.reset() + self.cert_config_fetcher.configure(False, self.cert_config_B) + self._do_one_shot_client_rpc( + True, + root_certificates=CA_2_PEM, + private_key=CLIENT_KEY_1_PEM, + certificate_chain=CLIENT_CERT_CHAIN_1_PEM) + actual_calls = self.cert_config_fetcher.getCalls() + self.assertEqual(len(actual_calls), 1) + self.assertFalse(actual_calls[0].did_raise) + self.assertEqual(actual_calls[0].returned_cert_config, + self.cert_config_B) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/src/python/grpcio_tests/tests/unit/credentials/README b/src/python/grpcio_tests/tests/unit/credentials/README deleted file mode 100644 index cb20dcb49f..0000000000 --- a/src/python/grpcio_tests/tests/unit/credentials/README +++ /dev/null @@ -1 +0,0 @@ -These are test keys *NOT* to be used in production. diff --git a/src/python/grpcio_tests/tests/unit/credentials/README.md b/src/python/grpcio_tests/tests/unit/credentials/README.md new file mode 100644 index 0000000000..100b43c1aa --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/credentials/README.md @@ -0,0 +1,15 @@ +These are test keys *NOT* to be used in production. + +The `certificate_hierarchy_1` and `certificate_hierarchy_2` contain +two disjoint but similarly organized certificate hierarchies. Each +contains: + +* The respective root CA cert in `certs/ca.cert.pem` + +* The intermediate CA cert in + `intermediate/certs/intermediate.cert.pem`, signed by the root CA + +* A client cert and a server cert--both signed by the intermediate + CA--in `intermediate/certs/client.cert.pem` and + `intermediate/certs/localhost-1.cert.pem`; the corresponding keys + are in `intermediate/private` diff --git a/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/certs/ca.cert.pem b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/certs/ca.cert.pem new file mode 100644 index 0000000000..604b86fdff --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/certs/ca.cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFZDCCA0ygAwIBAgIJAKfkDFZ6+Ly/MA0GCSqGSIb3DQEBCwUAMD8xCzAJBgNV +BAYTAnVzMQ4wDAYDVQQIDAVkdW1teTEOMAwGA1UECgwFZHVtbXkxEDAOBgNVBAMM +B3Jvb3QgY2EwHhcNMTcxMTAyMDAzNzA1WhcNMzcxMDI4MDAzNzA1WjA/MQswCQYD +VQQGEwJ1czEOMAwGA1UECAwFZHVtbXkxDjAMBgNVBAoMBWR1bW15MRAwDgYDVQQD +DAdyb290IGNhMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxlSUuSbi +o66tT2ZCqu9wNqSX8VhAJkmrAT5y6m2V0VlQ8Gz7ddynW5UVSmtvDNTebZ15FrvO +6Ng7QnwXXNs/dEzl6oMe6AKDZpuWScVkiqH1UYWBkMLRygWCTEYpSTWTpZWk1zxj +DJ2LlIoO1X/ufLyLOfy2a2XEz8ICzJePmqVca6fmfEtCTj1/8FcwCBF6YlUWVzlR +wewjanQo/lorTYbub+Q6LGxPXZ8W0qoKZzLDSD9cnj4pcJzGGFeu9KkNaW4rldZG +t7mTGQqIRc98dDRc9Jb7PqL8tMPLidw1KErUi05ofxggc5vqNnj4xBl6aX6b/EYN +rBLzO2e0FazX6TwNKwwg68vbOanpDq5LVmIUH8bY1zNZ+JPBGO9pXlAA0YwLx86r +R7YhQ431ZpJ2KGnYjVhYnZ2L3NjV3UYX3x5Z3OrDj9hybhucJB48DMQ1+loEabwK +fSUJtcSPc8dCIibxVKidBFgaTPXtHy2MPXuhMhR7PCtMpE7RPUoYmdZLr9FNN1ty +/RAbwBfuhGLbRI2qqJgbOzHJHaOY/FtShfooLz7lt4LIjPTARaNsulG2rbv+m3z9 +mhNjL+peV8gni/xyOYYTbdzZagLrtSHeTWsITvmVt0flMHkjHyv35rw23+hBlSjp +6+S+0MmwuwxqBBccBSlZ9t3Xh1N+vFkb2UkCAwEAAaNjMGEwHQYDVR0OBBYEFJWE +tQwTbTCgZWNN08VSxjdNA0oaMB8GA1UdIwQYMBaAFJWEtQwTbTCgZWNN08VSxjdN +A0oaMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB +CwUAA4ICAQCNjPv/e3ozX1PuN5Tluf0yOmKCxKVCK3Pp98WkDzH4Rp1urEeYrGJL +vBNcl17avOJ0e+zTVYPXFviFbsBsU/zaf+TqEujXabsdL+nvvCJ2mMqYn4wyDFjS +zDNbGH6O0ENZz5NSY0/UGSOHYrYnYB94QRFLbbf0Y3PmBS2eRNjIUnv7ytPZNMi/ +piM+QhPb0Ebyk0rHQZ0RAJaC/wsEtqP8TGV/fx+AzG7zW/zxgPTrgIThy138tLQ+ +xCVDP9H2c17nVP6vjYzKnMZ94uGrGqUzV9vU7EqYl0uZflIf98pLfdKHnQ3heqds +8KQPNKRxVvcc92qv2pQY951wb1fkhLutjHn7TUvrenyAngz+Vs19NxbqLPys1CTw +iaL7vZ8VE/aEDm1tjt5SLM474tpATjk1+qMRaWnii8J5rTodYHP+Zu2GxyIrMiGq +tfNZMYI0tETK1XmEo75E/3s9pmIeQNGKLFp+qL7xrVyN/2ffNv0at8kkqXluunK9 +/Ki0gKYlGFm4Eu8t/nHMqhBx/njYg6pLDuarLW6ftUV7aHd7qKcCWOWqK6gnH/vX +3Apv31eltZBBVN69p3CFy2oMnjrom2Yn/DUXFwrJLBiNJ1dd1JyDxpqpJ74ZQy+/ +pSRWMTRM5SuC7lYARx5rYPmp6cZJWyWRH/3r7bwS699/W965pa5nug== +-----END CERTIFICATE----- diff --git a/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/certs/client.cert.pem b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/certs/client.cert.pem new file mode 100644 index 0000000000..44bc562599 --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/certs/client.cert.pem @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIExzCCAq+gAwIBAgICEAMwDQYJKoZIhvcNAQELBQAwRzELMAkGA1UEBhMCdXMx +DjAMBgNVBAgMBWR1bW15MQ4wDAYDVQQKDAVkdW1teTEYMBYGA1UEAwwPaW50ZXJt +ZWRpYXRlIGNhMB4XDTE3MTEwMjAwMzcwNloXDTI3MTAzMTAwMzcwNlowPjELMAkG +A1UEBhMCdXMxDjAMBgNVBAgMBWR1bW15MQ4wDAYDVQQKDAVkdW1teTEPMA0GA1UE +AwwGY2xpZW50MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwquL6gtP +R7P9xJK76FTj8fI5TSJa3cAMt1p6CmessjHQq7nQ6DWLGVi4XIt9Sc/1C3rXupOe +90Ok4L0tsuVZH78Wn0EBmBH7S4IbhU9P+aJ9mcigepj1lnxWqoVblgeJYKMOOwAf +pAKUNMWDSm+nCfwE+R5d8d8cfA41Awq1jTRjOVpiJq6aoKfs791a1ZkZde3kFrNV +AVjC06GgA1lZd3sHf94hmLeC+xJztRXVE9e+7dcc7nFDH0t5DIKYBAklsHg77mZa +3IK4aOZew7Lm6diPoMnAzXh2rWpJU6RrEE29gIkJBsF8CL1Ndg9MzssCg6KBjoai +Vt5dJ+4TSEGCOwIDAQABo4HFMIHCMAkGA1UdEwQCMAAwEQYJYIZIAYb4QgEBBAQD +AgWgMDMGCWCGSAGG+EIBDQQmFiRPcGVuU1NMIEdlbmVyYXRlZCBDbGllbnQgQ2Vy +dGlmaWNhdGUwHQYDVR0OBBYEFPeuKDCswk8jaH9tl6X+uXjo+WM1MB8GA1UdIwQY +MBaAFCoqYgmKh3CUafVp+paXxfz+He+FMA4GA1UdDwEB/wQEAwIF4DAdBgNVHSUE +FjAUBggrBgEFBQcDAgYIKwYBBQUHAwQwDQYJKoZIhvcNAQELBQADggIBADYAp8XS +UjMEpX/zVjRWpAAT4HNEJylCV1QNyhBIAyx38A6xJYuFIx966Htd6W9/Rw4sUY6y +F4pOmnLCRxIPqFzzMYcBHSpynlcu5G7zqIod3wYIk7BNlB0AzkZn6yD8bM1y5Plf +myzQVDEGggrDtaW2EehhNIB+wOmbRGITjIcZUEr8V4BlLXkCqOuxauxl82d5/k2w +LAhjOb9d1VW6RT8+Lcn6drhHZdvtSCe8Z27BcXhaQLL8366mhbigKYJt5adD0KOx +pl0MQcoL1Rth5cJEj+1/lgUaxcnvh7TaIIGEx0h3olQXsTxSTypU/nww2Ic41xdG +xl3xvHsxe20IvOOAMRfS/LPW7MCtQ3k0BqB/rAQvmB0r5YITLlMJuBqg+zjYrG/j +s5szSGAz9r0leFuPraeuZA41d9UBTAJMoVrrQZ4xVHMXQi1oz9E9KlIdbO9+spvC +ulfO+D+Z4a9trYSWhnQL2dSHT0+kHqJ/8GipiUNP/yAC76dRpDVR3xtYNr73iw0j +hyDsVjihTD8JBebs3axnt+Bc+FwoCCd6CVcsggfGUNhu/N5LS78b13PcaRzrUNjU +Eh+8cJvMLst+UQzePlyazzpn7jjN3KsBzWUkbnXCtUs2qRMn8f2gZqliDo7JSFvy +WtBSCYpikOivuJSQUlrHQ8NaXeddyWQzLY79 +-----END CERTIFICATE----- diff --git a/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/certs/intermediate.cert.pem b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/certs/intermediate.cert.pem new file mode 100644 index 0000000000..98e13669c0 --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/certs/intermediate.cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFaDCCA1CgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwPzELMAkGA1UEBhMCdXMx +DjAMBgNVBAgMBWR1bW15MQ4wDAYDVQQKDAVkdW1teTEQMA4GA1UEAwwHcm9vdCBj +YTAeFw0xNzExMDIwMDM3MDZaFw0yNzEwMzEwMDM3MDZaMEcxCzAJBgNVBAYTAnVz +MQ4wDAYDVQQIDAVkdW1teTEOMAwGA1UECgwFZHVtbXkxGDAWBgNVBAMMD2ludGVy +bWVkaWF0ZSBjYTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAOOxzve7 +CG2P9SvKfXkJVTXkj4y79JSZ77Kud/TiPfDbHTqZWKuLTXkOCkCCxfpuJvWXnnj5 +1AeLCdKx9hEwJQeU23EXDt1K+RsRyl09SXtPNnJnqHD1mUHRQR28vGX5ctrQzK8J +Sa6/mHW4bX8ol100npbgVMDnM4IDfLYcsv4BXMICGkSHOW6Gn0zJaeHzRVPpmnK/ +0k/GQAcIrU2sZ39kVlVQkWq3HJC28cNL/P04hjh4gAf0evo/k9VrEtxPWYMfiPDt +kOAKueoPv/VTA/zL5t8lyzfhrhxvsJxFg/klapPXK0gLLbhsHyOhnkbrzvmSR4Rw +xubYJ2dDK0DKx+BIZqlFznjP9BvOtvtuVVMyqg9cfgc7J/OjvAguO0f93MLSfIWP +uISqv7Llt/Blvy/xI5owvOKVc/hm3d+5pqjWBC1HkVwo4qugpWmM49dFWl4kc4c7 +ayYUjTmcgoj1ZR89w4Off/bPd1A6gXqSkw2VQfgFF+uOos84fP1V+zPWhp3UDY3P +bFeJtuTdv1gR5w1jCIq6xVJ+UsyDZBaYP7yBBRiNzS1/yXJpnXrvHmDfUeQHLBPR +N0nbMjqXJ1dVpZwydiI0Qx9DnJtOaq/spUreXr8+PU2jeQdCCAN21MB1umr2gZBJ +8MZBStTgE7SDByfGmGfp7B5/s/r4O/rNc4WzAgMBAAGjZjBkMB0GA1UdDgQWBBQq +KmIJiodwlGn1afqWl8X8/h3vhTAfBgNVHSMEGDAWgBSVhLUME20woGVjTdPFUsY3 +TQNKGjASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG +9w0BAQsFAAOCAgEAvzLu/Jc8DlfCltVufC54UZ8DVwUfxdGapNBGv4icrs1wMV3S +xqdaLO+vSp9NeEufi724+/hj4URapW9kSt2TMD7BNJ61QSATZFJajxTFgGa0Zz95 +RBDw8/b5Arz/2pOF4VX+FJ+wqHvoH/2A0T+fwz8hLORhxZHv/cUN6kif4FKCwryQ +s89e694kXkEiJfquvu7DR9hYCLOJwzMOOJiTnjz3hlQg4WGu7Z8ZvqzCM+how1hr +nYbUx6a+HfoUf79AHJB0N1EsEEetJ+omvTdrrayCvy1bHA3QgHlJ28QZIJ7MzX9E +n11/xQ95iTuSp8iWurzjTjbrm7eHnGUh+5QubYLXOzbqKzNZu72w0uvWv6ptIudU +usttltiwW8H9kP0ArWTcZDPhhPfS9impFlhiPDk1wUv2/7g+Zz1OaOb7IiSH0s8y +FG72AB8ucJ5dNa/2q5dJiM8Gm5CbiVw5RXTBjlfTTkNeM6LBI3dRghpPdU7Kbfhn +xYs9vnRZeRMJHrcodLuwVcpY/gyeJ0k5LD6eIPCJmatkYZ122isYyMX8lL2P5aR+ +7d2hhqcOCproOrtThjp6nW2jWTB+R/O2+s6mhKSPgfbY2cdky1Y9FSJxSNayb9B8 +eQ+A29iOHrGVAA0R/rvw119rLAYxjXzToM28owx7IyXKrBaU4RMv5yokgag= +-----END CERTIFICATE----- diff --git a/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/certs/localhost-1.cert.pem b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/certs/localhost-1.cert.pem new file mode 100644 index 0000000000..f15f1cf5c2 --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/certs/localhost-1.cert.pem @@ -0,0 +1,30 @@ +-----BEGIN CERTIFICATE----- +MIIFFzCCAv+gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwRzELMAkGA1UEBhMCdXMx +DjAMBgNVBAgMBWR1bW15MQ4wDAYDVQQKDAVkdW1teTEYMBYGA1UEAwwPaW50ZXJt +ZWRpYXRlIGNhMB4XDTE3MTEwMjAwMzcwNloXDTI3MTAzMTAwMzcwNlowTTELMAkG +A1UEBhMCdXMxDjAMBgNVBAgMBWR1bW15MQ4wDAYDVQQKDAVkdW1teTEKMAgGA1UE +CwwBMTESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEArRAy0Nim9P883BAisXdFoKmgHGTtcLH/SzwkkPWTFHz0rHU1Klwz +w8u3OkRyvgoQp7DqkohboNMDwg5VrOOcfKwtM2GZ5jixo+YKvJ25oj8Jfr+40baz +nyWTmOcfoviKrb7u2T9BPEEz5og+lXRDAsTFATGaQDX2LN3Dd9KIw+7sWY+gc3Zi +13HHaWYhtmfJjzFbH1vDxHKCdSdgtPyEhqcJ4OC6wbgp/mQ01VlPAr08kRfkC8mT +TS7atqc410irKViF3sWi4YNPf7LuBrjo75FIIOp+sQgZE6xwOuZ/9bT2Zx/IUtCC +TqzVgZI0s5NVlINtWR6eyyxQ1uDKTs4xrQIDAQABo4IBBTCCAQEwCQYDVR0TBAIw +ADARBglghkgBhvhCAQEEBAMCBkAwMwYJYIZIAYb4QgENBCYWJE9wZW5TU0wgR2Vu +ZXJhdGVkIFNlcnZlciBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUDE8pwi7aELJjvyNT +ed81/KIgGfowaAYDVR0jBGEwX4AUKipiCYqHcJRp9Wn6lpfF/P4d74WhQ6RBMD8x +CzAJBgNVBAYTAnVzMQ4wDAYDVQQIDAVkdW1teTEOMAwGA1UECgwFZHVtbXkxEDAO +BgNVBAMMB3Jvb3QgY2GCAhAAMA4GA1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggr +BgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAgEA2cvXxJw120Z9oWXyGwR6CH7TcXoy +1i77B1M5j0Krvkjh2/MkEU+JxpZcrhAgZODK9wMPeIUIpJNw2t6Hg+vigpInu7pY +MXR4IA5XLnhGV/hueXa0JLia5FG1TISxr4piW6Jd9P2pOt3ECm3Url/F0OeFF/74 +jGaAlWkbhqWJ9M7Gd4QP2wUNm0P4CwAqS9DC6dnMz+JXTakEUirOpmq7U8UKT+5N +QS1K4WuH671n4MiYye3+UoRYt4zPjOzN+QxzvAMtkUBspPmWD6txmD5tKUYDECqn +0sSbY6ytD30OTHIbICFp40arOffmEEJSriL+uQNPPmvqMxX1G2kUFGm15NLPs8Xa +J7ChrAaJzssN5J3myZUbDfCuxmTkWg+hGvGmxLraVNWc3fzKFmdszSkXrGIdf2HR +gZeFI3w6M4Ktx3KctXlsjwqQTYZI/WwLOEpsrHQBPBLQhISyNw4xjZ4MxK8SFZuQ +IiGps/do0eEgeQ+o3gD1dIXt8YxFIxrgk0pzJONpXGgv/cZrukbLNTBdkTSkIwtx +TXKdiJbO17H24MvW+UxFdsIoJXmfQZWdQC3p+Dl0iP+K80aI6WbaysmToHuOi216 +e49nmiM72Izul2zmBi7Cq2nRQbHAETsFfqC34FzJlx0aP8WS953IBD0jNi1BB+AX +BxwiZ1rPjeMvekI= +-----END CERTIFICATE----- diff --git a/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/private/client.key.pem b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/private/client.key.pem new file mode 100644 index 0000000000..d8a21632ab --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/private/client.key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEogIBAAKCAQEAwquL6gtPR7P9xJK76FTj8fI5TSJa3cAMt1p6CmessjHQq7nQ +6DWLGVi4XIt9Sc/1C3rXupOe90Ok4L0tsuVZH78Wn0EBmBH7S4IbhU9P+aJ9mcig +epj1lnxWqoVblgeJYKMOOwAfpAKUNMWDSm+nCfwE+R5d8d8cfA41Awq1jTRjOVpi +Jq6aoKfs791a1ZkZde3kFrNVAVjC06GgA1lZd3sHf94hmLeC+xJztRXVE9e+7dcc +7nFDH0t5DIKYBAklsHg77mZa3IK4aOZew7Lm6diPoMnAzXh2rWpJU6RrEE29gIkJ +BsF8CL1Ndg9MzssCg6KBjoaiVt5dJ+4TSEGCOwIDAQABAoIBABECKAFU56JeKYfp +Qh20fQ4Amd0RaVsCkpnaf9s037PaAl9eptADDZozVDhRv6qZTtGn8/1LNJJqCJfS +L5H30+egLHvRlDATMh+QyJLHMTegaNTs4IiVoK97QZ84c54SHoCg/ndNNXaA+y35 +K9VvF+sZZ93UN2UQl06Hdz5Cy0YA7L5HIIH3Ezk0ArAw4AarLil5mv4yEz2ApZhm +Tw4I4yNfxB7tZeP+ekNg0XXRL1quA0tGblp+A5fAFfVMDplqqB2d3/KxPR9FSEOi +4PzBZ5Mq2wQBPIaNog5um9qkw6VKxjl5sQGhP1GGTA8iZqR9iM2+xh57xdCZm3g3 +jcr+aPECgYEA42mXTsF/4oBQtU6hh/sOCMWHhxAPstKpQHFMKGYLHKEJ/V1qq0Sd +d0kswAYCmH5G9ookzu5p7pNf0hUUHO5EwelpSZ3FEmtIM+oBwSnDk3vGuadYXN5X +fPuVUla65B1F9SSwapYNBUAiRgrY69Knca2rkTSdcZQaBuWmo684UQcCgYEA2yRE +P23I/9N6AVhKB/zTRtil1AxnTW8o+j7AE4q1o+xly7DS7DT34INaLKLiuG6ylV1F +UoTiqmWqH3A7m3o3Id2AnVf/oDoKV78LCXRF3dJJWvzrPdob2fLlwyjgqXYvmD3O +UH/OFY2blYcAHOYib1Y1AAhHPlXiHA52BYZtnC0CgYAVjjitWmII0ijURrPA8+cM +pcyG3NrgFF++n/6cBbAf8pPD1Er8GPDkEaeQPAGa+r03OTjr9GVOG+IFQ8I4S81w +o/M66x129XxOj2vDJ3ZGUIExr88MXnbkfeRVfasRXET5S5T9RWPOj5mwEe8lyz3b +5J5SkS4rSeJ9rN7yvPUVmQKBgAvrrB67LRzldxSNpfFLSn7nGBYx2oi2zEbYlQA7 +ImhZWqw64S5iLz2yR3x4G9cmhmZjnXrAqcfVIez14PgzLL6V2wI0ID6qCZf+V25b +OdW4M69UZMOHks5HTUJRfe8Z87rXWdq9KQu5GUaIAnSP/D2MNfPbf2yfpV4bV0Yz +qtC9AoGAD3/XXaeGCdV5DPomEmehp84JXU2q/YECRvph46tr4jArG67PCvx2m84B ++W6my4Yi7QJcW4gC0gsdAuxbJl4Y7MCZBnTtNIRCRnHEIciKITJ/+brFln5QUgyn +WnXEPN8q7VjSVXGrljFuLWkzi2Vh8iZDgourNfW+iYDGCJjx1H0= +-----END RSA PRIVATE KEY----- diff --git a/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/private/localhost-1.key.pem b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/private/localhost-1.key.pem new file mode 100644 index 0000000000..aa83f1a4a2 --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_1/intermediate/private/localhost-1.key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEogIBAAKCAQEArRAy0Nim9P883BAisXdFoKmgHGTtcLH/SzwkkPWTFHz0rHU1 +Klwzw8u3OkRyvgoQp7DqkohboNMDwg5VrOOcfKwtM2GZ5jixo+YKvJ25oj8Jfr+4 +0baznyWTmOcfoviKrb7u2T9BPEEz5og+lXRDAsTFATGaQDX2LN3Dd9KIw+7sWY+g +c3Zi13HHaWYhtmfJjzFbH1vDxHKCdSdgtPyEhqcJ4OC6wbgp/mQ01VlPAr08kRfk +C8mTTS7atqc410irKViF3sWi4YNPf7LuBrjo75FIIOp+sQgZE6xwOuZ/9bT2Zx/I +UtCCTqzVgZI0s5NVlINtWR6eyyxQ1uDKTs4xrQIDAQABAoIBAC56mDswxH4uAmlT +yA2Da+a/R6n4jTBkDZ1mFKf93Dd3a7rZa6Lpylk+YAI9GdfiGiD/SbB7AKjLo0m9 +0dKx+ngdQbJ39v42obbT9HQ9o/poFaO91+QyvkDytZYuFHgPaidJjRo5e8qz9D1o +v+4hoFGhCQvOB5BRLcFU+cc3etWr5t61sNL/kKCWEDd+MWWsOCHpdhEoWC+o25pC +bhD3FG5xoz+8zL7WdNfke/4twfKoBJ/kq89bfIkl8eKpg387WBQY44RJF7/zVr7a +9dsUuW2y/wVXslCHChjSrxhRlOyy5ssv3EgKh8gPkZ+oeKuONqAGw27nyKyvpjxS +i62K+WECgYEA4oKpIS2D77RCC6rpYIK6KYfbUcNSOtHFvcbf0RH9Oi8vSRYum2ZA +/ITdWSFgWkhT6iOSPuvZlu/EvueWDgNgW1ZVsTMFeapz1+Jwk7JRoBKF1dUEwELh +jdAswdh0MLbgBYs6NXtVVkeK2ocgZtosmt1PUktl566NlyIyhOjH6vkCgYEAw5g0 +cteTpz+noKsfWcbnjyesuQy0caICfZIE01nKv9rKTF8BtCO6Qxj10iM2o00jW7Vl +tZa/igjuqvozXAHBI3xegtrWV05urkjj3FB/Pyuqsx3wxhAdSNchQjdTjwUBQEzp +3ztGSlDTRPpijnpW28lg8Kkr3weryaHvl0xM1VUCgYBqnTN8QU8rgT3g/gYw/fcf +2ylY98V5mAkqBTSN1JjLTTBFh2JSlLOb5/HDpRkUBZ0xxKJuaVaWW67QaHLRj7dH +5oAZErnOBXPXNmbkrfcLkAxclJJS6Gf/9u9KIla2Iy2YjmrMh4uoO65Yo2eV4bVD +A031nzWM8jUE4PzEYEjRCQKBgHDdTj6KiQg0Yg0DUabjcNEZasCpRSJhAyDkdmZi +5OzKWnuxQvFowF1hdM/aQ/f9Vg7gYJ1lLIeBWf9NOv+3f3RzmrHVh2N/vbxSETIb +PSH9l5WeDEauG8fhY66q8EuR7sPk3ftTX98YPqEJ/n8Ktz5COO8GH2umKInEKNXc +UGW1AoGAfENy7vInNv0tzFWPSYdFgesvzo7e8mXyVO8hCyWvY3rxW2on7qfLF3Z9 +fHjd7P9gULja0n1kvmxwUC3u20RrvpY59F4hfi+ji2EiubS9Yhszd2e1CLeRMkln +ojDjnflN32ZbWVHX/i6g3Dabq9JOD0FsOaOlriLMuofdA6jTUFE= +-----END RSA PRIVATE KEY----- diff --git a/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/certs/ca.cert.pem b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/certs/ca.cert.pem new file mode 100644 index 0000000000..212b5862cb --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/certs/ca.cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFZDCCA0ygAwIBAgIJALhSfZ8i0rWTMA0GCSqGSIb3DQEBCwUAMD8xCzAJBgNV +BAYTAnVzMQ4wDAYDVQQIDAVkdW1teTEOMAwGA1UECgwFZHVtbXkxEDAOBgNVBAMM +B3Jvb3QgY2EwHhcNMTcxMTAyMDAzNzU4WhcNMzcxMDI4MDAzNzU4WjA/MQswCQYD +VQQGEwJ1czEOMAwGA1UECAwFZHVtbXkxDjAMBgNVBAoMBWR1bW15MRAwDgYDVQQD +DAdyb290IGNhMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEArHaQ3uyp +wVaVPZDYvy/EJbnP7KbZNPBvKpQCDEqg9B2TPaC8WVjiqT6I88c+KcGuB8nADJdk +o10iZC5AwbrXK4ELSCOvBpxYI5sjoFcv3lZ/oe4e650QO2L/ADmtwLaLYK6rZkwW +Sd90yCGF7ZOTZTJZDwmWEl+ohi+2ow6sRMHKcSKUNfx9G5BB7TOzoqUxqH+moEds +YpjVMEcKzQi2FmbRd+8Dlg2eGqA2V4faprGQwoYz8NqJZGa/KPpRvXE2VjSTDN6b +rJ7mmui6eYN53mZEBRYogyoQHdFXhK02FgyoPEgR/wQlLLbQ+xxOcv02YsOljtza +hl5LjeNUYPMjyhef0QpONp+5NcFhZf38DsSq5EWZLLxPScxwl0lBQkJTjo5ARuFl +Mrv50RYrLwv4ImsiO2ftE7gAX4vNsgcixnCHd6rNzoGimf1+DSvDVJ9ujWo7HPN3 +7ONuoyjsU4mUJJpYXs8zHx5WSxaYiPJRcmG3LjcU5/A+Fs7bkqSrlEjJsG29xDrO +vKR7hH+m6MwcIcXSh9wjjAIvHxAALdU9xaYE3hmVkoxew1mRBsYq34h2vpwGOY5r +0njRQyGGZnVa8qkQd6P3U5fcvLOM8v9QImZqRDS2jAGZXYruo/RIgJpklVX7ZY0+ +CnGdz4YxgLyOBJCDu3aEgL1oON3mg2SsrVMCAwEAAaNjMGEwHQYDVR0OBBYEFOBO +9R6yEY6KOE+aSClwD2BQtWXKMB8GA1UdIwQYMBaAFOBO9R6yEY6KOE+aSClwD2BQ +tWXKMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB +CwUAA4ICAQBElio7lLZ2eNt0tDPVSkChksc0IJ2/DpjYjqJzqxF/jZ2oToaAn2Er +9iHl8ggTLB5WrTQxO1ev7qOwQsk9hrgvZ+EQCBTbyDyfNwVjgftH5jdQGdbyrnuJ +yaks1mnd8is5ZZQmmQSd7GVOMTYi/7yH0xI4DHQ386dwnf5eKdoOI7yrVufEMxRx +tB3Wv8KrX4z47zsIO28H/O0T26oUkrd4PEqFwDa5HQr6iG7QQgoGD/DPLgbBudlO +kEos9fmXxiX60RLziKCE/DAxI3YWPvG3WhIWnVj22Oz6apz2pYWpOKwlaihNYrhq +8xc02vIFwKh+t7D+wF4KHfduyMJ/wKVc5dzpNbTgkZePPKSB7QgbsMeRqbdPoXQF +pMuzfj8VCWzpqBeHqE/adSCZhzeTrnyiYavF4T2vkSC5KJu+MHmbZ3nU9bcnnEy+ +24oEv9cEAiYNkvftbD+5ByEtkcBB2uT47sbiGrAeco+GxFGUVqi1IjObqrkIrPzV +OjQhTZV6qgYCOuniJiGfoiMeHqdaDybpqo1bIrxSlvGRNcVoOsKt2/KP1DzW4ARZ +hoRvayU2apHz/T5TAailqAW2MsrjGRaVHQTmeZKag8CKtAcjWzui0J2DnfXxUMn8 +R3ruFu3xJduOT1VghT9L9udvX9YhPCIKVL9+B5eFX9eMV6N7hUnVug== +-----END CERTIFICATE----- diff --git a/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/certs/client.cert.pem b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/certs/client.cert.pem new file mode 100644 index 0000000000..b6f4280168 --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/certs/client.cert.pem @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIExzCCAq+gAwIBAgICEAMwDQYJKoZIhvcNAQELBQAwRzELMAkGA1UEBhMCdXMx +DjAMBgNVBAgMBWR1bW15MQ4wDAYDVQQKDAVkdW1teTEYMBYGA1UEAwwPaW50ZXJt +ZWRpYXRlIGNhMB4XDTE3MTEwMjAwMzgwMFoXDTI3MTAzMTAwMzgwMFowPjELMAkG +A1UEBhMCdXMxDjAMBgNVBAgMBWR1bW15MQ4wDAYDVQQKDAVkdW1teTEPMA0GA1UE +AwwGY2xpZW50MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyxZFTLqv +Gd9SpFAykyRyLQgHcR5hgD55mz+9fl1OfnMoAc7yTdPVLksDLmeFUlxcvCtLHysJ +klIBX62c6LzbsVcfLg/DPJlQxFnkhJCRKen4fp7x9h62qqJkDFVXsiEFza9L1lsN +4OwqU8i4RRgZ/xggM/s/wVBtynioeW9QADNmKZ1n6HVKkYwdOynbFSggYfFrL3HL +54bC9roZUETin0G5wZ9QU+srgivT0a/KC3ourBYHXAI40iHuuOBf3syDVJ6xId/r +3UO3qkiQ5q7pwglg+8Nx7Q3CFtGZY3ewxSSSDo6BOyweGYMsBaxMO3EyTqecyfXn +3n4XPqwmDalWYQIDAQABo4HFMIHCMAkGA1UdEwQCMAAwEQYJYIZIAYb4QgEBBAQD +AgWgMDMGCWCGSAGG+EIBDQQmFiRPcGVuU1NMIEdlbmVyYXRlZCBDbGllbnQgQ2Vy +dGlmaWNhdGUwHQYDVR0OBBYEFP2bodoNQ1tCNEOALPnygGMUfNI+MB8GA1UdIwQY +MBaAFOWzLd7eBJwSNbzRqNsD7MQDCHg/MA4GA1UdDwEB/wQEAwIF4DAdBgNVHSUE +FjAUBggrBgEFBQcDAgYIKwYBBQUHAwQwDQYJKoZIhvcNAQELBQADggIBAHqUuCLt +olOdR9p/g+KgGPnKuVgMn15Wc2VLCrbbl2P0fuCcNWmnBKqHHgQ1EJEpgnQ2N8m6 +tOGucX7IAzlZj36RP4lN3gZqFRSO/OiTOUYpE6Uv1hYRxeMzAYo5sBdCiiypjV9z +H0Ew5NuWRf2/0nFWoywB9ktHcfD8lRFI3o8zUFXmE2JSUPQtKhW3tBkPPjYBlgzD +RD8cq8dVK9P7i3tUENP+MNHJToNLFBqfA9De6bKnhCWHhZkfB0VeeSm4Ja9HkCg/ +DB+PAKMfbLCH5T8gCpEWxNlvj09r9mn37fNjtJPO/goAcNZNO2AURmb/ZQ4ggdry +xb6lm832qplMUMWx//Ore0faEodlEc5d2kEtmcjj79gAypcLmm74q7CPt7xmniyd +XvNT33S2tkh4dSirpCVwq0xyqOP3ZqTsTjudTveTBaTZNhTbCjDbaV7ga47TcH9/ ++OZ3fQKjt2LAC6162wgEFZf10nUgaAXvSlI74gru93vEwWd8Pd3sWfGwuAFX3oKI +JuwL2kxEuoZQmeRiVJu6KQb+Im7d5CIoWViDmfxcSDJfdtSePTqmDURIx87fw14Z +XBWJP4PiK5PRmG/L0cGiDckmDKm/MuD13Z2I/NMl81GNY/q3WY2O7BmddPpAG5dr +sc5hOqA9+jX08XbxKnfBPYllK5skYMkFH5tN +-----END CERTIFICATE----- diff --git a/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/certs/intermediate.cert.pem b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/certs/intermediate.cert.pem new file mode 100644 index 0000000000..4305e5333f --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/certs/intermediate.cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFaDCCA1CgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwPzELMAkGA1UEBhMCdXMx +DjAMBgNVBAgMBWR1bW15MQ4wDAYDVQQKDAVkdW1teTEQMA4GA1UEAwwHcm9vdCBj +YTAeFw0xNzExMDIwMDM3NTlaFw0yNzEwMzEwMDM3NTlaMEcxCzAJBgNVBAYTAnVz +MQ4wDAYDVQQIDAVkdW1teTEOMAwGA1UECgwFZHVtbXkxGDAWBgNVBAMMD2ludGVy +bWVkaWF0ZSBjYTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKuM2iFz +CCKmbs4uLj/8wjtxf+jFmkwzN4Pps4hqJ3NJqWB326LhzWyqM4WiTAJWE02wSJbS +16RPfbjkVC77OI4+PUdwqxU9vNAP/95w0h6hBSFtkysuT5VVUt5jiY7wnUKgqTCi +MYhYOl+HEP32O4cnxAazkUKKvtyrd4/PvejJ9zz+iYexRnaaGfOFR3co7jQ5QKar +oK4UgJC3mVDZQEMBV0oljkpgVQMAVb4XQU7e+o25JOUkOoK6LdK/b/95khR0jTyD +OBLqd4mCEzxNi+jZ0jLTLPk0c+DnGmRfoNUxnFb40R8QnEIEKwf+JKyl6p89oqOl +pvIZFLZlUWIS4qL+993l1SCqPkWJOAdTg+s/Zh6DeAOhrUn9/wk0aQwZrK7wQQLJ +4GGhxC/FfuUGsLqZszAVkP8jDEWnzhN2rw3V+C7v6lj4qHhUwqGHuYzCx2Hxl+B8 +UyBmZb9gXKVUtAvaZjaL2PDj1ZAxT0KVMlw1ZVrZu45OsHNQuBx/4uIAt6Rga8yt +av1lsq+hFqwI4bU/oZC/oPMacOsB4qEkAA1101WjMc5bg6JOPWobwIqmUXQR1WJE +j30e99HCpk1Cc2+9sUCzNu8KvU5kUY2K90zwqProvj5IfMuDetAVXsEjgW+ZqSho +UMIpJ2M/hzAFl8Z5IRlG+YNfZNXl0FqJ5LzLAgMBAAGjZjBkMB0GA1UdDgQWBBTl +sy3e3gScEjW80ajbA+zEAwh4PzAfBgNVHSMEGDAWgBTgTvUeshGOijhPmkgpcA9g +ULVlyjASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG +9w0BAQsFAAOCAgEAOS7DtliOUPcVosRfyx9dHcSUc3O+uY8uKjSHhdIrxDJm4lwP +Q6lKg5j8CdMVb+sDQmyBkqQIA/6E13corP6R283jO6W8D4A8kjOiQWpXfjW6OcP3 +4rrDEWhCdeLFSNJIYOFkr2qWJpI/k0VpyDnmY0YluS5WbNjg6zTzGelzhFbV7/S1 +cteNAZD0vHD8NmbLVDJjjIY3E/iwzoUzBncLYbDwqyVS1g6utWdSy8LEJxzzqqWJ +pBKlNYILAdh8efBgvotafaxsn2nfjmVmekPn3KcQZuE4Kzv1EQ2PrHpGeJKwh6up +YBL2tav5cAki8bWoGPr2oGmWUf9L2tB57SdWdaY60ifzmQaeGiWPZBSmAz7PRSrz +sR9SMIkBfYVRxXgWwlvr8JYnd2h/Ef5K9fI32nGfje+7/0kPEjNyjehri7sV4Sjt +zzkDiFO+JklrRuLBPMFYOokq6Pcko32FKlE82pe8QkMDS8Sk//9PqCTK9ceB7y6E +NYLNBW/X9SAw/TR5kdRinHHgHyEug7N4+DCU3lU1wl72ZjoiGE7V6c2AssFC2VcE +E+WYxJT1ROJ1/5+U6BKdaIpTwMtRIFRomOEI66iOwOSEwqLIztkqxwpQ7THraWKm +2W5e54u/efapIDcQFnP3E8r7TD0PdIeU6mD28o0+WiK3uL/OZpvyKaHPeFU= +-----END CERTIFICATE----- diff --git a/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/certs/localhost-1.cert.pem b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/certs/localhost-1.cert.pem new file mode 100644 index 0000000000..2850e42fe9 --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/certs/localhost-1.cert.pem @@ -0,0 +1,30 @@ +-----BEGIN CERTIFICATE----- +MIIFFzCCAv+gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwRzELMAkGA1UEBhMCdXMx +DjAMBgNVBAgMBWR1bW15MQ4wDAYDVQQKDAVkdW1teTEYMBYGA1UEAwwPaW50ZXJt +ZWRpYXRlIGNhMB4XDTE3MTEwMjAwMzc1OVoXDTI3MTAzMTAwMzc1OVowTTELMAkG +A1UEBhMCdXMxDjAMBgNVBAgMBWR1bW15MQ4wDAYDVQQKDAVkdW1teTEKMAgGA1UE +CwwBMTESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAycY/7H1xk3/XHZRopULV7YsOzPIrMG25zoACbpDZxjS0I+2r1c7V +wnvE8TszAkloLi+Skku5CYC7IvVEEEuKuIuV+8M48FJEwlCPge8LPiy18C+npCEd +fgDzCV/O9DfJj6UaiCUayVE7UujXoke7AlKQEJcqvnD/CoTv2Y8jV1A6mPf6CTEI +Sl1BMeFSmeFyvZll+xJ8Up1KfQZxKhtpP1s/rp6ZNlqSs1LM5+vcDHHZ6COTbq7t +2vvcmGDTqeCLsqicBg1kJyMPRtqa0bNPj2bcVtcK0Ndfn6eL2hi+EoBy2nIXi6aG +PpXf85b9bCLd5pZI80nHzFlhdvV+SxqrfwIDAQABo4IBBTCCAQEwCQYDVR0TBAIw +ADARBglghkgBhvhCAQEEBAMCBkAwMwYJYIZIAYb4QgENBCYWJE9wZW5TU0wgR2Vu +ZXJhdGVkIFNlcnZlciBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUoYjECaDz/ZELru/r +jfTB1ShlVrAwaAYDVR0jBGEwX4AU5bMt3t4EnBI1vNGo2wPsxAMIeD+hQ6RBMD8x +CzAJBgNVBAYTAnVzMQ4wDAYDVQQIDAVkdW1teTEOMAwGA1UECgwFZHVtbXkxEDAO +BgNVBAMMB3Jvb3QgY2GCAhAAMA4GA1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggr +BgEFBQcDATANBgkqhkiG9w0BAQsFAAOCAgEAiiR2knMMym4O+3fD1KlYSnc2UR3v +0FlRVAsr8wvTlVjJhx7DbRusBNJHWX66mUgK9x5OLnhyvyqlFVhR9AwlnxgfLWz9 +nnACeXzcjQZnKWFQWu8bJSC6Ene6rd1g2acK6SOjxavVbj7JVFnmlHF/naZUzvMl +mJivYta4k7ob8UcX0I5TlJpzglU3UHyyJd5d9zhbF8wqbBq63zR2ovWci4pYCg+F +jYcTGYVZJti3SHO+9/EqTC9x2KDNs3o0+rreJ3GuoonkInKZMQQZJQ6qILvkxlhT +jyU5xlcaJ+0tSaiFK3eF0nXIpFYdZbIHYPCdLjh9AZ2dkFcAgSa/L8+tsVt60k8D +HTO0Hz6dW5D2ckeebZvz5LACMN89gVzrc/rVkeg7QmpSbjkTSLC2KJS53hJzWcEI +3KB73B9iY+ZYytcYBTYLizsAxd5g7j9z8UXrmVQ4mWbh2+xKiG+9aVOzCZ09AYi6 +WVK2aRcMQshgkkqPOloN9OeQNCE8Exf7N/zHsBhygorJXoD/PFgnV1VZm8xkOdiJ +zTb3bpGdmL5+bzzS6wP8Q7pGZGYdlnB7JNO8oMYPPtzX8OOx92BTkPnqJnnRWTpR +SjMEEdQe8K7iXxejQkjaAq5BlwaAOjCjPTqYomECcYjC0WaXsmrPcnZwSqpnHZZ2 +OiINYJub5cvBLNo= +-----END CERTIFICATE----- diff --git a/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/private/client.key.pem b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/private/client.key.pem new file mode 100644 index 0000000000..a4c5fd4a56 --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/private/client.key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAyxZFTLqvGd9SpFAykyRyLQgHcR5hgD55mz+9fl1OfnMoAc7y +TdPVLksDLmeFUlxcvCtLHysJklIBX62c6LzbsVcfLg/DPJlQxFnkhJCRKen4fp7x +9h62qqJkDFVXsiEFza9L1lsN4OwqU8i4RRgZ/xggM/s/wVBtynioeW9QADNmKZ1n +6HVKkYwdOynbFSggYfFrL3HL54bC9roZUETin0G5wZ9QU+srgivT0a/KC3ourBYH +XAI40iHuuOBf3syDVJ6xId/r3UO3qkiQ5q7pwglg+8Nx7Q3CFtGZY3ewxSSSDo6B +OyweGYMsBaxMO3EyTqecyfXn3n4XPqwmDalWYQIDAQABAoIBAFhIOR3OtVlw3BLz +jdiq6jsrF1kUFNxTzDcxsSUiWIHde1G17Vzpre0uzJY6iBkyb1mZFFHbOpDxtwkp +hmEh3/qqXbJ/RaatGxAP56e81G28+LnKTHJqDYwFhapa2wFjG4u7HSN0d4cEAq5j +Pb9DZ+GdUjpmiON3HBL8+ne3bLZ42uI+DSVe8d3irbqg2rqsiANf0gdimMW4nuI4 +rVxf8HrY43PdQn/Vby+7qLRE3tmIlpbTqJGRtWRjdeBBI91APCrRljjXrKqT6Zpa +E6Daz3YIQvXkIT0q+WkeN1VmQbtRnk7kRsPNp15kSwpHfmv6o/vkO9OUb1n71P2F +wnB0WDECgYEA8iltnKxXnjqwZ/vzIWzcd94j+mdZg/K2/JCOqjwMvpSGCvx2zUmq +Y2nxO2K85AVeOm/Yt87SMODB6AQ9CsrVGEUAzzacvCJDb8oUhaOL5gypnyvZiGCy +snzXfgB+v/xuGekIjs2y7E8h3GG40j0aNQnUY1Fuc6iaeJG4BtjkuQUCgYEA1rE4 +DrTSsUh3hLYQusIHZR8Lecrrd4QUZSMKLkWjobiSTw3m4mglx1s2G4eZ3WuzOyFq +Dp3/b3yfT8prdPBGA6shHNFf+1TO1q1/pIt15dc3sFwxMkuunai8N4QZJRqZLbYq +FkNFkZ20hFHcH/NHDsAsRL/0tJdEmJ2ruP+Qdq0CgYBsdPGKwgVb8J0hdU4nIkJ7 +zRoABFmrJwGdjIDY7Zwnnw2JzhjHSL7vV3ubRVWkKmNReNZvPEoXahJuf7d3JfDa +tczvAV6hRBc/8hnO4Li/h9xQVatP0T83gYJiBIbAJaaKJDyY+Lex7p8TvRCx2Hvs +VUKyWL5HPrQwW9M3/dwyoQKBgQCNQoPA4Wcz8Jt7PZQaXaoh9eBGHab6t3P366s6 +MOXudZQG4f3FgINC/ZfHW1x43PFL+btfrMOyJkxoYqZ7hdB7f3DFFlpR80Y46GVw +7bYAKbBhoPdZwYQ+BhT5bjhhOnQJKK/egBrZKevpmDb+6sIZSYaXIbovzMv8otmn +WrhB7QKBgAdl+KYBQULCUBp8qCQH5sAQoWErpyuD2FNN6LGknpPqn4DdujvwEP0Z +OSvbauLkI0Qc9/MezKPTeYXlFqdbpItwyySJsUkiI3HhVYlBgDkZ7xb6uHIH5E6I +bKgIW5JEf5I7Eu1iurORkXxCCGMkiQmEs4X5kSXXRYgXfNgAD0FX +-----END RSA PRIVATE KEY----- diff --git a/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/private/localhost-1.key.pem b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/private/localhost-1.key.pem new file mode 100644 index 0000000000..8cba174841 --- /dev/null +++ b/src/python/grpcio_tests/tests/unit/credentials/certificate_hierarchy_2/intermediate/private/localhost-1.key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAycY/7H1xk3/XHZRopULV7YsOzPIrMG25zoACbpDZxjS0I+2r +1c7VwnvE8TszAkloLi+Skku5CYC7IvVEEEuKuIuV+8M48FJEwlCPge8LPiy18C+n +pCEdfgDzCV/O9DfJj6UaiCUayVE7UujXoke7AlKQEJcqvnD/CoTv2Y8jV1A6mPf6 +CTEISl1BMeFSmeFyvZll+xJ8Up1KfQZxKhtpP1s/rp6ZNlqSs1LM5+vcDHHZ6COT +bq7t2vvcmGDTqeCLsqicBg1kJyMPRtqa0bNPj2bcVtcK0Ndfn6eL2hi+EoBy2nIX +i6aGPpXf85b9bCLd5pZI80nHzFlhdvV+SxqrfwIDAQABAoIBAQC022161aoTEtjH +m7n8v56vUCCRFVQfEYsljFohrtZ0sdLyDVwjxkSWEYiizXRYTWIDXALd/N+7o9aZ +bAx5Kq0J45wpUYBc8PDO15T6W0DRlxPxWVXDaSddRQ6TTXxcLREPH2dbtx5+asBo +/Woi/Haki0q0hDr8/p2sWSH/+SwtWpOezGVlrWrkMeIhlBwHZfdHVoZvSx65Uv7x +WU07vsjrbXNDwf+2fmklAQrzhedCeh8loGyjtN3cfrTjrE1zqpEsHnlZcJxe6sRB +1nOqpoUnpZXklDDIYC8EmeubmDJ0jnXOQCDDep3MzVcnZGyF5E/+szaa1NL70Ayj +rbKk1Y3ZAoGBAPy/1ym7Cjl4OGHN2fdkR6iL68ebJozpr+eTSxDNLuBSi5IJxJyG +1+B4+v1u0RwZ3DjrSQsO5DCbZ+DHU6O/DAJK2CxUED+M+G2kRyffailRQmNzjpRG +75dIhSkSRYH8vdvEOnGpeQBZwBcCRH/2YUMlZeSfx9fHJhk1nyUxJeHjAoGBAMxe +k+cBb0zYok+Ww1xTwOdq0PwKj0oDsEg8hOdWc8pH0SlOAB4BI5kmfd1JDMHfRc49 +7tpNqjsPrnlb9xd8l0281Lj2NoVSE5KX1JtsOsKecQsvHH5zRk4eJ3h/mNixpjfe +79Zc/O40T4rWpQRqhat+WHveJC0/ON4AH4uT0BK1AoGBAPcTioCu6YXYsjVaCJPB +IhPwBGOylfL2lxDoel9IVWTRDMOMbPkfEHXNjn6lECJKXW//Af6fZg7mPJwN/wN5 +xYGQLNbYrrGRW2HDUBP4YU1WtHGIC3+EAL+BEztdMzmpGuh1YTSvmSvwkMltXA1D +iz0amArw72lOsz29n3+6FfBFAoGAIpRqMC8k9vq80/yth6TAQifnvo3G2v4uyLo8 +vqv5IaPvNy70hB8rN9G0gEnI99Dgjdoa3SNBB4dKvUwbTgUN0OB/meBHL13I5Af+ +uGGiu6V1eS/6gUbeAX/Gq/PjF99PQareKAZJ4cBGKTbSayHfBjp1nFflBSbqZ13b ++JEFJvUCgYBOs2J2XXamPbI7gu7B2TE9j/62v0SJyoHq2LHMmYUDRuPdPk3eKCt3 +283w+E8XUIFbctaxsbo8msNjjvV22D/Nci3d87aPe8bn1SVto3GnTuwnOpRq3E+3 +wAarqrhiZbGZSCcAkEOk7FlxAwYnCM6paqMxDEMCJ4qChMM42E9ZyQ== +-----END RSA PRIVATE KEY----- diff --git a/src/python/grpcio_tests/tests/unit/resources.py b/src/python/grpcio_tests/tests/unit/resources.py index 823d2307d3..11ef9e8565 100644 --- a/src/python/grpcio_tests/tests/unit/resources.py +++ b/src/python/grpcio_tests/tests/unit/resources.py @@ -11,7 +11,7 @@ # 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. -"""Constants and functions for data used in interoperability testing.""" +"""Constants and functions for data used in testing.""" import os @@ -34,3 +34,81 @@ def private_key(): def certificate_chain(): return pkg_resources.resource_string(__name__, _CERTIFICATE_CHAIN_RESOURCE_PATH) + + +def cert_hier_1_root_ca_cert(): + return pkg_resources.resource_string( + __name__, 'credentials/certificate_hierarchy_1/certs/ca.cert.pem') + + +def cert_hier_1_intermediate_ca_cert(): + return pkg_resources.resource_string( + __name__, + 'credentials/certificate_hierarchy_1/intermediate/certs/intermediate.cert.pem' + ) + + +def cert_hier_1_client_1_key(): + return pkg_resources.resource_string( + __name__, + 'credentials/certificate_hierarchy_1/intermediate/private/client.key.pem' + ) + + +def cert_hier_1_client_1_cert(): + return pkg_resources.resource_string( + __name__, + 'credentials/certificate_hierarchy_1/intermediate/certs/client.cert.pem') + + +def cert_hier_1_server_1_key(): + return pkg_resources.resource_string( + __name__, + 'credentials/certificate_hierarchy_1/intermediate/private/localhost-1.key.pem' + ) + + +def cert_hier_1_server_1_cert(): + return pkg_resources.resource_string( + __name__, + 'credentials/certificate_hierarchy_1/intermediate/certs/localhost-1.cert.pem' + ) + + +def cert_hier_2_root_ca_cert(): + return pkg_resources.resource_string( + __name__, 'credentials/certificate_hierarchy_2/certs/ca.cert.pem') + + +def cert_hier_2_intermediate_ca_cert(): + return pkg_resources.resource_string( + __name__, + 'credentials/certificate_hierarchy_2/intermediate/certs/intermediate.cert.pem' + ) + + +def cert_hier_2_client_1_key(): + return pkg_resources.resource_string( + __name__, + 'credentials/certificate_hierarchy_2/intermediate/private/client.key.pem' + ) + + +def cert_hier_2_client_1_cert(): + return pkg_resources.resource_string( + __name__, + 'credentials/certificate_hierarchy_2/intermediate/certs/client.cert.pem') + + +def cert_hier_2_server_1_key(): + return pkg_resources.resource_string( + __name__, + 'credentials/certificate_hierarchy_2/intermediate/private/localhost-1.key.pem' + ) + + +def cert_hier_2_server_1_cert(): + return pkg_resources.resource_string( + __name__, + 'credentials/certificate_hierarchy_2/intermediate/certs/localhost-1.cert.pem' + ) -- cgit v1.2.3 From 90dbd2b6701acacace74df6bbdd8bcfe2248b431 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Thu, 16 Nov 2017 15:21:02 -0800 Subject: Alter health/reflection packages' build criterion Using the presence of the `*_pb2_grpc` module, as opposed to the absence of the build script (`*_commands` module) is a problematic choice, because even if a generated file is present, the test infrastructure may want to regenerate it under a different environment (e.g. different Python/proto package version). This will ensure the protos always get recompiled if we have a `*_commands` module present, signaling we are in a build environment, thereby making the process hermetic. --- src/python/grpcio_health_checking/setup.py | 18 ++++++++---------- src/python/grpcio_reflection/setup.py | 18 ++++++++---------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/python/grpcio_health_checking/setup.py b/src/python/grpcio_health_checking/setup.py index 01d796f4e6..7a2e6f5027 100644 --- a/src/python/grpcio_health_checking/setup.py +++ b/src/python/grpcio_health_checking/setup.py @@ -60,17 +60,8 @@ INSTALL_REQUIRES = ('protobuf>=3.3.0', 'grpcio>={version}'.format(version=grpc_version.VERSION),) try: - # ensure we can load the _pb2_grpc module: - from grpc_health.v1 import health_pb2_grpc as _pb2_grpc - # if we can find the _pb2_grpc module, the package has already been built. - SETUP_REQUIRES = () - COMMAND_CLASS = { - # wire up commands to no-op not to break the external dependencies - 'preprocess': _NoOpCommand, - 'build_package_protos': _NoOpCommand, - } -except ImportError: # we are in the build environment import health_commands as _health_commands + # we are in the build environment, otherwise the above import fails SETUP_REQUIRES = ( 'grpcio-tools=={version}'.format(version=grpc_version.VERSION),) COMMAND_CLASS = { @@ -78,6 +69,13 @@ except ImportError: # we are in the build environment 'preprocess': _health_commands.CopyProtoModules, 'build_package_protos': _health_commands.BuildPackageProtos, } +except ImportError: + SETUP_REQUIRES = () + COMMAND_CLASS = { + # wire up commands to no-op not to break the external dependencies + 'preprocess': _NoOpCommand, + 'build_package_protos': _NoOpCommand, + } setuptools.setup( name='grpcio-health-checking', diff --git a/src/python/grpcio_reflection/setup.py b/src/python/grpcio_reflection/setup.py index ad9e86990f..25312c7c0a 100644 --- a/src/python/grpcio_reflection/setup.py +++ b/src/python/grpcio_reflection/setup.py @@ -61,17 +61,8 @@ INSTALL_REQUIRES = ('protobuf>=3.3.0', 'grpcio>={version}'.format(version=grpc_version.VERSION),) try: - # ensure we can load the _pb2_grpc module: - from grpc_reflection.v1alpha import reflection_pb2_grpc as _pb2_grpc - # if we can find the _pb2_grpc module, the package has already been built. - SETUP_REQUIRES = () - COMMAND_CLASS = { - # wire up commands to no-op not to break the external dependencies - 'preprocess': _NoOpCommand, - 'build_package_protos': _NoOpCommand, - } -except ImportError: # we are in the build environment import reflection_commands as _reflection_commands + # we are in the build environment, otherwise the above import fails SETUP_REQUIRES = ( 'grpcio-tools=={version}'.format(version=grpc_version.VERSION),) COMMAND_CLASS = { @@ -79,6 +70,13 @@ except ImportError: # we are in the build environment 'preprocess': _reflection_commands.CopyProtoModules, 'build_package_protos': _reflection_commands.BuildPackageProtos, } +except ImportError: + SETUP_REQUIRES = () + COMMAND_CLASS = { + # wire up commands to no-op not to break the external dependencies + 'preprocess': _NoOpCommand, + 'build_package_protos': _NoOpCommand, + } setuptools.setup( name='grpcio-reflection', -- cgit v1.2.3 From 11c1c47fe95e6ec8c9ff97d1e702561eee36434e Mon Sep 17 00:00:00 2001 From: Noah Eisen Date: Mon, 20 Nov 2017 21:41:51 -0800 Subject: Fix real TSAN/ASAN bug --- src/core/lib/channel/channel_stack.h | 2 +- src/core/lib/iomgr/error.cc | 2 +- src/core/lib/surface/call.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/lib/channel/channel_stack.h b/src/core/lib/channel/channel_stack.h index 41851382ae..6419f1ac48 100644 --- a/src/core/lib/channel/channel_stack.h +++ b/src/core/lib/channel/channel_stack.h @@ -84,7 +84,7 @@ typedef struct { typedef struct { grpc_call_stats stats; grpc_status_code final_status; - const char* error_string; + const char** error_string; } grpc_call_final_info; /* Channel filters specify: diff --git a/src/core/lib/iomgr/error.cc b/src/core/lib/iomgr/error.cc index 5fe6514802..581b903f1a 100644 --- a/src/core/lib/iomgr/error.cc +++ b/src/core/lib/iomgr/error.cc @@ -754,7 +754,7 @@ const char* grpc_error_string(grpc_error* err) { if (!gpr_atm_rel_cas(&err->atomics.error_string, 0, (gpr_atm)out)) { gpr_free(out); - out = (char*)gpr_atm_acq_load(&err->atomics.error_string); + out = (char*)gpr_atm_no_barrier_load(&err->atomics.error_string); } GPR_TIMER_END("grpc_error_string", 0); diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc index c67b577ba1..d9185ec81e 100644 --- a/src/core/lib/surface/call.cc +++ b/src/core/lib/surface/call.cc @@ -551,7 +551,7 @@ static void destroy_call(grpc_exec_ctx* exec_ctx, void* call, get_final_status(exec_ctx, c, set_status_value_directly, &c->final_info.final_status, nullptr, - &c->final_info.error_string); + c->final_info.error_string); c->final_info.stats.latency = gpr_time_sub(gpr_now(GPR_CLOCK_MONOTONIC), c->start_time); -- cgit v1.2.3 From 9a244d61d4a0b2bbe775041b5ce63c1df6a97e37 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 17 Nov 2017 20:02:31 +0100 Subject: avoid unnecessary allocation in completion registry --- src/csharp/Grpc.Core.Tests/PInvokeTest.cs | 4 +- .../Grpc.Core/Internal/BatchContextSafeHandle.cs | 28 ++++++++++- .../Grpc.Core/Internal/CompletionRegistry.cs | 58 +++------------------- src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs | 8 +-- src/csharp/Grpc.Core/Internal/NativeMethods.cs | 4 +- .../Internal/RequestCallContextSafeHandle.cs | 23 ++++++++- .../CompletionRegistryBenchmark.cs | 12 ++++- .../Grpc.Microbenchmarks/SendMessageBenchmark.cs | 2 +- 8 files changed, 77 insertions(+), 62 deletions(-) diff --git a/src/csharp/Grpc.Core.Tests/PInvokeTest.cs b/src/csharp/Grpc.Core.Tests/PInvokeTest.cs index 7529c44c4e..43f816bb1c 100644 --- a/src/csharp/Grpc.Core.Tests/PInvokeTest.cs +++ b/src/csharp/Grpc.Core.Tests/PInvokeTest.cs @@ -63,7 +63,7 @@ namespace Grpc.Core.Tests [Ignore("Prevent running on Jenkins")] public void NativeCallbackBenchmark() { - OpCompletionDelegate handler = Handler; + NativeCallbackTestDelegate handler = Handler; counter = 0; BenchmarkUtil.RunBenchmark( @@ -91,7 +91,7 @@ namespace Grpc.Core.Tests 10000, 10000, () => { - Native.grpcsharp_test_callback(new OpCompletionDelegate(Handler)); + Native.grpcsharp_test_callback(new NativeCallbackTestDelegate(Handler)); }); Assert.AreNotEqual(0, counter); } diff --git a/src/csharp/Grpc.Core/Internal/BatchContextSafeHandle.cs b/src/csharp/Grpc.Core/Internal/BatchContextSafeHandle.cs index cd5e3d8911..d839413a80 100644 --- a/src/csharp/Grpc.Core/Internal/BatchContextSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/BatchContextSafeHandle.cs @@ -20,15 +20,22 @@ using System; using System.Runtime.InteropServices; using System.Text; using Grpc.Core; +using Grpc.Core.Logging; namespace Grpc.Core.Internal { + internal interface IOpCompletionCallback + { + void OnComplete(bool success); + } + /// /// grpcsharp_batch_context /// - internal class BatchContextSafeHandle : SafeHandleZeroIsInvalid + internal class BatchContextSafeHandle : SafeHandleZeroIsInvalid, IOpCompletionCallback { static readonly NativeMethods Native = NativeMethods.Get(); + static readonly ILogger Logger = GrpcEnvironment.Logger.ForType(); private BatchContextSafeHandle() { @@ -47,6 +54,8 @@ namespace Grpc.Core.Internal } } + public BatchCompletionDelegate CompletionCallback { get; set; } + // Gets data of recv_initial_metadata completion. public Metadata GetReceivedInitialMetadata() { @@ -92,5 +101,22 @@ namespace Grpc.Core.Internal Native.grpcsharp_batch_context_destroy(handle); return true; } + + void IOpCompletionCallback.OnComplete(bool success) + { + try + { + CompletionCallback(success, this); + } + catch (Exception e) + { + Logger.Error(e, "Exception occured while invoking batch completion delegate."); + } + finally + { + CompletionCallback = null; + Dispose(); + } + } } } diff --git a/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs b/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs index 1102c8d14f..33734864bd 100644 --- a/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs +++ b/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs @@ -25,8 +25,6 @@ using Grpc.Core.Utils; namespace Grpc.Core.Internal { - internal delegate void OpCompletionDelegate(bool success); - internal delegate void BatchCompletionDelegate(bool success, BatchContextSafeHandle ctx); internal delegate void RequestCallCompletionDelegate(bool success, RequestCallContextSafeHandle ctx); @@ -36,7 +34,7 @@ namespace Grpc.Core.Internal static readonly ILogger Logger = GrpcEnvironment.Logger.ForType(); readonly GrpcEnvironment environment; - readonly Dictionary dict = new Dictionary(new IntPtrComparer()); + readonly Dictionary dict = new Dictionary(new IntPtrComparer()); readonly object myLock = new object(); IntPtr lastRegisteredKey; // only for testing @@ -45,7 +43,7 @@ namespace Grpc.Core.Internal this.environment = environment; } - public void Register(IntPtr key, OpCompletionDelegate callback) + public void Register(IntPtr key, IOpCompletionCallback callback) { environment.DebugStats.PendingBatchCompletions.Increment(); lock (myLock) @@ -57,21 +55,19 @@ namespace Grpc.Core.Internal public void RegisterBatchCompletion(BatchContextSafeHandle ctx, BatchCompletionDelegate callback) { - // TODO(jtattermusch): get rid of new delegate creation here - OpCompletionDelegate opCallback = ((success) => HandleBatchCompletion(success, ctx, callback)); - Register(ctx.Handle, opCallback); + ctx.CompletionCallback = callback; + Register(ctx.Handle, ctx); } public void RegisterRequestCallCompletion(RequestCallContextSafeHandle ctx, RequestCallCompletionDelegate callback) { - // TODO(jtattermusch): get rid of new delegate creation here - OpCompletionDelegate opCallback = ((success) => HandleRequestCallCompletion(success, ctx, callback)); - Register(ctx.Handle, opCallback); + ctx.CompletionCallback = callback; + Register(ctx.Handle, ctx); } - public OpCompletionDelegate Extract(IntPtr key) + public IOpCompletionCallback Extract(IntPtr key) { - OpCompletionDelegate value = null; + IOpCompletionCallback value = null; lock (myLock) { value = dict[key]; @@ -89,44 +85,6 @@ namespace Grpc.Core.Internal get { return this.lastRegisteredKey; } } - private static void HandleBatchCompletion(bool success, BatchContextSafeHandle ctx, BatchCompletionDelegate callback) - { - try - { - callback(success, ctx); - } - catch (Exception e) - { - Logger.Error(e, "Exception occured while invoking batch completion delegate."); - } - finally - { - if (ctx != null) - { - ctx.Dispose(); - } - } - } - - private static void HandleRequestCallCompletion(bool success, RequestCallContextSafeHandle ctx, RequestCallCompletionDelegate callback) - { - try - { - callback(success, ctx); - } - catch (Exception e) - { - Logger.Error(e, "Exception occured while invoking request call completion delegate."); - } - finally - { - if (ctx != null) - { - ctx.Dispose(); - } - } - } - /// /// IntPtr doesn't implement IEquatable{IntPtr} so we need to use custom comparer to avoid boxing. /// diff --git a/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs b/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs index f7f723c00b..bd0229a9dd 100644 --- a/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs +++ b/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs @@ -68,8 +68,8 @@ namespace Grpc.Core.Internal GrpcPreconditions.CheckArgument(poolSize >= completionQueueCount, "Thread pool size cannot be smaller than the number of completion queues used."); - this.runCompletionQueueEventCallbackSuccess = new WaitCallback((callback) => RunCompletionQueueEventCallback((OpCompletionDelegate) callback, true)); - this.runCompletionQueueEventCallbackFailure = new WaitCallback((callback) => RunCompletionQueueEventCallback((OpCompletionDelegate) callback, false)); + this.runCompletionQueueEventCallbackSuccess = new WaitCallback((callback) => RunCompletionQueueEventCallback((IOpCompletionCallback) callback, true)); + this.runCompletionQueueEventCallbackFailure = new WaitCallback((callback) => RunCompletionQueueEventCallback((IOpCompletionCallback) callback, false)); } public void Start() @@ -225,11 +225,11 @@ namespace Grpc.Core.Internal return list.AsReadOnly(); } - private void RunCompletionQueueEventCallback(OpCompletionDelegate callback, bool success) + private void RunCompletionQueueEventCallback(IOpCompletionCallback callback, bool success) { try { - callback(success); + callback.OnComplete(success); } catch (Exception e) { diff --git a/src/csharp/Grpc.Core/Internal/NativeMethods.cs b/src/csharp/Grpc.Core/Internal/NativeMethods.cs index 22faa19d9b..d517252cfe 100644 --- a/src/csharp/Grpc.Core/Internal/NativeMethods.cs +++ b/src/csharp/Grpc.Core/Internal/NativeMethods.cs @@ -29,6 +29,8 @@ using Grpc.Core.Utils; namespace Grpc.Core.Internal { + internal delegate void NativeCallbackTestDelegate(bool success); + /// /// Provides access to all native methods provided by NativeExtension. /// An extra level of indirection is added to P/Invoke calls to allow intelligent loading @@ -420,7 +422,7 @@ namespace Grpc.Core.Internal public delegate Timespec gprsharp_convert_clock_type_delegate(Timespec t, ClockType targetClock); public delegate int gprsharp_sizeof_timespec_delegate(); - public delegate CallError grpcsharp_test_callback_delegate([MarshalAs(UnmanagedType.FunctionPtr)] OpCompletionDelegate callback); + public delegate CallError grpcsharp_test_callback_delegate([MarshalAs(UnmanagedType.FunctionPtr)] NativeCallbackTestDelegate callback); public delegate IntPtr grpcsharp_test_nop_delegate(IntPtr ptr); public delegate void grpcsharp_test_override_method_delegate(string methodName, string variant); } diff --git a/src/csharp/Grpc.Core/Internal/RequestCallContextSafeHandle.cs b/src/csharp/Grpc.Core/Internal/RequestCallContextSafeHandle.cs index b7af0c102d..09f5c3e452 100644 --- a/src/csharp/Grpc.Core/Internal/RequestCallContextSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/RequestCallContextSafeHandle.cs @@ -19,15 +19,17 @@ using System; using System.Runtime.InteropServices; using Grpc.Core; +using Grpc.Core.Logging; namespace Grpc.Core.Internal { /// /// grpcsharp_request_call_context /// - internal class RequestCallContextSafeHandle : SafeHandleZeroIsInvalid + internal class RequestCallContextSafeHandle : SafeHandleZeroIsInvalid, IOpCompletionCallback { static readonly NativeMethods Native = NativeMethods.Get(); + static readonly ILogger Logger = GrpcEnvironment.Logger.ForType(); private RequestCallContextSafeHandle() { @@ -46,6 +48,8 @@ namespace Grpc.Core.Internal } } + public RequestCallCompletionDelegate CompletionCallback { get; set; } + // Gets data of server_rpc_new completion. public ServerRpcNew GetServerRpcNew(Server server) { @@ -72,5 +76,22 @@ namespace Grpc.Core.Internal Native.grpcsharp_request_call_context_destroy(handle); return true; } + + void IOpCompletionCallback.OnComplete(bool success) + { + try + { + CompletionCallback(success, this); + } + catch (Exception e) + { + Logger.Error(e, "Exception occured while invoking request call completion delegate."); + } + finally + { + CompletionCallback = null; + Dispose(); + } + } } } diff --git a/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs b/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs index 810de119a8..0e2fb070f1 100644 --- a/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs +++ b/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs @@ -52,18 +52,26 @@ namespace Grpc.Microbenchmarks { var completionRegistry = new CompletionRegistry(environment); var ctx = BatchContextSafeHandle.Create(); - var completionDelegate = new OpCompletionDelegate((success) => {}); var stopwatch = Stopwatch.StartNew(); for (int i = 0; i < iterations; i++) { - completionRegistry.Register(ctx.DangerousGetHandle(), completionDelegate); + completionRegistry.Register(ctx.Handle, ctx); var callback = completionRegistry.Extract(completionRegistry.LastRegisteredKey); + // NOTE: we are not calling the callback to avoid disposing ctx. } stopwatch.Stop(); Console.WriteLine("Elapsed millis: " + stopwatch.ElapsedMilliseconds); ctx.Dispose(); } + + private class NopCompletionCallback : IOpCompletionCallback + { + public void OnComplete(bool success) + { + + } + } } } diff --git a/src/csharp/Grpc.Microbenchmarks/SendMessageBenchmark.cs b/src/csharp/Grpc.Microbenchmarks/SendMessageBenchmark.cs index de67874580..6a8a29d770 100644 --- a/src/csharp/Grpc.Microbenchmarks/SendMessageBenchmark.cs +++ b/src/csharp/Grpc.Microbenchmarks/SendMessageBenchmark.cs @@ -68,7 +68,7 @@ namespace Grpc.Microbenchmarks { call.StartSendMessage(sendCompletionHandler, payload, writeFlags, false); var callback = completionRegistry.Extract(completionRegistry.LastRegisteredKey); - callback(true); + callback.OnComplete(true); } stopwatch.Stop(); Console.WriteLine("Elapsed millis: " + stopwatch.ElapsedMilliseconds); -- cgit v1.2.3 From 2dc792de17c56fe838685eb71aceea1f1ef788e5 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 20 Nov 2017 11:31:32 +0100 Subject: add "state" filed to batch completion delegate --- .../Grpc.Core/Internal/BatchContextSafeHandle.cs | 32 ++++++++++++++++++---- .../Grpc.Core/Internal/CompletionRegistry.cs | 6 ++-- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/csharp/Grpc.Core/Internal/BatchContextSafeHandle.cs b/src/csharp/Grpc.Core/Internal/BatchContextSafeHandle.cs index d839413a80..1e6f1fba37 100644 --- a/src/csharp/Grpc.Core/Internal/BatchContextSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/BatchContextSafeHandle.cs @@ -21,6 +21,7 @@ using System.Runtime.InteropServices; using System.Text; using Grpc.Core; using Grpc.Core.Logging; +using Grpc.Core.Utils; namespace Grpc.Core.Internal { @@ -37,6 +38,8 @@ namespace Grpc.Core.Internal static readonly NativeMethods Native = NativeMethods.Get(); static readonly ILogger Logger = GrpcEnvironment.Logger.ForType(); + CompletionCallbackData completionCallbackData; + private BatchContextSafeHandle() { } @@ -54,7 +57,12 @@ namespace Grpc.Core.Internal } } - public BatchCompletionDelegate CompletionCallback { get; set; } + public void SetCompletionCallback(BatchCompletionDelegate callback, object state) + { + GrpcPreconditions.CheckState(completionCallbackData.Callback == null); + GrpcPreconditions.CheckNotNull(callback, nameof(callback)); + completionCallbackData = new CompletionCallbackData(callback, state); + } // Gets data of recv_initial_metadata completion. public Metadata GetReceivedInitialMetadata() @@ -62,13 +70,13 @@ namespace Grpc.Core.Internal IntPtr metadataArrayPtr = Native.grpcsharp_batch_context_recv_initial_metadata(this); return MetadataArraySafeHandle.ReadMetadataFromPtrUnsafe(metadataArrayPtr); } - + // Gets data of recv_status_on_client completion. public ClientSideStatus GetReceivedStatusOnClient() { UIntPtr detailsLength; IntPtr detailsPtr = Native.grpcsharp_batch_context_recv_status_on_client_details(this, out detailsLength); - string details = MarshalUtils.PtrToStringUTF8(detailsPtr, (int) detailsLength.ToUInt32()); + string details = MarshalUtils.PtrToStringUTF8(detailsPtr, (int)detailsLength.ToUInt32()); var status = new Status(Native.grpcsharp_batch_context_recv_status_on_client_status(this), details); IntPtr metadataArrayPtr = Native.grpcsharp_batch_context_recv_status_on_client_trailing_metadata(this); @@ -95,7 +103,7 @@ namespace Grpc.Core.Internal { return Native.grpcsharp_batch_context_recv_close_on_server_cancelled(this) != 0; } - + protected override bool ReleaseHandle() { Native.grpcsharp_batch_context_destroy(handle); @@ -106,7 +114,7 @@ namespace Grpc.Core.Internal { try { - CompletionCallback(success, this); + completionCallbackData.Callback(success, this, completionCallbackData.State); } catch (Exception e) { @@ -114,9 +122,21 @@ namespace Grpc.Core.Internal } finally { - CompletionCallback = null; + completionCallbackData = default(CompletionCallbackData); Dispose(); } } + + struct CompletionCallbackData + { + public CompletionCallbackData(BatchCompletionDelegate callback, object state) + { + this.Callback = callback; + this.State = state; + } + + public BatchCompletionDelegate Callback { get; } + public object State { get; } + } } } diff --git a/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs b/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs index 33734864bd..f4aea685c3 100644 --- a/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs +++ b/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs @@ -25,7 +25,7 @@ using Grpc.Core.Utils; namespace Grpc.Core.Internal { - internal delegate void BatchCompletionDelegate(bool success, BatchContextSafeHandle ctx); + internal delegate void BatchCompletionDelegate(bool success, BatchContextSafeHandle ctx, object state); internal delegate void RequestCallCompletionDelegate(bool success, RequestCallContextSafeHandle ctx); @@ -53,9 +53,9 @@ namespace Grpc.Core.Internal } } - public void RegisterBatchCompletion(BatchContextSafeHandle ctx, BatchCompletionDelegate callback) + public void RegisterBatchCompletion(BatchContextSafeHandle ctx, BatchCompletionDelegate callback, object state) { - ctx.CompletionCallback = callback; + ctx.SetCompletionCallback(callback, state); Register(ctx.Handle, ctx); } -- cgit v1.2.3 From 8b451ed31dc25f397ce9d270a5f293999505c2cc Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 20 Nov 2017 11:46:48 +0100 Subject: server and channel adjustments --- src/csharp/Grpc.Core/Channel.cs | 28 ++++++++++++---------- src/csharp/Grpc.Core/Internal/ChannelSafeHandle.cs | 4 ++-- src/csharp/Grpc.Core/Internal/ServerSafeHandle.cs | 6 +++-- src/csharp/Grpc.Core/Server.cs | 2 +- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/csharp/Grpc.Core/Channel.cs b/src/csharp/Grpc.Core/Channel.cs index 1803920662..f9925a8a76 100644 --- a/src/csharp/Grpc.Core/Channel.cs +++ b/src/csharp/Grpc.Core/Channel.cs @@ -127,6 +127,20 @@ namespace Grpc.Core } } + // cached handler for watch connectivity state + static readonly BatchCompletionDelegate WatchConnectivityStateHandler = (success, ctx, state) => + { + var tcs = (TaskCompletionSource) state; + if (success) + { + tcs.SetResult(null); + } + else + { + tcs.SetCanceled(); + } + }; + /// /// Returned tasks completes once channel state has become different from /// given lastObservedState. @@ -138,18 +152,8 @@ namespace Grpc.Core "Shutdown is a terminal state. No further state changes can occur."); var tcs = new TaskCompletionSource(); var deadlineTimespec = deadline.HasValue ? Timespec.FromDateTime(deadline.Value) : Timespec.InfFuture; - var handler = new BatchCompletionDelegate((success, ctx) => - { - if (success) - { - tcs.SetResult(null); - } - else - { - tcs.SetCanceled(); - } - }); - handle.WatchConnectivityState(lastObservedState, deadlineTimespec, completionQueue, handler); + // pass "tcs" as "state" for WatchConnectivityStateHandler. + handle.WatchConnectivityState(lastObservedState, deadlineTimespec, completionQueue, WatchConnectivityStateHandler, tcs); return tcs.Task; } diff --git a/src/csharp/Grpc.Core/Internal/ChannelSafeHandle.cs b/src/csharp/Grpc.Core/Internal/ChannelSafeHandle.cs index f826a17bad..1eeb0e3d97 100644 --- a/src/csharp/Grpc.Core/Internal/ChannelSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/ChannelSafeHandle.cs @@ -64,10 +64,10 @@ namespace Grpc.Core.Internal return Native.grpcsharp_channel_check_connectivity_state(this, tryToConnect ? 1 : 0); } - public void WatchConnectivityState(ChannelState lastObservedState, Timespec deadline, CompletionQueueSafeHandle cq, BatchCompletionDelegate callback) + public void WatchConnectivityState(ChannelState lastObservedState, Timespec deadline, CompletionQueueSafeHandle cq, BatchCompletionDelegate callback, object callbackState) { var ctx = BatchContextSafeHandle.Create(); - cq.CompletionRegistry.RegisterBatchCompletion(ctx, callback); + cq.CompletionRegistry.RegisterBatchCompletion(ctx, callback, callbackState); Native.grpcsharp_channel_watch_connectivity_state(this, lastObservedState, deadline, cq, ctx); } diff --git a/src/csharp/Grpc.Core/Internal/ServerSafeHandle.cs b/src/csharp/Grpc.Core/Internal/ServerSafeHandle.cs index 63000e9a22..a308890cde 100644 --- a/src/csharp/Grpc.Core/Internal/ServerSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/ServerSafeHandle.cs @@ -59,13 +59,15 @@ namespace Grpc.Core.Internal { Native.grpcsharp_server_start(this); } - + public void ShutdownAndNotify(BatchCompletionDelegate callback, CompletionQueueSafeHandle completionQueue) { using (completionQueue.NewScope()) { var ctx = BatchContextSafeHandle.Create(); - completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, callback); + // TODO(jtattermusch): delegate allocation by caller can be avoided by utilizing the "state" object, + // but server shutdown isn't worth optimizing right now. + completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, callback, null); Native.grpcsharp_server_shutdown_and_notify_callback(this, completionQueue, ctx); } } diff --git a/src/csharp/Grpc.Core/Server.cs b/src/csharp/Grpc.Core/Server.cs index 77ad876bdf..71c7f108f3 100644 --- a/src/csharp/Grpc.Core/Server.cs +++ b/src/csharp/Grpc.Core/Server.cs @@ -387,7 +387,7 @@ namespace Grpc.Core /// /// Handles native callback. /// - private void HandleServerShutdown(bool success, BatchContextSafeHandle ctx) + private void HandleServerShutdown(bool success, BatchContextSafeHandle ctx, object state) { shutdownTcs.SetResult(null); } -- cgit v1.2.3 From 466d77b26f1a842873817cb945f561dd4a679c53 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 20 Nov 2017 12:59:09 +0100 Subject: avoid delegate allocations in callsafehandle --- src/csharp/Grpc.Core/Internal/CallSafeHandle.cs | 57 ++++++++++++++++--------- src/csharp/Grpc.Core/Internal/INativeCall.cs | 31 ++++++++++++++ 2 files changed, 67 insertions(+), 21 deletions(-) diff --git a/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs b/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs index 3a7f97707b..589f6cbe16 100644 --- a/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs @@ -32,6 +32,21 @@ namespace Grpc.Core.Internal public static readonly CallSafeHandle NullInstance = new CallSafeHandle(); static readonly NativeMethods Native = NativeMethods.Get(); + // Completion handlers are pre-allocated to avoid unneccessary delegate allocations. + // The "state" field is used to store the actual callback to invoke. + static readonly BatchCompletionDelegate CompletionHandler_IUnaryResponseClientCallback = + (success, context, state) => ((IUnaryResponseClientCallback)state).OnUnaryResponseClient(success, context.GetReceivedStatusOnClient(), context.GetReceivedMessage(), context.GetReceivedInitialMetadata()); + static readonly BatchCompletionDelegate CompletionHandler_IReceivedStatusOnClientCallback = + (success, context, state) => ((IReceivedStatusOnClientCallback)state).OnReceivedStatusOnClient(success, context.GetReceivedStatusOnClient()); + static readonly BatchCompletionDelegate CompletionHandler_IReceivedMessageCallback = + (success, context, state) => ((IReceivedMessageCallback)state).OnReceivedMessage(success, context.GetReceivedMessage()); + static readonly BatchCompletionDelegate CompletionHandler_IReceivedResponseHeadersCallback = + (success, context, state) => ((IReceivedResponseHeadersCallback)state).OnReceivedResponseHeaders(success, context.GetReceivedInitialMetadata()); + static readonly BatchCompletionDelegate CompletionHandler_ISendCompletionCallback = + (success, context, state) => ((ISendCompletionCallback)state).OnSendCompletion(success); + static readonly BatchCompletionDelegate CompletionHandler_IReceivedCloseOnServerCallback = + (success, context, state) => ((IReceivedCloseOnServerCallback)state).OnReceivedCloseOnServerHandler(success, context.GetReceivedCloseOnServerCancelled()); + const uint GRPC_WRITE_BUFFER_HINT = 1; CompletionQueueSafeHandle completionQueue; @@ -49,12 +64,12 @@ namespace Grpc.Core.Internal Native.grpcsharp_call_set_credentials(this, credentials).CheckOk(); } - public void StartUnary(UnaryResponseClientHandler callback, byte[] payload, WriteFlags writeFlags, MetadataArraySafeHandle metadataArray, CallFlags callFlags) + public void StartUnary(IUnaryResponseClientCallback callback, byte[] payload, WriteFlags writeFlags, MetadataArraySafeHandle metadataArray, CallFlags callFlags) { using (completionQueue.NewScope()) { var ctx = BatchContextSafeHandle.Create(); - completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, (success, context) => callback(success, context.GetReceivedStatusOnClient(), context.GetReceivedMessage(), context.GetReceivedInitialMetadata())); + completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, CompletionHandler_IUnaryResponseClientCallback, callback); Native.grpcsharp_call_start_unary(this, ctx, payload, new UIntPtr((ulong)payload.Length), writeFlags, metadataArray, callFlags) .CheckOk(); } @@ -71,101 +86,101 @@ namespace Grpc.Core.Internal using (completionQueue.NewScope()) { var ctx = BatchContextSafeHandle.Create(); - completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, (success, context) => callback(success, context.GetReceivedStatusOnClient(), context.GetReceivedMessage(), context.GetReceivedInitialMetadata())); + completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, CompletionHandler_IUnaryResponseClientCallback, callback); Native.grpcsharp_call_start_client_streaming(this, ctx, metadataArray, callFlags).CheckOk(); } } - public void StartServerStreaming(ReceivedStatusOnClientHandler callback, byte[] payload, WriteFlags writeFlags, MetadataArraySafeHandle metadataArray, CallFlags callFlags) + public void StartServerStreaming(IReceivedStatusOnClientCallback callback, byte[] payload, WriteFlags writeFlags, MetadataArraySafeHandle metadataArray, CallFlags callFlags) { using (completionQueue.NewScope()) { var ctx = BatchContextSafeHandle.Create(); - completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, (success, context) => callback(success, context.GetReceivedStatusOnClient())); + completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, CompletionHandler_IReceivedStatusOnClientCallback, callback); Native.grpcsharp_call_start_server_streaming(this, ctx, payload, new UIntPtr((ulong)payload.Length), writeFlags, metadataArray, callFlags).CheckOk(); } } - public void StartDuplexStreaming(ReceivedStatusOnClientHandler callback, MetadataArraySafeHandle metadataArray, CallFlags callFlags) + public void StartDuplexStreaming(IReceivedStatusOnClientCallback callback, MetadataArraySafeHandle metadataArray, CallFlags callFlags) { using (completionQueue.NewScope()) { var ctx = BatchContextSafeHandle.Create(); - completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, (success, context) => callback(success, context.GetReceivedStatusOnClient())); + completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, CompletionHandler_IReceivedStatusOnClientCallback, callback); Native.grpcsharp_call_start_duplex_streaming(this, ctx, metadataArray, callFlags).CheckOk(); } } - public void StartSendMessage(SendCompletionHandler callback, byte[] payload, WriteFlags writeFlags, bool sendEmptyInitialMetadata) + public void StartSendMessage(ISendCompletionCallback callback, byte[] payload, WriteFlags writeFlags, bool sendEmptyInitialMetadata) { using (completionQueue.NewScope()) { var ctx = BatchContextSafeHandle.Create(); - completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, (success, context) => callback(success)); + completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, CompletionHandler_ISendCompletionCallback, callback); Native.grpcsharp_call_send_message(this, ctx, payload, new UIntPtr((ulong)payload.Length), writeFlags, sendEmptyInitialMetadata ? 1 : 0).CheckOk(); } } - public void StartSendCloseFromClient(SendCompletionHandler callback) + public void StartSendCloseFromClient(ISendCompletionCallback callback) { using (completionQueue.NewScope()) { var ctx = BatchContextSafeHandle.Create(); - completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, (success, context) => callback(success)); + completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, CompletionHandler_ISendCompletionCallback, callback); Native.grpcsharp_call_send_close_from_client(this, ctx).CheckOk(); } } - public void StartSendStatusFromServer(SendCompletionHandler callback, Status status, MetadataArraySafeHandle metadataArray, bool sendEmptyInitialMetadata, + public void StartSendStatusFromServer(ISendCompletionCallback callback, Status status, MetadataArraySafeHandle metadataArray, bool sendEmptyInitialMetadata, byte[] optionalPayload, WriteFlags writeFlags) { using (completionQueue.NewScope()) { var ctx = BatchContextSafeHandle.Create(); var optionalPayloadLength = optionalPayload != null ? new UIntPtr((ulong)optionalPayload.Length) : UIntPtr.Zero; - completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, (success, context) => callback(success)); + completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, CompletionHandler_ISendCompletionCallback, callback); var statusDetailBytes = MarshalUtils.GetBytesUTF8(status.Detail); Native.grpcsharp_call_send_status_from_server(this, ctx, status.StatusCode, statusDetailBytes, new UIntPtr((ulong)statusDetailBytes.Length), metadataArray, sendEmptyInitialMetadata ? 1 : 0, optionalPayload, optionalPayloadLength, writeFlags).CheckOk(); } } - public void StartReceiveMessage(ReceivedMessageHandler callback) + public void StartReceiveMessage(IReceivedMessageCallback callback) { using (completionQueue.NewScope()) { var ctx = BatchContextSafeHandle.Create(); - completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, (success, context) => callback(success, context.GetReceivedMessage())); + completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, CompletionHandler_IReceivedMessageCallback, callback); Native.grpcsharp_call_recv_message(this, ctx).CheckOk(); } } - public void StartReceiveInitialMetadata(ReceivedResponseHeadersHandler callback) + public void StartReceiveInitialMetadata(IReceivedResponseHeadersCallback callback) { using (completionQueue.NewScope()) { var ctx = BatchContextSafeHandle.Create(); - completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, (success, context) => callback(success, context.GetReceivedInitialMetadata())); + completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, CompletionHandler_IReceivedResponseHeadersCallback, callback); Native.grpcsharp_call_recv_initial_metadata(this, ctx).CheckOk(); } } - public void StartServerSide(ReceivedCloseOnServerHandler callback) + public void StartServerSide(IReceivedCloseOnServerCallback callback) { using (completionQueue.NewScope()) { var ctx = BatchContextSafeHandle.Create(); - completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, (success, context) => callback(success, context.GetReceivedCloseOnServerCancelled())); + completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, CompletionHandler_IReceivedCloseOnServerCallback, callback); Native.grpcsharp_call_start_serverside(this, ctx).CheckOk(); } } - public void StartSendInitialMetadata(SendCompletionHandler callback, MetadataArraySafeHandle metadataArray) + public void StartSendInitialMetadata(ISendCompletionCallback callback, MetadataArraySafeHandle metadataArray) { using (completionQueue.NewScope()) { var ctx = BatchContextSafeHandle.Create(); - completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, (success, context) => callback(success)); + completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, CompletionHandler_ISendCompletionCallback, callback); Native.grpcsharp_call_send_initial_metadata(this, ctx, metadataArray).CheckOk(); } } diff --git a/src/csharp/Grpc.Core/Internal/INativeCall.cs b/src/csharp/Grpc.Core/Internal/INativeCall.cs index f9c06583c8..cedf82a037 100644 --- a/src/csharp/Grpc.Core/Internal/INativeCall.cs +++ b/src/csharp/Grpc.Core/Internal/INativeCall.cs @@ -33,6 +33,37 @@ namespace Grpc.Core.Internal internal delegate void ReceivedCloseOnServerHandler(bool success, bool cancelled); + + internal interface IUnaryResponseClientCallback + { + void OnUnaryResponseClient(bool success, ClientSideStatus receivedStatus, byte[] receivedMessage, Metadata responseHeaders); + } + + internal interface IReceivedStatusOnClientCallback + { + void OnReceivedStatusOnClient(bool success, ClientSideStatus receivedStatus); + } + + internal interface IReceivedMessageCallback + { + void OnReceivedMessage(bool success, byte[] receivedMessage); + } + + internal interface IReceivedResponseHeadersCallback + { + void OnReceivedResponseHeaders(bool success, Metadata responseHeaders); + } + + internal interface ISendCompletionCallback + { + void OnSendCompletion(bool success); + } + + internal interface IReceivedCloseOnServerCallback + { + void OnReceivedCloseOnServerHandler(bool success, bool cancelled); + } + /// /// Abstraction of a native call object. /// -- cgit v1.2.3 From c5638887bfa899c796db911efde5ae770b7dc043 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 20 Nov 2017 16:06:13 +0100 Subject: make everything compile --- .../Internal/AsyncCallServerTest.cs | 28 +++--- .../Grpc.Core.Tests/Internal/AsyncCallTest.cs | 106 ++++++++++----------- .../Grpc.Core.Tests/Internal/FakeNativeCall.cs | 58 +++++------ src/csharp/Grpc.Core/Internal/AsyncCall.cs | 37 +++++-- src/csharp/Grpc.Core/Internal/AsyncCallBase.cs | 20 +++- src/csharp/Grpc.Core/Internal/AsyncCallServer.cs | 22 ++++- src/csharp/Grpc.Core/Internal/CallSafeHandle.cs | 8 +- src/csharp/Grpc.Core/Internal/INativeCall.cs | 27 +++--- .../Grpc.Microbenchmarks/SendMessageBenchmark.cs | 12 ++- 9 files changed, 191 insertions(+), 127 deletions(-) diff --git a/src/csharp/Grpc.Core.Tests/Internal/AsyncCallServerTest.cs b/src/csharp/Grpc.Core.Tests/Internal/AsyncCallServerTest.cs index 9488ce29e9..41d7ee4075 100644 --- a/src/csharp/Grpc.Core.Tests/Internal/AsyncCallServerTest.cs +++ b/src/csharp/Grpc.Core.Tests/Internal/AsyncCallServerTest.cs @@ -64,7 +64,7 @@ namespace Grpc.Core.Internal.Tests public void CancelNotificationAfterStartDisposes() { var finishedTask = asyncCallServer.ServerSideCallAsync(); - fakeCall.ReceivedCloseOnServerHandler(true, cancelled: true); + fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(true, cancelled: true); AssertFinished(asyncCallServer, fakeCall, finishedTask); } @@ -76,8 +76,8 @@ namespace Grpc.Core.Internal.Tests var moveNextTask = requestStream.MoveNext(); - fakeCall.ReceivedCloseOnServerHandler(true, cancelled: true); - fakeCall.ReceivedMessageHandler(true, null); + fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(true, cancelled: true); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(true, null); Assert.IsFalse(moveNextTask.Result); AssertFinished(asyncCallServer, fakeCall, finishedTask); @@ -89,7 +89,7 @@ namespace Grpc.Core.Internal.Tests var finishedTask = asyncCallServer.ServerSideCallAsync(); var requestStream = new ServerRequestStream(asyncCallServer); - fakeCall.ReceivedCloseOnServerHandler(true, cancelled: true); + fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(true, cancelled: true); // Check that starting a read after cancel notification has been processed is legal. var moveNextTask = requestStream.MoveNext(); @@ -107,10 +107,10 @@ namespace Grpc.Core.Internal.Tests // if a read completion's success==false, the request stream will silently finish // and we rely on C core cancelling the call. var moveNextTask = requestStream.MoveNext(); - fakeCall.ReceivedMessageHandler(false, null); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(false, null); Assert.IsFalse(moveNextTask.Result); - fakeCall.ReceivedCloseOnServerHandler(true, cancelled: true); + fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(true, cancelled: true); AssertFinished(asyncCallServer, fakeCall, finishedTask); } @@ -120,7 +120,7 @@ namespace Grpc.Core.Internal.Tests var finishedTask = asyncCallServer.ServerSideCallAsync(); var responseStream = new ServerResponseStream(asyncCallServer); - fakeCall.ReceivedCloseOnServerHandler(true, cancelled: true); + fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(true, cancelled: true); // TODO(jtattermusch): should we throw a different exception type instead? Assert.Throws(typeof(InvalidOperationException), () => responseStream.WriteAsync("request1")); @@ -134,10 +134,10 @@ namespace Grpc.Core.Internal.Tests var responseStream = new ServerResponseStream(asyncCallServer); var writeTask = responseStream.WriteAsync("request1"); - fakeCall.SendCompletionHandler(false); + fakeCall.SendCompletionCallback.OnSendCompletion(false); Assert.ThrowsAsync(typeof(IOException), async () => await writeTask); - fakeCall.ReceivedCloseOnServerHandler(true, cancelled: true); + fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(true, cancelled: true); AssertFinished(asyncCallServer, fakeCall, finishedTask); } @@ -150,13 +150,13 @@ namespace Grpc.Core.Internal.Tests var writeTask = responseStream.WriteAsync("request1"); var writeStatusTask = asyncCallServer.SendStatusFromServerAsync(Status.DefaultSuccess, new Metadata(), null); - fakeCall.SendCompletionHandler(true); - fakeCall.SendStatusFromServerHandler(true); + fakeCall.SendCompletionCallback.OnSendCompletion(true); + fakeCall.SendStatusFromServerCallback.OnSendStatusFromServerCompletion(true); Assert.DoesNotThrowAsync(async () => await writeTask); Assert.DoesNotThrowAsync(async () => await writeStatusTask); - fakeCall.ReceivedCloseOnServerHandler(true, cancelled: true); + fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(true, cancelled: true); AssertFinished(asyncCallServer, fakeCall, finishedTask); } @@ -170,8 +170,8 @@ namespace Grpc.Core.Internal.Tests asyncCallServer.SendStatusFromServerAsync(Status.DefaultSuccess, new Metadata(), null); Assert.ThrowsAsync(typeof(InvalidOperationException), async () => await responseStream.WriteAsync("request1")); - fakeCall.SendStatusFromServerHandler(true); - fakeCall.ReceivedCloseOnServerHandler(true, cancelled: true); + fakeCall.SendStatusFromServerCallback.OnSendStatusFromServerCompletion(true); + fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(true, cancelled: true); AssertFinished(asyncCallServer, fakeCall, finishedTask); } diff --git a/src/csharp/Grpc.Core.Tests/Internal/AsyncCallTest.cs b/src/csharp/Grpc.Core.Tests/Internal/AsyncCallTest.cs index b2b49f3a48..9aab54d2d0 100644 --- a/src/csharp/Grpc.Core.Tests/Internal/AsyncCallTest.cs +++ b/src/csharp/Grpc.Core.Tests/Internal/AsyncCallTest.cs @@ -73,7 +73,7 @@ namespace Grpc.Core.Internal.Tests public void AsyncUnary_Success() { var resultTask = asyncCall.UnaryCallAsync("request1"); - fakeCall.UnaryResponseClientHandler(true, + fakeCall.UnaryResponseClientCallback.OnUnaryResponseClient(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata()), CreateResponsePayload(), new Metadata()); @@ -85,7 +85,7 @@ namespace Grpc.Core.Internal.Tests public void AsyncUnary_NonSuccessStatusCode() { var resultTask = asyncCall.UnaryCallAsync("request1"); - fakeCall.UnaryResponseClientHandler(true, + fakeCall.UnaryResponseClientCallback.OnUnaryResponseClient(true, CreateClientSideStatus(StatusCode.InvalidArgument), null, new Metadata()); @@ -97,7 +97,7 @@ namespace Grpc.Core.Internal.Tests public void AsyncUnary_NullResponsePayload() { var resultTask = asyncCall.UnaryCallAsync("request1"); - fakeCall.UnaryResponseClientHandler(true, + fakeCall.UnaryResponseClientCallback.OnUnaryResponseClient(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata()), null, new Metadata()); @@ -118,7 +118,7 @@ namespace Grpc.Core.Internal.Tests public void ClientStreaming_NoRequest_Success() { var resultTask = asyncCall.ClientStreamingCallAsync(); - fakeCall.UnaryResponseClientHandler(true, + fakeCall.UnaryResponseClientCallback.OnUnaryResponseClient(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata()), CreateResponsePayload(), new Metadata()); @@ -130,7 +130,7 @@ namespace Grpc.Core.Internal.Tests public void ClientStreaming_NoRequest_NonSuccessStatusCode() { var resultTask = asyncCall.ClientStreamingCallAsync(); - fakeCall.UnaryResponseClientHandler(true, + fakeCall.UnaryResponseClientCallback.OnUnaryResponseClient(true, CreateClientSideStatus(StatusCode.InvalidArgument), null, new Metadata()); @@ -145,18 +145,18 @@ namespace Grpc.Core.Internal.Tests var requestStream = new ClientRequestStream(asyncCall); var writeTask = requestStream.WriteAsync("request1"); - fakeCall.SendCompletionHandler(true); + fakeCall.SendCompletionCallback.OnSendCompletion(true); writeTask.Wait(); var writeTask2 = requestStream.WriteAsync("request2"); - fakeCall.SendCompletionHandler(true); + fakeCall.SendCompletionCallback.OnSendCompletion(true); writeTask2.Wait(); var completeTask = requestStream.CompleteAsync(); - fakeCall.SendCompletionHandler(true); + fakeCall.SendCompletionCallback.OnSendCompletion(true); completeTask.Wait(); - fakeCall.UnaryResponseClientHandler(true, + fakeCall.UnaryResponseClientCallback.OnUnaryResponseClient(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata()), CreateResponsePayload(), new Metadata()); @@ -171,12 +171,12 @@ namespace Grpc.Core.Internal.Tests var requestStream = new ClientRequestStream(asyncCall); var writeTask = requestStream.WriteAsync("request1"); - fakeCall.SendCompletionHandler(false); + fakeCall.SendCompletionCallback.OnSendCompletion(false); // The write will wait for call to finish to receive the status code. Assert.IsFalse(writeTask.IsCompleted); - fakeCall.UnaryResponseClientHandler(true, + fakeCall.UnaryResponseClientCallback.OnUnaryResponseClient(true, CreateClientSideStatus(StatusCode.Internal), null, new Metadata()); @@ -195,12 +195,12 @@ namespace Grpc.Core.Internal.Tests var writeTask = requestStream.WriteAsync("request1"); - fakeCall.UnaryResponseClientHandler(true, + fakeCall.UnaryResponseClientCallback.OnUnaryResponseClient(true, CreateClientSideStatus(StatusCode.Internal), null, new Metadata()); - fakeCall.SendCompletionHandler(false); + fakeCall.SendCompletionCallback.OnSendCompletion(false); var ex = Assert.ThrowsAsync(async () => await writeTask); Assert.AreEqual(StatusCode.Internal, ex.Status.StatusCode); @@ -215,13 +215,13 @@ namespace Grpc.Core.Internal.Tests var requestStream = new ClientRequestStream(asyncCall); var writeTask = requestStream.WriteAsync("request1"); - fakeCall.SendCompletionHandler(false); + fakeCall.SendCompletionCallback.OnSendCompletion(false); // Until the delayed write completion has been triggered, // we still act as if there was an active write. Assert.Throws(typeof(InvalidOperationException), () => requestStream.WriteAsync("request2")); - fakeCall.UnaryResponseClientHandler(true, + fakeCall.UnaryResponseClientCallback.OnUnaryResponseClient(true, CreateClientSideStatus(StatusCode.Internal), null, new Metadata()); @@ -242,7 +242,7 @@ namespace Grpc.Core.Internal.Tests var resultTask = asyncCall.ClientStreamingCallAsync(); var requestStream = new ClientRequestStream(asyncCall); - fakeCall.UnaryResponseClientHandler(true, + fakeCall.UnaryResponseClientCallback.OnUnaryResponseClient(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata()), CreateResponsePayload(), new Metadata()); @@ -260,7 +260,7 @@ namespace Grpc.Core.Internal.Tests var resultTask = asyncCall.ClientStreamingCallAsync(); var requestStream = new ClientRequestStream(asyncCall); - fakeCall.UnaryResponseClientHandler(true, + fakeCall.UnaryResponseClientCallback.OnUnaryResponseClient(true, new ClientSideStatus(new Status(StatusCode.OutOfRange, ""), new Metadata()), CreateResponsePayload(), new Metadata()); @@ -282,9 +282,9 @@ namespace Grpc.Core.Internal.Tests Assert.Throws(typeof(InvalidOperationException), () => requestStream.WriteAsync("request1")); - fakeCall.SendCompletionHandler(true); + fakeCall.SendCompletionCallback.OnSendCompletion(true); - fakeCall.UnaryResponseClientHandler(true, + fakeCall.UnaryResponseClientCallback.OnUnaryResponseClient(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata()), CreateResponsePayload(), new Metadata()); @@ -298,7 +298,7 @@ namespace Grpc.Core.Internal.Tests var resultTask = asyncCall.ClientStreamingCallAsync(); var requestStream = new ClientRequestStream(asyncCall); - fakeCall.UnaryResponseClientHandler(true, + fakeCall.UnaryResponseClientCallback.OnUnaryResponseClient(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata()), CreateResponsePayload(), new Metadata()); @@ -319,7 +319,7 @@ namespace Grpc.Core.Internal.Tests var writeTask = requestStream.WriteAsync("request1"); Assert.ThrowsAsync(typeof(TaskCanceledException), async () => await writeTask); - fakeCall.UnaryResponseClientHandler(true, + fakeCall.UnaryResponseClientCallback.OnUnaryResponseClient(true, CreateClientSideStatus(StatusCode.Cancelled), null, new Metadata()); @@ -342,11 +342,11 @@ namespace Grpc.Core.Internal.Tests var responseStream = new ClientResponseStream(asyncCall); var readTask = responseStream.MoveNext(); - fakeCall.ReceivedResponseHeadersHandler(true, new Metadata()); + fakeCall.ReceivedResponseHeadersCallback.OnReceivedResponseHeaders(true, new Metadata()); Assert.AreEqual(0, asyncCall.ResponseHeadersAsync.Result.Count); - fakeCall.ReceivedMessageHandler(true, null); - fakeCall.ReceivedStatusOnClientHandler(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata())); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(true, null); + fakeCall.ReceivedStatusOnClientCallback.OnReceivedStatusOnClient(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata())); AssertStreamingResponseSuccess(asyncCall, fakeCall, readTask); } @@ -359,8 +359,8 @@ namespace Grpc.Core.Internal.Tests var readTask = responseStream.MoveNext(); // try alternative order of completions - fakeCall.ReceivedStatusOnClientHandler(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata())); - fakeCall.ReceivedMessageHandler(true, null); + fakeCall.ReceivedStatusOnClientCallback.OnReceivedStatusOnClient(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata())); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(true, null); AssertStreamingResponseSuccess(asyncCall, fakeCall, readTask); } @@ -372,8 +372,8 @@ namespace Grpc.Core.Internal.Tests var responseStream = new ClientResponseStream(asyncCall); var readTask = responseStream.MoveNext(); - fakeCall.ReceivedMessageHandler(false, null); // after a failed read, we rely on C core to deliver appropriate status code. - fakeCall.ReceivedStatusOnClientHandler(true, CreateClientSideStatus(StatusCode.Internal)); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(false, null); // after a failed read, we rely on C core to deliver appropriate status code. + fakeCall.ReceivedStatusOnClientCallback.OnReceivedStatusOnClient(true, CreateClientSideStatus(StatusCode.Internal)); AssertStreamingResponseError(asyncCall, fakeCall, readTask, StatusCode.Internal); } @@ -385,18 +385,18 @@ namespace Grpc.Core.Internal.Tests var responseStream = new ClientResponseStream(asyncCall); var readTask1 = responseStream.MoveNext(); - fakeCall.ReceivedMessageHandler(true, CreateResponsePayload()); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(true, CreateResponsePayload()); Assert.IsTrue(readTask1.Result); Assert.AreEqual("response1", responseStream.Current); var readTask2 = responseStream.MoveNext(); - fakeCall.ReceivedMessageHandler(true, CreateResponsePayload()); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(true, CreateResponsePayload()); Assert.IsTrue(readTask2.Result); Assert.AreEqual("response1", responseStream.Current); var readTask3 = responseStream.MoveNext(); - fakeCall.ReceivedStatusOnClientHandler(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata())); - fakeCall.ReceivedMessageHandler(true, null); + fakeCall.ReceivedStatusOnClientCallback.OnReceivedStatusOnClient(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata())); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(true, null); AssertStreamingResponseSuccess(asyncCall, fakeCall, readTask3); } @@ -409,12 +409,12 @@ namespace Grpc.Core.Internal.Tests var responseStream = new ClientResponseStream(asyncCall); var writeTask1 = requestStream.CompleteAsync(); - fakeCall.SendCompletionHandler(true); + fakeCall.SendCompletionCallback.OnSendCompletion(true); Assert.DoesNotThrowAsync(async () => await writeTask1); var readTask = responseStream.MoveNext(); - fakeCall.ReceivedMessageHandler(true, null); - fakeCall.ReceivedStatusOnClientHandler(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata())); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(true, null); + fakeCall.ReceivedStatusOnClientCallback.OnReceivedStatusOnClient(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata())); AssertStreamingResponseSuccess(asyncCall, fakeCall, readTask); } @@ -427,8 +427,8 @@ namespace Grpc.Core.Internal.Tests var responseStream = new ClientResponseStream(asyncCall); var readTask = responseStream.MoveNext(); - fakeCall.ReceivedMessageHandler(true, null); - fakeCall.ReceivedStatusOnClientHandler(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata())); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(true, null); + fakeCall.ReceivedStatusOnClientCallback.OnReceivedStatusOnClient(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata())); AssertStreamingResponseSuccess(asyncCall, fakeCall, readTask); @@ -445,8 +445,8 @@ namespace Grpc.Core.Internal.Tests var responseStream = new ClientResponseStream(asyncCall); var readTask = responseStream.MoveNext(); - fakeCall.ReceivedMessageHandler(true, null); - fakeCall.ReceivedStatusOnClientHandler(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata())); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(true, null); + fakeCall.ReceivedStatusOnClientCallback.OnReceivedStatusOnClient(true, new ClientSideStatus(Status.DefaultSuccess, new Metadata())); AssertStreamingResponseSuccess(asyncCall, fakeCall, readTask); @@ -461,14 +461,14 @@ namespace Grpc.Core.Internal.Tests var responseStream = new ClientResponseStream(asyncCall); var writeTask = requestStream.WriteAsync("request1"); - fakeCall.SendCompletionHandler(false); + fakeCall.SendCompletionCallback.OnSendCompletion(false); // The write will wait for call to finish to receive the status code. Assert.IsFalse(writeTask.IsCompleted); var readTask = responseStream.MoveNext(); - fakeCall.ReceivedMessageHandler(true, null); - fakeCall.ReceivedStatusOnClientHandler(true, CreateClientSideStatus(StatusCode.PermissionDenied)); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(true, null); + fakeCall.ReceivedStatusOnClientCallback.OnReceivedStatusOnClient(true, CreateClientSideStatus(StatusCode.PermissionDenied)); var ex = Assert.ThrowsAsync(async () => await writeTask); Assert.AreEqual(StatusCode.PermissionDenied, ex.Status.StatusCode); @@ -486,9 +486,9 @@ namespace Grpc.Core.Internal.Tests var writeTask = requestStream.WriteAsync("request1"); var readTask = responseStream.MoveNext(); - fakeCall.ReceivedMessageHandler(true, null); - fakeCall.ReceivedStatusOnClientHandler(true, CreateClientSideStatus(StatusCode.PermissionDenied)); - fakeCall.SendCompletionHandler(false); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(true, null); + fakeCall.ReceivedStatusOnClientCallback.OnReceivedStatusOnClient(true, CreateClientSideStatus(StatusCode.PermissionDenied)); + fakeCall.SendCompletionCallback.OnSendCompletion(false); var ex = Assert.ThrowsAsync(async () => await writeTask); Assert.AreEqual(StatusCode.PermissionDenied, ex.Status.StatusCode); @@ -510,8 +510,8 @@ namespace Grpc.Core.Internal.Tests Assert.ThrowsAsync(typeof(TaskCanceledException), async () => await writeTask); var readTask = responseStream.MoveNext(); - fakeCall.ReceivedMessageHandler(true, null); - fakeCall.ReceivedStatusOnClientHandler(true, CreateClientSideStatus(StatusCode.Cancelled)); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(true, null); + fakeCall.ReceivedStatusOnClientCallback.OnReceivedStatusOnClient(true, CreateClientSideStatus(StatusCode.Cancelled)); AssertStreamingResponseError(asyncCall, fakeCall, readTask, StatusCode.Cancelled); } @@ -526,13 +526,13 @@ namespace Grpc.Core.Internal.Tests Assert.IsTrue(fakeCall.IsCancelled); var readTask1 = responseStream.MoveNext(); - fakeCall.ReceivedMessageHandler(true, CreateResponsePayload()); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(true, CreateResponsePayload()); Assert.IsTrue(readTask1.Result); Assert.AreEqual("response1", responseStream.Current); var readTask2 = responseStream.MoveNext(); - fakeCall.ReceivedMessageHandler(true, null); - fakeCall.ReceivedStatusOnClientHandler(true, CreateClientSideStatus(StatusCode.Cancelled)); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(true, null); + fakeCall.ReceivedStatusOnClientCallback.OnReceivedStatusOnClient(true, CreateClientSideStatus(StatusCode.Cancelled)); AssertStreamingResponseError(asyncCall, fakeCall, readTask2, StatusCode.Cancelled); } @@ -547,13 +547,13 @@ namespace Grpc.Core.Internal.Tests asyncCall.Cancel(); Assert.IsTrue(fakeCall.IsCancelled); - fakeCall.ReceivedMessageHandler(true, CreateResponsePayload()); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(true, CreateResponsePayload()); Assert.IsTrue(readTask1.Result); Assert.AreEqual("response1", responseStream.Current); var readTask2 = responseStream.MoveNext(); - fakeCall.ReceivedMessageHandler(true, null); - fakeCall.ReceivedStatusOnClientHandler(true, CreateClientSideStatus(StatusCode.Cancelled)); + fakeCall.ReceivedMessageCallback.OnReceivedMessage(true, null); + fakeCall.ReceivedStatusOnClientCallback.OnReceivedStatusOnClient(true, CreateClientSideStatus(StatusCode.Cancelled)); AssertStreamingResponseError(asyncCall, fakeCall, readTask2, StatusCode.Cancelled); } diff --git a/src/csharp/Grpc.Core.Tests/Internal/FakeNativeCall.cs b/src/csharp/Grpc.Core.Tests/Internal/FakeNativeCall.cs index c3a27167f9..581ac3384b 100644 --- a/src/csharp/Grpc.Core.Tests/Internal/FakeNativeCall.cs +++ b/src/csharp/Grpc.Core.Tests/Internal/FakeNativeCall.cs @@ -31,43 +31,43 @@ namespace Grpc.Core.Internal.Tests /// internal class FakeNativeCall : INativeCall { - public UnaryResponseClientHandler UnaryResponseClientHandler + public IUnaryResponseClientCallback UnaryResponseClientCallback { get; set; } - public ReceivedStatusOnClientHandler ReceivedStatusOnClientHandler + public IReceivedStatusOnClientCallback ReceivedStatusOnClientCallback { get; set; } - public ReceivedMessageHandler ReceivedMessageHandler + public IReceivedMessageCallback ReceivedMessageCallback { get; set; } - public ReceivedResponseHeadersHandler ReceivedResponseHeadersHandler + public IReceivedResponseHeadersCallback ReceivedResponseHeadersCallback { get; set; } - public SendCompletionHandler SendCompletionHandler + public ISendCompletionCallback SendCompletionCallback { get; set; } - public SendCompletionHandler SendStatusFromServerHandler + public ISendStatusFromServerCompletionCallback SendStatusFromServerCallback { get; set; } - public ReceivedCloseOnServerHandler ReceivedCloseOnServerHandler + public IReceivedCloseOnServerCallback ReceivedCloseOnServerCallback { get; set; @@ -100,9 +100,9 @@ namespace Grpc.Core.Internal.Tests return "PEER"; } - public void StartUnary(UnaryResponseClientHandler callback, byte[] payload, WriteFlags writeFlags, MetadataArraySafeHandle metadataArray, CallFlags callFlags) + public void StartUnary(IUnaryResponseClientCallback callback, byte[] payload, WriteFlags writeFlags, MetadataArraySafeHandle metadataArray, CallFlags callFlags) { - UnaryResponseClientHandler = callback; + UnaryResponseClientCallback = callback; } public void StartUnary(BatchContextSafeHandle ctx, byte[] payload, WriteFlags writeFlags, MetadataArraySafeHandle metadataArray, CallFlags callFlags) @@ -110,55 +110,55 @@ namespace Grpc.Core.Internal.Tests throw new NotImplementedException(); } - public void StartClientStreaming(UnaryResponseClientHandler callback, MetadataArraySafeHandle metadataArray, CallFlags callFlags) + public void StartClientStreaming(IUnaryResponseClientCallback callback, MetadataArraySafeHandle metadataArray, CallFlags callFlags) { - UnaryResponseClientHandler = callback; + UnaryResponseClientCallback = callback; } - public void StartServerStreaming(ReceivedStatusOnClientHandler callback, byte[] payload, WriteFlags writeFlags, MetadataArraySafeHandle metadataArray, CallFlags callFlags) + public void StartServerStreaming(IReceivedStatusOnClientCallback callback, byte[] payload, WriteFlags writeFlags, MetadataArraySafeHandle metadataArray, CallFlags callFlags) { - ReceivedStatusOnClientHandler = callback; + ReceivedStatusOnClientCallback = callback; } - public void StartDuplexStreaming(ReceivedStatusOnClientHandler callback, MetadataArraySafeHandle metadataArray, CallFlags callFlags) + public void StartDuplexStreaming(IReceivedStatusOnClientCallback callback, MetadataArraySafeHandle metadataArray, CallFlags callFlags) { - ReceivedStatusOnClientHandler = callback; + ReceivedStatusOnClientCallback = callback; } - public void StartReceiveMessage(ReceivedMessageHandler callback) + public void StartReceiveMessage(IReceivedMessageCallback callback) { - ReceivedMessageHandler = callback; + ReceivedMessageCallback = callback; } - public void StartReceiveInitialMetadata(ReceivedResponseHeadersHandler callback) + public void StartReceiveInitialMetadata(IReceivedResponseHeadersCallback callback) { - ReceivedResponseHeadersHandler = callback; + ReceivedResponseHeadersCallback = callback; } - public void StartSendInitialMetadata(SendCompletionHandler callback, MetadataArraySafeHandle metadataArray) + public void StartSendInitialMetadata(ISendCompletionCallback callback, MetadataArraySafeHandle metadataArray) { - SendCompletionHandler = callback; + SendCompletionCallback = callback; } - public void StartSendMessage(SendCompletionHandler callback, byte[] payload, WriteFlags writeFlags, bool sendEmptyInitialMetadata) + public void StartSendMessage(ISendCompletionCallback callback, byte[] payload, WriteFlags writeFlags, bool sendEmptyInitialMetadata) { - SendCompletionHandler = callback; + SendCompletionCallback = callback; } - public void StartSendCloseFromClient(SendCompletionHandler callback) + public void StartSendCloseFromClient(ISendCompletionCallback callback) { - SendCompletionHandler = callback; + SendCompletionCallback = callback; } - public void StartSendStatusFromServer(SendCompletionHandler callback, Status status, MetadataArraySafeHandle metadataArray, bool sendEmptyInitialMetadata, + public void StartSendStatusFromServer(ISendStatusFromServerCompletionCallback callback, Status status, MetadataArraySafeHandle metadataArray, bool sendEmptyInitialMetadata, byte[] optionalPayload, WriteFlags writeFlags) { - SendStatusFromServerHandler = callback; + SendStatusFromServerCallback = callback; } - public void StartServerSide(ReceivedCloseOnServerHandler callback) + public void StartServerSide(IReceivedCloseOnServerCallback callback) { - ReceivedCloseOnServerHandler = callback; + ReceivedCloseOnServerCallback = callback; } public void Dispose() diff --git a/src/csharp/Grpc.Core/Internal/AsyncCall.cs b/src/csharp/Grpc.Core/Internal/AsyncCall.cs index 09fb722c81..aa2161267a 100644 --- a/src/csharp/Grpc.Core/Internal/AsyncCall.cs +++ b/src/csharp/Grpc.Core/Internal/AsyncCall.cs @@ -27,7 +27,7 @@ namespace Grpc.Core.Internal /// /// Manages client side native call lifecycle. /// - internal class AsyncCall : AsyncCallBase + internal class AsyncCall : AsyncCallBase, IUnaryResponseClientCallback, IReceivedStatusOnClientCallback, IReceivedResponseHeadersCallback { static readonly ILogger Logger = GrpcEnvironment.Logger.ForType>(); @@ -138,7 +138,7 @@ namespace Grpc.Core.Internal unaryResponseTcs = new TaskCompletionSource(); using (var metadataArray = MetadataArraySafeHandle.Create(details.Options.Headers)) { - call.StartUnary(HandleUnaryResponse, payload, GetWriteFlagsForCall(), metadataArray, details.Options.Flags); + call.StartUnary(UnaryResponseClientCallback, payload, GetWriteFlagsForCall(), metadataArray, details.Options.Flags); } return unaryResponseTcs.Task; } @@ -162,7 +162,7 @@ namespace Grpc.Core.Internal unaryResponseTcs = new TaskCompletionSource(); using (var metadataArray = MetadataArraySafeHandle.Create(details.Options.Headers)) { - call.StartClientStreaming(HandleUnaryResponse, metadataArray, details.Options.Flags); + call.StartClientStreaming(UnaryResponseClientCallback, metadataArray, details.Options.Flags); } return unaryResponseTcs.Task; @@ -188,9 +188,9 @@ namespace Grpc.Core.Internal streamingResponseCallFinishedTcs = new TaskCompletionSource(); using (var metadataArray = MetadataArraySafeHandle.Create(details.Options.Headers)) { - call.StartServerStreaming(HandleFinished, payload, GetWriteFlagsForCall(), metadataArray, details.Options.Flags); + call.StartServerStreaming(ReceivedStatusOnClientCallback, payload, GetWriteFlagsForCall(), metadataArray, details.Options.Flags); } - call.StartReceiveInitialMetadata(HandleReceivedResponseHeaders); + call.StartReceiveInitialMetadata(ReceivedResponseHeadersCallback); } } @@ -210,9 +210,9 @@ namespace Grpc.Core.Internal streamingResponseCallFinishedTcs = new TaskCompletionSource(); using (var metadataArray = MetadataArraySafeHandle.Create(details.Options.Headers)) { - call.StartDuplexStreaming(HandleFinished, metadataArray, details.Options.Flags); + call.StartDuplexStreaming(ReceivedStatusOnClientCallback, metadataArray, details.Options.Flags); } - call.StartReceiveInitialMetadata(HandleReceivedResponseHeaders); + call.StartReceiveInitialMetadata(ReceivedResponseHeadersCallback); } } @@ -256,7 +256,7 @@ namespace Grpc.Core.Internal halfcloseRequested = true; return TaskUtils.CompletedTask; } - call.StartSendCloseFromClient(HandleSendFinished); + call.StartSendCloseFromClient(SendCompletionCallback); halfcloseRequested = true; streamingWriteTcs = new TaskCompletionSource(); @@ -516,5 +516,26 @@ namespace Grpc.Core.Internal streamingResponseCallFinishedTcs.SetResult(null); } + + IUnaryResponseClientCallback UnaryResponseClientCallback => this; + + void IUnaryResponseClientCallback.OnUnaryResponseClient(bool success, ClientSideStatus receivedStatus, byte[] receivedMessage, Metadata responseHeaders) + { + HandleUnaryResponse(success, receivedStatus, receivedMessage, responseHeaders); + } + + IReceivedStatusOnClientCallback ReceivedStatusOnClientCallback => this; + + void IReceivedStatusOnClientCallback.OnReceivedStatusOnClient(bool success, ClientSideStatus receivedStatus) + { + HandleFinished(success, receivedStatus); + } + + IReceivedResponseHeadersCallback ReceivedResponseHeadersCallback => this; + + void IReceivedResponseHeadersCallback.OnReceivedResponseHeaders(bool success, Metadata responseHeaders) + { + HandleReceivedResponseHeaders(success, responseHeaders); + } } } diff --git a/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs b/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs index f379c85e00..3273c26b88 100644 --- a/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs +++ b/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs @@ -35,7 +35,7 @@ namespace Grpc.Core.Internal /// Base for handling both client side and server side calls. /// Manages native call lifecycle and provides convenience methods. /// - internal abstract class AsyncCallBase + internal abstract class AsyncCallBase : IReceivedMessageCallback, ISendCompletionCallback { static readonly ILogger Logger = GrpcEnvironment.Logger.ForType>(); protected static readonly Status DeserializeResponseFailureStatus = new Status(StatusCode.Internal, "Failed to deserialize response message."); @@ -126,7 +126,7 @@ namespace Grpc.Core.Internal return earlyResult; } - call.StartSendMessage(HandleSendFinished, payload, writeFlags, !initialMetadataSent); + call.StartSendMessage(SendCompletionCallback, payload, writeFlags, !initialMetadataSent); initialMetadataSent = true; streamingWritesCounter++; @@ -154,7 +154,7 @@ namespace Grpc.Core.Internal GrpcPreconditions.CheckState(streamingReadTcs == null, "Only one read can be pending at a time"); GrpcPreconditions.CheckState(!disposed); - call.StartReceiveMessage(HandleReadFinished); + call.StartReceiveMessage(ReceivedMessageCallback); streamingReadTcs = new TaskCompletionSource(); return streamingReadTcs.Task; } @@ -342,5 +342,19 @@ namespace Grpc.Core.Internal } origTcs.SetResult(msg); } + + protected ISendCompletionCallback SendCompletionCallback => this; + + void ISendCompletionCallback.OnSendCompletion(bool success) + { + HandleSendFinished(success); + } + + IReceivedMessageCallback ReceivedMessageCallback => this; + + void IReceivedMessageCallback.OnReceivedMessage(bool success, byte[] receivedMessage) + { + HandleReadFinished(success, receivedMessage); + } } } diff --git a/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs b/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs index 271a6ffadf..4f44514974 100644 --- a/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs +++ b/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs @@ -31,7 +31,7 @@ namespace Grpc.Core.Internal /// /// Manages server side native call lifecycle. /// - internal class AsyncCallServer : AsyncCallBase + internal class AsyncCallServer : AsyncCallBase, IReceivedCloseOnServerCallback, ISendStatusFromServerCompletionCallback { readonly TaskCompletionSource finishedServersideTcs = new TaskCompletionSource(); readonly CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); @@ -70,7 +70,7 @@ namespace Grpc.Core.Internal started = true; - call.StartServerSide(HandleFinishedServerside); + call.StartServerSide(ReceiveCloseOnServerCallback); return finishedServersideTcs.Task; } } @@ -114,7 +114,7 @@ namespace Grpc.Core.Internal using (var metadataArray = MetadataArraySafeHandle.Create(headers)) { - call.StartSendInitialMetadata(HandleSendFinished, metadataArray); + call.StartSendInitialMetadata(SendCompletionCallback, metadataArray); } this.initialMetadataSent = true; @@ -140,7 +140,7 @@ namespace Grpc.Core.Internal using (var metadataArray = MetadataArraySafeHandle.Create(trailers)) { - call.StartSendStatusFromServer(HandleSendStatusFromServerFinished, status, metadataArray, !initialMetadataSent, + call.StartSendStatusFromServer(SendStatusFromServerCompletionCallback, status, metadataArray, !initialMetadataSent, payload, writeFlags); } halfcloseRequested = true; @@ -227,5 +227,19 @@ namespace Grpc.Core.Internal finishedServersideTcs.SetResult(null); } + + IReceivedCloseOnServerCallback ReceiveCloseOnServerCallback => this; + + void IReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(bool success, bool cancelled) + { + HandleFinishedServerside(success, cancelled); + } + + ISendStatusFromServerCompletionCallback SendStatusFromServerCompletionCallback => this; + + void ISendStatusFromServerCompletionCallback.OnSendStatusFromServerCompletion(bool success) + { + HandleSendStatusFromServerFinished(success); + } } } diff --git a/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs b/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs index 589f6cbe16..7316bc2787 100644 --- a/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs @@ -44,6 +44,8 @@ namespace Grpc.Core.Internal (success, context, state) => ((IReceivedResponseHeadersCallback)state).OnReceivedResponseHeaders(success, context.GetReceivedInitialMetadata()); static readonly BatchCompletionDelegate CompletionHandler_ISendCompletionCallback = (success, context, state) => ((ISendCompletionCallback)state).OnSendCompletion(success); + static readonly BatchCompletionDelegate CompletionHandler_ISendStatusFromServerCompletionCallback = + (success, context, state) => ((ISendStatusFromServerCompletionCallback)state).OnSendStatusFromServerCompletion(success); static readonly BatchCompletionDelegate CompletionHandler_IReceivedCloseOnServerCallback = (success, context, state) => ((IReceivedCloseOnServerCallback)state).OnReceivedCloseOnServerHandler(success, context.GetReceivedCloseOnServerCancelled()); @@ -81,7 +83,7 @@ namespace Grpc.Core.Internal .CheckOk(); } - public void StartClientStreaming(UnaryResponseClientHandler callback, MetadataArraySafeHandle metadataArray, CallFlags callFlags) + public void StartClientStreaming(IUnaryResponseClientCallback callback, MetadataArraySafeHandle metadataArray, CallFlags callFlags) { using (completionQueue.NewScope()) { @@ -131,14 +133,14 @@ namespace Grpc.Core.Internal } } - public void StartSendStatusFromServer(ISendCompletionCallback callback, Status status, MetadataArraySafeHandle metadataArray, bool sendEmptyInitialMetadata, + public void StartSendStatusFromServer(ISendStatusFromServerCompletionCallback callback, Status status, MetadataArraySafeHandle metadataArray, bool sendEmptyInitialMetadata, byte[] optionalPayload, WriteFlags writeFlags) { using (completionQueue.NewScope()) { var ctx = BatchContextSafeHandle.Create(); var optionalPayloadLength = optionalPayload != null ? new UIntPtr((ulong)optionalPayload.Length) : UIntPtr.Zero; - completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, CompletionHandler_ISendCompletionCallback, callback); + completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, CompletionHandler_ISendStatusFromServerCompletionCallback, callback); var statusDetailBytes = MarshalUtils.GetBytesUTF8(status.Detail); Native.grpcsharp_call_send_status_from_server(this, ctx, status.StatusCode, statusDetailBytes, new UIntPtr((ulong)statusDetailBytes.Length), metadataArray, sendEmptyInitialMetadata ? 1 : 0, optionalPayload, optionalPayloadLength, writeFlags).CheckOk(); diff --git a/src/csharp/Grpc.Core/Internal/INativeCall.cs b/src/csharp/Grpc.Core/Internal/INativeCall.cs index cedf82a037..3474ad6208 100644 --- a/src/csharp/Grpc.Core/Internal/INativeCall.cs +++ b/src/csharp/Grpc.Core/Internal/INativeCall.cs @@ -59,6 +59,11 @@ namespace Grpc.Core.Internal void OnSendCompletion(bool success); } + internal interface ISendStatusFromServerCompletionCallback + { + void OnSendStatusFromServerCompletion(bool success); + } + internal interface IReceivedCloseOnServerCallback { void OnReceivedCloseOnServerHandler(bool success, bool cancelled); @@ -75,28 +80,28 @@ namespace Grpc.Core.Internal string GetPeer(); - void StartUnary(UnaryResponseClientHandler callback, byte[] payload, WriteFlags writeFlags, MetadataArraySafeHandle metadataArray, CallFlags callFlags); + void StartUnary(IUnaryResponseClientCallback callback, byte[] payload, WriteFlags writeFlags, MetadataArraySafeHandle metadataArray, CallFlags callFlags); void StartUnary(BatchContextSafeHandle ctx, byte[] payload, WriteFlags writeFlags, MetadataArraySafeHandle metadataArray, CallFlags callFlags); - void StartClientStreaming(UnaryResponseClientHandler callback, MetadataArraySafeHandle metadataArray, CallFlags callFlags); + void StartClientStreaming(IUnaryResponseClientCallback callback, MetadataArraySafeHandle metadataArray, CallFlags callFlags); - void StartServerStreaming(ReceivedStatusOnClientHandler callback, byte[] payload, WriteFlags writeFlags, MetadataArraySafeHandle metadataArray, CallFlags callFlags); + void StartServerStreaming(IReceivedStatusOnClientCallback callback, byte[] payload, WriteFlags writeFlags, MetadataArraySafeHandle metadataArray, CallFlags callFlags); - void StartDuplexStreaming(ReceivedStatusOnClientHandler callback, MetadataArraySafeHandle metadataArray, CallFlags callFlags); + void StartDuplexStreaming(IReceivedStatusOnClientCallback callback, MetadataArraySafeHandle metadataArray, CallFlags callFlags); - void StartReceiveMessage(ReceivedMessageHandler callback); + void StartReceiveMessage(IReceivedMessageCallback callback); - void StartReceiveInitialMetadata(ReceivedResponseHeadersHandler callback); + void StartReceiveInitialMetadata(IReceivedResponseHeadersCallback callback); - void StartSendInitialMetadata(SendCompletionHandler callback, MetadataArraySafeHandle metadataArray); + void StartSendInitialMetadata(ISendCompletionCallback callback, MetadataArraySafeHandle metadataArray); - void StartSendMessage(SendCompletionHandler callback, byte[] payload, WriteFlags writeFlags, bool sendEmptyInitialMetadata); + void StartSendMessage(ISendCompletionCallback callback, byte[] payload, WriteFlags writeFlags, bool sendEmptyInitialMetadata); - void StartSendCloseFromClient(SendCompletionHandler callback); + void StartSendCloseFromClient(ISendCompletionCallback callback); - void StartSendStatusFromServer(SendCompletionHandler callback, Status status, MetadataArraySafeHandle metadataArray, bool sendEmptyInitialMetadata, byte[] optionalPayload, WriteFlags writeFlags); + void StartSendStatusFromServer(ISendStatusFromServerCompletionCallback callback, Status status, MetadataArraySafeHandle metadataArray, bool sendEmptyInitialMetadata, byte[] optionalPayload, WriteFlags writeFlags); - void StartServerSide(ReceivedCloseOnServerHandler callback); + void StartServerSide(IReceivedCloseOnServerCallback callback); } } diff --git a/src/csharp/Grpc.Microbenchmarks/SendMessageBenchmark.cs b/src/csharp/Grpc.Microbenchmarks/SendMessageBenchmark.cs index 6a8a29d770..9cff97eb88 100644 --- a/src/csharp/Grpc.Microbenchmarks/SendMessageBenchmark.cs +++ b/src/csharp/Grpc.Microbenchmarks/SendMessageBenchmark.cs @@ -59,14 +59,14 @@ namespace Grpc.Microbenchmarks var cq = CompletionQueueSafeHandle.CreateAsync(completionRegistry); var call = CreateFakeCall(cq); - var sendCompletionHandler = new SendCompletionHandler((success) => { }); + var sendCompletionCallback = new NopSendCompletionCallback(); var payload = new byte[payloadSize]; var writeFlags = default(WriteFlags); var stopwatch = Stopwatch.StartNew(); for (int i = 0; i < iterations; i++) { - call.StartSendMessage(sendCompletionHandler, payload, writeFlags, false); + call.StartSendMessage(sendCompletionCallback, payload, writeFlags, false); var callback = completionRegistry.Extract(completionRegistry.LastRegisteredKey); callback.OnComplete(true); } @@ -87,5 +87,13 @@ namespace Grpc.Microbenchmarks } return call; } + + private class NopSendCompletionCallback : ISendCompletionCallback + { + public void OnSendCompletion(bool success) + { + // NOP + } + } } } -- cgit v1.2.3 From 2622fdc07d5a82bd71c08f836b54237984000a88 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 20 Nov 2017 16:38:05 +0100 Subject: remove legacy delegates --- src/csharp/Grpc.Core/Internal/INativeCall.cs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/csharp/Grpc.Core/Internal/INativeCall.cs b/src/csharp/Grpc.Core/Internal/INativeCall.cs index 3474ad6208..717c9460ab 100644 --- a/src/csharp/Grpc.Core/Internal/INativeCall.cs +++ b/src/csharp/Grpc.Core/Internal/INativeCall.cs @@ -20,25 +20,12 @@ using Grpc.Core; namespace Grpc.Core.Internal { - internal delegate void UnaryResponseClientHandler(bool success, ClientSideStatus receivedStatus, byte[] receivedMessage, Metadata responseHeaders); - - // Received status for streaming response calls. - internal delegate void ReceivedStatusOnClientHandler(bool success, ClientSideStatus receivedStatus); - - internal delegate void ReceivedMessageHandler(bool success, byte[] receivedMessage); - - internal delegate void ReceivedResponseHeadersHandler(bool success, Metadata responseHeaders); - - internal delegate void SendCompletionHandler(bool success); - - internal delegate void ReceivedCloseOnServerHandler(bool success, bool cancelled); - - internal interface IUnaryResponseClientCallback { void OnUnaryResponseClient(bool success, ClientSideStatus receivedStatus, byte[] receivedMessage, Metadata responseHeaders); } + // Received status for streaming response calls. internal interface IReceivedStatusOnClientCallback { void OnReceivedStatusOnClient(bool success, ClientSideStatus receivedStatus); -- cgit v1.2.3 From 85807230fb6c9cb6c65d3976e97ac0720323678d Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 21 Nov 2017 11:48:29 +0100 Subject: consistent naming for OnReceivedCloseOnServer --- .../Grpc.Core.Tests/Internal/AsyncCallServerTest.cs | 16 ++++++++-------- src/csharp/Grpc.Core/Internal/AsyncCallServer.cs | 2 +- src/csharp/Grpc.Core/Internal/CallSafeHandle.cs | 2 +- src/csharp/Grpc.Core/Internal/INativeCall.cs | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/csharp/Grpc.Core.Tests/Internal/AsyncCallServerTest.cs b/src/csharp/Grpc.Core.Tests/Internal/AsyncCallServerTest.cs index 41d7ee4075..e7d8939978 100644 --- a/src/csharp/Grpc.Core.Tests/Internal/AsyncCallServerTest.cs +++ b/src/csharp/Grpc.Core.Tests/Internal/AsyncCallServerTest.cs @@ -64,7 +64,7 @@ namespace Grpc.Core.Internal.Tests public void CancelNotificationAfterStartDisposes() { var finishedTask = asyncCallServer.ServerSideCallAsync(); - fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(true, cancelled: true); + fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServer(true, cancelled: true); AssertFinished(asyncCallServer, fakeCall, finishedTask); } @@ -76,7 +76,7 @@ namespace Grpc.Core.Internal.Tests var moveNextTask = requestStream.MoveNext(); - fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(true, cancelled: true); + fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServer(true, cancelled: true); fakeCall.ReceivedMessageCallback.OnReceivedMessage(true, null); Assert.IsFalse(moveNextTask.Result); @@ -89,7 +89,7 @@ namespace Grpc.Core.Internal.Tests var finishedTask = asyncCallServer.ServerSideCallAsync(); var requestStream = new ServerRequestStream(asyncCallServer); - fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(true, cancelled: true); + fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServer(true, cancelled: true); // Check that starting a read after cancel notification has been processed is legal. var moveNextTask = requestStream.MoveNext(); @@ -110,7 +110,7 @@ namespace Grpc.Core.Internal.Tests fakeCall.ReceivedMessageCallback.OnReceivedMessage(false, null); Assert.IsFalse(moveNextTask.Result); - fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(true, cancelled: true); + fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServer(true, cancelled: true); AssertFinished(asyncCallServer, fakeCall, finishedTask); } @@ -120,7 +120,7 @@ namespace Grpc.Core.Internal.Tests var finishedTask = asyncCallServer.ServerSideCallAsync(); var responseStream = new ServerResponseStream(asyncCallServer); - fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(true, cancelled: true); + fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServer(true, cancelled: true); // TODO(jtattermusch): should we throw a different exception type instead? Assert.Throws(typeof(InvalidOperationException), () => responseStream.WriteAsync("request1")); @@ -137,7 +137,7 @@ namespace Grpc.Core.Internal.Tests fakeCall.SendCompletionCallback.OnSendCompletion(false); Assert.ThrowsAsync(typeof(IOException), async () => await writeTask); - fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(true, cancelled: true); + fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServer(true, cancelled: true); AssertFinished(asyncCallServer, fakeCall, finishedTask); } @@ -156,7 +156,7 @@ namespace Grpc.Core.Internal.Tests Assert.DoesNotThrowAsync(async () => await writeTask); Assert.DoesNotThrowAsync(async () => await writeStatusTask); - fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(true, cancelled: true); + fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServer(true, cancelled: true); AssertFinished(asyncCallServer, fakeCall, finishedTask); } @@ -171,7 +171,7 @@ namespace Grpc.Core.Internal.Tests Assert.ThrowsAsync(typeof(InvalidOperationException), async () => await responseStream.WriteAsync("request1")); fakeCall.SendStatusFromServerCallback.OnSendStatusFromServerCompletion(true); - fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(true, cancelled: true); + fakeCall.ReceivedCloseOnServerCallback.OnReceivedCloseOnServer(true, cancelled: true); AssertFinished(asyncCallServer, fakeCall, finishedTask); } diff --git a/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs b/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs index 4f44514974..bb8287c549 100644 --- a/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs +++ b/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs @@ -230,7 +230,7 @@ namespace Grpc.Core.Internal IReceivedCloseOnServerCallback ReceiveCloseOnServerCallback => this; - void IReceivedCloseOnServerCallback.OnReceivedCloseOnServerHandler(bool success, bool cancelled) + void IReceivedCloseOnServerCallback.OnReceivedCloseOnServer(bool success, bool cancelled) { HandleFinishedServerside(success, cancelled); } diff --git a/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs b/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs index 7316bc2787..d6a5ba586b 100644 --- a/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs @@ -47,7 +47,7 @@ namespace Grpc.Core.Internal static readonly BatchCompletionDelegate CompletionHandler_ISendStatusFromServerCompletionCallback = (success, context, state) => ((ISendStatusFromServerCompletionCallback)state).OnSendStatusFromServerCompletion(success); static readonly BatchCompletionDelegate CompletionHandler_IReceivedCloseOnServerCallback = - (success, context, state) => ((IReceivedCloseOnServerCallback)state).OnReceivedCloseOnServerHandler(success, context.GetReceivedCloseOnServerCancelled()); + (success, context, state) => ((IReceivedCloseOnServerCallback)state).OnReceivedCloseOnServer(success, context.GetReceivedCloseOnServerCancelled()); const uint GRPC_WRITE_BUFFER_HINT = 1; CompletionQueueSafeHandle completionQueue; diff --git a/src/csharp/Grpc.Core/Internal/INativeCall.cs b/src/csharp/Grpc.Core/Internal/INativeCall.cs index 717c9460ab..5c35b2ba46 100644 --- a/src/csharp/Grpc.Core/Internal/INativeCall.cs +++ b/src/csharp/Grpc.Core/Internal/INativeCall.cs @@ -53,7 +53,7 @@ namespace Grpc.Core.Internal internal interface IReceivedCloseOnServerCallback { - void OnReceivedCloseOnServerHandler(bool success, bool cancelled); + void OnReceivedCloseOnServer(bool success, bool cancelled); } /// -- cgit v1.2.3 From da8ef4046555b9f3c36ce6e1d77f3bf532067333 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 20 Nov 2017 19:37:17 +0100 Subject: save allocation by using a struct instead of a tuple --- src/csharp/Grpc.Core/Internal/AsyncCallServer.cs | 20 ++++++++++++++++---- src/csharp/Grpc.Core/Internal/ServerCallHandler.cs | 12 ++++++------ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs b/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs index bb8287c549..11acb27533 100644 --- a/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs +++ b/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs @@ -127,10 +127,10 @@ namespace Grpc.Core.Internal /// Sends call result status, indicating we are done with writes. /// Sending a status different from StatusCode.OK will also implicitly cancel the call. /// - public Task SendStatusFromServerAsync(Status status, Metadata trailers, Tuple optionalWrite) + public Task SendStatusFromServerAsync(Status status, Metadata trailers, ResponseWithFlags? optionalWrite) { - byte[] payload = optionalWrite != null ? UnsafeSerialize(optionalWrite.Item1) : null; - var writeFlags = optionalWrite != null ? optionalWrite.Item2 : default(WriteFlags); + byte[] payload = optionalWrite.HasValue ? UnsafeSerialize(optionalWrite.Value.Response) : null; + var writeFlags = optionalWrite.HasValue ? optionalWrite.Value.WriteFlags : default(WriteFlags); lock (myLock) { @@ -146,7 +146,7 @@ namespace Grpc.Core.Internal halfcloseRequested = true; initialMetadataSent = true; sendStatusFromServerTcs = new TaskCompletionSource(); - if (optionalWrite != null) + if (optionalWrite.HasValue) { streamingWritesCounter++; } @@ -241,5 +241,17 @@ namespace Grpc.Core.Internal { HandleSendStatusFromServerFinished(success); } + + public struct ResponseWithFlags + { + public ResponseWithFlags(TResponse response, WriteFlags writeFlags) + { + this.Response = response; + this.WriteFlags = writeFlags; + } + + public TResponse Response { get; } + public WriteFlags WriteFlags { get; } + } } } diff --git a/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs b/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs index 6019f8e793..98995a0862 100644 --- a/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs +++ b/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs @@ -60,7 +60,7 @@ namespace Grpc.Core.Internal var responseStream = new ServerResponseStream(asyncCall); Status status; - Tuple responseTuple = null; + AsyncCallServer.ResponseWithFlags? responseWithFlags = null; var context = HandlerUtils.NewContext(newRpc, responseStream, asyncCall.CancellationToken); try { @@ -68,7 +68,7 @@ namespace Grpc.Core.Internal var request = requestStream.Current; var response = await handler(request, context).ConfigureAwait(false); status = context.Status; - responseTuple = Tuple.Create(response, HandlerUtils.GetWriteFlags(context.WriteOptions)); + responseWithFlags = new AsyncCallServer.ResponseWithFlags(response, HandlerUtils.GetWriteFlags(context.WriteOptions)); } catch (Exception e) { @@ -80,7 +80,7 @@ namespace Grpc.Core.Internal } try { - await asyncCall.SendStatusFromServerAsync(status, context.ResponseTrailers, responseTuple).ConfigureAwait(false); + await asyncCall.SendStatusFromServerAsync(status, context.ResponseTrailers, responseWithFlags).ConfigureAwait(false); } catch (Exception) { @@ -177,13 +177,13 @@ namespace Grpc.Core.Internal var responseStream = new ServerResponseStream(asyncCall); Status status; - Tuple responseTuple = null; + AsyncCallServer.ResponseWithFlags? responseWithFlags = null; var context = HandlerUtils.NewContext(newRpc, responseStream, asyncCall.CancellationToken); try { var response = await handler(requestStream, context).ConfigureAwait(false); status = context.Status; - responseTuple = Tuple.Create(response, HandlerUtils.GetWriteFlags(context.WriteOptions)); + responseWithFlags = new AsyncCallServer.ResponseWithFlags(response, HandlerUtils.GetWriteFlags(context.WriteOptions)); } catch (Exception e) { @@ -196,7 +196,7 @@ namespace Grpc.Core.Internal try { - await asyncCall.SendStatusFromServerAsync(status, context.ResponseTrailers, responseTuple).ConfigureAwait(false); + await asyncCall.SendStatusFromServerAsync(status, context.ResponseTrailers, responseWithFlags).ConfigureAwait(false); } catch (Exception) { -- cgit v1.2.3 From 8bae77cdd17b9bb9056cfff63366ad7fd97f352d Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 20 Nov 2017 19:59:40 +0100 Subject: add completion registry benchmark with shared registry too --- .../Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs | 13 +++++++------ src/csharp/Grpc.Microbenchmarks/Program.cs | 5 ++++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs b/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs index 0e2fb070f1..2d1c33e9a0 100644 --- a/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs +++ b/src/csharp/Grpc.Microbenchmarks/CompletionRegistryBenchmark.cs @@ -40,24 +40,25 @@ namespace Grpc.Microbenchmarks GrpcEnvironment.ReleaseAsync().Wait(); } - public void Run(int threadCount, int iterations) + public void Run(int threadCount, int iterations, bool useSharedRegistry) { - Console.WriteLine(string.Format("CompletionRegistryBenchmark: threads={0}, iterations={1}", threadCount, iterations)); - var threadedBenchmark = new ThreadedBenchmark(threadCount, () => ThreadBody(iterations)); + Console.WriteLine(string.Format("CompletionRegistryBenchmark: threads={0}, iterations={1}, useSharedRegistry={2}", threadCount, iterations, useSharedRegistry)); + CompletionRegistry sharedRegistry = useSharedRegistry ? new CompletionRegistry(environment) : null; + var threadedBenchmark = new ThreadedBenchmark(threadCount, () => ThreadBody(iterations, sharedRegistry)); threadedBenchmark.Run(); // TODO: parametrize by number of pending completions } - private void ThreadBody(int iterations) + private void ThreadBody(int iterations, CompletionRegistry optionalSharedRegistry) { - var completionRegistry = new CompletionRegistry(environment); + var completionRegistry = optionalSharedRegistry ?? new CompletionRegistry(environment); var ctx = BatchContextSafeHandle.Create(); var stopwatch = Stopwatch.StartNew(); for (int i = 0; i < iterations; i++) { completionRegistry.Register(ctx.Handle, ctx); - var callback = completionRegistry.Extract(completionRegistry.LastRegisteredKey); + var callback = completionRegistry.Extract(ctx.Handle); // NOTE: we are not calling the callback to avoid disposing ctx. } stopwatch.Stop(); diff --git a/src/csharp/Grpc.Microbenchmarks/Program.cs b/src/csharp/Grpc.Microbenchmarks/Program.cs index 79ec308501..a64c2979ab 100644 --- a/src/csharp/Grpc.Microbenchmarks/Program.cs +++ b/src/csharp/Grpc.Microbenchmarks/Program.cs @@ -77,7 +77,10 @@ namespace Grpc.Microbenchmarks benchmark.Init(); foreach (int threadCount in new int[] {1, 1, 2, 4, 8, 12}) { - benchmark.Run(threadCount, 4 * 1000 * 1000); + foreach (bool useSharedRegistry in new bool[] {false, true}) + { + benchmark.Run(threadCount, 4 * 1000 * 1000, useSharedRegistry); + } } benchmark.Cleanup(); } -- cgit v1.2.3 From eec8b84c71bc81a7073142506f369a9b8a3a63a6 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 20 Nov 2017 20:23:30 +0100 Subject: spinlock in completion registry is slightly faster --- .../Grpc.Core/Internal/CompletionRegistry.cs | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs b/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs index f4aea685c3..b68655b33c 100644 --- a/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs +++ b/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs @@ -19,7 +19,9 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; +using System.Diagnostics; using System.Runtime.InteropServices; +using System.Threading; using Grpc.Core.Logging; using Grpc.Core.Utils; @@ -35,7 +37,7 @@ namespace Grpc.Core.Internal readonly GrpcEnvironment environment; readonly Dictionary dict = new Dictionary(new IntPtrComparer()); - readonly object myLock = new object(); + SpinLock spinLock = new SpinLock(Debugger.IsAttached); IntPtr lastRegisteredKey; // only for testing public CompletionRegistry(GrpcEnvironment environment) @@ -46,11 +48,19 @@ namespace Grpc.Core.Internal public void Register(IntPtr key, IOpCompletionCallback callback) { environment.DebugStats.PendingBatchCompletions.Increment(); - lock (myLock) + + bool lockTaken = false; + try { + spinLock.Enter(ref lockTaken); + dict.Add(key, callback); this.lastRegisteredKey = key; } + finally + { + if (lockTaken) spinLock.Exit(); + } } public void RegisterBatchCompletion(BatchContextSafeHandle ctx, BatchCompletionDelegate callback, object state) @@ -68,11 +78,18 @@ namespace Grpc.Core.Internal public IOpCompletionCallback Extract(IntPtr key) { IOpCompletionCallback value = null; - lock (myLock) + bool lockTaken = false; + try { + spinLock.Enter(ref lockTaken); + value = dict[key]; dict.Remove(key); } + finally + { + if (lockTaken) spinLock.Exit(); + } environment.DebugStats.PendingBatchCompletions.Decrement(); return value; } -- cgit v1.2.3 From 4c1713af84d8895c7e93edc889ac06987ed37a31 Mon Sep 17 00:00:00 2001 From: Carl Mastrangelo Date: Tue, 21 Nov 2017 10:00:20 -0800 Subject: Add java 1.8 --- tools/interop_matrix/client_matrix.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py index c8dbb3ae66..15f12a2653 100644 --- a/tools/interop_matrix/client_matrix.py +++ b/tools/interop_matrix/client_matrix.py @@ -63,6 +63,7 @@ LANG_RELEASE_MATRIX = { 'v1.5.0', 'v1.6.1', 'v1.7.0', + 'v1.8.0', ], 'python': [ 'v1.0.x', -- cgit v1.2.3 From 264560ff4a497de14e070de0323dd5eb48d96b6f Mon Sep 17 00:00:00 2001 From: ncteisen Date: Tue, 21 Nov 2017 13:55:52 -0500 Subject: Reviewer feedback --- src/core/lib/support/abstract.h | 2 +- src/core/lib/support/manual_constructor.h | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/core/lib/support/abstract.h b/src/core/lib/support/abstract.h index ddf472bc37..5498769a7d 100644 --- a/src/core/lib/support/abstract.h +++ b/src/core/lib/support/abstract.h @@ -21,7 +21,7 @@ // This is needed to support abstract base classes in the c core. Since gRPC // doesn't have a c++ runtime, it will hit a linker error on delete unless -// a we define a virtual operator delete. See this blog for more info: +// we define a virtual operator delete. See this blog for more info: // https://eli.thegreenplace.net/2015/c-deleting-destructors-and-virtual-operator-delete/ #define GRPC_ABSTRACT_BASE_CLASS \ static void operator delete(void* p) { abort(); } diff --git a/src/core/lib/support/manual_constructor.h b/src/core/lib/support/manual_constructor.h index 25731936b1..fda7653dbc 100644 --- a/src/core/lib/support/manual_constructor.h +++ b/src/core/lib/support/manual_constructor.h @@ -35,25 +35,25 @@ namespace grpc_core { // in this file. namespace manual_ctor_impl { -// is_one_of returns true it a class, Needle, is present in a variadic list of -// classes, Haystack. -template +// is_one_of returns true it a class, Member, is present in a variadic list of +// classes, List. +template class is_one_of; -template -class is_one_of { +template +class is_one_of { public: static constexpr const bool value = true; }; -template -class is_one_of { +template +class is_one_of { public: - static constexpr const bool value = is_one_of::value; + static constexpr const bool value = is_one_of::value; }; -template -class is_one_of { +template +class is_one_of { public: static constexpr const bool value = false; }; -- cgit v1.2.3 From 1628da0136deb8acfa5670de7fbf54637bcb03a1 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Tue, 21 Nov 2017 17:51:00 +0000 Subject: Avoid abbreviation in Python API I should have requested this during code review of bcf083fa9099e5c919 but it slipped my mind. --- src/python/grpcio/grpc/__init__.py | 65 +++++++++++----------- .../grpc/_cython/_cygrpc/credentials.pyx.pxi | 5 +- .../grpcio/grpc/_cython/_cygrpc/server.pyx.pxi | 14 +++-- src/python/grpcio_tests/tests/unit/_api_test.py | 9 ++- .../tests/unit/_server_ssl_cert_config_test.py | 45 ++++++++------- 5 files changed, 71 insertions(+), 67 deletions(-) diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py index 70558a699a..558ce42129 100644 --- a/src/python/grpcio/grpc/__init__.py +++ b/src/python/grpcio/grpc/__init__.py @@ -424,17 +424,19 @@ class ServerCredentials(object): self._credentials = credentials -class ServerCertificateConfig(object): - """A certificate config for use with an SSL-enabled Server, e.g., can - be returned in the certificate config fetching callback. +class ServerCertificateConfiguration(object): + """A certificate configuration for use with an SSL-enabled Server. + + Instances of this class can be returned in the certificate configuration + fetching callback. This class has no supported interface -- it exists to define the type of its instances and its instances exist to be passed to other functions. """ - def __init__(self, cert_config): - self._cert_config = cert_config + def __init__(self, certificate_configuration): + self._certificate_configuration = certificate_configuration ######################## Multi-Callable Interfaces ########################### @@ -1265,9 +1267,9 @@ def ssl_server_credentials(private_key_certificate_chain_pairs, ], require_client_auth)) -def ssl_server_certificate_config(private_key_certificate_chain_pairs, - root_certificates=None): - """Creates a ServerCertificateConfig for use with an SSL-enabled Server. +def ssl_server_certificate_configuration(private_key_certificate_chain_pairs, + root_certificates=None): + """Creates a ServerCertificateConfiguration for use with a Server. Args: private_key_certificate_chain_pairs: A collection of pairs of @@ -1277,38 +1279,38 @@ def ssl_server_certificate_config(private_key_certificate_chain_pairs, certificates that the server will use to verify client authentication. Returns: - A ServerCertificateConfig that can be returned in the certificate config - fetching callback. + A ServerCertificateConfiguration that can be returned in the certificate + configuration fetching callback. """ if len(private_key_certificate_chain_pairs) == 0: raise ValueError( 'At least one private key-certificate chain pair is required!') else: - return ServerCertificateConfig( + return ServerCertificateConfiguration( _cygrpc.server_certificate_config_ssl(root_certificates, [ _cygrpc.SslPemKeyCertPair(key, pem) for key, pem in private_key_certificate_chain_pairs ])) -def ssl_server_credentials_dynamic_cert_config(initial_cert_config, - cert_config_fetcher, - require_client_auth=False): +def dynamic_ssl_server_credentials(initial_certificate_configuration, + certificate_configuration_fetcher, + require_client_authentication=False): """Creates a ServerCredentials for use with an SSL-enabled Server. Args: - initial_cert_config (ServerCertificateConfig): the certificate - config with which the server will be initialized. - cert_config_fetcher (callable): a callable that takes no - arguments and should return a ServerCertificateConfig to - replace the server's current cert, or None for no change + initial_certificate_configuration (ServerCertificateConfiguration): The + certificate configuration with which the server will be initialized. + certificate_configuration_fetcher (callable): A callable that takes no + arguments and should return a ServerCertificateConfiguration to + replace the server's current certificate, or None for no change (i.e., the server will continue its current certificate config). The library will call this callback on *every* new client connection before starting the TLS handshake with the client, thus allowing the user application to optionally - return a new ServerCertificateConfig that the server will then + return a new ServerCertificateConfiguration that the server will then use for the handshake. - require_client_auth: A boolean indicating whether or not to + require_client_authentication: A boolean indicating whether or not to require clients to be authenticated. Returns: @@ -1316,7 +1318,8 @@ def ssl_server_credentials_dynamic_cert_config(initial_cert_config, """ return ServerCredentials( _cygrpc.server_credentials_ssl_dynamic_cert_config( - initial_cert_config, cert_config_fetcher, require_client_auth)) + initial_certificate_configuration, + certificate_configuration_fetcher, require_client_authentication)) def channel_ready_future(channel): @@ -1401,19 +1404,19 @@ __all__ = ('FutureTimeoutError', 'FutureCancelledError', 'Future', 'ChannelConnectivity', 'StatusCode', 'RpcError', 'RpcContext', 'Call', 'ChannelCredentials', 'CallCredentials', 'AuthMetadataContext', 'AuthMetadataPluginCallback', - 'AuthMetadataPlugin', 'ServerCertificateConfig', 'ServerCredentials', - 'UnaryUnaryMultiCallable', 'UnaryStreamMultiCallable', - 'StreamUnaryMultiCallable', 'StreamStreamMultiCallable', 'Channel', - 'ServicerContext', 'RpcMethodHandler', 'HandlerCallDetails', - 'GenericRpcHandler', 'ServiceRpcHandler', 'Server', - 'unary_unary_rpc_method_handler', 'unary_stream_rpc_method_handler', - 'stream_unary_rpc_method_handler', + 'AuthMetadataPlugin', 'ServerCertificateConfiguration', + 'ServerCredentials', 'UnaryUnaryMultiCallable', + 'UnaryStreamMultiCallable', 'StreamUnaryMultiCallable', + 'StreamStreamMultiCallable', 'Channel', 'ServicerContext', + 'RpcMethodHandler', 'HandlerCallDetails', 'GenericRpcHandler', + 'ServiceRpcHandler', 'Server', 'unary_unary_rpc_method_handler', + 'unary_stream_rpc_method_handler', 'stream_unary_rpc_method_handler', 'stream_stream_rpc_method_handler', 'method_handlers_generic_handler', 'ssl_channel_credentials', 'metadata_call_credentials', 'access_token_call_credentials', 'composite_call_credentials', 'composite_channel_credentials', - 'ssl_server_credentials', 'ssl_server_certificate_config', - 'ssl_server_credentials_dynamic_cert_config', 'channel_ready_future', + 'ssl_server_credentials', 'ssl_server_certificate_configuration', + 'dynamic_ssl_server_credentials', 'channel_ready_future', 'insecure_channel', 'secure_channel', 'server',) ############################### Extension Shims ################################ diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi index db813b7243..bdba40b4f1 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi @@ -338,8 +338,9 @@ def server_certificate_config_ssl(pem_root_certs, pem_key_cert_pairs): def server_credentials_ssl_dynamic_cert_config(initial_cert_config, cert_config_fetcher, bint force_client_auth): - if not isinstance(initial_cert_config, grpc.ServerCertificateConfig): - raise TypeError('initial_cert_config must be a grpc.ServerCertificateConfig') + if not isinstance(initial_cert_config, grpc.ServerCertificateConfiguration): + raise TypeError( + 'initial_cert_config must be a grpc.ServerCertificateConfiguration') if not callable(cert_config_fetcher): raise TypeError('cert_config_fetcher must be callable') cdef ServerCredentials credentials = ServerCredentials() diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi index 66565d084b..5f3405936c 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi @@ -28,7 +28,7 @@ cdef grpc_ssl_certificate_config_reload_status _server_cert_config_fetcher_wrapp if not credentials.initial_cert_config_fetched: # C-core is asking for the initial cert config credentials.initial_cert_config_fetched = True - cert_config = credentials.initial_cert_config._cert_config + cert_config = credentials.initial_cert_config._certificate_configuration else: user_cb = credentials.cert_config_fetcher try: @@ -38,13 +38,15 @@ cdef grpc_ssl_certificate_config_reload_status _server_cert_config_fetcher_wrapp return GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL if cert_config_wrapper is None: return GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED - elif not isinstance(cert_config_wrapper, grpc.ServerCertificateConfig): - logging.error('Error fetching certificate config: certificate ' - 'config must be of type grpc.ServerCertificateConfig, ' - 'not %s' % type(cert_config_wrapper).__name__) + elif not isinstance( + cert_config_wrapper, grpc.ServerCertificateConfiguration): + logging.error( + 'Error fetching certificate configuration: certificate ' + 'configuration must be of type grpc.ServerCertificateConfiguration, ' + 'not %s' % type(cert_config_wrapper).__name__) return GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL else: - cert_config = cert_config_wrapper._cert_config + cert_config = cert_config_wrapper._certificate_configuration config[0] = cert_config.c_cert_config # our caller will assume ownership of memory, so we have to recreate # a copy of c_cert_config here diff --git a/src/python/grpcio_tests/tests/unit/_api_test.py b/src/python/grpcio_tests/tests/unit/_api_test.py index d877e0f993..b14e8d5c75 100644 --- a/src/python/grpcio_tests/tests/unit/_api_test.py +++ b/src/python/grpcio_tests/tests/unit/_api_test.py @@ -30,7 +30,7 @@ class AllTest(unittest.TestCase): 'ChannelConnectivity', 'StatusCode', 'RpcError', 'RpcContext', 'Call', 'ChannelCredentials', 'CallCredentials', 'AuthMetadataContext', 'AuthMetadataPluginCallback', - 'AuthMetadataPlugin', 'ServerCertificateConfig', + 'AuthMetadataPlugin', 'ServerCertificateConfiguration', 'ServerCredentials', 'UnaryUnaryMultiCallable', 'UnaryStreamMultiCallable', 'StreamUnaryMultiCallable', 'StreamStreamMultiCallable', 'Channel', 'ServicerContext', @@ -42,10 +42,9 @@ class AllTest(unittest.TestCase): 'method_handlers_generic_handler', 'ssl_channel_credentials', 'metadata_call_credentials', 'access_token_call_credentials', 'composite_call_credentials', 'composite_channel_credentials', - 'ssl_server_credentials', 'ssl_server_certificate_config', - 'ssl_server_credentials_dynamic_cert_config', - 'channel_ready_future', 'insecure_channel', 'secure_channel', - 'server',) + 'ssl_server_credentials', 'ssl_server_certificate_configuration', + 'dynamic_ssl_server_credentials', 'channel_ready_future', + 'insecure_channel', 'secure_channel', 'server',) six.assertCountEqual(self, expected_grpc_code_elements, _from_grpc_import_star.GRPC_ELEMENTS) diff --git a/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py b/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py index d2f9f114a5..005d16ea75 100644 --- a/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py +++ b/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py @@ -11,11 +11,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" -This tests server certificate rotation support. +"""Tests server certificate rotation. -Here we test various aspects of gRPC Python, and in some cases C-core -by extension, support for server certificate rotation. +Here we test various aspects of gRPC Python, and in some cases gRPC +Core by extension, support for server certificate rotation. * ServerSSLCertReloadTestWithClientAuth: test ability to rotate server's SSL cert for use in future channels with clients while not @@ -27,7 +26,7 @@ by extension, support for server certificate rotation. not authenticate the client. * ServerSSLCertReloadTestCertConfigReuse: tests gRPC Python's ability - to deal with user's reuse of ServerCertificateConfig instances. + to deal with user's reuse of ServerCertificateConfiguration instances. """ import abc @@ -140,14 +139,14 @@ class _ServerSSLCertReloadTest( services_pb2_grpc.add_FirstServiceServicer_to_server( _server_application.FirstServiceServicer(), self.server) switch_cert_on_client_num = 10 - initial_cert_config = grpc.ssl_server_certificate_config( + initial_cert_config = grpc.ssl_server_certificate_configuration( [(SERVER_KEY_1_PEM, SERVER_CERT_CHAIN_1_PEM)], root_certificates=CA_2_PEM) self.cert_config_fetcher = CertConfigFetcher() - server_credentials = grpc.ssl_server_credentials_dynamic_cert_config( + server_credentials = grpc.dynamic_ssl_server_credentials( initial_cert_config, self.cert_config_fetcher, - require_client_auth=self.require_client_auth()) + require_client_authentication=self.require_client_auth()) self.port = self.server.add_secure_port('[::]:0', server_credentials) self.server.start() @@ -285,7 +284,7 @@ class _ServerSSLCertReloadTest( # moment of truth!! client should reject server because the # server switch cert... - cert_config = grpc.ssl_server_certificate_config( + cert_config = grpc.ssl_server_certificate_configuration( [(SERVER_KEY_2_PEM, SERVER_CERT_CHAIN_2_PEM)], root_certificates=CA_1_PEM) self.cert_config_fetcher.reset() @@ -362,18 +361,18 @@ class ServerSSLCertConfigFetcherParamsChecks(unittest.TestCase): def test_check_on_initial_config(self): with self.assertRaises(TypeError): - grpc.ssl_server_credentials_dynamic_cert_config(None, str) + grpc.dynamic_ssl_server_credentials(None, str) with self.assertRaises(TypeError): - grpc.ssl_server_credentials_dynamic_cert_config(1, str) + grpc.dynamic_ssl_server_credentials(1, str) def test_check_on_config_fetcher(self): - cert_config = grpc.ssl_server_certificate_config( + cert_config = grpc.ssl_server_certificate_configuration( [(SERVER_KEY_2_PEM, SERVER_CERT_CHAIN_2_PEM)], root_certificates=CA_1_PEM) with self.assertRaises(TypeError): - grpc.ssl_server_credentials_dynamic_cert_config(cert_config, None) + grpc.dynamic_ssl_server_credentials(cert_config, None) with self.assertRaises(TypeError): - grpc.ssl_server_credentials_dynamic_cert_config(cert_config, 1) + grpc.dynamic_ssl_server_credentials(cert_config, 1) class ServerSSLCertReloadTestWithClientAuth(_ServerSSLCertReloadTest): @@ -393,14 +392,14 @@ class ServerSSLCertReloadTestWithoutClientAuth(_ServerSSLCertReloadTest): class ServerSSLCertReloadTestCertConfigReuse(_ServerSSLCertReloadTest): - """Ensures that `ServerCertificateConfig` instances can be reused. + """Ensures that `ServerCertificateConfiguration` instances can be reused. - Because C-core takes ownership of the + Because gRPC Core takes ownership of the `grpc_ssl_server_certificate_config` encapsulated by - `ServerCertificateConfig`, this test reuses the same - `ServerCertificateConfig` instances multiple times to make sure + `ServerCertificateConfiguration`, this test reuses the same + `ServerCertificateConfiguration` instances multiple times to make sure gRPC Python takes care of maintaining the validity of - `ServerCertificateConfig` instances, so that such instances can be + `ServerCertificateConfiguration` instances, so that such instances can be re-used by user application. """ @@ -411,17 +410,17 @@ class ServerSSLCertReloadTestCertConfigReuse(_ServerSSLCertReloadTest): self.server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) services_pb2_grpc.add_FirstServiceServicer_to_server( _server_application.FirstServiceServicer(), self.server) - self.cert_config_A = grpc.ssl_server_certificate_config( + self.cert_config_A = grpc.ssl_server_certificate_configuration( [(SERVER_KEY_1_PEM, SERVER_CERT_CHAIN_1_PEM)], root_certificates=CA_2_PEM) - self.cert_config_B = grpc.ssl_server_certificate_config( + self.cert_config_B = grpc.ssl_server_certificate_configuration( [(SERVER_KEY_2_PEM, SERVER_CERT_CHAIN_2_PEM)], root_certificates=CA_1_PEM) self.cert_config_fetcher = CertConfigFetcher() - server_credentials = grpc.ssl_server_credentials_dynamic_cert_config( + server_credentials = grpc.dynamic_ssl_server_credentials( self.cert_config_A, self.cert_config_fetcher, - require_client_auth=True) + require_client_authentication=True) self.port = self.server.add_secure_port('[::]:0', server_credentials) self.server.start() -- cgit v1.2.3 From a4f03206431e93cf425d9b6aaeebfaac1cbc6a3d Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Tue, 21 Nov 2017 13:32:47 -0800 Subject: Add go release versions to client_matrix.py --- tools/interop_matrix/client_matrix.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py index c8dbb3ae66..cbfaafee1d 100644 --- a/tools/interop_matrix/client_matrix.py +++ b/tools/interop_matrix/client_matrix.py @@ -53,6 +53,10 @@ LANG_RELEASE_MATRIX = { 'v1.5.2', 'v1.6.0', 'v1.7.0', + 'v1.7.1', + 'v1.7.2', + 'v1.7.3', + 'v1.8.0', ], 'java': [ 'v1.0.3', -- cgit v1.2.3 From 704009a19869e9ec46e70c6d16bc5399e010fccc Mon Sep 17 00:00:00 2001 From: yang-g Date: Tue, 21 Nov 2017 17:24:50 -0800 Subject: Enable check for use-after-dtor --- Makefile | 2 +- build.yaml | 6 ++++-- tools/run_tests/generated/configs.json | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 25a7933b2f..c85b1bca73 100644 --- a/Makefile +++ b/Makefile @@ -114,7 +114,7 @@ CC_msan = clang CXX_msan = clang++ LD_msan = clang++ LDXX_msan = clang++ -CPPFLAGS_msan = -O0 -fsanitize-coverage=edge -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-command-line-argument -fPIE -pie -DGPR_NO_DIRECT_SYSCALLS +CPPFLAGS_msan = -O0 -fsanitize-coverage=edge -fsanitize=memory -fsanitize-memory-track-origins -fsanitize-memory-use-after-dtor -fno-omit-frame-pointer -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-command-line-argument -fPIE -pie -DGPR_NO_DIRECT_SYSCALLS LDFLAGS_msan = -fsanitize=memory -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1 -fPIE -pie $(if $(JENKINS_BUILD),-Wl$(comma)-Ttext-segment=0x7e0000000000,) DEFINES_msan = NDEBUG diff --git a/build.yaml b/build.yaml index 16e31eb588..4f6194ecc4 100644 --- a/build.yaml +++ b/build.yaml @@ -4915,8 +4915,8 @@ configs: msan: CC: clang CPPFLAGS: -O0 -fsanitize-coverage=edge -fsanitize=memory -fsanitize-memory-track-origins - -fno-omit-frame-pointer -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1 - -Wno-unused-command-line-argument -fPIE -pie -DGPR_NO_DIRECT_SYSCALLS + -fsanitize-memory-use-after-dtor -fno-omit-frame-pointer -DGTEST_HAS_TR1_TUPLE=0 + -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-command-line-argument -fPIE -pie -DGPR_NO_DIRECT_SYSCALLS CXX: clang++ DEFINES: NDEBUG LD: clang++ @@ -4924,6 +4924,8 @@ configs: -fPIE -pie $(if $(JENKINS_BUILD),-Wl$(comma)-Ttext-segment=0x7e0000000000,) LDXX: clang++ compile_the_world: true + test_environ: + MSAN_OPTIONS: poison_in_dtor=1 mutrace: CPPFLAGS: -O3 -fno-omit-frame-pointer DEFINES: NDEBUG diff --git a/tools/run_tests/generated/configs.json b/tools/run_tests/generated/configs.json index abbe76d60c..fee8290efe 100644 --- a/tools/run_tests/generated/configs.json +++ b/tools/run_tests/generated/configs.json @@ -20,7 +20,10 @@ } }, { - "config": "msan" + "config": "msan", + "environ": { + "MSAN_OPTIONS": "poison_in_dtor=1" + } }, { "config": "basicprof" -- cgit v1.2.3 From 77d2c721cbfee17620c3b2c36586cbdb1dfa06d3 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Wed, 22 Nov 2017 01:42:56 +0000 Subject: Add missing const --- src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi index db813b7243..2b8b66cce4 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi @@ -303,7 +303,7 @@ def server_credentials_ssl(pem_root_certs, pem_key_cert_pairs, cdef ServerCredentials credentials = ServerCredentials() credentials.references.append(pem_root_certs) credentials.references.append(pem_key_cert_pairs) - cdef char * c_pem_root_certs = _get_c_pem_root_certs(pem_root_certs) + cdef const char * c_pem_root_certs = _get_c_pem_root_certs(pem_root_certs) credentials.c_ssl_pem_key_cert_pairs_count = len(pem_key_cert_pairs) credentials.c_ssl_pem_key_cert_pairs = _create_c_ssl_pem_key_cert_pairs(pem_key_cert_pairs) cdef grpc_ssl_server_certificate_config *c_cert_config = NULL -- cgit v1.2.3 From 0eacb45a488beebb94ebab12f2275a477b8f239a Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Wed, 22 Nov 2017 02:10:52 +0000 Subject: Elide local field by directly returning values --- src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi index 2b8b66cce4..d97c80f17a 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi @@ -274,10 +274,10 @@ def call_credentials_metadata_plugin(CredentialsMetadataPlugin plugin): return credentials cdef const char* _get_c_pem_root_certs(pem_root_certs): - cdef char *c_pem_root_certs = NULL - if pem_root_certs is not None: - c_pem_root_certs = pem_root_certs - return c_pem_root_certs + if pem_root_certs is None: + return NULL + else: + return pem_root_certs cdef grpc_ssl_pem_key_cert_pair* _create_c_ssl_pem_key_cert_pairs(pem_key_cert_pairs): # return a malloc'ed grpc_ssl_pem_key_cert_pair from a _list_ of SslPemKeyCertPair -- cgit v1.2.3 From 00867f2cbe73057392c3d16ecf6583a1a8c4f4b6 Mon Sep 17 00:00:00 2001 From: vcaesar Date: Thu, 23 Nov 2017 00:48:53 +0800 Subject: Fix node source code link error --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 61479f34aa..048614a205 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,6 @@ Libraries in different languages may be in different states of development. We a | Shared C [core library] | [src/core](src/core) | 1.6 | | C++ | [src/cpp](src/cpp) | 1.6 | | Ruby | [src/ruby](src/ruby) | 1.6 | -| NodeJS | [src/node](src/node) | 1.6 | | Python | [src/python](src/python) | 1.6 | | PHP | [src/php](src/php) | 1.6 | | C# | [src/csharp](src/csharp) | 1.6 | @@ -38,7 +37,8 @@ Libraries in different languages may be in different states of development. We a Java source code is in the [grpc-java](http://github.com/grpc/grpc-java) repository. Go source code is in the -[grpc-go](http://github.com/grpc/grpc-go) repository. +[grpc-go](http://github.com/grpc/grpc-go) repository. NodeJS source code is in the +[grpc-node](https://github.com/grpc/grpc-node) repository. See [MANIFEST.md](MANIFEST.md) for a listing of top-level items in the repository. -- cgit v1.2.3 From 36f60a9cc15ef08c528396bc2c66d7d03a9b3ce7 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 22 Nov 2017 09:42:16 -0800 Subject: Kill off unnecessary sleep in route_guide example --- examples/python/route_guide/route_guide_client.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/examples/python/route_guide/route_guide_client.py b/examples/python/route_guide/route_guide_client.py index 653f0d02c6..a0e32fb6f5 100644 --- a/examples/python/route_guide/route_guide_client.py +++ b/examples/python/route_guide/route_guide_client.py @@ -17,7 +17,6 @@ from __future__ import print_function import random -import time import grpc @@ -66,7 +65,6 @@ def generate_route(feature_list): random_feature = feature_list[random.randint(0, len(feature_list) - 1)] print("Visiting point %s" % random_feature.location) yield random_feature.location - time.sleep(random.uniform(0.5, 1.5)) def guide_record_route(stub): @@ -91,7 +89,6 @@ def generate_messages(): for msg in messages: print("Sending %s at %s" % (msg.message, msg.location)) yield msg - time.sleep(random.uniform(0.5, 1.0)) def guide_route_chat(stub): -- cgit v1.2.3 From fcb42056452b69e216e53337a1d0b89ec1c5ab7c Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 22 Nov 2017 19:21:48 +0100 Subject: silence uninitialized use warning --- src/core/lib/iomgr/sockaddr_utils.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/lib/iomgr/sockaddr_utils.cc b/src/core/lib/iomgr/sockaddr_utils.cc index 3477fb52cd..0c0a2fe5b2 100644 --- a/src/core/lib/iomgr/sockaddr_utils.cc +++ b/src/core/lib/iomgr/sockaddr_utils.cc @@ -148,7 +148,7 @@ int grpc_sockaddr_to_string(char** out, grpc_resolved_address addr_normalized; char ntop_buf[INET6_ADDRSTRLEN]; const void* ip = nullptr; - int port; + int port = 0; uint32_t sin6_scope_id = 0; int ret; -- cgit v1.2.3 From 891254292e4a68dd9a3b31f8faf729aaeca8ccc9 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Wed, 22 Nov 2017 10:22:28 -0800 Subject: Remove lockfree stack, again --- BUILD | 14 +-- CMakeLists.txt | 30 ----- Makefile | 37 ------ build.yaml | 12 -- config.m4 | 1 - config.w32 | 1 - gRPC-Core.podspec | 3 - grpc.gemspec | 2 - grpc.gyp | 1 - package.xml | 2 - src/core/lib/support/stack_lockfree.cc | 137 -------------------- src/core/lib/support/stack_lockfree.h | 46 ------- src/python/grpcio/grpc_core_dependencies.py | 1 - test/core/support/BUILD | 22 +--- test/core/support/stack_lockfree_test.cc | 140 --------------------- tools/doxygen/Doxyfile.c++.internal | 1 - tools/doxygen/Doxyfile.core.internal | 2 - tools/run_tests/generated/sources_and_headers.json | 18 --- tools/run_tests/generated/tests.json | 24 ---- 19 files changed, 12 insertions(+), 482 deletions(-) delete mode 100644 src/core/lib/support/stack_lockfree.cc delete mode 100644 src/core/lib/support/stack_lockfree.h delete mode 100644 test/core/support/stack_lockfree_test.cc diff --git a/BUILD b/BUILD index 25daba8e1e..efb72d45b9 100644 --- a/BUILD +++ b/BUILD @@ -455,7 +455,6 @@ grpc_cc_library( "src/core/lib/support/log_windows.cc", "src/core/lib/support/mpscq.cc", "src/core/lib/support/murmur_hash.cc", - "src/core/lib/support/stack_lockfree.cc", "src/core/lib/support/string.cc", "src/core/lib/support/string_posix.cc", "src/core/lib/support/string_util_windows.cc", @@ -486,23 +485,22 @@ grpc_cc_library( "src/core/lib/support/atomic_with_atm.h", "src/core/lib/support/atomic_with_std.h", "src/core/lib/support/env.h", - "src/core/lib/support/memory.h", - "src/core/lib/support/vector.h", "src/core/lib/support/manual_constructor.h", + "src/core/lib/support/memory.h", "src/core/lib/support/mpscq.h", "src/core/lib/support/murmur_hash.h", "src/core/lib/support/spinlock.h", - "src/core/lib/support/stack_lockfree.h", "src/core/lib/support/string.h", "src/core/lib/support/string_windows.h", "src/core/lib/support/time_precise.h", "src/core/lib/support/tmpfile.h", + "src/core/lib/support/vector.h", ], language = "c++", public_hdrs = GPR_PUBLIC_HDRS, deps = [ "gpr_codegen", - "@com_google_absl//absl/container:inlined_vector" + "@com_google_absl//absl/container:inlined_vector", ], ) @@ -672,6 +670,7 @@ grpc_cc_library( "src/core/lib/transport/transport_op_string.cc", ], hdrs = [ + "src/core/lib/backoff/backoff.h", "src/core/lib/channel/channel_args.h", "src/core/lib/channel/channel_stack.h", "src/core/lib/channel/channel_stack_builder.h", @@ -690,6 +689,7 @@ grpc_cc_library( "src/core/lib/http/format_request.h", "src/core/lib/http/httpcli.h", "src/core/lib/http/parser.h", + "src/core/lib/iomgr/block_annotate.h", "src/core/lib/iomgr/call_combiner.h", "src/core/lib/iomgr/closure.h", "src/core/lib/iomgr/combiner.h", @@ -734,7 +734,6 @@ grpc_cc_library( "src/core/lib/iomgr/socket_utils_posix.h", "src/core/lib/iomgr/socket_windows.h", "src/core/lib/iomgr/sys_epoll_wrapper.h", - "src/core/lib/iomgr/block_annotate.h", "src/core/lib/iomgr/tcp_client.h", "src/core/lib/iomgr/tcp_client_posix.h", "src/core/lib/iomgr/tcp_posix.h", @@ -790,7 +789,6 @@ grpc_cc_library( "src/core/lib/transport/timeout_encoding.h", "src/core/lib/transport/transport.h", "src/core/lib/transport/transport_impl.h", - "src/core/lib/backoff/backoff.h", ], external_deps = [ "zlib", @@ -1250,8 +1248,8 @@ grpc_cc_library( "src/core/ext/transport/chttp2/transport/bin_decoder.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", - "src/core/ext/transport/chttp2/transport/frame.h", "src/core/ext/transport/chttp2/transport/flow_control.h", + "src/core/ext/transport/chttp2/transport/frame.h", "src/core/ext/transport/chttp2/transport/frame_data.h", "src/core/ext/transport/chttp2/transport/frame_goaway.h", "src/core/ext/transport/chttp2/transport/frame_ping.h", diff --git a/CMakeLists.txt b/CMakeLists.txt index 77b60e898a..81248381e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -433,7 +433,6 @@ add_dependencies(buildtests_c gpr_log_test) add_dependencies(buildtests_c gpr_manual_constructor_test) add_dependencies(buildtests_c gpr_mpscq_test) add_dependencies(buildtests_c gpr_spinlock_test) -add_dependencies(buildtests_c gpr_stack_lockfree_test) add_dependencies(buildtests_c gpr_string_test) add_dependencies(buildtests_c gpr_sync_test) add_dependencies(buildtests_c gpr_thd_test) @@ -807,7 +806,6 @@ add_library(gpr src/core/lib/support/log_windows.cc src/core/lib/support/mpscq.cc src/core/lib/support/murmur_hash.cc - src/core/lib/support/stack_lockfree.cc src/core/lib/support/string.cc src/core/lib/support/string_posix.cc src/core/lib/support/string_util_windows.cc @@ -6475,34 +6473,6 @@ target_link_libraries(gpr_spinlock_test endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) -add_executable(gpr_stack_lockfree_test - test/core/support/stack_lockfree_test.cc -) - - -target_include_directories(gpr_stack_lockfree_test - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${BORINGSSL_ROOT_DIR}/include - PRIVATE ${PROTOBUF_ROOT_DIR}/src - PRIVATE ${BENCHMARK_ROOT_DIR}/include - PRIVATE ${ZLIB_ROOT_DIR} - PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib - PRIVATE ${CARES_INCLUDE_DIR} - PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares - PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/abseil-cpp -) - -target_link_libraries(gpr_stack_lockfree_test - ${_gRPC_ALLTARGETS_LIBRARIES} - gpr_test_util - gpr -) - -endif (gRPC_BUILD_TESTS) -if (gRPC_BUILD_TESTS) - add_executable(gpr_string_test test/core/support/string_test.cc ) diff --git a/Makefile b/Makefile index 25a7933b2f..36c4252394 100644 --- a/Makefile +++ b/Makefile @@ -994,7 +994,6 @@ gpr_log_test: $(BINDIR)/$(CONFIG)/gpr_log_test gpr_manual_constructor_test: $(BINDIR)/$(CONFIG)/gpr_manual_constructor_test gpr_mpscq_test: $(BINDIR)/$(CONFIG)/gpr_mpscq_test gpr_spinlock_test: $(BINDIR)/$(CONFIG)/gpr_spinlock_test -gpr_stack_lockfree_test: $(BINDIR)/$(CONFIG)/gpr_stack_lockfree_test gpr_string_test: $(BINDIR)/$(CONFIG)/gpr_string_test gpr_sync_test: $(BINDIR)/$(CONFIG)/gpr_sync_test gpr_thd_test: $(BINDIR)/$(CONFIG)/gpr_thd_test @@ -1389,7 +1388,6 @@ buildtests_c: privatelibs_c \ $(BINDIR)/$(CONFIG)/gpr_manual_constructor_test \ $(BINDIR)/$(CONFIG)/gpr_mpscq_test \ $(BINDIR)/$(CONFIG)/gpr_spinlock_test \ - $(BINDIR)/$(CONFIG)/gpr_stack_lockfree_test \ $(BINDIR)/$(CONFIG)/gpr_string_test \ $(BINDIR)/$(CONFIG)/gpr_sync_test \ $(BINDIR)/$(CONFIG)/gpr_thd_test \ @@ -1840,8 +1838,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/gpr_mpscq_test || ( echo test gpr_mpscq_test failed ; exit 1 ) $(E) "[RUN] Testing gpr_spinlock_test" $(Q) $(BINDIR)/$(CONFIG)/gpr_spinlock_test || ( echo test gpr_spinlock_test failed ; exit 1 ) - $(E) "[RUN] Testing gpr_stack_lockfree_test" - $(Q) $(BINDIR)/$(CONFIG)/gpr_stack_lockfree_test || ( echo test gpr_stack_lockfree_test failed ; exit 1 ) $(E) "[RUN] Testing gpr_string_test" $(Q) $(BINDIR)/$(CONFIG)/gpr_string_test || ( echo test gpr_string_test failed ; exit 1 ) $(E) "[RUN] Testing gpr_sync_test" @@ -2836,7 +2832,6 @@ LIBGPR_SRC = \ src/core/lib/support/log_windows.cc \ src/core/lib/support/mpscq.cc \ src/core/lib/support/murmur_hash.cc \ - src/core/lib/support/stack_lockfree.cc \ src/core/lib/support/string.cc \ src/core/lib/support/string_posix.cc \ src/core/lib/support/string_util_windows.cc \ @@ -10258,38 +10253,6 @@ endif endif -GPR_STACK_LOCKFREE_TEST_SRC = \ - test/core/support/stack_lockfree_test.cc \ - -GPR_STACK_LOCKFREE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GPR_STACK_LOCKFREE_TEST_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/gpr_stack_lockfree_test: openssl_dep_error - -else - - - -$(BINDIR)/$(CONFIG)/gpr_stack_lockfree_test: $(GPR_STACK_LOCKFREE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LD) $(LDFLAGS) $(GPR_STACK_LOCKFREE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gpr_stack_lockfree_test - -endif - -$(OBJDIR)/$(CONFIG)/test/core/support/stack_lockfree_test.o: $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a - -deps_gpr_stack_lockfree_test: $(GPR_STACK_LOCKFREE_TEST_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(GPR_STACK_LOCKFREE_TEST_OBJS:.o=.dep) -endif -endif - - GPR_STRING_TEST_SRC = \ test/core/support/string_test.cc \ diff --git a/build.yaml b/build.yaml index 16e31eb588..762b9a2717 100644 --- a/build.yaml +++ b/build.yaml @@ -49,7 +49,6 @@ filegroups: - src/core/lib/support/log_windows.cc - src/core/lib/support/mpscq.cc - src/core/lib/support/murmur_hash.cc - - src/core/lib/support/stack_lockfree.cc - src/core/lib/support/string.cc - src/core/lib/support/string_posix.cc - src/core/lib/support/string_util_windows.cc @@ -115,7 +114,6 @@ filegroups: - src/core/lib/support/mpscq.h - src/core/lib/support/murmur_hash.h - src/core/lib/support/spinlock.h - - src/core/lib/support/stack_lockfree.h - src/core/lib/support/string.h - src/core/lib/support/string_windows.h - src/core/lib/support/time_precise.h @@ -2246,16 +2244,6 @@ targets: - gpr_test_util - gpr uses_polling: false -- name: gpr_stack_lockfree_test - cpu_cost: 7 - build: test - language: c - src: - - test/core/support/stack_lockfree_test.cc - deps: - - gpr_test_util - - gpr - uses_polling: false - name: gpr_string_test build: test language: c diff --git a/config.m4 b/config.m4 index d2f2520fea..520d296d08 100644 --- a/config.m4 +++ b/config.m4 @@ -62,7 +62,6 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/support/log_windows.cc \ src/core/lib/support/mpscq.cc \ src/core/lib/support/murmur_hash.cc \ - src/core/lib/support/stack_lockfree.cc \ src/core/lib/support/string.cc \ src/core/lib/support/string_posix.cc \ src/core/lib/support/string_util_windows.cc \ diff --git a/config.w32 b/config.w32 index 8a713751dc..5e0b1266fb 100644 --- a/config.w32 +++ b/config.w32 @@ -39,7 +39,6 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\support\\log_windows.cc " + "src\\core\\lib\\support\\mpscq.cc " + "src\\core\\lib\\support\\murmur_hash.cc " + - "src\\core\\lib\\support\\stack_lockfree.cc " + "src\\core\\lib\\support\\string.cc " + "src\\core\\lib\\support\\string_posix.cc " + "src\\core\\lib\\support\\string_util_windows.cc " + diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 2f97565f1b..566ba38b0f 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -198,7 +198,6 @@ Pod::Spec.new do |s| 'src/core/lib/support/mpscq.h', 'src/core/lib/support/murmur_hash.h', 'src/core/lib/support/spinlock.h', - 'src/core/lib/support/stack_lockfree.h', 'src/core/lib/support/string.h', 'src/core/lib/support/string_windows.h', 'src/core/lib/support/time_precise.h', @@ -226,7 +225,6 @@ Pod::Spec.new do |s| 'src/core/lib/support/log_windows.cc', 'src/core/lib/support/mpscq.cc', 'src/core/lib/support/murmur_hash.cc', - 'src/core/lib/support/stack_lockfree.cc', 'src/core/lib/support/string.cc', 'src/core/lib/support/string_posix.cc', 'src/core/lib/support/string_util_windows.cc', @@ -718,7 +716,6 @@ Pod::Spec.new do |s| 'src/core/lib/support/mpscq.h', 'src/core/lib/support/murmur_hash.h', 'src/core/lib/support/spinlock.h', - 'src/core/lib/support/stack_lockfree.h', 'src/core/lib/support/string.h', 'src/core/lib/support/string_windows.h', 'src/core/lib/support/time_precise.h', diff --git a/grpc.gemspec b/grpc.gemspec index 0dd7ceb350..64bea9238b 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -95,7 +95,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/support/mpscq.h ) s.files += %w( src/core/lib/support/murmur_hash.h ) s.files += %w( src/core/lib/support/spinlock.h ) - s.files += %w( src/core/lib/support/stack_lockfree.h ) s.files += %w( src/core/lib/support/string.h ) s.files += %w( src/core/lib/support/string_windows.h ) s.files += %w( src/core/lib/support/time_precise.h ) @@ -123,7 +122,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/support/log_windows.cc ) s.files += %w( src/core/lib/support/mpscq.cc ) s.files += %w( src/core/lib/support/murmur_hash.cc ) - s.files += %w( src/core/lib/support/stack_lockfree.cc ) s.files += %w( src/core/lib/support/string.cc ) s.files += %w( src/core/lib/support/string_posix.cc ) s.files += %w( src/core/lib/support/string_util_windows.cc ) diff --git a/grpc.gyp b/grpc.gyp index fb153915ff..a23d862e20 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -184,7 +184,6 @@ 'src/core/lib/support/log_windows.cc', 'src/core/lib/support/mpscq.cc', 'src/core/lib/support/murmur_hash.cc', - 'src/core/lib/support/stack_lockfree.cc', 'src/core/lib/support/string.cc', 'src/core/lib/support/string_posix.cc', 'src/core/lib/support/string_util_windows.cc', diff --git a/package.xml b/package.xml index 59d49dd165..5b4c06647e 100644 --- a/package.xml +++ b/package.xml @@ -107,7 +107,6 @@ - @@ -135,7 +134,6 @@ - diff --git a/src/core/lib/support/stack_lockfree.cc b/src/core/lib/support/stack_lockfree.cc deleted file mode 100644 index 7a4ede3b92..0000000000 --- a/src/core/lib/support/stack_lockfree.cc +++ /dev/null @@ -1,137 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include "src/core/lib/support/stack_lockfree.h" - -#include -#include - -#include -#include -#include -#include - -/* The lockfree node structure is a single architecture-level - word that allows for an atomic CAS to set it up. */ -struct lockfree_node_contents { - /* next thing to look at. Actual index for head, next index otherwise */ - uint16_t index; -#ifdef GPR_ARCH_64 - uint16_t pad; - uint32_t aba_ctr; -#else -#ifdef GPR_ARCH_32 - uint16_t aba_ctr; -#else -#error Unsupported bit width architecture -#endif -#endif -}; - -/* Use a union to make sure that these are in the same bits as an atm word */ -typedef union lockfree_node { - gpr_atm atm; - struct lockfree_node_contents contents; -} lockfree_node; - -/* make sure that entries aligned to 8-bytes */ -#define ENTRY_ALIGNMENT_BITS 3 -/* reserve this entry as invalid */ -#define INVALID_ENTRY_INDEX ((1 << 16) - 1) - -struct gpr_stack_lockfree { - lockfree_node* entries; - lockfree_node head; /* An atomic entry describing curr head */ -}; - -gpr_stack_lockfree* gpr_stack_lockfree_create(size_t entries) { - gpr_stack_lockfree* stack; - stack = (gpr_stack_lockfree*)gpr_malloc(sizeof(*stack)); - /* Since we only allocate 16 bits to represent an entry number, - * make sure that we are within the desired range */ - /* Reserve the highest entry number as a dummy */ - GPR_ASSERT(entries < INVALID_ENTRY_INDEX); - stack->entries = (lockfree_node*)gpr_malloc_aligned( - entries * sizeof(stack->entries[0]), ENTRY_ALIGNMENT_BITS); - /* Clear out all entries */ - memset(stack->entries, 0, entries * sizeof(stack->entries[0])); - memset(&stack->head, 0, sizeof(stack->head)); - - GPR_ASSERT(sizeof(stack->entries->atm) == sizeof(stack->entries->contents)); - - /* Point the head at reserved dummy entry */ - stack->head.contents.index = INVALID_ENTRY_INDEX; -/* Fill in the pad and aba_ctr to avoid confusing memcheck tools */ -#ifdef GPR_ARCH_64 - stack->head.contents.pad = 0; -#endif - stack->head.contents.aba_ctr = 0; - return stack; -} - -void gpr_stack_lockfree_destroy(gpr_stack_lockfree* stack) { - gpr_free_aligned(stack->entries); - gpr_free(stack); -} - -int gpr_stack_lockfree_push(gpr_stack_lockfree* stack, int entry) { - lockfree_node head; - lockfree_node newhead; - lockfree_node curent; - lockfree_node newent; - - /* First fill in the entry's index and aba ctr for new head */ - newhead.contents.index = (uint16_t)entry; -#ifdef GPR_ARCH_64 - /* Fill in the pad to avoid confusing memcheck tools */ - newhead.contents.pad = 0; -#endif - - /* Also post-increment the aba_ctr */ - curent.atm = gpr_atm_no_barrier_load(&stack->entries[entry].atm); - newhead.contents.aba_ctr = ++curent.contents.aba_ctr; - gpr_atm_no_barrier_store(&stack->entries[entry].atm, curent.atm); - - do { - /* Atomically get the existing head value for use */ - head.atm = gpr_atm_no_barrier_load(&(stack->head.atm)); - /* Point to it */ - newent.atm = gpr_atm_no_barrier_load(&stack->entries[entry].atm); - newent.contents.index = head.contents.index; - gpr_atm_no_barrier_store(&stack->entries[entry].atm, newent.atm); - } while (!gpr_atm_rel_cas(&(stack->head.atm), head.atm, newhead.atm)); - /* Use rel_cas above to make sure that entry index is set properly */ - return head.contents.index == INVALID_ENTRY_INDEX; -} - -int gpr_stack_lockfree_pop(gpr_stack_lockfree* stack) { - lockfree_node head; - lockfree_node newhead; - - do { - head.atm = gpr_atm_acq_load(&(stack->head.atm)); - if (head.contents.index == INVALID_ENTRY_INDEX) { - return -1; - } - newhead.atm = - gpr_atm_no_barrier_load(&(stack->entries[head.contents.index].atm)); - - } while (!gpr_atm_no_barrier_cas(&(stack->head.atm), head.atm, newhead.atm)); - - return head.contents.index; -} diff --git a/src/core/lib/support/stack_lockfree.h b/src/core/lib/support/stack_lockfree.h deleted file mode 100644 index 337ecc2b17..0000000000 --- a/src/core/lib/support/stack_lockfree.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_CORE_LIB_SUPPORT_STACK_LOCKFREE_H -#define GRPC_CORE_LIB_SUPPORT_STACK_LOCKFREE_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct gpr_stack_lockfree gpr_stack_lockfree; - -/* This stack must specify the maximum number of entries to track. - The current implementation only allows up to 65534 entries */ -gpr_stack_lockfree* gpr_stack_lockfree_create(size_t entries); -void gpr_stack_lockfree_destroy(gpr_stack_lockfree* stack); - -/* Pass in a valid entry number for the next stack entry */ -/* Returns 1 if this is the first element on the stack, 0 otherwise */ -int gpr_stack_lockfree_push(gpr_stack_lockfree*, int entry); - -/* Returns -1 on empty or the actual entry number */ -int gpr_stack_lockfree_pop(gpr_stack_lockfree* stack); - -#ifdef __cplusplus -} -#endif - -#endif /* GRPC_CORE_LIB_SUPPORT_STACK_LOCKFREE_H */ diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 330c4185c6..efb4d8617d 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -38,7 +38,6 @@ CORE_SOURCE_FILES = [ 'src/core/lib/support/log_windows.cc', 'src/core/lib/support/mpscq.cc', 'src/core/lib/support/murmur_hash.cc', - 'src/core/lib/support/stack_lockfree.cc', 'src/core/lib/support/string.cc', 'src/core/lib/support/string_posix.cc', 'src/core/lib/support/string_util_windows.cc', diff --git a/test/core/support/BUILD b/test/core/support/BUILD index 69512cd9a9..996166a371 100644 --- a/test/core/support/BUILD +++ b/test/core/support/BUILD @@ -118,16 +118,6 @@ grpc_cc_test( ], ) -grpc_cc_test( - name = "stack_lockfree_test", - srcs = ["stack_lockfree_test.cc"], - language = "C++", - deps = [ - "//:gpr", - "//test/core/util:gpr_test_util", - ], -) - grpc_cc_test( name = "string_test", srcs = ["string_test.cc"], @@ -211,25 +201,25 @@ grpc_cc_test( grpc_cc_test( name = "memory_test", srcs = ["memory_test.cc"], + external_deps = [ + "gtest", + ], language = "C++", deps = [ "//:grpc", "//test/core/util:gpr_test_util", ], - external_deps = [ - "gtest", - ], ) grpc_cc_test( name = "vector_test", srcs = ["vector_test.cc"], + external_deps = [ + "gtest", + ], language = "C++", deps = [ "//:grpc", "//test/core/util:gpr_test_util", ], - external_deps = [ - "gtest", - ], ) diff --git a/test/core/support/stack_lockfree_test.cc b/test/core/support/stack_lockfree_test.cc deleted file mode 100644 index e6d0c9b795..0000000000 --- a/test/core/support/stack_lockfree_test.cc +++ /dev/null @@ -1,140 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include "src/core/lib/support/stack_lockfree.h" - -#include - -#include -#include -#include -#include -#include "test/core/util/test_config.h" - -/* max stack size supported */ -#define MAX_STACK_SIZE 65534 - -#define MAX_THREADS 32 - -static void test_serial_sized(size_t size) { - gpr_stack_lockfree* stack = gpr_stack_lockfree_create(size); - size_t i; - size_t j; - - /* First try popping empty */ - GPR_ASSERT(gpr_stack_lockfree_pop(stack) == -1); - - /* Now add one item and check it */ - gpr_stack_lockfree_push(stack, 3); - GPR_ASSERT(gpr_stack_lockfree_pop(stack) == 3); - GPR_ASSERT(gpr_stack_lockfree_pop(stack) == -1); - - /* Now add repeatedly more items and check them */ - for (i = 1; i < size; i *= 2) { - for (j = 0; j <= i; j++) { - GPR_ASSERT(gpr_stack_lockfree_push(stack, (int)j) == (j == 0)); - } - for (j = 0; j <= i; j++) { - GPR_ASSERT(gpr_stack_lockfree_pop(stack) == (int)(i - j)); - } - GPR_ASSERT(gpr_stack_lockfree_pop(stack) == -1); - } - - gpr_stack_lockfree_destroy(stack); -} - -static void test_serial() { - size_t i; - for (i = 128; i < MAX_STACK_SIZE; i *= 2) { - test_serial_sized(i); - } - test_serial_sized(MAX_STACK_SIZE); -} - -struct test_arg { - gpr_stack_lockfree* stack; - int stack_size; - int nthreads; - int rank; - int sum; -}; - -static void test_mt_body(void* v) { - struct test_arg* arg = (struct test_arg*)v; - int lo, hi; - int i; - int res; - lo = arg->rank * arg->stack_size / arg->nthreads; - hi = (arg->rank + 1) * arg->stack_size / arg->nthreads; - for (i = lo; i < hi; i++) { - gpr_stack_lockfree_push(arg->stack, i); - if ((res = gpr_stack_lockfree_pop(arg->stack)) != -1) { - arg->sum += res; - } - } - while ((res = gpr_stack_lockfree_pop(arg->stack)) != -1) { - arg->sum += res; - } -} - -static void test_mt_sized(size_t size, int nth) { - gpr_stack_lockfree* stack; - struct test_arg args[MAX_THREADS]; - gpr_thd_id thds[MAX_THREADS]; - int sum; - int i; - gpr_thd_options options = gpr_thd_options_default(); - - stack = gpr_stack_lockfree_create(size); - for (i = 0; i < nth; i++) { - args[i].stack = stack; - args[i].stack_size = (int)size; - args[i].nthreads = nth; - args[i].rank = i; - args[i].sum = 0; - } - gpr_thd_options_set_joinable(&options); - for (i = 0; i < nth; i++) { - GPR_ASSERT(gpr_thd_new(&thds[i], test_mt_body, &args[i], &options)); - } - sum = 0; - for (i = 0; i < nth; i++) { - gpr_thd_join(thds[i]); - sum = sum + args[i].sum; - } - GPR_ASSERT((unsigned)sum == ((unsigned)size * (size - 1)) / 2); - gpr_stack_lockfree_destroy(stack); -} - -static void test_mt() { - size_t size; - int nth; - for (nth = 1; nth < MAX_THREADS; nth++) { - for (size = 128; size < MAX_STACK_SIZE; size *= 2) { - test_mt_sized(size, nth); - } - test_mt_sized(MAX_STACK_SIZE, nth); - } -} - -int main(int argc, char** argv) { - grpc_test_init(argc, argv); - test_serial(); - test_mt(); - return 0; -} diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 3c564e203a..5d1bfb2735 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -1037,7 +1037,6 @@ src/core/lib/support/memory.h \ src/core/lib/support/mpscq.h \ src/core/lib/support/murmur_hash.h \ src/core/lib/support/spinlock.h \ -src/core/lib/support/stack_lockfree.h \ src/core/lib/support/string.h \ src/core/lib/support/string_windows.h \ src/core/lib/support/time_precise.h \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 5674124f44..e8ae75eae9 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1299,8 +1299,6 @@ src/core/lib/support/mpscq.h \ src/core/lib/support/murmur_hash.cc \ src/core/lib/support/murmur_hash.h \ src/core/lib/support/spinlock.h \ -src/core/lib/support/stack_lockfree.cc \ -src/core/lib/support/stack_lockfree.h \ src/core/lib/support/string.cc \ src/core/lib/support/string.h \ src/core/lib/support/string_posix.cc \ diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 5a3429c81f..24d865932c 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -793,21 +793,6 @@ "third_party": false, "type": "target" }, - { - "deps": [ - "gpr", - "gpr_test_util" - ], - "headers": [], - "is_filegroup": false, - "language": "c", - "name": "gpr_stack_lockfree_test", - "src": [ - "test/core/support/stack_lockfree_test.cc" - ], - "third_party": false, - "type": "target" - }, { "deps": [ "gpr", @@ -7770,7 +7755,6 @@ "src/core/lib/support/log_windows.cc", "src/core/lib/support/mpscq.cc", "src/core/lib/support/murmur_hash.cc", - "src/core/lib/support/stack_lockfree.cc", "src/core/lib/support/string.cc", "src/core/lib/support/string_posix.cc", "src/core/lib/support/string_util_windows.cc", @@ -7840,7 +7824,6 @@ "src/core/lib/support/mpscq.h", "src/core/lib/support/murmur_hash.h", "src/core/lib/support/spinlock.h", - "src/core/lib/support/stack_lockfree.h", "src/core/lib/support/string.h", "src/core/lib/support/string_windows.h", "src/core/lib/support/time_precise.h", @@ -7889,7 +7872,6 @@ "src/core/lib/support/mpscq.h", "src/core/lib/support/murmur_hash.h", "src/core/lib/support/spinlock.h", - "src/core/lib/support/stack_lockfree.h", "src/core/lib/support/string.h", "src/core/lib/support/string_windows.h", "src/core/lib/support/time_precise.h", diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index dfd7bfafe6..58db35ccf9 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -983,30 +983,6 @@ ], "uses_polling": false }, - { - "args": [], - "benchmark": false, - "ci_platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "cpu_cost": 7, - "exclude_configs": [], - "exclude_iomgrs": [], - "flaky": false, - "gtest": false, - "language": "c", - "name": "gpr_stack_lockfree_test", - "platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "uses_polling": false - }, { "args": [], "benchmark": false, -- cgit v1.2.3 From 99986d76a5b7183b9a6f8142169b145ae77c5290 Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Wed, 22 Nov 2017 11:08:58 -0800 Subject: fix --- tools/interop_matrix/client_matrix.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py index ae3ee2764a..d2cd376f4e 100644 --- a/tools/interop_matrix/client_matrix.py +++ b/tools/interop_matrix/client_matrix.py @@ -19,6 +19,7 @@ def get_github_repo(lang): return { 'go': 'git@github.com:grpc/grpc-go.git', 'java': 'git@github.com:grpc/grpc-java.git', + 'node': 'git@github.com:grpc/grpc-node.git', # all other languages use the grpc.git repo. }.get(lang, 'git@github.com:grpc/grpc.git') @@ -44,6 +45,7 @@ LANG_RELEASE_MATRIX = { 'v1.3.9', 'v1.4.2', 'v1.6.6', + 'v1.7.2', ], 'go': [ 'v1.0.5', @@ -77,6 +79,15 @@ LANG_RELEASE_MATRIX = { 'v1.4.2', 'v1.6.6', ], + 'python': [ + 'v1.0.x', + 'v1.1.4', + 'v1.2.5', + 'v1.3.9', + 'v1.4.2', + 'v1.6.6', + 'v1.7.2', + ], 'node': [ 'v1.0.1', 'v1.1.4', @@ -84,6 +95,7 @@ LANG_RELEASE_MATRIX = { 'v1.3.9', 'v1.4.2', 'v1.6.6', + 'v1.7.1', ], 'ruby': [ # Ruby v1.0.x doesn't have the fix #8914, therefore not supported. @@ -92,6 +104,7 @@ LANG_RELEASE_MATRIX = { 'v1.3.9', 'v1.4.2', 'v1.6.6', + 'v1.7.2', ], 'php': [ 'v1.0.1', @@ -100,6 +113,7 @@ LANG_RELEASE_MATRIX = { 'v1.3.9', 'v1.4.2', 'v1.6.6', + 'v1.7.2', ], 'csharp': [ #'v1.0.1', @@ -108,5 +122,6 @@ LANG_RELEASE_MATRIX = { 'v1.3.9', 'v1.4.2', 'v1.6.6', + 'v1.7.2', ], } -- cgit v1.2.3 From a3664680c5a5cdf5d25e09d139474bd459447b63 Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Tue, 14 Nov 2017 17:30:32 -0800 Subject: Recreate the git root dir by default. --- tools/interop_matrix/create_matrix_images.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/interop_matrix/create_matrix_images.py b/tools/interop_matrix/create_matrix_images.py index 21040eadf2..ddeca65f27 100755 --- a/tools/interop_matrix/create_matrix_images.py +++ b/tools/interop_matrix/create_matrix_images.py @@ -77,6 +77,13 @@ argp.add_argument('--keep', action='store_true', help='keep the created local images after uploading to GCR') +argp.add_argument('--reuse_git_root', + default=False, + action='store_const', + const=True, + help='reuse the repo dir. Reusing the repo can cause git ' + 'checkout error if you switch between releases.') + args = argp.parse_args() @@ -227,6 +234,11 @@ def checkout_grpc_stack(lang, release): repo_dir = os.path.splitext(os.path.basename(repo))[0] stack_base = os.path.join(args.git_checkout_root, repo_dir) + # Clean up leftover repo dir if necessary. + if not args.reuse_git_root and os.path.exists(stack_base): + jobset.message('START', 'Removing git checkout root.', do_newline=True) + shutil.rmtree(stack_base) + if not os.path.exists(stack_base): subprocess.check_call(['git', 'clone', '--recursive', repo], cwd=os.path.dirname(stack_base)) -- cgit v1.2.3 From 4fba378edf728a145ca2796169eb8f55eabb5464 Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Tue, 14 Nov 2017 17:43:37 -0800 Subject: Switch back to using template located at _IMAGE_BUILDER because the previous change will break Go, Java and Node. --- tools/interop_matrix/client_matrix.py | 9 +++++++++ tools/interop_matrix/create_matrix_images.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py index d2cd376f4e..c7860f3fcc 100644 --- a/tools/interop_matrix/client_matrix.py +++ b/tools/interop_matrix/client_matrix.py @@ -88,6 +88,15 @@ LANG_RELEASE_MATRIX = { 'v1.6.6', 'v1.7.2', ], + 'python': [ + 'v1.0.x', + 'v1.1.4', + 'v1.2.5', + 'v1.3.9', + 'v1.4.2', + 'v1.6.6', + 'v1.7.2', + ], 'node': [ 'v1.0.1', 'v1.1.4', diff --git a/tools/interop_matrix/create_matrix_images.py b/tools/interop_matrix/create_matrix_images.py index ddeca65f27..00aa003363 100755 --- a/tools/interop_matrix/create_matrix_images.py +++ b/tools/interop_matrix/create_matrix_images.py @@ -140,7 +140,7 @@ def build_image_jobspec(runtime, env, gcr_tag, stack_base): } build_env.update(env) build_job = jobset.JobSpec( - cmdline=[os.path.join(stack_base, _IMAGE_BUILDER)], + cmdline=[_IMAGE_BUILDER], environ=build_env, shortname='build_docker_%s' % runtime, timeout_seconds=30*60) -- cgit v1.2.3 From 935aa47e6574c3506c520122eaea23b541edc46a Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Wed, 15 Nov 2017 16:35:40 -0800 Subject: Use special VIP --- tools/interop_matrix/testcases/node__v1.0.1 | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tools/interop_matrix/testcases/node__v1.0.1 b/tools/interop_matrix/testcases/node__v1.0.1 index fca9821544..6faf321391 100644 --- a/tools/interop_matrix/testcases/node__v1.0.1 +++ b/tools/interop_matrix/testcases/node__v1.0.1 @@ -1,21 +1,21 @@ #!/bin/bash echo "Testing ${docker_image:=grpc_interop_node:a53aa5e3-b548-4566-b5a8-6d15c1315b32}" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_00c688f2-57da-4023-89f3-46b1f7b5869f $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_d86705d8-14ea-4024-90b6-de74d6e8d19c $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_ebaafacd-1d82-4a75-bea1-a5c64e01fcaf $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_5125241a-fbf6-4c1c-895b-026a5a41f02f $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_3d5e5b82-7205-4eba-b775-8122f05a4760 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_16fa0b49-2083-4932-8f26-79cfdffec940 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_23cee670-2d8d-4f5c-8893-c3c43da8b03a $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_7b6a9454-e3b6-4993-b542-468e268930aa $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_5a7109ed-c065-4b62-98f4-b3ed8f385762 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test.sandbox.googleapis.com --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_1e0ba8dd-4dc1-431b-b202-529e7ace5d1d $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_649de56a-e722-4a59-b265-e9c0e871f068 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_8be512a2-5e1c-4858-8cfc-82f99b678b76 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_d19b6333-e528-48b5-8421-2ae3f7ce9dab $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_4749c80a-21c5-4d81-9df5-3c46ba6480cd $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_b7bee545-4857-4269-a1f2-9553dfc7e4b8 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_4e96db87-6f48-426d-a7f0-97f3a5b6b3f4 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_31a1d58c-f8bf-460a-af60-28969ecaaf80 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response" -docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_ce64b147-bcfa-44b2-a2f7-4a485380ce30 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=grpc-test4.sandbox.googleapis.com --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_00c688f2-57da-4023-89f3-46b1f7b5869f $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_d86705d8-14ea-4024-90b6-de74d6e8d19c $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_ebaafacd-1d82-4a75-bea1-a5c64e01fcaf $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_5125241a-fbf6-4c1c-895b-026a5a41f02f $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_3d5e5b82-7205-4eba-b775-8122f05a4760 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_16fa0b49-2083-4932-8f26-79cfdffec940 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_23cee670-2d8d-4f5c-8893-c3c43da8b03a $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_7b6a9454-e3b6-4993-b542-468e268930aa $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_5a7109ed-c065-4b62-98f4-b3ed8f385762 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_1e0ba8dd-4dc1-431b-b202-529e7ace5d1d $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=large_unary" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_649de56a-e722-4a59-b265-e9c0e871f068 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_unary" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_8be512a2-5e1c-4858-8cfc-82f99b678b76 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=ping_pong" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_d19b6333-e528-48b5-8421-2ae3f7ce9dab $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=empty_stream" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_4749c80a-21c5-4d81-9df5-3c46ba6480cd $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=client_streaming" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_b7bee545-4857-4269-a1f2-9553dfc7e4b8 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=server_streaming" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_4e96db87-6f48-426d-a7f0-97f3a5b6b3f4 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_begin" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_31a1d58c-f8bf-460a-af60-28969ecaaf80 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=cancel_after_first_response" +docker run -i --rm=true -w /var/local/git/grpc --net=host --name interop_client_node_ce64b147-bcfa-44b2-a2f7-4a485380ce30 $docker_image bash -l -c "node src/node/interop/interop_client.js --server_host=216.239.32.254 --server_host_override=grpc-test4.sandbox.googleapis.com --server_port=443 --use_tls=true --test_case=timeout_on_sleeping_server" -- cgit v1.2.3 From e4d63e644630987ceaa098540d012026e290f610 Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Wed, 15 Nov 2017 16:42:12 -0800 Subject: Give a command example with multiple languages. --- tools/interop_matrix/README.md | 4 ++-- tools/interop_matrix/create_matrix_images.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/interop_matrix/README.md b/tools/interop_matrix/README.md index 588afe4fd4..40c02a1bc7 100644 --- a/tools/interop_matrix/README.md +++ b/tools/interop_matrix/README.md @@ -8,8 +8,8 @@ from specific releases/tag, are used to test version compatiblity between gRPC r ## Step-by-step instructions for adding a GCR image for a new release for compatibility test We have continuous nightly test setup to test gRPC backward compatibility between old clients and latest server. When a gRPC developer creates a new gRPC release, s/he is also responsible to add the just-released gRPC client to the nightly test. The steps are: - Add (or update) an entry in `./client_matrix.py` file to reference the github tag for the release. -- Build new client docker image(s). For example, for java release `v1.9.9`, do - - `tools/interop_matrix/create_matrix_images.py --git_checkout --release=v1.9.9 --language=java` +- Build new client docker image(s). For example, for C and wrapper languages release `v1.9.9`, do + - `tools/interop_matrix/create_matrix_images.py --git_checkout --release=v1.9.9 --language cxx csharp python ruby php` - Verify that the new docker image was built successfully and uploaded to GCR. For example, - `gcloud beta container images list --repository gcr.io/grpc-testing` shows image repos. - `gcloud beta container images list-tags gcr.io/grpc-testing/grpc_interop_java_oracle8` should show an image entry with tag `v1.9.9`. diff --git a/tools/interop_matrix/create_matrix_images.py b/tools/interop_matrix/create_matrix_images.py index 00aa003363..493a7d5364 100755 --- a/tools/interop_matrix/create_matrix_images.py +++ b/tools/interop_matrix/create_matrix_images.py @@ -81,8 +81,10 @@ argp.add_argument('--reuse_git_root', default=False, action='store_const', const=True, - help='reuse the repo dir. Reusing the repo can cause git ' - 'checkout error if you switch between releases.') + help='reuse the repo dir. If False, the existing git root ' + 'directory will removed before a clean checkout, because ' + 'reusing the repo can cause git checkout error if you switch ' + 'between releases.') args = argp.parse_args() -- cgit v1.2.3 From 28661ea6e189fc03fdcf9f6a0f6f15e40c916d08 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 22 Nov 2017 13:28:38 -0800 Subject: Bump third_party/protobuf submodule to v3.5.0 --- WORKSPACE | 4 ++-- third_party/protobuf | 2 +- tools/codegen/core/gen_nano_proto.sh | 2 +- tools/distrib/python/grpcio_tools/protoc_lib_deps.py | 4 ++-- tools/run_tests/sanity/check_submodules.sh | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 6df24e9c2f..cead0bc877 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -73,8 +73,8 @@ new_http_archive( http_archive( name = "com_google_protobuf", - strip_prefix = "protobuf-80a37e0782d2d702d52234b62dd4b9ec74fd2c95", - url = "https://github.com/google/protobuf/archive/80a37e0782d2d702d52234b62dd4b9ec74fd2c95.tar.gz", + strip_prefix = "protobuf-2761122b810fe8861004ae785cc3ab39f384d342", + url = "https://github.com/google/protobuf/archive/2761122b810fe8861004ae785cc3ab39f384d342.tar.gz", ) new_http_archive( diff --git a/third_party/protobuf b/third_party/protobuf index 80a37e0782..2761122b81 160000 --- a/third_party/protobuf +++ b/third_party/protobuf @@ -1 +1 @@ -Subproject commit 80a37e0782d2d702d52234b62dd4b9ec74fd2c95 +Subproject commit 2761122b810fe8861004ae785cc3ab39f384d342 diff --git a/tools/codegen/core/gen_nano_proto.sh b/tools/codegen/core/gen_nano_proto.sh index db00bd937f..4246840173 100755 --- a/tools/codegen/core/gen_nano_proto.sh +++ b/tools/codegen/core/gen_nano_proto.sh @@ -68,7 +68,7 @@ popd # this should be the same version as the submodule we compile against # ideally we'd update this as a template to ensure that -pip install protobuf==3.2.0 +pip install protobuf==3.5.0.post1 pushd "$(dirname $INPUT_PROTO)" > /dev/null diff --git a/tools/distrib/python/grpcio_tools/protoc_lib_deps.py b/tools/distrib/python/grpcio_tools/protoc_lib_deps.py index 2a42a518fc..2c65fca628 100644 --- a/tools/distrib/python/grpcio_tools/protoc_lib_deps.py +++ b/tools/distrib/python/grpcio_tools/protoc_lib_deps.py @@ -14,10 +14,10 @@ # limitations under the License. # AUTO-GENERATED BY make_grpcio_tools.py! -CC_FILES=['google/protobuf/compiler/zip_writer.cc', 'google/protobuf/compiler/subprocess.cc', 'google/protobuf/compiler/ruby/ruby_generator.cc', 'google/protobuf/compiler/python/python_generator.cc', 'google/protobuf/compiler/plugin.pb.cc', 'google/protobuf/compiler/plugin.cc', 'google/protobuf/compiler/php/php_generator.cc', 'google/protobuf/compiler/objectivec/objectivec_primitive_field.cc', 'google/protobuf/compiler/objectivec/objectivec_oneof.cc', 'google/protobuf/compiler/objectivec/objectivec_message_field.cc', 'google/protobuf/compiler/objectivec/objectivec_message.cc', 'google/protobuf/compiler/objectivec/objectivec_map_field.cc', 'google/protobuf/compiler/objectivec/objectivec_helpers.cc', 'google/protobuf/compiler/objectivec/objectivec_generator.cc', 'google/protobuf/compiler/objectivec/objectivec_file.cc', 'google/protobuf/compiler/objectivec/objectivec_field.cc', 'google/protobuf/compiler/objectivec/objectivec_extension.cc', 'google/protobuf/compiler/objectivec/objectivec_enum_field.cc', 'google/protobuf/compiler/objectivec/objectivec_enum.cc', 'google/protobuf/compiler/js/well_known_types_embed.cc', 'google/protobuf/compiler/js/js_generator.cc', 'google/protobuf/compiler/javanano/javanano_primitive_field.cc', 'google/protobuf/compiler/javanano/javanano_message_field.cc', 'google/protobuf/compiler/javanano/javanano_message.cc', 'google/protobuf/compiler/javanano/javanano_map_field.cc', 'google/protobuf/compiler/javanano/javanano_helpers.cc', 'google/protobuf/compiler/javanano/javanano_generator.cc', 'google/protobuf/compiler/javanano/javanano_file.cc', 'google/protobuf/compiler/javanano/javanano_field.cc', 'google/protobuf/compiler/javanano/javanano_extension.cc', 'google/protobuf/compiler/javanano/javanano_enum_field.cc', 'google/protobuf/compiler/javanano/javanano_enum.cc', 'google/protobuf/compiler/java/java_string_field_lite.cc', 'google/protobuf/compiler/java/java_string_field.cc', 'google/protobuf/compiler/java/java_shared_code_generator.cc', 'google/protobuf/compiler/java/java_service.cc', 'google/protobuf/compiler/java/java_primitive_field_lite.cc', 'google/protobuf/compiler/java/java_primitive_field.cc', 'google/protobuf/compiler/java/java_name_resolver.cc', 'google/protobuf/compiler/java/java_message_lite.cc', 'google/protobuf/compiler/java/java_message_field_lite.cc', 'google/protobuf/compiler/java/java_message_field.cc', 'google/protobuf/compiler/java/java_message_builder_lite.cc', 'google/protobuf/compiler/java/java_message_builder.cc', 'google/protobuf/compiler/java/java_message.cc', 'google/protobuf/compiler/java/java_map_field_lite.cc', 'google/protobuf/compiler/java/java_map_field.cc', 'google/protobuf/compiler/java/java_lazy_message_field_lite.cc', 'google/protobuf/compiler/java/java_lazy_message_field.cc', 'google/protobuf/compiler/java/java_helpers.cc', 'google/protobuf/compiler/java/java_generator_factory.cc', 'google/protobuf/compiler/java/java_generator.cc', 'google/protobuf/compiler/java/java_file.cc', 'google/protobuf/compiler/java/java_field.cc', 'google/protobuf/compiler/java/java_extension_lite.cc', 'google/protobuf/compiler/java/java_extension.cc', 'google/protobuf/compiler/java/java_enum_lite.cc', 'google/protobuf/compiler/java/java_enum_field_lite.cc', 'google/protobuf/compiler/java/java_enum_field.cc', 'google/protobuf/compiler/java/java_enum.cc', 'google/protobuf/compiler/java/java_doc_comment.cc', 'google/protobuf/compiler/java/java_context.cc', 'google/protobuf/compiler/csharp/csharp_wrapper_field.cc', 'google/protobuf/compiler/csharp/csharp_source_generator_base.cc', 'google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc', 'google/protobuf/compiler/csharp/csharp_repeated_message_field.cc', 'google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc', 'google/protobuf/compiler/csharp/csharp_reflection_class.cc', 'google/protobuf/compiler/csharp/csharp_primitive_field.cc', 'google/protobuf/compiler/csharp/csharp_message_field.cc', 'google/protobuf/compiler/csharp/csharp_message.cc', 'google/protobuf/compiler/csharp/csharp_map_field.cc', 'google/protobuf/compiler/csharp/csharp_helpers.cc', 'google/protobuf/compiler/csharp/csharp_generator.cc', 'google/protobuf/compiler/csharp/csharp_field_base.cc', 'google/protobuf/compiler/csharp/csharp_enum_field.cc', 'google/protobuf/compiler/csharp/csharp_enum.cc', 'google/protobuf/compiler/csharp/csharp_doc_comment.cc', 'google/protobuf/compiler/cpp/cpp_string_field.cc', 'google/protobuf/compiler/cpp/cpp_service.cc', 'google/protobuf/compiler/cpp/cpp_primitive_field.cc', 'google/protobuf/compiler/cpp/cpp_message_field.cc', 'google/protobuf/compiler/cpp/cpp_message.cc', 'google/protobuf/compiler/cpp/cpp_map_field.cc', 'google/protobuf/compiler/cpp/cpp_helpers.cc', 'google/protobuf/compiler/cpp/cpp_generator.cc', 'google/protobuf/compiler/cpp/cpp_file.cc', 'google/protobuf/compiler/cpp/cpp_field.cc', 'google/protobuf/compiler/cpp/cpp_extension.cc', 'google/protobuf/compiler/cpp/cpp_enum_field.cc', 'google/protobuf/compiler/cpp/cpp_enum.cc', 'google/protobuf/compiler/command_line_interface.cc', 'google/protobuf/compiler/code_generator.cc', 'google/protobuf/wrappers.pb.cc', 'google/protobuf/wire_format.cc', 'google/protobuf/util/type_resolver_util.cc', 'google/protobuf/util/time_util.cc', 'google/protobuf/util/message_differencer.cc', 'google/protobuf/util/json_util.cc', 'google/protobuf/util/internal/utility.cc', 'google/protobuf/util/internal/type_info_test_helper.cc', 'google/protobuf/util/internal/type_info.cc', 'google/protobuf/util/internal/protostream_objectwriter.cc', 'google/protobuf/util/internal/protostream_objectsource.cc', 'google/protobuf/util/internal/proto_writer.cc', 'google/protobuf/util/internal/object_writer.cc', 'google/protobuf/util/internal/json_stream_parser.cc', 'google/protobuf/util/internal/json_objectwriter.cc', 'google/protobuf/util/internal/json_escaping.cc', 'google/protobuf/util/internal/field_mask_utility.cc', 'google/protobuf/util/internal/error_listener.cc', 'google/protobuf/util/internal/default_value_objectwriter.cc', 'google/protobuf/util/internal/datapiece.cc', 'google/protobuf/util/field_mask_util.cc', 'google/protobuf/util/field_comparator.cc', 'google/protobuf/util/delimited_message_util.cc', 'google/protobuf/unknown_field_set.cc', 'google/protobuf/type.pb.cc', 'google/protobuf/timestamp.pb.cc', 'google/protobuf/text_format.cc', 'google/protobuf/stubs/substitute.cc', 'google/protobuf/stubs/mathlimits.cc', 'google/protobuf/struct.pb.cc', 'google/protobuf/source_context.pb.cc', 'google/protobuf/service.cc', 'google/protobuf/reflection_ops.cc', 'google/protobuf/message.cc', 'google/protobuf/map_field.cc', 'google/protobuf/io/zero_copy_stream_impl.cc', 'google/protobuf/io/tokenizer.cc', 'google/protobuf/io/strtod.cc', 'google/protobuf/io/printer.cc', 'google/protobuf/io/gzip_stream.cc', 'google/protobuf/generated_message_table_driven.cc', 'google/protobuf/generated_message_reflection.cc', 'google/protobuf/field_mask.pb.cc', 'google/protobuf/extension_set_heavy.cc', 'google/protobuf/empty.pb.cc', 'google/protobuf/dynamic_message.cc', 'google/protobuf/duration.pb.cc', 'google/protobuf/descriptor_database.cc', 'google/protobuf/descriptor.pb.cc', 'google/protobuf/descriptor.cc', 'google/protobuf/compiler/parser.cc', 'google/protobuf/compiler/importer.cc', 'google/protobuf/api.pb.cc', 'google/protobuf/any.pb.cc', 'google/protobuf/any.cc', 'google/protobuf/wire_format_lite.cc', 'google/protobuf/stubs/time.cc', 'google/protobuf/stubs/strutil.cc', 'google/protobuf/stubs/structurally_valid.cc', 'google/protobuf/stubs/stringprintf.cc', 'google/protobuf/stubs/stringpiece.cc', 'google/protobuf/stubs/statusor.cc', 'google/protobuf/stubs/status.cc', 'google/protobuf/stubs/once.cc', 'google/protobuf/stubs/io_win32.cc', 'google/protobuf/stubs/int128.cc', 'google/protobuf/stubs/common.cc', 'google/protobuf/stubs/bytestream.cc', 'google/protobuf/stubs/atomicops_internals_x86_msvc.cc', 'google/protobuf/stubs/atomicops_internals_x86_gcc.cc', 'google/protobuf/repeated_field.cc', 'google/protobuf/message_lite.cc', 'google/protobuf/io/zero_copy_stream_impl_lite.cc', 'google/protobuf/io/zero_copy_stream.cc', 'google/protobuf/io/coded_stream.cc', 'google/protobuf/generated_message_util.cc', 'google/protobuf/generated_message_table_driven_lite.cc', 'google/protobuf/extension_set.cc', 'google/protobuf/arenastring.cc', 'google/protobuf/arena.cc', 'google/protobuf/compiler/js/embed.cc'] +CC_FILES=['google/protobuf/compiler/zip_writer.cc', 'google/protobuf/compiler/subprocess.cc', 'google/protobuf/compiler/ruby/ruby_generator.cc', 'google/protobuf/compiler/python/python_generator.cc', 'google/protobuf/compiler/plugin.pb.cc', 'google/protobuf/compiler/plugin.cc', 'google/protobuf/compiler/php/php_generator.cc', 'google/protobuf/compiler/objectivec/objectivec_primitive_field.cc', 'google/protobuf/compiler/objectivec/objectivec_oneof.cc', 'google/protobuf/compiler/objectivec/objectivec_message_field.cc', 'google/protobuf/compiler/objectivec/objectivec_message.cc', 'google/protobuf/compiler/objectivec/objectivec_map_field.cc', 'google/protobuf/compiler/objectivec/objectivec_helpers.cc', 'google/protobuf/compiler/objectivec/objectivec_generator.cc', 'google/protobuf/compiler/objectivec/objectivec_file.cc', 'google/protobuf/compiler/objectivec/objectivec_field.cc', 'google/protobuf/compiler/objectivec/objectivec_extension.cc', 'google/protobuf/compiler/objectivec/objectivec_enum_field.cc', 'google/protobuf/compiler/objectivec/objectivec_enum.cc', 'google/protobuf/compiler/js/well_known_types_embed.cc', 'google/protobuf/compiler/js/js_generator.cc', 'google/protobuf/compiler/javanano/javanano_primitive_field.cc', 'google/protobuf/compiler/javanano/javanano_message_field.cc', 'google/protobuf/compiler/javanano/javanano_message.cc', 'google/protobuf/compiler/javanano/javanano_map_field.cc', 'google/protobuf/compiler/javanano/javanano_helpers.cc', 'google/protobuf/compiler/javanano/javanano_generator.cc', 'google/protobuf/compiler/javanano/javanano_file.cc', 'google/protobuf/compiler/javanano/javanano_field.cc', 'google/protobuf/compiler/javanano/javanano_extension.cc', 'google/protobuf/compiler/javanano/javanano_enum_field.cc', 'google/protobuf/compiler/javanano/javanano_enum.cc', 'google/protobuf/compiler/java/java_string_field_lite.cc', 'google/protobuf/compiler/java/java_string_field.cc', 'google/protobuf/compiler/java/java_shared_code_generator.cc', 'google/protobuf/compiler/java/java_service.cc', 'google/protobuf/compiler/java/java_primitive_field_lite.cc', 'google/protobuf/compiler/java/java_primitive_field.cc', 'google/protobuf/compiler/java/java_name_resolver.cc', 'google/protobuf/compiler/java/java_message_lite.cc', 'google/protobuf/compiler/java/java_message_field_lite.cc', 'google/protobuf/compiler/java/java_message_field.cc', 'google/protobuf/compiler/java/java_message_builder_lite.cc', 'google/protobuf/compiler/java/java_message_builder.cc', 'google/protobuf/compiler/java/java_message.cc', 'google/protobuf/compiler/java/java_map_field_lite.cc', 'google/protobuf/compiler/java/java_map_field.cc', 'google/protobuf/compiler/java/java_lazy_message_field_lite.cc', 'google/protobuf/compiler/java/java_lazy_message_field.cc', 'google/protobuf/compiler/java/java_helpers.cc', 'google/protobuf/compiler/java/java_generator_factory.cc', 'google/protobuf/compiler/java/java_generator.cc', 'google/protobuf/compiler/java/java_file.cc', 'google/protobuf/compiler/java/java_field.cc', 'google/protobuf/compiler/java/java_extension_lite.cc', 'google/protobuf/compiler/java/java_extension.cc', 'google/protobuf/compiler/java/java_enum_lite.cc', 'google/protobuf/compiler/java/java_enum_field_lite.cc', 'google/protobuf/compiler/java/java_enum_field.cc', 'google/protobuf/compiler/java/java_enum.cc', 'google/protobuf/compiler/java/java_doc_comment.cc', 'google/protobuf/compiler/java/java_context.cc', 'google/protobuf/compiler/csharp/csharp_wrapper_field.cc', 'google/protobuf/compiler/csharp/csharp_source_generator_base.cc', 'google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc', 'google/protobuf/compiler/csharp/csharp_repeated_message_field.cc', 'google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc', 'google/protobuf/compiler/csharp/csharp_reflection_class.cc', 'google/protobuf/compiler/csharp/csharp_primitive_field.cc', 'google/protobuf/compiler/csharp/csharp_message_field.cc', 'google/protobuf/compiler/csharp/csharp_message.cc', 'google/protobuf/compiler/csharp/csharp_map_field.cc', 'google/protobuf/compiler/csharp/csharp_helpers.cc', 'google/protobuf/compiler/csharp/csharp_generator.cc', 'google/protobuf/compiler/csharp/csharp_field_base.cc', 'google/protobuf/compiler/csharp/csharp_enum_field.cc', 'google/protobuf/compiler/csharp/csharp_enum.cc', 'google/protobuf/compiler/csharp/csharp_doc_comment.cc', 'google/protobuf/compiler/cpp/cpp_string_field.cc', 'google/protobuf/compiler/cpp/cpp_service.cc', 'google/protobuf/compiler/cpp/cpp_primitive_field.cc', 'google/protobuf/compiler/cpp/cpp_padding_optimizer.cc', 'google/protobuf/compiler/cpp/cpp_message_field.cc', 'google/protobuf/compiler/cpp/cpp_message.cc', 'google/protobuf/compiler/cpp/cpp_map_field.cc', 'google/protobuf/compiler/cpp/cpp_helpers.cc', 'google/protobuf/compiler/cpp/cpp_generator.cc', 'google/protobuf/compiler/cpp/cpp_file.cc', 'google/protobuf/compiler/cpp/cpp_field.cc', 'google/protobuf/compiler/cpp/cpp_extension.cc', 'google/protobuf/compiler/cpp/cpp_enum_field.cc', 'google/protobuf/compiler/cpp/cpp_enum.cc', 'google/protobuf/compiler/command_line_interface.cc', 'google/protobuf/compiler/code_generator.cc', 'google/protobuf/wrappers.pb.cc', 'google/protobuf/wire_format.cc', 'google/protobuf/util/type_resolver_util.cc', 'google/protobuf/util/time_util.cc', 'google/protobuf/util/message_differencer.cc', 'google/protobuf/util/json_util.cc', 'google/protobuf/util/internal/utility.cc', 'google/protobuf/util/internal/type_info_test_helper.cc', 'google/protobuf/util/internal/type_info.cc', 'google/protobuf/util/internal/protostream_objectwriter.cc', 'google/protobuf/util/internal/protostream_objectsource.cc', 'google/protobuf/util/internal/proto_writer.cc', 'google/protobuf/util/internal/object_writer.cc', 'google/protobuf/util/internal/json_stream_parser.cc', 'google/protobuf/util/internal/json_objectwriter.cc', 'google/protobuf/util/internal/json_escaping.cc', 'google/protobuf/util/internal/field_mask_utility.cc', 'google/protobuf/util/internal/error_listener.cc', 'google/protobuf/util/internal/default_value_objectwriter.cc', 'google/protobuf/util/internal/datapiece.cc', 'google/protobuf/util/field_mask_util.cc', 'google/protobuf/util/field_comparator.cc', 'google/protobuf/util/delimited_message_util.cc', 'google/protobuf/unknown_field_set.cc', 'google/protobuf/type.pb.cc', 'google/protobuf/timestamp.pb.cc', 'google/protobuf/text_format.cc', 'google/protobuf/stubs/substitute.cc', 'google/protobuf/stubs/mathlimits.cc', 'google/protobuf/struct.pb.cc', 'google/protobuf/source_context.pb.cc', 'google/protobuf/service.cc', 'google/protobuf/reflection_ops.cc', 'google/protobuf/message.cc', 'google/protobuf/map_field.cc', 'google/protobuf/io/zero_copy_stream_impl.cc', 'google/protobuf/io/tokenizer.cc', 'google/protobuf/io/strtod.cc', 'google/protobuf/io/printer.cc', 'google/protobuf/io/gzip_stream.cc', 'google/protobuf/generated_message_table_driven.cc', 'google/protobuf/generated_message_reflection.cc', 'google/protobuf/field_mask.pb.cc', 'google/protobuf/extension_set_heavy.cc', 'google/protobuf/empty.pb.cc', 'google/protobuf/dynamic_message.cc', 'google/protobuf/duration.pb.cc', 'google/protobuf/descriptor_database.cc', 'google/protobuf/descriptor.pb.cc', 'google/protobuf/descriptor.cc', 'google/protobuf/compiler/parser.cc', 'google/protobuf/compiler/importer.cc', 'google/protobuf/api.pb.cc', 'google/protobuf/any.pb.cc', 'google/protobuf/any.cc', 'google/protobuf/wire_format_lite.cc', 'google/protobuf/stubs/time.cc', 'google/protobuf/stubs/strutil.cc', 'google/protobuf/stubs/structurally_valid.cc', 'google/protobuf/stubs/stringprintf.cc', 'google/protobuf/stubs/stringpiece.cc', 'google/protobuf/stubs/statusor.cc', 'google/protobuf/stubs/status.cc', 'google/protobuf/stubs/once.cc', 'google/protobuf/stubs/io_win32.cc', 'google/protobuf/stubs/int128.cc', 'google/protobuf/stubs/common.cc', 'google/protobuf/stubs/bytestream.cc', 'google/protobuf/stubs/atomicops_internals_x86_msvc.cc', 'google/protobuf/stubs/atomicops_internals_x86_gcc.cc', 'google/protobuf/repeated_field.cc', 'google/protobuf/message_lite.cc', 'google/protobuf/io/zero_copy_stream_impl_lite.cc', 'google/protobuf/io/zero_copy_stream.cc', 'google/protobuf/io/coded_stream.cc', 'google/protobuf/generated_message_util.cc', 'google/protobuf/generated_message_table_driven_lite.cc', 'google/protobuf/extension_set.cc', 'google/protobuf/arenastring.cc', 'google/protobuf/arena.cc', 'google/protobuf/compiler/js/embed.cc'] PROTO_FILES=['google/protobuf/wrappers.proto', 'google/protobuf/type.proto', 'google/protobuf/timestamp.proto', 'google/protobuf/struct.proto', 'google/protobuf/source_context.proto', 'google/protobuf/field_mask.proto', 'google/protobuf/empty.proto', 'google/protobuf/duration.proto', 'google/protobuf/descriptor.proto', 'google/protobuf/compiler/plugin.proto', 'google/protobuf/api.proto', 'google/protobuf/any.proto'] CC_INCLUDE='third_party/protobuf/src' PROTO_INCLUDE='third_party/protobuf/src' -PROTOBUF_SUBMODULE_VERSION="80a37e0782d2d702d52234b62dd4b9ec74fd2c95" +PROTOBUF_SUBMODULE_VERSION="2761122b810fe8861004ae785cc3ab39f384d342" diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh index 1f7b078ff7..b573d21f4f 100755 --- a/tools/run_tests/sanity/check_submodules.sh +++ b/tools/run_tests/sanity/check_submodules.sh @@ -31,7 +31,7 @@ cat << EOF | awk '{ print $1 }' | sort > $want_submodules 886e7d75368e3f4fab3f4d0d3584e4abfc557755 third_party/boringssl-with-bazel (version_for_cocoapods_7.0-857-g886e7d7) 30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e third_party/gflags (v2.2.0) ec44c6c1675c25b9827aacd08c02433cccde7780 third_party/googletest (release-1.8.0) - 80a37e0782d2d702d52234b62dd4b9ec74fd2c95 third_party/protobuf (v3.4.0) + 2761122b810fe8861004ae785cc3ab39f384d342 third_party/protobuf (v3.5.0) cacf7f1d4e3d44d871b605da3b647f07d718623f third_party/zlib (v1.2.11) 3be1924221e1326df520f8498d704a5c4c8d0cce third_party/cares/cares (cares-1_13_0) 73594cde8c9a52a102c4341c244c833aa61b9c06 third_party/bloaty -- cgit v1.2.3 From 32318b05e366cfdbe1473df7f7f983b219a01b0c Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 27 Nov 2017 09:52:30 -0800 Subject: Fix ObjC C++ syntax error --- .../CoreCronetEnd2EndTests.m | 398 --------------------- .../CoreCronetEnd2EndTests.mm | 398 +++++++++++++++++++++ .../tests/Tests.xcodeproj/project.pbxproj | 8 +- 3 files changed, 402 insertions(+), 402 deletions(-) delete mode 100644 src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.m create mode 100644 src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.mm diff --git a/src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.m b/src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.m deleted file mode 100644 index 453b0752c3..0000000000 --- a/src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.m +++ /dev/null @@ -1,398 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/* - * This test file is derived from fixture h2_ssl.c in core end2end test - * (test/core/end2end/fixture/h2_ssl.c). The structure of the fixture is - * preserved as much as possible - * - * This fixture creates a server full stack using chttp2 and a client - * full stack using Cronet. End-to-end tests are run against this - * configuration - * - */ - -#import -#include "test/core/end2end/end2end_tests.h" - -#include -#include - -#include -#include -#include - -#include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/security/credentials/credentials.h" -#include "src/core/lib/support/env.h" -#include "src/core/lib/support/string.h" -#include "src/core/lib/support/tmpfile.h" -#include "test/core/end2end/data/ssl_test_data.h" -#include "test/core/util/port.h" -#include "test/core/util/test_config.h" - -#import -#include - -typedef struct fullstack_secure_fixture_data { - char *localaddr; -} fullstack_secure_fixture_data; - -static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( - grpc_channel_args *client_args, grpc_channel_args *server_args) { - grpc_end2end_test_fixture f; - int port = grpc_pick_unused_port_or_die(); - fullstack_secure_fixture_data *ffd = - gpr_malloc(sizeof(fullstack_secure_fixture_data)); - memset(&f, 0, sizeof(f)); - - gpr_join_host_port(&ffd->localaddr, "127.0.0.1", port); - - f.fixture_data = ffd; - f.cq = grpc_completion_queue_create_for_next(NULL); - f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); - - return f; -} - -static void process_auth_failure(void *state, grpc_auth_context *ctx, - const grpc_metadata *md, size_t md_count, - grpc_process_auth_metadata_done_cb cb, - void *user_data) { - GPR_ASSERT(state == NULL); - cb(user_data, NULL, 0, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL); -} - -static void cronet_init_client_secure_fullstack(grpc_end2end_test_fixture *f, - grpc_channel_args *client_args, - stream_engine *cronetEngine) { - fullstack_secure_fixture_data *ffd = f->fixture_data; - f->client = grpc_cronet_secure_channel_create(cronetEngine, ffd->localaddr, - client_args, NULL); - GPR_ASSERT(f->client != NULL); -} - -static void chttp2_init_server_secure_fullstack( - grpc_end2end_test_fixture *f, grpc_channel_args *server_args, - grpc_server_credentials *server_creds) { - fullstack_secure_fixture_data *ffd = f->fixture_data; - if (f->server) { - grpc_server_destroy(f->server); - } - f->server = grpc_server_create(server_args, NULL); - grpc_server_register_completion_queue(f->server, f->cq, NULL); - GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr, - server_creds)); - grpc_server_credentials_release(server_creds); - grpc_server_start(f->server); -} - -static void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture *f) { - fullstack_secure_fixture_data *ffd = f->fixture_data; - gpr_free(ffd->localaddr); - gpr_free(ffd); -} - -static void cronet_init_client_simple_ssl_secure_fullstack( - grpc_end2end_test_fixture *f, grpc_channel_args *client_args) { - grpc_exec_ctx ctx = GRPC_EXEC_CTX_INIT; - stream_engine *cronetEngine = [Cronet getGlobalEngine]; - - grpc_channel_args *new_client_args = grpc_channel_args_copy(client_args); - cronet_init_client_secure_fullstack(f, new_client_args, cronetEngine); - grpc_channel_args_destroy(&ctx, new_client_args); - grpc_exec_ctx_finish(&ctx); -} - -static int fail_server_auth_check(grpc_channel_args *server_args) { - size_t i; - if (server_args == NULL) return 0; - for (i = 0; i < server_args->num_args; i++) { - if (strcmp(server_args->args[i].key, FAIL_AUTH_CHECK_SERVER_ARG_NAME) == - 0) { - return 1; - } - } - return 0; -} - -static void chttp2_init_server_simple_ssl_secure_fullstack( - grpc_end2end_test_fixture *f, grpc_channel_args *server_args) { - grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key, - test_server1_cert}; - grpc_server_credentials *ssl_creds = - grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL); - if (fail_server_auth_check(server_args)) { - grpc_auth_metadata_processor processor = {process_auth_failure, NULL, NULL}; - grpc_server_credentials_set_auth_metadata_processor(ssl_creds, processor); - } - chttp2_init_server_secure_fullstack(f, server_args, ssl_creds); -} - -/* All test configurations */ - -static grpc_end2end_test_config configs[] = { - {"chttp2/simple_ssl_fullstack", - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS, - chttp2_create_fixture_secure_fullstack, - cronet_init_client_simple_ssl_secure_fullstack, - chttp2_init_server_simple_ssl_secure_fullstack, - chttp2_tear_down_secure_fullstack}, -}; - -static char *roots_filename; - -@interface CoreCronetEnd2EndTests : XCTestCase - -@end - -@implementation CoreCronetEnd2EndTests - -// The setUp() function is run before the test cases run and only run once -+ (void)setUp { - [super setUp]; - - FILE *roots_file; - size_t roots_size = strlen(test_root_cert); - - char *argv[] = {"CoreCronetEnd2EndTests"}; - grpc_test_init(1, argv); - grpc_end2end_tests_pre_init(); - - /* Set the SSL roots env var. */ - roots_file = gpr_tmpfile("chttp2_simple_ssl_fullstack_test", &roots_filename); - GPR_ASSERT(roots_filename != NULL); - GPR_ASSERT(roots_file != NULL); - GPR_ASSERT(fwrite(test_root_cert, 1, roots_size, roots_file) == roots_size); - fclose(roots_file); - gpr_setenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR, roots_filename); - - grpc_init(); - - [Cronet setHttp2Enabled:YES]; - [Cronet enableTestCertVerifierForTesting]; - NSURL *url = [[[NSFileManager defaultManager] - URLsForDirectory:NSDocumentDirectory - inDomains:NSUserDomainMask] lastObject]; - NSLog(@"Documents directory: %@", url); - [Cronet start]; - [Cronet startNetLogToFile:@"cronet_netlog.json" logBytes:YES]; -} - -// The tearDown() function is run after all test cases finish running -+ (void)tearDown { - grpc_shutdown(); - - /* Cleanup. */ - remove(roots_filename); - gpr_free(roots_filename); - - [super tearDown]; -} - -- (void)testIndividualCase:(char *)test_case { - char *argv[] = {"h2_ssl", test_case}; - - for (int i = 0; i < sizeof(configs) / sizeof(*configs); i++) { - grpc_end2end_tests(sizeof(argv) / sizeof(argv[0]), argv, configs[i]); - } -} - -// TODO(mxyan): Use NSStringFromSelector(_cmd) to acquire test name from the -// test case method name, so that bodies of test cases can stay identical -- (void)testAuthorityNotSupported { - [self testIndividualCase:"authority_not_supported"]; -} - -- (void)testBadHostname { - [self testIndividualCase:"bad_hostname"]; -} - -- (void)testBinaryMetadata { - // NOT SUPPORTED - //[self testIndividualCase:"binary_metadata"]; -} - -- (void)testCallCreds { - // NOT SUPPORTED - // [self testIndividualCase:"call_creds"]; -} - -- (void)testCancelAfterAccept { - [self testIndividualCase:"cancel_after_accept"]; -} - -- (void)testCancelAfterClientDone { - [self testIndividualCase:"cancel_after_client_done"]; -} - -- (void)testCancelAfterInvoke { - [self testIndividualCase:"cancel_after_invoke"]; -} - -- (void)testCancelAfterRoundTrip { - [self testIndividualCase:"cancel_after_round_trip"]; -} - -- (void)testCancelBeforeInvoke { - [self testIndividualCase:"cancel_before_invoke"]; -} - -- (void)testCancelInAVacuum { - [self testIndividualCase:"cancel_in_a_vacuum"]; -} - -- (void)testCancelWithStatus { - [self testIndividualCase:"cancel_with_status"]; -} - -- (void)testCompressedPayload { - [self testIndividualCase:"compressed_payload"]; -} - -- (void)testConnectivity { - // NOT SUPPORTED - // [self testIndividualCase:"connectivity"]; -} - -- (void)testDefaultHost { - [self testIndividualCase:"default_host"]; -} - -- (void)testDisappearingServer { - [self testIndividualCase:"disappearing_server"]; -} - -- (void)testEmptyBatch { - [self testIndividualCase:"empty_batch"]; -} - -- (void)testFilterCausesClose { - // NOT SUPPORTED - // [self testIndividualCase:"filter_causes_close"]; -} - -- (void)testGracefulServerShutdown { - [self testIndividualCase:"graceful_server_shutdown"]; -} - -- (void)testHighInitialSeqno { - [self testIndividualCase:"high_initial_seqno"]; -} - -- (void)testHpackSize { - // NOT SUPPORTED - // [self testIndividualCase:"hpack_size"]; -} - -- (void)testIdempotentRequest { - // NOT SUPPORTED - // [self testIndividualCase:"idempotent_request"]; -} - -- (void)testInvokeLargeRequest { - // NOT SUPPORTED (frame size) - // [self testIndividualCase:"invoke_large_request"]; -} - -- (void)testLargeMetadata { - // NOT SUPPORTED - // [self testIndividualCase:"large_metadata"]; -} - -- (void)testMaxConcurrentStreams { - [self testIndividualCase:"max_concurrent_streams"]; -} - -- (void)testMaxMessageLength { - // NOT SUPPORTED (close_error) - // [self testIndividualCase:"max_message_length"]; -} - -- (void)testNegativeDeadline { - [self testIndividualCase:"negative_deadline"]; -} - -- (void)testNetworkStatusChange { - [self testIndividualCase:"network_status_change"]; -} - -- (void)testNoOp { - [self testIndividualCase:"no_op"]; -} - -- (void)testPayload { - [self testIndividualCase:"payload"]; -} - -- (void)testPing { - // NOT SUPPORTED - // [self testIndividualCase:"ping"]; -} - -- (void)testPingPongStreaming { - [self testIndividualCase:"ping_pong_streaming"]; -} - -- (void)testRegisteredCall { - [self testIndividualCase:"registered_call"]; -} - -- (void)testRequestWithFlags { - // NOT SUPPORTED - // [self testIndividualCase:"request_with_flags"]; -} - -- (void)testRequestWithPayload { - [self testIndividualCase:"request_with_payload"]; -} - -- (void)testServerFinishesRequest { - [self testIndividualCase:"server_finishes_request"]; -} - -- (void)testShutdownFinishesCalls { - [self testIndividualCase:"shutdown_finishes_calls"]; -} - -- (void)testShutdownFinishesTags { - [self testIndividualCase:"shutdown_finishes_tags"]; -} - -- (void)testSimpleDelayedRequest { - [self testIndividualCase:"simple_delayed_request"]; -} - -- (void)testSimpleMetadata { - [self testIndividualCase:"simple_metadata"]; -} - -- (void)testSimpleRequest { - [self testIndividualCase:"simple_request"]; -} - -- (void)testStreamingErrorResponse { - [self testIndividualCase:"streaming_error_response"]; -} - -- (void)testTrailingMetadata { - [self testIndividualCase:"trailing_metadata"]; -} - -@end diff --git a/src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.mm b/src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.mm new file mode 100644 index 0000000000..d5e668a858 --- /dev/null +++ b/src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.mm @@ -0,0 +1,398 @@ +/* + * + * Copyright 2015 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/* + * This test file is derived from fixture h2_ssl.c in core end2end test + * (test/core/end2end/fixture/h2_ssl.c). The structure of the fixture is + * preserved as much as possible + * + * This fixture creates a server full stack using chttp2 and a client + * full stack using Cronet. End-to-end tests are run against this + * configuration + * + */ + +#import +#include "test/core/end2end/end2end_tests.h" + +#include +#include + +#include +#include +#include + +#include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/security/credentials/credentials.h" +#include "src/core/lib/support/env.h" +#include "src/core/lib/support/string.h" +#include "src/core/lib/support/tmpfile.h" +#include "test/core/end2end/data/ssl_test_data.h" +#include "test/core/util/port.h" +#include "test/core/util/test_config.h" + +#import +#include + +typedef struct fullstack_secure_fixture_data { + char *localaddr; +} fullstack_secure_fixture_data; + +static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( + grpc_channel_args *client_args, grpc_channel_args *server_args) { + grpc_end2end_test_fixture f; + int port = grpc_pick_unused_port_or_die(); + fullstack_secure_fixture_data *ffd = + (fullstack_secure_fixture_data*)gpr_malloc(sizeof(fullstack_secure_fixture_data)); + memset(&f, 0, sizeof(f)); + + gpr_join_host_port(&ffd->localaddr, "127.0.0.1", port); + + f.fixture_data = ffd; + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); + + return f; +} + +static void process_auth_failure(void *state, grpc_auth_context *ctx, + const grpc_metadata *md, size_t md_count, + grpc_process_auth_metadata_done_cb cb, + void *user_data) { + GPR_ASSERT(state == NULL); + cb(user_data, NULL, 0, NULL, 0, GRPC_STATUS_UNAUTHENTICATED, NULL); +} + +static void cronet_init_client_secure_fullstack(grpc_end2end_test_fixture *f, + grpc_channel_args *client_args, + stream_engine *cronetEngine) { + fullstack_secure_fixture_data *ffd = (fullstack_secure_fixture_data *)f->fixture_data; + f->client = grpc_cronet_secure_channel_create(cronetEngine, ffd->localaddr, + client_args, NULL); + GPR_ASSERT(f->client != NULL); +} + +static void chttp2_init_server_secure_fullstack( + grpc_end2end_test_fixture *f, grpc_channel_args *server_args, + grpc_server_credentials *server_creds) { + fullstack_secure_fixture_data *ffd = (fullstack_secure_fixture_data *)f->fixture_data; + if (f->server) { + grpc_server_destroy(f->server); + } + f->server = grpc_server_create(server_args, NULL); + grpc_server_register_completion_queue(f->server, f->cq, NULL); + GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr, + server_creds)); + grpc_server_credentials_release(server_creds); + grpc_server_start(f->server); +} + +static void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture *f) { + fullstack_secure_fixture_data *ffd = (fullstack_secure_fixture_data *)f->fixture_data; + gpr_free(ffd->localaddr); + gpr_free(ffd); +} + +static void cronet_init_client_simple_ssl_secure_fullstack( + grpc_end2end_test_fixture *f, grpc_channel_args *client_args) { + grpc_exec_ctx ctx = GRPC_EXEC_CTX_INIT; + stream_engine *cronetEngine = [Cronet getGlobalEngine]; + + grpc_channel_args *new_client_args = grpc_channel_args_copy(client_args); + cronet_init_client_secure_fullstack(f, new_client_args, cronetEngine); + grpc_channel_args_destroy(&ctx, new_client_args); + grpc_exec_ctx_finish(&ctx); +} + +static int fail_server_auth_check(grpc_channel_args *server_args) { + size_t i; + if (server_args == NULL) return 0; + for (i = 0; i < server_args->num_args; i++) { + if (strcmp(server_args->args[i].key, FAIL_AUTH_CHECK_SERVER_ARG_NAME) == + 0) { + return 1; + } + } + return 0; +} + +static void chttp2_init_server_simple_ssl_secure_fullstack( + grpc_end2end_test_fixture *f, grpc_channel_args *server_args) { + grpc_ssl_pem_key_cert_pair pem_cert_key_pair = {test_server1_key, + test_server1_cert}; + grpc_server_credentials *ssl_creds = + grpc_ssl_server_credentials_create(NULL, &pem_cert_key_pair, 1, 0, NULL); + if (fail_server_auth_check(server_args)) { + grpc_auth_metadata_processor processor = {process_auth_failure, NULL, NULL}; + grpc_server_credentials_set_auth_metadata_processor(ssl_creds, processor); + } + chttp2_init_server_secure_fullstack(f, server_args, ssl_creds); +} + +/* All test configurations */ + +static grpc_end2end_test_config configs[] = { + {"chttp2/simple_ssl_fullstack", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS, + chttp2_create_fixture_secure_fullstack, + cronet_init_client_simple_ssl_secure_fullstack, + chttp2_init_server_simple_ssl_secure_fullstack, + chttp2_tear_down_secure_fullstack}, +}; + +static char *roots_filename; + +@interface CoreCronetEnd2EndTests : XCTestCase + +@end + +@implementation CoreCronetEnd2EndTests + +// The setUp() function is run before the test cases run and only run once ++ (void)setUp { + [super setUp]; + + FILE *roots_file; + size_t roots_size = strlen(test_root_cert); + + char *argv[] = {(char *)"CoreCronetEnd2EndTests"}; + grpc_test_init(1, argv); + grpc_end2end_tests_pre_init(); + + /* Set the SSL roots env var. */ + roots_file = gpr_tmpfile("chttp2_simple_ssl_fullstack_test", &roots_filename); + GPR_ASSERT(roots_filename != NULL); + GPR_ASSERT(roots_file != NULL); + GPR_ASSERT(fwrite(test_root_cert, 1, roots_size, roots_file) == roots_size); + fclose(roots_file); + gpr_setenv(GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR, roots_filename); + + grpc_init(); + + [Cronet setHttp2Enabled:YES]; + [Cronet enableTestCertVerifierForTesting]; + NSURL *url = [[[NSFileManager defaultManager] + URLsForDirectory:NSDocumentDirectory + inDomains:NSUserDomainMask] lastObject]; + NSLog(@"Documents directory: %@", url); + [Cronet start]; + [Cronet startNetLogToFile:@"cronet_netlog.json" logBytes:YES]; +} + +// The tearDown() function is run after all test cases finish running ++ (void)tearDown { + grpc_shutdown(); + + /* Cleanup. */ + remove(roots_filename); + gpr_free(roots_filename); + + [super tearDown]; +} + +- (void)testIndividualCase:(char *)test_case { + char *argv[] = {(char *)"h2_ssl", test_case}; + + for (int i = 0; i < sizeof(configs) / sizeof(*configs); i++) { + grpc_end2end_tests(sizeof(argv) / sizeof(argv[0]), argv, configs[i]); + } +} + +// TODO(mxyan): Use NSStringFromSelector(_cmd) to acquire test name from the +// test case method name, so that bodies of test cases can stay identical +- (void)testAuthorityNotSupported { + [self testIndividualCase:(char *)"authority_not_supported"]; +} + +- (void)testBadHostname { + [self testIndividualCase:(char *)"bad_hostname"]; +} + +- (void)testBinaryMetadata { + // NOT SUPPORTED + //[self testIndividualCase:(char *)"binary_metadata"]; +} + +- (void)testCallCreds { + // NOT SUPPORTED + // [self testIndividualCase:(char *)"call_creds"]; +} + +- (void)testCancelAfterAccept { + [self testIndividualCase:(char *)"cancel_after_accept"]; +} + +- (void)testCancelAfterClientDone { + [self testIndividualCase:(char *)"cancel_after_client_done"]; +} + +- (void)testCancelAfterInvoke { + [self testIndividualCase:(char *)"cancel_after_invoke"]; +} + +- (void)testCancelAfterRoundTrip { + [self testIndividualCase:(char *)"cancel_after_round_trip"]; +} + +- (void)testCancelBeforeInvoke { + [self testIndividualCase:(char *)"cancel_before_invoke"]; +} + +- (void)testCancelInAVacuum { + [self testIndividualCase:(char *)"cancel_in_a_vacuum"]; +} + +- (void)testCancelWithStatus { + [self testIndividualCase:(char *)"cancel_with_status"]; +} + +- (void)testCompressedPayload { + [self testIndividualCase:(char *)"compressed_payload"]; +} + +- (void)testConnectivity { + // NOT SUPPORTED + // [self testIndividualCase:(char *)"connectivity"]; +} + +- (void)testDefaultHost { + [self testIndividualCase:(char *)"default_host"]; +} + +- (void)testDisappearingServer { + [self testIndividualCase:(char *)"disappearing_server"]; +} + +- (void)testEmptyBatch { + [self testIndividualCase:(char *)"empty_batch"]; +} + +- (void)testFilterCausesClose { + // NOT SUPPORTED + // [self testIndividualCase:(char *)"filter_causes_close"]; +} + +- (void)testGracefulServerShutdown { + [self testIndividualCase:(char *)"graceful_server_shutdown"]; +} + +- (void)testHighInitialSeqno { + [self testIndividualCase:(char *)"high_initial_seqno"]; +} + +- (void)testHpackSize { + // NOT SUPPORTED + // [self testIndividualCase:(char *)"hpack_size"]; +} + +- (void)testIdempotentRequest { + // NOT SUPPORTED + // [self testIndividualCase:(char *)"idempotent_request"]; +} + +- (void)testInvokeLargeRequest { + // NOT SUPPORTED (frame size) + // [self testIndividualCase:(char *)"invoke_large_request"]; +} + +- (void)testLargeMetadata { + // NOT SUPPORTED + // [self testIndividualCase:(char *)"large_metadata"]; +} + +- (void)testMaxConcurrentStreams { + [self testIndividualCase:(char *)"max_concurrent_streams"]; +} + +- (void)testMaxMessageLength { + // NOT SUPPORTED (close_error) + // [self testIndividualCase:(char *)"max_message_length"]; +} + +- (void)testNegativeDeadline { + [self testIndividualCase:(char *)"negative_deadline"]; +} + +- (void)testNetworkStatusChange { + [self testIndividualCase:(char *)"network_status_change"]; +} + +- (void)testNoOp { + [self testIndividualCase:(char *)"no_op"]; +} + +- (void)testPayload { + [self testIndividualCase:(char *)"payload"]; +} + +- (void)testPing { + // NOT SUPPORTED + // [self testIndividualCase:(char *)"ping"]; +} + +- (void)testPingPongStreaming { + [self testIndividualCase:(char *)"ping_pong_streaming"]; +} + +- (void)testRegisteredCall { + [self testIndividualCase:(char *)"registered_call"]; +} + +- (void)testRequestWithFlags { + // NOT SUPPORTED + // [self testIndividualCase:(char *)"request_with_flags"]; +} + +- (void)testRequestWithPayload { + [self testIndividualCase:(char *)"request_with_payload"]; +} + +- (void)testServerFinishesRequest { + [self testIndividualCase:(char *)"server_finishes_request"]; +} + +- (void)testShutdownFinishesCalls { + [self testIndividualCase:(char *)"shutdown_finishes_calls"]; +} + +- (void)testShutdownFinishesTags { + [self testIndividualCase:(char *)"shutdown_finishes_tags"]; +} + +- (void)testSimpleDelayedRequest { + [self testIndividualCase:(char *)"simple_delayed_request"]; +} + +- (void)testSimpleMetadata { + [self testIndividualCase:(char *)"simple_metadata"]; +} + +- (void)testSimpleRequest { + [self testIndividualCase:(char *)"simple_request"]; +} + +- (void)testStreamingErrorResponse { + [self testIndividualCase:(char *)"streaming_error_response"]; +} + +- (void)testTrailingMetadata { + [self testIndividualCase:(char *)"trailing_metadata"]; +} + +@end diff --git a/src/objective-c/tests/Tests.xcodeproj/project.pbxproj b/src/objective-c/tests/Tests.xcodeproj/project.pbxproj index 2f0c8cfe18..52631b4dce 100644 --- a/src/objective-c/tests/Tests.xcodeproj/project.pbxproj +++ b/src/objective-c/tests/Tests.xcodeproj/project.pbxproj @@ -14,7 +14,7 @@ 20DFDF829DD993A4A00D5662 /* libPods-RxLibraryUnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A58BE6DF1C62D1739EBB2C78 /* libPods-RxLibraryUnitTests.a */; }; 333E8FC01C8285B7C547D799 /* libPods-InteropTestsLocalCleartext.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD346DB2C23F676C4842F3FF /* libPods-InteropTestsLocalCleartext.a */; }; 3D7C85F6AA68C4A205E3BA16 /* libPods-Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 20DFF2F3C97EF098FE5A3171 /* libPods-Tests.a */; }; - 5E8A5DA71D3840B4000F8BC4 /* CoreCronetEnd2EndTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E8A5DA61D3840B4000F8BC4 /* CoreCronetEnd2EndTests.m */; }; + 5E8A5DA71D3840B4000F8BC4 /* CoreCronetEnd2EndTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5E8A5DA61D3840B4000F8BC4 /* CoreCronetEnd2EndTests.mm */; }; 5E8A5DA91D3840B4000F8BC4 /* libTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 635697C71B14FC11007A7283 /* libTests.a */; }; 5EAD6D271E27047400002378 /* CronetUnitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EAD6D261E27047400002378 /* CronetUnitTests.m */; }; 5EAD6D291E27047400002378 /* libTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 635697C71B14FC11007A7283 /* libTests.a */; }; @@ -140,7 +140,7 @@ 573450F334B331D0BED8B961 /* Pods-CoreCronetEnd2EndTests.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoreCronetEnd2EndTests.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-CoreCronetEnd2EndTests/Pods-CoreCronetEnd2EndTests.cronet.xcconfig"; sourceTree = ""; }; 5761E98978DDDF136A58CB7E /* Pods-AllTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AllTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-AllTests/Pods-AllTests.release.xcconfig"; sourceTree = ""; }; 5E8A5DA41D3840B4000F8BC4 /* CoreCronetEnd2EndTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreCronetEnd2EndTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 5E8A5DA61D3840B4000F8BC4 /* CoreCronetEnd2EndTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CoreCronetEnd2EndTests.m; sourceTree = ""; }; + 5E8A5DA61D3840B4000F8BC4 /* CoreCronetEnd2EndTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CoreCronetEnd2EndTests.mm; sourceTree = ""; }; 5EAD6D241E27047400002378 /* CronetUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CronetUnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 5EAD6D261E27047400002378 /* CronetUnitTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CronetUnitTests.m; sourceTree = ""; }; 5EAD6D281E27047400002378 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -343,7 +343,7 @@ 5E8A5DA51D3840B4000F8BC4 /* CoreCronetEnd2EndTests */ = { isa = PBXGroup; children = ( - 5E8A5DA61D3840B4000F8BC4 /* CoreCronetEnd2EndTests.m */, + 5E8A5DA61D3840B4000F8BC4 /* CoreCronetEnd2EndTests.mm */, ); path = CoreCronetEnd2EndTests; sourceTree = ""; @@ -1196,7 +1196,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 5E8A5DA71D3840B4000F8BC4 /* CoreCronetEnd2EndTests.m in Sources */, + 5E8A5DA71D3840B4000F8BC4 /* CoreCronetEnd2EndTests.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; -- cgit v1.2.3 From ab8fce5338ff89acb570c77a84e56dcc18500476 Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Mon, 27 Nov 2017 09:53:19 -0800 Subject: Disable node 1.7 --- tools/interop_matrix/client_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py index c7860f3fcc..ee24ae7b28 100644 --- a/tools/interop_matrix/client_matrix.py +++ b/tools/interop_matrix/client_matrix.py @@ -104,7 +104,7 @@ LANG_RELEASE_MATRIX = { 'v1.3.9', 'v1.4.2', 'v1.6.6', - 'v1.7.1', + #'v1.7.1', Failing tests. ], 'ruby': [ # Ruby v1.0.x doesn't have the fix #8914, therefore not supported. -- cgit v1.2.3 From 333dd3e1ad9acdccb10a7536590317bf58102ad9 Mon Sep 17 00:00:00 2001 From: "David G. Quintas" Date: Mon, 27 Nov 2017 12:27:49 -0800 Subject: Revert "Do not interpolate variables in leading comments." --- src/compiler/cpp_generator.cc | 2 +- src/compiler/csharp_generator.cc | 2 +- src/compiler/node_generator.cc | 2 +- src/compiler/objective_c_generator.cc | 2 +- src/compiler/php_generator.cc | 2 +- src/compiler/protobuf_plugin.h | 1 - src/compiler/python_generator.cc | 2 +- src/compiler/ruby_generator.cc | 2 +- src/compiler/schema_interface.h | 1 - 9 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc index dec8cd0f25..3adf0fa451 100644 --- a/src/compiler/cpp_generator.cc +++ b/src/compiler/cpp_generator.cc @@ -104,7 +104,7 @@ grpc::string GetHeaderPrologue(grpc_generator::File* file, grpc::string leading_comments = file->GetLeadingComments("//"); if (!leading_comments.empty()) { printer->Print(vars, "// Original file comments:\n"); - printer->PrintRaw(leading_comments.c_str()); + printer->Print(leading_comments.c_str()); } printer->Print(vars, "#ifndef GRPC_$filename_identifier$__INCLUDED\n"); printer->Print(vars, "#define GRPC_$filename_identifier$__INCLUDED\n"); diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc index 40fe0b054a..e0957bf9bb 100644 --- a/src/compiler/csharp_generator.cc +++ b/src/compiler/csharp_generator.cc @@ -666,7 +666,7 @@ grpc::string GetServices(const FileDescriptor* file, bool generate_client, grpc::string leading_comments = GetCsharpComments(file, true); if (!leading_comments.empty()) { out.Print("// Original file comments:\n"); - out.PrintRaw(leading_comments.c_str()); + out.Print(leading_comments.c_str()); } out.Print("#pragma warning disable 1591\n"); diff --git a/src/compiler/node_generator.cc b/src/compiler/node_generator.cc index 661587cbd6..ed835b4445 100644 --- a/src/compiler/node_generator.cc +++ b/src/compiler/node_generator.cc @@ -250,7 +250,7 @@ grpc::string GenerateFile(const FileDescriptor* file) { grpc::string leading_comments = GetNodeComments(file, true); if (!leading_comments.empty()) { out.Print("// Original file comments:\n"); - out.PrintRaw(leading_comments.c_str()); + out.Print(leading_comments.c_str()); } out.Print("'use strict';\n"); diff --git a/src/compiler/objective_c_generator.cc b/src/compiler/objective_c_generator.cc index 8fe30e97e9..349f1dc281 100644 --- a/src/compiler/objective_c_generator.cc +++ b/src/compiler/objective_c_generator.cc @@ -65,7 +65,7 @@ static void PrintAllComments(const DescriptorType* desc, Printer* printer) { printer->Print(" * "); size_t start_pos = it->find_first_not_of(' '); if (start_pos != grpc::string::npos) { - printer->PrintRaw(it->c_str() + start_pos); + printer->Print(it->c_str() + start_pos); } printer->Print("\n"); } diff --git a/src/compiler/php_generator.cc b/src/compiler/php_generator.cc index d9705e8077..1ff9520d7f 100644 --- a/src/compiler/php_generator.cc +++ b/src/compiler/php_generator.cc @@ -164,7 +164,7 @@ grpc::string GenerateFile(const FileDescriptor* file, grpc::string leading_comments = GetPHPComments(file, "//"); if (!leading_comments.empty()) { out.Print("// Original file comments:\n"); - out.PrintRaw(leading_comments.c_str()); + out.Print(leading_comments.c_str()); } map vars; diff --git a/src/compiler/protobuf_plugin.h b/src/compiler/protobuf_plugin.h index b971af1310..1551908156 100644 --- a/src/compiler/protobuf_plugin.h +++ b/src/compiler/protobuf_plugin.h @@ -141,7 +141,6 @@ class ProtoBufPrinter : public grpc_generator::Printer { } void Print(const char* string) { printer_.Print(string); } - void PrintRaw(const char* string) { printer_.PrintRaw(string); } void Indent() { printer_.Indent(); } void Outdent() { printer_.Outdent(); } diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc index 8a0b889454..c1ae7d31ad 100644 --- a/src/compiler/python_generator.cc +++ b/src/compiler/python_generator.cc @@ -101,7 +101,7 @@ void PrivateGenerator::PrintAllComments(StringVector comments, ++it) { size_t start_pos = it->find_first_not_of(' '); if (start_pos != grpc::string::npos) { - out->PrintRaw(it->c_str() + start_pos); + out->Print(it->c_str() + start_pos); } out->Print("\n"); } diff --git a/src/compiler/ruby_generator.cc b/src/compiler/ruby_generator.cc index e81dea603b..ed7e074b47 100644 --- a/src/compiler/ruby_generator.cc +++ b/src/compiler/ruby_generator.cc @@ -174,7 +174,7 @@ grpc::string GetServices(const FileDescriptor* file) { grpc::string leading_comments = GetRubyComments(file, true); if (!leading_comments.empty()) { out.Print("# Original file comments:\n"); - out.PrintRaw(leading_comments.c_str()); + out.Print(leading_comments.c_str()); } out.Print("\n"); diff --git a/src/compiler/schema_interface.h b/src/compiler/schema_interface.h index c000478e68..b2021f2926 100644 --- a/src/compiler/schema_interface.h +++ b/src/compiler/schema_interface.h @@ -86,7 +86,6 @@ struct Printer { virtual void Print(const std::map& vars, const char* template_string) = 0; virtual void Print(const char* string) = 0; - virtual void PrintRaw(const char* string) = 0; virtual void Indent() = 0; virtual void Outdent() = 0; }; -- cgit v1.2.3 From 0df9c8acdcb41adc3e28fd147c31d40d650140a8 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Fri, 24 Nov 2017 21:20:14 -0800 Subject: Update Python dependency to protobuf v3.5.0.post1 --- requirements.txt | 2 +- setup.py | 2 +- src/python/grpcio_health_checking/setup.py | 2 +- src/python/grpcio_reflection/setup.py | 2 +- src/python/grpcio_testing/setup.py | 2 +- src/python/grpcio_tests/setup.py | 4 ++-- templates/tools/dockerfile/python_deps.include | 2 +- tools/distrib/python/grpcio_tools/setup.py | 2 +- tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_go/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_go1.7/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_java/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_java_oracle8/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_node/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_python/Dockerfile | 2 +- tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile | 2 +- tools/dockerfile/test/csharp_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/cxx_alpine_x64/Dockerfile | 2 +- tools/dockerfile/test/cxx_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/cxx_jessie_x86/Dockerfile | 2 +- tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile | 2 +- tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile | 2 +- tools/dockerfile/test/fuzzer/Dockerfile | 2 +- tools/dockerfile/test/multilang_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/node_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/php7_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/php_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/python_alpine_x64/Dockerfile | 2 +- tools/dockerfile/test/python_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/python_pyenv_x64/Dockerfile | 2 +- tools/dockerfile/test/ruby_jessie_x64/Dockerfile | 2 +- tools/dockerfile/test/sanity/Dockerfile | 2 +- 36 files changed, 37 insertions(+), 37 deletions(-) diff --git a/requirements.txt b/requirements.txt index 12969958ae..c976cef4cb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,6 @@ coverage>=4.0 cython>=0.23 enum34>=1.0.4 futures>=2.2.0 -protobuf>=3.2.0 +protobuf>=3.5.0.post1 six>=1.10 wheel>=0.29 diff --git a/setup.py b/setup.py index bf8aea6b6f..bd07ccd73a 100644 --- a/setup.py +++ b/setup.py @@ -237,7 +237,7 @@ INSTALL_REQUIRES = ( 'six>=1.5.2', # TODO(atash): eventually split the grpcio package into a metapackage # depending on protobuf and the runtime component (independent of protobuf) - 'protobuf>=3.3.0', + 'protobuf>=3.5.0.post1', ) if not PY3: diff --git a/src/python/grpcio_health_checking/setup.py b/src/python/grpcio_health_checking/setup.py index 7a2e6f5027..c105f57509 100644 --- a/src/python/grpcio_health_checking/setup.py +++ b/src/python/grpcio_health_checking/setup.py @@ -56,7 +56,7 @@ PACKAGE_DIRECTORIES = { '': '.', } -INSTALL_REQUIRES = ('protobuf>=3.3.0', +INSTALL_REQUIRES = ('protobuf>=3.5.0.post1', 'grpcio>={version}'.format(version=grpc_version.VERSION),) try: diff --git a/src/python/grpcio_reflection/setup.py b/src/python/grpcio_reflection/setup.py index 25312c7c0a..760b89373a 100644 --- a/src/python/grpcio_reflection/setup.py +++ b/src/python/grpcio_reflection/setup.py @@ -57,7 +57,7 @@ PACKAGE_DIRECTORIES = { '': '.', } -INSTALL_REQUIRES = ('protobuf>=3.3.0', +INSTALL_REQUIRES = ('protobuf>=3.5.0.post1', 'grpcio>={version}'.format(version=grpc_version.VERSION),) try: diff --git a/src/python/grpcio_testing/setup.py b/src/python/grpcio_testing/setup.py index 0cc336abd1..fa40424f6a 100644 --- a/src/python/grpcio_testing/setup.py +++ b/src/python/grpcio_testing/setup.py @@ -28,7 +28,7 @@ PACKAGE_DIRECTORIES = { '': '.', } -INSTALL_REQUIRES = ('protobuf>=3.3.0', +INSTALL_REQUIRES = ('protobuf>=3.5.0.post1', 'grpcio>={version}'.format(version=grpc_version.VERSION),) setuptools.setup( diff --git a/src/python/grpcio_tests/setup.py b/src/python/grpcio_tests/setup.py index debe14c40e..aeb4ea9c53 100644 --- a/src/python/grpcio_tests/setup.py +++ b/src/python/grpcio_tests/setup.py @@ -41,8 +41,8 @@ INSTALL_REQUIRES = ( 'grpcio>={version}'.format(version=grpc_version.VERSION), 'grpcio-tools>={version}'.format(version=grpc_version.VERSION), 'grpcio-health-checking>={version}'.format(version=grpc_version.VERSION), - 'oauth2client>=1.4.7', 'protobuf>=3.3.0', 'six>=1.10', 'google-auth>=1.0.0', - 'requests>=2.14.2') + 'oauth2client>=1.4.7', 'protobuf>=3.5.0.post1', 'six>=1.10', + 'google-auth>=1.0.0', 'requests>=2.14.2') COMMAND_CLASS = { # Run `preprocess` *before* doing any packaging! diff --git a/templates/tools/dockerfile/python_deps.include b/templates/tools/dockerfile/python_deps.include index bf1f57f267..cd1af22b43 100644 --- a/templates/tools/dockerfile/python_deps.include +++ b/templates/tools/dockerfile/python_deps.include @@ -11,4 +11,4 @@ RUN apt-get update && apt-get install -y ${'\\'} # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 diff --git a/tools/distrib/python/grpcio_tools/setup.py b/tools/distrib/python/grpcio_tools/setup.py index e0e9226211..8d95cb5a28 100644 --- a/tools/distrib/python/grpcio_tools/setup.py +++ b/tools/distrib/python/grpcio_tools/setup.py @@ -209,7 +209,7 @@ setuptools.setup( ext_modules=extension_modules(), packages=setuptools.find_packages('.'), install_requires=[ - 'protobuf>=3.3.0', + 'protobuf>=3.5.0.post1', 'grpcio>={version}'.format(version=grpc_version.VERSION), ], package_data=package_data(), diff --git a/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile index ea82476b65..af2ab90b76 100644 --- a/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile @@ -62,7 +62,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 #================ # C# dependencies diff --git a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile index ea82476b65..af2ab90b76 100644 --- a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile @@ -62,7 +62,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 #================ # C# dependencies diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile index 38d377ce2f..ec5338b4fc 100644 --- a/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile @@ -62,7 +62,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 #================= # C++ dependencies diff --git a/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile index 73c41a4838..a775961ff7 100644 --- a/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile @@ -30,7 +30,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.7/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go1.7/Dockerfile index 7c083de365..c296c8c674 100644 --- a/tools/dockerfile/interoptest/grpc_interop_go1.7/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_go1.7/Dockerfile @@ -30,7 +30,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile index 61efc18df9..9ac0b97341 100644 --- a/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile @@ -30,7 +30,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile index 278b09a666..92a2faa605 100644 --- a/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile @@ -30,7 +30,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 RUN pip install twisted h2==2.6.1 hyper diff --git a/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile index d56632440f..34b4e39df4 100644 --- a/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile @@ -45,7 +45,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 # Trigger download of as many Gradle artifacts as possible. diff --git a/tools/dockerfile/interoptest/grpc_interop_java_oracle8/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_java_oracle8/Dockerfile index d56632440f..34b4e39df4 100644 --- a/tools/dockerfile/interoptest/grpc_interop_java_oracle8/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_java_oracle8/Dockerfile @@ -45,7 +45,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 # Trigger download of as many Gradle artifacts as possible. diff --git a/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile index f4c3e4103e..17671a384e 100644 --- a/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile @@ -62,7 +62,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 #================== # Node dependencies diff --git a/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile index d165307031..07f419f880 100644 --- a/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile @@ -62,7 +62,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 # Prepare ccache RUN ln -s /usr/bin/ccache /usr/local/bin/gcc diff --git a/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile index 2217b10b8b..543e207c64 100644 --- a/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile @@ -62,7 +62,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 #================== # Ruby dependencies diff --git a/tools/dockerfile/test/csharp_jessie_x64/Dockerfile b/tools/dockerfile/test/csharp_jessie_x64/Dockerfile index 3e31e67f5f..0fae21de63 100644 --- a/tools/dockerfile/test/csharp_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/csharp_jessie_x64/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 #================ # C# dependencies diff --git a/tools/dockerfile/test/cxx_alpine_x64/Dockerfile b/tools/dockerfile/test/cxx_alpine_x64/Dockerfile index af5e7d6f14..13a0ea1002 100644 --- a/tools/dockerfile/test/cxx_alpine_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_alpine_x64/Dockerfile @@ -38,7 +38,7 @@ RUN apk update && apk add \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 # Google Cloud platform API libraries RUN pip install --upgrade google-api-python-client diff --git a/tools/dockerfile/test/cxx_jessie_x64/Dockerfile b/tools/dockerfile/test/cxx_jessie_x64/Dockerfile index 3492dd72c5..dff4c96e9a 100644 --- a/tools/dockerfile/test/cxx_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_jessie_x64/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 #================= # C++ dependencies diff --git a/tools/dockerfile/test/cxx_jessie_x86/Dockerfile b/tools/dockerfile/test/cxx_jessie_x86/Dockerfile index f8cbf35d39..ea1d645628 100644 --- a/tools/dockerfile/test/cxx_jessie_x86/Dockerfile +++ b/tools/dockerfile/test/cxx_jessie_x86/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 #================= # C++ dependencies diff --git a/tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile b/tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile index 6966d6b8d3..990dac9128 100644 --- a/tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_ubuntu1404_x64/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 #================= # C++ dependencies diff --git a/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile b/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile index 016034aa50..c8943cada9 100644 --- a/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 #================= # C++ dependencies diff --git a/tools/dockerfile/test/fuzzer/Dockerfile b/tools/dockerfile/test/fuzzer/Dockerfile index 50104ad7ae..52666eab99 100644 --- a/tools/dockerfile/test/fuzzer/Dockerfile +++ b/tools/dockerfile/test/fuzzer/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 #================= # C++ dependencies diff --git a/tools/dockerfile/test/multilang_jessie_x64/Dockerfile b/tools/dockerfile/test/multilang_jessie_x64/Dockerfile index 8e29fcb88c..362c061f6d 100644 --- a/tools/dockerfile/test/multilang_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/multilang_jessie_x64/Dockerfile @@ -141,7 +141,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 # Install coverage for Python test coverage reporting RUN pip install coverage diff --git a/tools/dockerfile/test/node_jessie_x64/Dockerfile b/tools/dockerfile/test/node_jessie_x64/Dockerfile index d0e5af64cc..9f19e76bf5 100644 --- a/tools/dockerfile/test/node_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/node_jessie_x64/Dockerfile @@ -77,7 +77,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 #================== # Node dependencies diff --git a/tools/dockerfile/test/php7_jessie_x64/Dockerfile b/tools/dockerfile/test/php7_jessie_x64/Dockerfile index 1399502840..865bf695fe 100644 --- a/tools/dockerfile/test/php7_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/php7_jessie_x64/Dockerfile @@ -77,7 +77,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 # Prepare ccache RUN ln -s /usr/bin/ccache /usr/local/bin/gcc diff --git a/tools/dockerfile/test/php_jessie_x64/Dockerfile b/tools/dockerfile/test/php_jessie_x64/Dockerfile index 56dc6045e1..fb653d365a 100644 --- a/tools/dockerfile/test/php_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/php_jessie_x64/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 #================= # PHP dependencies diff --git a/tools/dockerfile/test/python_alpine_x64/Dockerfile b/tools/dockerfile/test/python_alpine_x64/Dockerfile index 7584ab8767..87acef9cb6 100644 --- a/tools/dockerfile/test/python_alpine_x64/Dockerfile +++ b/tools/dockerfile/test/python_alpine_x64/Dockerfile @@ -38,7 +38,7 @@ RUN apk update && apk add \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 # Google Cloud platform API libraries RUN pip install --upgrade google-api-python-client diff --git a/tools/dockerfile/test/python_jessie_x64/Dockerfile b/tools/dockerfile/test/python_jessie_x64/Dockerfile index 8d89f5022f..914e343373 100644 --- a/tools/dockerfile/test/python_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/python_jessie_x64/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 # Prepare ccache RUN ln -s /usr/bin/ccache /usr/local/bin/gcc diff --git a/tools/dockerfile/test/python_pyenv_x64/Dockerfile b/tools/dockerfile/test/python_pyenv_x64/Dockerfile index f8cbdc5726..379f26ad91 100644 --- a/tools/dockerfile/test/python_pyenv_x64/Dockerfile +++ b/tools/dockerfile/test/python_pyenv_x64/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 # Install dependencies for pyenv RUN apt-get update && apt-get install -y \ diff --git a/tools/dockerfile/test/ruby_jessie_x64/Dockerfile b/tools/dockerfile/test/ruby_jessie_x64/Dockerfile index 5d7f80bf88..63e42fd2da 100644 --- a/tools/dockerfile/test/ruby_jessie_x64/Dockerfile +++ b/tools/dockerfile/test/ruby_jessie_x64/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 #================== # Ruby dependencies diff --git a/tools/dockerfile/test/sanity/Dockerfile b/tools/dockerfile/test/sanity/Dockerfile index 967e813b85..e4a2972c0e 100644 --- a/tools/dockerfile/test/sanity/Dockerfile +++ b/tools/dockerfile/test/sanity/Dockerfile @@ -66,7 +66,7 @@ RUN apt-get update && apt-get install -y \ # Install Python packages from PyPI RUN pip install --upgrade pip==9.0.1 RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0 twisted==17.5.0 +RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.0.post1 six==1.10.0 twisted==17.5.0 #================= # C++ dependencies -- cgit v1.2.3 From c04f4f16cdea21d793c5c65a771e4ac21206c164 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Mon, 27 Nov 2017 13:08:01 -0800 Subject: Revert "Revert "Do not interpolate variables in leading comments."" --- src/compiler/cpp_generator.cc | 2 +- src/compiler/csharp_generator.cc | 2 +- src/compiler/node_generator.cc | 2 +- src/compiler/objective_c_generator.cc | 2 +- src/compiler/php_generator.cc | 2 +- src/compiler/protobuf_plugin.h | 1 + src/compiler/python_generator.cc | 2 +- src/compiler/ruby_generator.cc | 2 +- src/compiler/schema_interface.h | 1 + 9 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc index 3adf0fa451..dec8cd0f25 100644 --- a/src/compiler/cpp_generator.cc +++ b/src/compiler/cpp_generator.cc @@ -104,7 +104,7 @@ grpc::string GetHeaderPrologue(grpc_generator::File* file, grpc::string leading_comments = file->GetLeadingComments("//"); if (!leading_comments.empty()) { printer->Print(vars, "// Original file comments:\n"); - printer->Print(leading_comments.c_str()); + printer->PrintRaw(leading_comments.c_str()); } printer->Print(vars, "#ifndef GRPC_$filename_identifier$__INCLUDED\n"); printer->Print(vars, "#define GRPC_$filename_identifier$__INCLUDED\n"); diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc index e0957bf9bb..40fe0b054a 100644 --- a/src/compiler/csharp_generator.cc +++ b/src/compiler/csharp_generator.cc @@ -666,7 +666,7 @@ grpc::string GetServices(const FileDescriptor* file, bool generate_client, grpc::string leading_comments = GetCsharpComments(file, true); if (!leading_comments.empty()) { out.Print("// Original file comments:\n"); - out.Print(leading_comments.c_str()); + out.PrintRaw(leading_comments.c_str()); } out.Print("#pragma warning disable 1591\n"); diff --git a/src/compiler/node_generator.cc b/src/compiler/node_generator.cc index ed835b4445..661587cbd6 100644 --- a/src/compiler/node_generator.cc +++ b/src/compiler/node_generator.cc @@ -250,7 +250,7 @@ grpc::string GenerateFile(const FileDescriptor* file) { grpc::string leading_comments = GetNodeComments(file, true); if (!leading_comments.empty()) { out.Print("// Original file comments:\n"); - out.Print(leading_comments.c_str()); + out.PrintRaw(leading_comments.c_str()); } out.Print("'use strict';\n"); diff --git a/src/compiler/objective_c_generator.cc b/src/compiler/objective_c_generator.cc index 349f1dc281..8fe30e97e9 100644 --- a/src/compiler/objective_c_generator.cc +++ b/src/compiler/objective_c_generator.cc @@ -65,7 +65,7 @@ static void PrintAllComments(const DescriptorType* desc, Printer* printer) { printer->Print(" * "); size_t start_pos = it->find_first_not_of(' '); if (start_pos != grpc::string::npos) { - printer->Print(it->c_str() + start_pos); + printer->PrintRaw(it->c_str() + start_pos); } printer->Print("\n"); } diff --git a/src/compiler/php_generator.cc b/src/compiler/php_generator.cc index 1ff9520d7f..d9705e8077 100644 --- a/src/compiler/php_generator.cc +++ b/src/compiler/php_generator.cc @@ -164,7 +164,7 @@ grpc::string GenerateFile(const FileDescriptor* file, grpc::string leading_comments = GetPHPComments(file, "//"); if (!leading_comments.empty()) { out.Print("// Original file comments:\n"); - out.Print(leading_comments.c_str()); + out.PrintRaw(leading_comments.c_str()); } map vars; diff --git a/src/compiler/protobuf_plugin.h b/src/compiler/protobuf_plugin.h index 1551908156..b971af1310 100644 --- a/src/compiler/protobuf_plugin.h +++ b/src/compiler/protobuf_plugin.h @@ -141,6 +141,7 @@ class ProtoBufPrinter : public grpc_generator::Printer { } void Print(const char* string) { printer_.Print(string); } + void PrintRaw(const char* string) { printer_.PrintRaw(string); } void Indent() { printer_.Indent(); } void Outdent() { printer_.Outdent(); } diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc index c1ae7d31ad..8a0b889454 100644 --- a/src/compiler/python_generator.cc +++ b/src/compiler/python_generator.cc @@ -101,7 +101,7 @@ void PrivateGenerator::PrintAllComments(StringVector comments, ++it) { size_t start_pos = it->find_first_not_of(' '); if (start_pos != grpc::string::npos) { - out->Print(it->c_str() + start_pos); + out->PrintRaw(it->c_str() + start_pos); } out->Print("\n"); } diff --git a/src/compiler/ruby_generator.cc b/src/compiler/ruby_generator.cc index ed7e074b47..e81dea603b 100644 --- a/src/compiler/ruby_generator.cc +++ b/src/compiler/ruby_generator.cc @@ -174,7 +174,7 @@ grpc::string GetServices(const FileDescriptor* file) { grpc::string leading_comments = GetRubyComments(file, true); if (!leading_comments.empty()) { out.Print("# Original file comments:\n"); - out.Print(leading_comments.c_str()); + out.PrintRaw(leading_comments.c_str()); } out.Print("\n"); diff --git a/src/compiler/schema_interface.h b/src/compiler/schema_interface.h index b2021f2926..c000478e68 100644 --- a/src/compiler/schema_interface.h +++ b/src/compiler/schema_interface.h @@ -86,6 +86,7 @@ struct Printer { virtual void Print(const std::map& vars, const char* template_string) = 0; virtual void Print(const char* string) = 0; + virtual void PrintRaw(const char* string) = 0; virtual void Indent() = 0; virtual void Outdent() = 0; }; -- cgit v1.2.3 From fba967747c279f676d9571cbec6478a884a9cbbe Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 27 Nov 2017 14:39:28 -0800 Subject: generate_projects --- src/ruby/ext/grpc/rb_grpc_imports.generated.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h index ae1e1a0b30..c2698d16ea 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h @@ -337,7 +337,7 @@ extern grpc_composite_call_credentials_create_type grpc_composite_call_credentia typedef grpc_call_credentials*(*grpc_google_compute_engine_credentials_create_type)(void* reserved); extern grpc_google_compute_engine_credentials_create_type grpc_google_compute_engine_credentials_create_import; #define grpc_google_compute_engine_credentials_create grpc_google_compute_engine_credentials_create_import -typedef gpr_timespec(*grpc_max_auth_token_lifetime_type)(); +typedef gpr_timespec(*grpc_max_auth_token_lifetime_type)(void); extern grpc_max_auth_token_lifetime_type grpc_max_auth_token_lifetime_import; #define grpc_max_auth_token_lifetime grpc_max_auth_token_lifetime_import typedef grpc_call_credentials*(*grpc_service_account_jwt_access_credentials_create_type)(const char* json_key, gpr_timespec token_lifetime, void* reserved); @@ -589,7 +589,7 @@ extern gpr_free_aligned_type gpr_free_aligned_import; typedef void(*gpr_set_allocation_functions_type)(gpr_allocation_functions functions); extern gpr_set_allocation_functions_type gpr_set_allocation_functions_import; #define gpr_set_allocation_functions gpr_set_allocation_functions_import -typedef gpr_allocation_functions(*gpr_get_allocation_functions_type)(); +typedef gpr_allocation_functions(*gpr_get_allocation_functions_type)(void); extern gpr_get_allocation_functions_type gpr_get_allocation_functions_import; #define gpr_get_allocation_functions gpr_get_allocation_functions_import typedef gpr_avl(*gpr_avl_create_type)(const gpr_avl_vtable* vtable); @@ -712,7 +712,7 @@ extern gpr_log_message_type gpr_log_message_import; typedef void(*gpr_set_log_verbosity_type)(gpr_log_severity min_severity_to_print); extern gpr_set_log_verbosity_type gpr_set_log_verbosity_import; #define gpr_set_log_verbosity gpr_set_log_verbosity_import -typedef void(*gpr_log_verbosity_init_type)(); +typedef void(*gpr_log_verbosity_init_type)(void); extern gpr_log_verbosity_init_type gpr_log_verbosity_init_import; #define gpr_log_verbosity_init gpr_log_verbosity_init_import typedef void(*gpr_set_log_function_type)(gpr_log_func func); -- cgit v1.2.3 From 9f6a6f3f1a1ab44834ef5d4c3e4601e07c6287ed Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 27 Nov 2017 16:28:44 -0800 Subject: Fix compiler error on need_to_unref_constructed `need_to_unref_constructed` is not initialized, making Xcode compiler [complain on Sierra](https://sponge-qa.corp.google.com/invocation?tab=Kokoro&id=0ff33b71-2f61-4ad6-837e-5e43043c282a&searchFor=): ``` /Volumes/BuildData/tmpfs/src/github/grpc/workspace_objc_macos_dbg_native/src/core/ext/filters/client_channel/subchannel_index.cc:206:7: error: variable 'need_to_unref_constructed' may be uninitialized when used here [-Werror,-Wconditional-uninitialized] ``` --- src/core/ext/filters/client_channel/subchannel_index.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ext/filters/client_channel/subchannel_index.cc b/src/core/ext/filters/client_channel/subchannel_index.cc index ae39ca394e..1624643d0b 100644 --- a/src/core/ext/filters/client_channel/subchannel_index.cc +++ b/src/core/ext/filters/client_channel/subchannel_index.cc @@ -163,7 +163,7 @@ grpc_subchannel* grpc_subchannel_index_register(grpc_exec_ctx* exec_ctx, grpc_subchannel_key* key, grpc_subchannel* constructed) { grpc_subchannel* c = nullptr; - bool need_to_unref_constructed; + bool need_to_unref_constructed = false; while (c == nullptr) { need_to_unref_constructed = false; -- cgit v1.2.3 From 552a7ca088e12128810918a66f4462f42395058d Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Mon, 27 Nov 2017 16:51:21 -0800 Subject: Bump 1.8.0-dev to 1.8.0-pre1 --- CMakeLists.txt | 2 +- Makefile | 6 +++--- build.yaml | 4 ++-- gRPC-Core.podspec | 2 +- gRPC-ProtoRPC.podspec | 2 +- gRPC-RxLibrary.podspec | 2 +- gRPC.podspec | 2 +- package.xml | 4 ++-- src/core/lib/surface/version.cc | 2 +- src/cpp/common/version_cc.cc | 2 +- src/csharp/Grpc.Core/Version.csproj.include | 2 +- src/csharp/Grpc.Core/VersionInfo.cs | 2 +- src/csharp/build_packages_dotnetcli.bat | 2 +- src/csharp/build_packages_dotnetcli.sh | 4 ++-- src/objective-c/!ProtoCompiler-gRPCPlugin.podspec | 2 +- src/objective-c/GRPCClient/private/version.h | 2 +- src/objective-c/tests/version.h | 4 ++-- src/php/ext/grpc/version.h | 2 +- src/python/grpcio/grpc/_grpcio_metadata.py | 2 +- src/python/grpcio/grpc_version.py | 2 +- src/python/grpcio_health_checking/grpc_version.py | 2 +- src/python/grpcio_reflection/grpc_version.py | 2 +- src/python/grpcio_testing/grpc_version.py | 2 +- src/python/grpcio_tests/grpc_version.py | 2 +- src/ruby/lib/grpc/version.rb | 2 +- src/ruby/tools/version.rb | 2 +- tools/distrib/python/grpcio_tools/grpc_version.py | 2 +- tools/doxygen/Doxyfile.c++ | 2 +- tools/doxygen/Doxyfile.c++.internal | 2 +- tools/doxygen/Doxyfile.core | 2 +- tools/doxygen/Doxyfile.core.internal | 2 +- 31 files changed, 37 insertions(+), 37 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 77b60e898a..79640ec0a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ cmake_minimum_required(VERSION 2.8) set(PACKAGE_NAME "grpc") -set(PACKAGE_VERSION "1.8.0-dev") +set(PACKAGE_VERSION "1.8.0-pre1") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") diff --git a/Makefile b/Makefile index c85b1bca73..289d8f124b 100644 --- a/Makefile +++ b/Makefile @@ -411,9 +411,9 @@ E = @echo Q = @ endif -CORE_VERSION = 5.0.0-dev -CPP_VERSION = 1.8.0-dev -CSHARP_VERSION = 1.8.0-dev +CORE_VERSION = 5.0.0-pre1 +CPP_VERSION = 1.8.0-pre1 +CSHARP_VERSION = 1.8.0-pre1 CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) diff --git a/build.yaml b/build.yaml index 4f6194ecc4..a744599a83 100644 --- a/build.yaml +++ b/build.yaml @@ -12,9 +12,9 @@ settings: '#08': Use "-preN" suffixes to identify pre-release versions '#09': Per-language overrides are possible with (eg) ruby_version tag here '#10': See the expand_version.py for all the quirks here - core_version: 5.0.0-dev + core_version: 5.0.0-pre1 g_stands_for: generous - version: 1.8.0-dev + version: 1.8.0-pre1 filegroups: - name: census public_headers: diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 2f97565f1b..33d7341d9e 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -22,7 +22,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-Core' - version = '1.8.0-dev' + version = '1.8.0-pre1' s.version = version s.summary = 'Core cross-platform gRPC library, written in C' s.homepage = 'https://grpc.io' diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index db1e8db06c..76a7a82e5d 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-ProtoRPC' - version = '1.8.0-dev' + version = '1.8.0-pre1' s.version = version s.summary = 'RPC library for Protocol Buffers, based on gRPC' s.homepage = 'https://grpc.io' diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec index 3689779039..a724849fdf 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-RxLibrary' - version = '1.8.0-dev' + version = '1.8.0-pre1' s.version = version s.summary = 'Reactive Extensions library for iOS/OSX.' s.homepage = 'https://grpc.io' diff --git a/gRPC.podspec b/gRPC.podspec index 4c6cd3535f..6abae4032d 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -20,7 +20,7 @@ Pod::Spec.new do |s| s.name = 'gRPC' - version = '1.8.0-dev' + version = '1.8.0-pre1' s.version = version s.summary = 'gRPC client library for iOS/OSX' s.homepage = 'https://grpc.io' diff --git a/package.xml b/package.xml index 59d49dd165..a0a56b1281 100644 --- a/package.xml +++ b/package.xml @@ -13,8 +13,8 @@ 2017-08-24 - 1.8.0dev - 1.8.0dev + 1.8.0RC1 + 1.8.0RC1 beta diff --git a/src/core/lib/surface/version.cc b/src/core/lib/surface/version.cc index f4feadc640..7c498ec57e 100644 --- a/src/core/lib/surface/version.cc +++ b/src/core/lib/surface/version.cc @@ -21,6 +21,6 @@ #include -const char* grpc_version_string(void) { return "5.0.0-dev"; } +const char* grpc_version_string(void) { return "5.0.0-pre1"; } const char* grpc_g_stands_for(void) { return "generous"; } diff --git a/src/cpp/common/version_cc.cc b/src/cpp/common/version_cc.cc index e1e5e895f6..1f418f4a11 100644 --- a/src/cpp/common/version_cc.cc +++ b/src/cpp/common/version_cc.cc @@ -22,5 +22,5 @@ #include namespace grpc { -grpc::string Version() { return "1.8.0-dev"; } +grpc::string Version() { return "1.8.0-pre1"; } } // namespace grpc diff --git a/src/csharp/Grpc.Core/Version.csproj.include b/src/csharp/Grpc.Core/Version.csproj.include index b9ceaf8254..c3fab52695 100755 --- a/src/csharp/Grpc.Core/Version.csproj.include +++ b/src/csharp/Grpc.Core/Version.csproj.include @@ -1,7 +1,7 @@ - 1.8.0-dev + 1.8.0-pre1 3.3.0 diff --git a/src/csharp/Grpc.Core/VersionInfo.cs b/src/csharp/Grpc.Core/VersionInfo.cs index dab938821f..f8da981169 100644 --- a/src/csharp/Grpc.Core/VersionInfo.cs +++ b/src/csharp/Grpc.Core/VersionInfo.cs @@ -38,6 +38,6 @@ namespace Grpc.Core /// /// Current version of gRPC C# /// - public const string CurrentVersion = "1.8.0-dev"; + public const string CurrentVersion = "1.8.0-pre1"; } } diff --git a/src/csharp/build_packages_dotnetcli.bat b/src/csharp/build_packages_dotnetcli.bat index ff013d5680..4f96fbcbfd 100755 --- a/src/csharp/build_packages_dotnetcli.bat +++ b/src/csharp/build_packages_dotnetcli.bat @@ -13,7 +13,7 @@ @rem limitations under the License. @rem Current package versions -set VERSION=1.8.0-dev +set VERSION=1.8.0-pre1 @rem Adjust the location of nuget.exe set NUGET=C:\nuget\nuget.exe diff --git a/src/csharp/build_packages_dotnetcli.sh b/src/csharp/build_packages_dotnetcli.sh index 44a4791146..5f8608c9a1 100755 --- a/src/csharp/build_packages_dotnetcli.sh +++ b/src/csharp/build_packages_dotnetcli.sh @@ -39,7 +39,7 @@ dotnet pack --configuration Release Grpc.Auth --output ../../../artifacts dotnet pack --configuration Release Grpc.HealthCheck --output ../../../artifacts dotnet pack --configuration Release Grpc.Reflection --output ../../../artifacts -nuget pack Grpc.nuspec -Version "1.8.0-dev" -OutputDirectory ../../artifacts -nuget pack Grpc.Tools.nuspec -Version "1.8.0-dev" -OutputDirectory ../../artifacts +nuget pack Grpc.nuspec -Version "1.8.0-pre1" -OutputDirectory ../../artifacts +nuget pack Grpc.Tools.nuspec -Version "1.8.0-pre1" -OutputDirectory ../../artifacts (cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg) diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index 9065ab9f73..8b9492281b 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCPlugin' - v = '1.8.0-dev' + v = '1.8.0-pre1' s.version = v s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/GRPCClient/private/version.h b/src/objective-c/GRPCClient/private/version.h index db589d12de..e972bd6ae8 100644 --- a/src/objective-c/GRPCClient/private/version.h +++ b/src/objective-c/GRPCClient/private/version.h @@ -23,4 +23,4 @@ // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.8.0-dev" +#define GRPC_OBJC_VERSION_STRING @"1.8.0-pre1" diff --git a/src/objective-c/tests/version.h b/src/objective-c/tests/version.h index 02515063fa..faeb09c455 100644 --- a/src/objective-c/tests/version.h +++ b/src/objective-c/tests/version.h @@ -23,5 +23,5 @@ // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.8.0-dev" -#define GRPC_C_VERSION_STRING @"5.0.0-dev" +#define GRPC_OBJC_VERSION_STRING @"1.8.0-pre1" +#define GRPC_C_VERSION_STRING @"5.0.0-pre1" diff --git a/src/php/ext/grpc/version.h b/src/php/ext/grpc/version.h index 93dd563cff..f74d28e14e 100644 --- a/src/php/ext/grpc/version.h +++ b/src/php/ext/grpc/version.h @@ -20,6 +20,6 @@ #ifndef VERSION_H #define VERSION_H -#define PHP_GRPC_VERSION "1.8.0dev" +#define PHP_GRPC_VERSION "1.8.0RC1" #endif /* VERSION_H */ diff --git a/src/python/grpcio/grpc/_grpcio_metadata.py b/src/python/grpcio/grpc/_grpcio_metadata.py index 0887ac1722..6c224b031e 100644 --- a/src/python/grpcio/grpc/_grpcio_metadata.py +++ b/src/python/grpcio/grpc/_grpcio_metadata.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!! -__version__ = """1.8.0.dev0""" +__version__ = """1.8.0rc1""" diff --git a/src/python/grpcio/grpc_version.py b/src/python/grpcio/grpc_version.py index 61c4157375..b43b5324d2 100644 --- a/src/python/grpcio/grpc_version.py +++ b/src/python/grpcio/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!! -VERSION='1.8.0.dev0' +VERSION='1.8.0rc1' diff --git a/src/python/grpcio_health_checking/grpc_version.py b/src/python/grpcio_health_checking/grpc_version.py index 889297f020..28dafde8cf 100644 --- a/src/python/grpcio_health_checking/grpc_version.py +++ b/src/python/grpcio_health_checking/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!! -VERSION='1.8.0.dev0' +VERSION='1.8.0rc1' diff --git a/src/python/grpcio_reflection/grpc_version.py b/src/python/grpcio_reflection/grpc_version.py index 192f4cc217..5e90b55daf 100644 --- a/src/python/grpcio_reflection/grpc_version.py +++ b/src/python/grpcio_reflection/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!! -VERSION='1.8.0.dev0' +VERSION='1.8.0rc1' diff --git a/src/python/grpcio_testing/grpc_version.py b/src/python/grpcio_testing/grpc_version.py index 83470c2825..aef43f181c 100644 --- a/src/python/grpcio_testing/grpc_version.py +++ b/src/python/grpcio_testing/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_testing/grpc_version.py.template`!!! -VERSION='1.8.0.dev0' +VERSION='1.8.0rc1' diff --git a/src/python/grpcio_tests/grpc_version.py b/src/python/grpcio_tests/grpc_version.py index 7065edd3bf..4f946d346e 100644 --- a/src/python/grpcio_tests/grpc_version.py +++ b/src/python/grpcio_tests/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!! -VERSION='1.8.0.dev0' +VERSION='1.8.0rc1' diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb index 3001579ce7..a8db6600de 100644 --- a/src/ruby/lib/grpc/version.rb +++ b/src/ruby/lib/grpc/version.rb @@ -14,5 +14,5 @@ # GRPC contains the General RPC module. module GRPC - VERSION = '1.8.0.dev' + VERSION = '1.8.0.pre1' end diff --git a/src/ruby/tools/version.rb b/src/ruby/tools/version.rb index c584a7cf59..a2614a8245 100644 --- a/src/ruby/tools/version.rb +++ b/src/ruby/tools/version.rb @@ -14,6 +14,6 @@ module GRPC module Tools - VERSION = '1.8.0.dev' + VERSION = '1.8.0.pre1' end end diff --git a/tools/distrib/python/grpcio_tools/grpc_version.py b/tools/distrib/python/grpcio_tools/grpc_version.py index db92b10c60..0f960b84ab 100644 --- a/tools/distrib/python/grpcio_tools/grpc_version.py +++ b/tools/distrib/python/grpcio_tools/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! -VERSION='1.8.0.dev0' +VERSION='1.8.0rc1' diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index eb27eed075..06bf406a72 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.8.0-dev +PROJECT_NUMBER = 1.8.0-pre1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 3c564e203a..1f7b4c75f4 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.8.0-dev +PROJECT_NUMBER = 1.8.0-pre1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core index c8fd2ee48b..89b8583457 100644 --- a/tools/doxygen/Doxyfile.core +++ b/tools/doxygen/Doxyfile.core @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 5.0.0-dev +PROJECT_NUMBER = 5.0.0-pre1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 5674124f44..7d72374a7b 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 5.0.0-dev +PROJECT_NUMBER = 5.0.0-pre1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a -- cgit v1.2.3 From 14e96f9ae8b6490242b99915d4aa860ceac9154a Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Mon, 27 Nov 2017 17:00:13 -0800 Subject: Bump 1.8.0-dev to 1.9.0-dev --- CMakeLists.txt | 2 +- Makefile | 4 ++-- build.yaml | 4 ++-- doc/g_stands_for.md | 1 + gRPC-Core.podspec | 2 +- gRPC-ProtoRPC.podspec | 2 +- gRPC-RxLibrary.podspec | 2 +- gRPC.podspec | 2 +- package.xml | 4 ++-- src/core/lib/surface/version.cc | 2 +- src/cpp/common/version_cc.cc | 2 +- src/csharp/Grpc.Core/Version.csproj.include | 2 +- src/csharp/Grpc.Core/VersionInfo.cs | 4 ++-- src/csharp/build_packages_dotnetcli.bat | 2 +- src/csharp/build_packages_dotnetcli.sh | 4 ++-- src/objective-c/!ProtoCompiler-gRPCPlugin.podspec | 2 +- src/objective-c/GRPCClient/private/version.h | 2 +- src/objective-c/tests/version.h | 2 +- src/php/composer.json | 2 +- src/php/ext/grpc/version.h | 2 +- src/python/grpcio/grpc/_grpcio_metadata.py | 2 +- src/python/grpcio/grpc_version.py | 2 +- src/python/grpcio_health_checking/grpc_version.py | 2 +- src/python/grpcio_reflection/grpc_version.py | 2 +- src/python/grpcio_testing/grpc_version.py | 2 +- src/python/grpcio_tests/grpc_version.py | 2 +- src/ruby/lib/grpc/version.rb | 2 +- src/ruby/tools/version.rb | 2 +- tools/distrib/python/grpcio_tools/grpc_version.py | 2 +- tools/doxygen/Doxyfile.c++ | 2 +- tools/doxygen/Doxyfile.c++.internal | 2 +- 31 files changed, 36 insertions(+), 35 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 77b60e898a..fa178a86d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ cmake_minimum_required(VERSION 2.8) set(PACKAGE_NAME "grpc") -set(PACKAGE_VERSION "1.8.0-dev") +set(PACKAGE_VERSION "1.9.0-dev") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") diff --git a/Makefile b/Makefile index c85b1bca73..cdba3d7ff1 100644 --- a/Makefile +++ b/Makefile @@ -412,8 +412,8 @@ Q = @ endif CORE_VERSION = 5.0.0-dev -CPP_VERSION = 1.8.0-dev -CSHARP_VERSION = 1.8.0-dev +CPP_VERSION = 1.9.0-dev +CSHARP_VERSION = 1.9.0-dev CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) diff --git a/build.yaml b/build.yaml index 4f6194ecc4..86054749e9 100644 --- a/build.yaml +++ b/build.yaml @@ -13,8 +13,8 @@ settings: '#09': Per-language overrides are possible with (eg) ruby_version tag here '#10': See the expand_version.py for all the quirks here core_version: 5.0.0-dev - g_stands_for: generous - version: 1.8.0-dev + g_stands_for: glossy + version: 1.9.0-dev filegroups: - name: census public_headers: diff --git a/doc/g_stands_for.md b/doc/g_stands_for.md index 4e2ca33276..edc6dc1e79 100644 --- a/doc/g_stands_for.md +++ b/doc/g_stands_for.md @@ -12,3 +12,4 @@ future), and the corresponding version numbers that used them: - 1.6 'g' stands for 'garcia' - 1.7 'g' stands for 'gambit' - 1.8 'g' stands for 'generous' +- 1.9 'g' stands for 'glossy' diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 2f97565f1b..8e0f60d4e9 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -22,7 +22,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-Core' - version = '1.8.0-dev' + version = '1.9.0-dev' s.version = version s.summary = 'Core cross-platform gRPC library, written in C' s.homepage = 'https://grpc.io' diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index db1e8db06c..7533ef51dd 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-ProtoRPC' - version = '1.8.0-dev' + version = '1.9.0-dev' s.version = version s.summary = 'RPC library for Protocol Buffers, based on gRPC' s.homepage = 'https://grpc.io' diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec index 3689779039..37410a573a 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-RxLibrary' - version = '1.8.0-dev' + version = '1.9.0-dev' s.version = version s.summary = 'Reactive Extensions library for iOS/OSX.' s.homepage = 'https://grpc.io' diff --git a/gRPC.podspec b/gRPC.podspec index 4c6cd3535f..5fff7c8123 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -20,7 +20,7 @@ Pod::Spec.new do |s| s.name = 'gRPC' - version = '1.8.0-dev' + version = '1.9.0-dev' s.version = version s.summary = 'gRPC client library for iOS/OSX' s.homepage = 'https://grpc.io' diff --git a/package.xml b/package.xml index 59d49dd165..7c0c309a89 100644 --- a/package.xml +++ b/package.xml @@ -13,8 +13,8 @@ 2017-08-24 - 1.8.0dev - 1.8.0dev + 1.9.0dev + 1.9.0dev beta diff --git a/src/core/lib/surface/version.cc b/src/core/lib/surface/version.cc index f4feadc640..7d36c6c9e1 100644 --- a/src/core/lib/surface/version.cc +++ b/src/core/lib/surface/version.cc @@ -23,4 +23,4 @@ const char* grpc_version_string(void) { return "5.0.0-dev"; } -const char* grpc_g_stands_for(void) { return "generous"; } +const char* grpc_g_stands_for(void) { return "glossy"; } diff --git a/src/cpp/common/version_cc.cc b/src/cpp/common/version_cc.cc index e1e5e895f6..7f01a66dcf 100644 --- a/src/cpp/common/version_cc.cc +++ b/src/cpp/common/version_cc.cc @@ -22,5 +22,5 @@ #include namespace grpc { -grpc::string Version() { return "1.8.0-dev"; } +grpc::string Version() { return "1.9.0-dev"; } } // namespace grpc diff --git a/src/csharp/Grpc.Core/Version.csproj.include b/src/csharp/Grpc.Core/Version.csproj.include index b9ceaf8254..2d9e4ba16a 100755 --- a/src/csharp/Grpc.Core/Version.csproj.include +++ b/src/csharp/Grpc.Core/Version.csproj.include @@ -1,7 +1,7 @@ - 1.8.0-dev + 1.9.0-dev 3.3.0 diff --git a/src/csharp/Grpc.Core/VersionInfo.cs b/src/csharp/Grpc.Core/VersionInfo.cs index dab938821f..9b5da1c947 100644 --- a/src/csharp/Grpc.Core/VersionInfo.cs +++ b/src/csharp/Grpc.Core/VersionInfo.cs @@ -33,11 +33,11 @@ namespace Grpc.Core /// /// Current AssemblyFileVersion of gRPC C# assemblies /// - public const string CurrentAssemblyFileVersion = "1.8.0.0"; + public const string CurrentAssemblyFileVersion = "1.9.0.0"; /// /// Current version of gRPC C# /// - public const string CurrentVersion = "1.8.0-dev"; + public const string CurrentVersion = "1.9.0-dev"; } } diff --git a/src/csharp/build_packages_dotnetcli.bat b/src/csharp/build_packages_dotnetcli.bat index ff013d5680..8f89e2846a 100755 --- a/src/csharp/build_packages_dotnetcli.bat +++ b/src/csharp/build_packages_dotnetcli.bat @@ -13,7 +13,7 @@ @rem limitations under the License. @rem Current package versions -set VERSION=1.8.0-dev +set VERSION=1.9.0-dev @rem Adjust the location of nuget.exe set NUGET=C:\nuget\nuget.exe diff --git a/src/csharp/build_packages_dotnetcli.sh b/src/csharp/build_packages_dotnetcli.sh index 44a4791146..6a6cafe2bd 100755 --- a/src/csharp/build_packages_dotnetcli.sh +++ b/src/csharp/build_packages_dotnetcli.sh @@ -39,7 +39,7 @@ dotnet pack --configuration Release Grpc.Auth --output ../../../artifacts dotnet pack --configuration Release Grpc.HealthCheck --output ../../../artifacts dotnet pack --configuration Release Grpc.Reflection --output ../../../artifacts -nuget pack Grpc.nuspec -Version "1.8.0-dev" -OutputDirectory ../../artifacts -nuget pack Grpc.Tools.nuspec -Version "1.8.0-dev" -OutputDirectory ../../artifacts +nuget pack Grpc.nuspec -Version "1.9.0-dev" -OutputDirectory ../../artifacts +nuget pack Grpc.Tools.nuspec -Version "1.9.0-dev" -OutputDirectory ../../artifacts (cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg) diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index 9065ab9f73..80e1069ddd 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -42,7 +42,7 @@ Pod::Spec.new do |s| # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed # before them. s.name = '!ProtoCompiler-gRPCPlugin' - v = '1.8.0-dev' + v = '1.9.0-dev' s.version = v s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.' s.description = <<-DESC diff --git a/src/objective-c/GRPCClient/private/version.h b/src/objective-c/GRPCClient/private/version.h index db589d12de..69dd6266fd 100644 --- a/src/objective-c/GRPCClient/private/version.h +++ b/src/objective-c/GRPCClient/private/version.h @@ -23,4 +23,4 @@ // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.8.0-dev" +#define GRPC_OBJC_VERSION_STRING @"1.9.0-dev" diff --git a/src/objective-c/tests/version.h b/src/objective-c/tests/version.h index 02515063fa..6e3a073020 100644 --- a/src/objective-c/tests/version.h +++ b/src/objective-c/tests/version.h @@ -23,5 +23,5 @@ // `tools/buildgen/generate_projects.sh`. -#define GRPC_OBJC_VERSION_STRING @"1.8.0-dev" +#define GRPC_OBJC_VERSION_STRING @"1.9.0-dev" #define GRPC_C_VERSION_STRING @"5.0.0-dev" diff --git a/src/php/composer.json b/src/php/composer.json index 09471d23fe..43833980f9 100644 --- a/src/php/composer.json +++ b/src/php/composer.json @@ -2,7 +2,7 @@ "name": "grpc/grpc-dev", "description": "gRPC library for PHP - for Developement use only", "license": "Apache-2.0", - "version": "1.8.0", + "version": "1.9.0", "require": { "php": ">=5.5.0", "google/protobuf": "^v3.3.0" diff --git a/src/php/ext/grpc/version.h b/src/php/ext/grpc/version.h index 93dd563cff..48131d72d1 100644 --- a/src/php/ext/grpc/version.h +++ b/src/php/ext/grpc/version.h @@ -20,6 +20,6 @@ #ifndef VERSION_H #define VERSION_H -#define PHP_GRPC_VERSION "1.8.0dev" +#define PHP_GRPC_VERSION "1.9.0dev" #endif /* VERSION_H */ diff --git a/src/python/grpcio/grpc/_grpcio_metadata.py b/src/python/grpcio/grpc/_grpcio_metadata.py index 0887ac1722..993c49d4af 100644 --- a/src/python/grpcio/grpc/_grpcio_metadata.py +++ b/src/python/grpcio/grpc/_grpcio_metadata.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!! -__version__ = """1.8.0.dev0""" +__version__ = """1.9.0.dev0""" diff --git a/src/python/grpcio/grpc_version.py b/src/python/grpcio/grpc_version.py index 61c4157375..8f07f3b30b 100644 --- a/src/python/grpcio/grpc_version.py +++ b/src/python/grpcio/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!! -VERSION='1.8.0.dev0' +VERSION='1.9.0.dev0' diff --git a/src/python/grpcio_health_checking/grpc_version.py b/src/python/grpcio_health_checking/grpc_version.py index 889297f020..0987d57261 100644 --- a/src/python/grpcio_health_checking/grpc_version.py +++ b/src/python/grpcio_health_checking/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!! -VERSION='1.8.0.dev0' +VERSION='1.9.0.dev0' diff --git a/src/python/grpcio_reflection/grpc_version.py b/src/python/grpcio_reflection/grpc_version.py index 192f4cc217..95d2ff143a 100644 --- a/src/python/grpcio_reflection/grpc_version.py +++ b/src/python/grpcio_reflection/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!! -VERSION='1.8.0.dev0' +VERSION='1.9.0.dev0' diff --git a/src/python/grpcio_testing/grpc_version.py b/src/python/grpcio_testing/grpc_version.py index 83470c2825..afc6dd83f2 100644 --- a/src/python/grpcio_testing/grpc_version.py +++ b/src/python/grpcio_testing/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_testing/grpc_version.py.template`!!! -VERSION='1.8.0.dev0' +VERSION='1.9.0.dev0' diff --git a/src/python/grpcio_tests/grpc_version.py b/src/python/grpcio_tests/grpc_version.py index 7065edd3bf..99ca3fd82d 100644 --- a/src/python/grpcio_tests/grpc_version.py +++ b/src/python/grpcio_tests/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!! -VERSION='1.8.0.dev0' +VERSION='1.9.0.dev0' diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb index 3001579ce7..be1412511a 100644 --- a/src/ruby/lib/grpc/version.rb +++ b/src/ruby/lib/grpc/version.rb @@ -14,5 +14,5 @@ # GRPC contains the General RPC module. module GRPC - VERSION = '1.8.0.dev' + VERSION = '1.9.0.dev' end diff --git a/src/ruby/tools/version.rb b/src/ruby/tools/version.rb index c584a7cf59..48aad39e08 100644 --- a/src/ruby/tools/version.rb +++ b/src/ruby/tools/version.rb @@ -14,6 +14,6 @@ module GRPC module Tools - VERSION = '1.8.0.dev' + VERSION = '1.9.0.dev' end end diff --git a/tools/distrib/python/grpcio_tools/grpc_version.py b/tools/distrib/python/grpcio_tools/grpc_version.py index db92b10c60..f613025be3 100644 --- a/tools/distrib/python/grpcio_tools/grpc_version.py +++ b/tools/distrib/python/grpcio_tools/grpc_version.py @@ -14,4 +14,4 @@ # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/distrib/python/grpcio_tools/grpc_version.py.template`!!! -VERSION='1.8.0.dev0' +VERSION='1.9.0.dev0' diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index eb27eed075..269ce971f6 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.8.0-dev +PROJECT_NUMBER = 1.9.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 3c564e203a..3e13de5b00 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.8.0-dev +PROJECT_NUMBER = 1.9.0-dev # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a -- cgit v1.2.3 From 81e9581bf380ceea2f5edaf6661c040c7fa81859 Mon Sep 17 00:00:00 2001 From: Alex Polcyn Date: Sat, 23 Sep 2017 18:48:02 -0700 Subject: Remove some sleeps in ruby tests and fix test server shutdown --- src/ruby/end2end/channel_closing_driver.rb | 6 +-- src/ruby/end2end/channel_state_driver.rb | 7 +-- src/ruby/end2end/end2end_common.rb | 6 +-- src/ruby/end2end/forking_client_driver.rb | 6 --- src/ruby/end2end/grpc_class_init_client.rb | 2 +- src/ruby/end2end/killed_client_thread_driver.rb | 56 +++++++++------------- .../multiple_killed_watching_threads_driver.rb | 2 + src/ruby/end2end/sig_handling_client.rb | 30 ++++++++---- src/ruby/end2end/sig_handling_driver.rb | 35 ++++++++++++-- .../end2end/sig_int_during_channel_watch_driver.rb | 4 -- src/ruby/lib/grpc/generic/rpc_server.rb | 37 +++++++++----- src/ruby/qps/worker.rb | 12 +++-- 12 files changed, 117 insertions(+), 86 deletions(-) diff --git a/src/ruby/end2end/channel_closing_driver.rb b/src/ruby/end2end/channel_closing_driver.rb index 0ceb3667eb..57544b0398 100755 --- a/src/ruby/end2end/channel_closing_driver.rb +++ b/src/ruby/end2end/channel_closing_driver.rb @@ -23,13 +23,11 @@ def main STDERR.puts 'start server' server_runner = ServerRunner.new(EchoServerImpl) server_port = server_runner.run - - sleep 1 - STDERR.puts 'start client' control_stub, client_pid = start_client('channel_closing_client.rb', server_port) - + # sleep to allow time for the client to get into + # the middle of a "watch connectivity state" call sleep 3 begin diff --git a/src/ruby/end2end/channel_state_driver.rb b/src/ruby/end2end/channel_state_driver.rb index 98339baebe..f4b1cd2bb8 100755 --- a/src/ruby/end2end/channel_state_driver.rb +++ b/src/ruby/end2end/channel_state_driver.rb @@ -22,14 +22,11 @@ def main STDERR.puts 'start server' server_runner = ServerRunner.new(EchoServerImpl) server_port = server_runner.run - - sleep 1 - STDERR.puts 'start client' _, client_pid = start_client('channel_state_client.rb', server_port) - + # sleep to allow time for the client to get into + # the middle of a "watch connectivity state" call sleep 3 - Process.kill('SIGTERM', client_pid) begin diff --git a/src/ruby/end2end/end2end_common.rb b/src/ruby/end2end/end2end_common.rb index a1b824fcbf..790fc23e92 100755 --- a/src/ruby/end2end/end2end_common.rb +++ b/src/ruby/end2end/end2end_common.rb @@ -40,12 +40,13 @@ end # ServerRunner starts an "echo server" that test clients can make calls to class ServerRunner - def initialize(service_impl) + def initialize(service_impl, rpc_server_args: {}) @service_impl = service_impl + @rpc_server_args = rpc_server_args end def run - @srv = GRPC::RpcServer.new + @srv = GRPC::RpcServer.new(@rpc_server_args) port = @srv.add_http2_port('0.0.0.0:0', :this_port_is_insecure) @srv.handle(@service_impl) @@ -75,7 +76,6 @@ def start_client(client_main, server_port) client_path, "--client_control_port=#{client_control_port}", "--server_port=#{server_port}") - sleep 1 control_stub = ClientControl::ClientController::Stub.new( "localhost:#{client_control_port}", :this_channel_is_insecure) [control_stub, client_pid] diff --git a/src/ruby/end2end/forking_client_driver.rb b/src/ruby/end2end/forking_client_driver.rb index 63565395f7..5cf1d73112 100755 --- a/src/ruby/end2end/forking_client_driver.rb +++ b/src/ruby/end2end/forking_client_driver.rb @@ -20,12 +20,6 @@ def main STDERR.puts 'start server' server_runner = ServerRunner.new(EchoServerImpl) server_port = server_runner.run - - # TODO(apolcyn) Can we get rid of this sleep? - # Without it, an immediate call to the just started EchoServer - # fails with UNAVAILABLE - sleep 1 - STDERR.puts 'start client' _, client_pid = start_client('forking_client_client.rb', server_port) diff --git a/src/ruby/end2end/grpc_class_init_client.rb b/src/ruby/end2end/grpc_class_init_client.rb index c35719a71f..ff40350cfa 100755 --- a/src/ruby/end2end/grpc_class_init_client.rb +++ b/src/ruby/end2end/grpc_class_init_client.rb @@ -54,7 +54,7 @@ def run_concurrency_stress_test(test_proc) test_proc.call - fail 'exception thrown while child thread initing class' + fail '(expected) exception thrown while child thread initing class' end # default (no gc_stress and no concurrency_stress) diff --git a/src/ruby/end2end/killed_client_thread_driver.rb b/src/ruby/end2end/killed_client_thread_driver.rb index fce5d13e82..370f7e686b 100755 --- a/src/ruby/end2end/killed_client_thread_driver.rb +++ b/src/ruby/end2end/killed_client_thread_driver.rb @@ -17,56 +17,46 @@ require_relative './end2end_common' # Service that sleeps for a long time upon receiving an 'echo request' -# Also, this notifies @call_started_cv once it has received a request. +# Also, this calls it's callback upon receiving an RPC as a method +# of synchronization/waiting for the child to start. class SleepingEchoServerImpl < Echo::EchoServer::Service - def initialize(call_started, call_started_mu, call_started_cv) - @call_started = call_started - @call_started_mu = call_started_mu - @call_started_cv = call_started_cv + def initialize(received_rpc_callback) + @received_rpc_callback = received_rpc_callback end def echo(echo_req, _) - @call_started_mu.synchronize do - @call_started.set_true - @call_started_cv.signal - end - sleep 1000 + @received_rpc_callback.call + # sleep forever to get the client stuck waiting + sleep Echo::EchoReply.new(response: echo_req.request) end end -# Mutable boolean -class BoolHolder - attr_reader :val - - def init - @val = false - end - - def set_true - @val = true - end -end - def main STDERR.puts 'start server' - call_started = BoolHolder.new - call_started_mu = Mutex.new - call_started_cv = ConditionVariable.new + client_started = false + client_started_mu = Mutex.new + client_started_cv = ConditionVariable.new + received_rpc_callback = proc do + client_started_mu.synchronize do + client_started = true + client_started_cv.signal + end + end - service_impl = SleepingEchoServerImpl.new(call_started, - call_started_mu, - call_started_cv) - server_runner = ServerRunner.new(service_impl) + service_impl = SleepingEchoServerImpl.new(received_rpc_callback) + # RPCs against the server will all be hanging, so kill thread + # pool workers immediately rather than after waiting for a second. + rpc_server_args = { poll_period: 0, pool_keep_alive: 0 } + server_runner = ServerRunner.new(service_impl, rpc_server_args: rpc_server_args) server_port = server_runner.run - STDERR.puts 'start client' _, client_pid = start_client('killed_client_thread_client.rb', server_port) - call_started_mu.synchronize do - call_started_cv.wait(call_started_mu) until call_started.val + client_started_mu.synchronize do + client_started_cv.wait(client_started_mu) until client_started end # SIGTERM the child process now that it's diff --git a/src/ruby/end2end/multiple_killed_watching_threads_driver.rb b/src/ruby/end2end/multiple_killed_watching_threads_driver.rb index 94d5e9da2d..59f6f275e4 100755 --- a/src/ruby/end2end/multiple_killed_watching_threads_driver.rb +++ b/src/ruby/end2end/multiple_killed_watching_threads_driver.rb @@ -26,6 +26,8 @@ def watch_state(ch) fail "non-idle state: #{state}" unless state == IDLE ch.watch_connectivity_state(IDLE, Time.now + 360) end + # sleep to get the thread into the middle of a + # "watch connectivity state" call sleep 0.1 thd.kill end diff --git a/src/ruby/end2end/sig_handling_client.rb b/src/ruby/end2end/sig_handling_client.rb index 41b5f334be..129ad7cb7f 100755 --- a/src/ruby/end2end/sig_handling_client.rb +++ b/src/ruby/end2end/sig_handling_client.rb @@ -30,16 +30,18 @@ class SigHandlingClientController < ClientControl::ClientController::Service end def shutdown(_, _) - Thread.new do - # TODO(apolcyn) There is a race between stopping the - # server and the "shutdown" rpc completing, - # See if stop method on server can end active RPC cleanly, to - # avoid this sleep. - sleep 3 + # Spawn a new thread because RpcServer#stop is + # synchronous and blocks until either this RPC has finished, + # or the server's "poll_period" seconds have passed. + @shutdown_thread = Thread.new do @srv.stop end ClientControl::Void.new end + + def join_shutdown_thread + @shutdown_thread.join + end end def main @@ -62,13 +64,23 @@ def main STDERR.puts 'SIGINT received' end - srv = GRPC::RpcServer.new + # The "shutdown" RPC should end very quickly. + # Allow a few seconds to be safe. + srv = GRPC::RpcServer.new(poll_period: 3) srv.add_http2_port("0.0.0.0:#{client_control_port}", :this_port_is_insecure) stub = Echo::EchoServer::Stub.new("localhost:#{server_port}", :this_channel_is_insecure) - srv.handle(SigHandlingClientController.new(srv, stub)) - srv.run + control_service = SigHandlingClientController.new(srv, stub) + srv.handle(control_service) + server_thread = Thread.new do + srv.run + end + srv.wait_till_running + # send a first RPC to notify the parent process that we've started + stub.echo(Echo::EchoRequest.new(request: 'client/child started')) + server_thread.join + control_service.join_shutdown_thread end main diff --git a/src/ruby/end2end/sig_handling_driver.rb b/src/ruby/end2end/sig_handling_driver.rb index 291bf29424..0ad1cbd661 100755 --- a/src/ruby/end2end/sig_handling_driver.rb +++ b/src/ruby/end2end/sig_handling_driver.rb @@ -19,17 +19,42 @@ require_relative './end2end_common' +# A service that calls back it's received_rpc_callback +# upon receiving an RPC. Used for synchronization/waiting +# for child process to start. +class ClientStartedService < Echo::EchoServer::Service + def initialize(received_rpc_callback) + @received_rpc_callback = received_rpc_callback + end + + def echo(echo_req, _) + @received_rpc_callback.call unless @received_rpc_callback.nil? + @received_rpc_callback = nil + Echo::EchoReply.new(response: echo_req.request) + end +end + def main STDERR.puts 'start server' - server_runner = ServerRunner.new(EchoServerImpl) - server_port = server_runner.run - - sleep 1 + client_started = false + client_started_mu = Mutex.new + client_started_cv = ConditionVariable.new + received_rpc_callback = proc do + client_started_mu.synchronize do + client_started = true + client_started_cv.signal + end + end + client_started_service = ClientStartedService.new(received_rpc_callback) + server_runner = ServerRunner.new(client_started_service) + server_port = server_runner.run STDERR.puts 'start client' control_stub, client_pid = start_client('sig_handling_client.rb', server_port) - sleep 1 + client_started_mu.synchronize do + client_started_cv.wait(client_started_mu) until client_started + end count = 0 while count < 5 diff --git a/src/ruby/end2end/sig_int_during_channel_watch_driver.rb b/src/ruby/end2end/sig_int_during_channel_watch_driver.rb index b054f0f5f3..2df22f48a2 100755 --- a/src/ruby/end2end/sig_int_during_channel_watch_driver.rb +++ b/src/ruby/end2end/sig_int_during_channel_watch_driver.rb @@ -23,13 +23,9 @@ def main STDERR.puts 'start server' server_runner = ServerRunner.new(EchoServerImpl) server_port = server_runner.run - - sleep 1 - STDERR.puts 'start client' _, client_pid = start_client('sig_int_during_channel_watch_client.rb', server_port) - # give time for the client to get into the middle # of a channel state watch call sleep 1 diff --git a/src/ruby/lib/grpc/generic/rpc_server.rb b/src/ruby/lib/grpc/generic/rpc_server.rb index d5fc11dc1c..c80c7fcd32 100644 --- a/src/ruby/lib/grpc/generic/rpc_server.rb +++ b/src/ruby/lib/grpc/generic/rpc_server.rb @@ -92,9 +92,13 @@ module GRPC # Stops the jobs in the pool def stop GRPC.logger.info('stopping, will wait for all the workers to exit') - schedule { throw :exit } while ready_for_work? - @stop_mutex.synchronize do # wait @keep_alive for works to stop + @stop_mutex.synchronize do # wait @keep_alive seconds for workers to stop @stopped = true + loop do + break unless ready_for_work? + worker_queue = @ready_workers.pop + worker_queue << [proc { throw :exit }, []] + end @stop_cond.wait(@stop_mutex, @keep_alive) if @workers.size > 0 end forcibly_stop_workers @@ -138,7 +142,10 @@ module GRPC end # there shouldn't be any work given to this thread while its busy fail('received a task while busy') unless worker_queue.empty? - @ready_workers << worker_queue + @stop_mutex.synchronize do + return if @stopped + @ready_workers << worker_queue + end end end end @@ -186,8 +193,13 @@ module GRPC # * max_waiting_requests: Deprecated due to internal changes to the thread # pool. This is still an argument for compatibility but is ignored. # - # * poll_period: when present, the server polls for new events with this - # period + # * poll_period: The amount of time in seconds to wait for + # currently-serviced RPC's to finish before cancelling them when shutting + # down the server. + # + # * pool_keep_alive: The amount of time in seconds to wait + # for currently busy thread-pool threads to finish before + # forcing an abrupt exit to each thread. # # * connect_md_proc: # when non-nil is a proc for determining metadata to to send back the client @@ -202,17 +214,18 @@ module GRPC # intercepting server handlers to provide extra functionality. # Interceptors are an EXPERIMENTAL API. # - def initialize(pool_size:DEFAULT_POOL_SIZE, - max_waiting_requests:DEFAULT_MAX_WAITING_REQUESTS, - poll_period:DEFAULT_POLL_PERIOD, - connect_md_proc:nil, - server_args:{}, - interceptors:[]) + def initialize(pool_size: DEFAULT_POOL_SIZE, + max_waiting_requests: DEFAULT_MAX_WAITING_REQUESTS, + poll_period: DEFAULT_POLL_PERIOD, + pool_keep_alive: GRPC::RpcServer::DEFAULT_POOL_SIZE, + connect_md_proc: nil, + server_args: {}, + interceptors: []) @connect_md_proc = RpcServer.setup_connect_md_proc(connect_md_proc) @max_waiting_requests = max_waiting_requests @poll_period = poll_period @pool_size = pool_size - @pool = Pool.new(@pool_size) + @pool = Pool.new(@pool_size, keep_alive: pool_keep_alive) @run_cond = ConditionVariable.new @run_mutex = Mutex.new # running_state can take 4 values: :not_started, :running, :stopping, and diff --git a/src/ruby/qps/worker.rb b/src/ruby/qps/worker.rb index 21e8815890..8258487418 100755 --- a/src/ruby/qps/worker.rb +++ b/src/ruby/qps/worker.rb @@ -77,8 +77,7 @@ class WorkerServiceImpl < Grpc::Testing::WorkerService::Service Grpc::Testing::CoreResponse.new(cores: cpu_cores) end def quit_worker(_args, _call) - Thread.new { - sleep 3 + @shutdown_thread = Thread.new { @server.stop } Grpc::Testing::Void.new @@ -87,6 +86,9 @@ class WorkerServiceImpl < Grpc::Testing::WorkerService::Service @server = s @server_port = sp end + def join_shutdown_thread + @shutdown_thread.join + end end def main @@ -107,11 +109,13 @@ def main # Configure any errors with client or server child threads to surface Thread.abort_on_exception = true - s = GRPC::RpcServer.new + s = GRPC::RpcServer.new(poll_period: 3) s.add_http2_port("0.0.0.0:" + options['driver_port'].to_s, :this_port_is_insecure) - s.handle(WorkerServiceImpl.new(s, options['server_port'].to_i)) + worker_service = WorkerServiceImpl.new(s, options['server_port'].to_i) + s.handle(worker_service) s.run + worker_service.join_shutdown_thread end main -- cgit v1.2.3 From 962722cbc02c5b1e00baaaad3ddeebd95bc3906d Mon Sep 17 00:00:00 2001 From: Camillo Lugaresi Date: Fri, 17 Nov 2017 14:21:13 -0800 Subject: Fix alignment issue in gpr_murmur_hash3 This function cast a void* to a uint32_t*. This is invalid, since a uint32_t* must be 32-bit-aligned, while the input key clearly isn't. Even though the function later uses memcpy to access the memory, by that point the compiler is allowed to assume that the pointer is aligned, and so it can output code that does an unaligned memory access. In practice, this resulted in a crash on some devices when this code is compiled with optimizations for 32-bit ARM with the Android NDK r14. --- src/core/lib/support/murmur_hash.cc | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/core/lib/support/murmur_hash.cc b/src/core/lib/support/murmur_hash.cc index 4e08579a1d..2f0e71a53c 100644 --- a/src/core/lib/support/murmur_hash.cc +++ b/src/core/lib/support/murmur_hash.cc @@ -30,22 +30,19 @@ (h) ^= (h) >> 16; uint32_t gpr_murmur_hash3(const void* key, size_t len, uint32_t seed) { - const uint8_t* data = (const uint8_t*)key; - const size_t nblocks = len / 4; - int i; - uint32_t h1 = seed; uint32_t k1; const uint32_t c1 = 0xcc9e2d51; const uint32_t c2 = 0x1b873593; - const uint32_t* blocks = ((const uint32_t*)key) + nblocks; - const uint8_t* tail = (const uint8_t*)(data + nblocks * 4); + const uint8_t* keyptr = (const uint8_t*)key; + const size_t bsize = sizeof(k1); + const size_t nblocks = len / bsize; /* body */ - for (i = -(int)nblocks; i; i++) { - memcpy(&k1, blocks + i, sizeof(uint32_t)); + for (size_t i = 0; i < nblocks; i++, keyptr += bsize) { + memcpy(&k1, keyptr, bsize); k1 *= c1; k1 = ROTL32(k1, 15); @@ -61,13 +58,13 @@ uint32_t gpr_murmur_hash3(const void* key, size_t len, uint32_t seed) { /* tail */ switch (len & 3) { case 3: - k1 ^= ((uint32_t)tail[2]) << 16; + k1 ^= ((uint32_t)keyptr[2]) << 16; /* fallthrough */ case 2: - k1 ^= ((uint32_t)tail[1]) << 8; + k1 ^= ((uint32_t)keyptr[1]) << 8; /* fallthrough */ case 1: - k1 ^= tail[0]; + k1 ^= keyptr[0]; k1 *= c1; k1 = ROTL32(k1, 15); k1 *= c2; -- cgit v1.2.3 From 9389b152dfa8ec81e205ceeefefd288710d1de56 Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Tue, 28 Nov 2017 10:56:23 -0800 Subject: increase timeout --- tools/internal_ci/linux/grpc_interop_matrix.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/internal_ci/linux/grpc_interop_matrix.cfg b/tools/internal_ci/linux/grpc_interop_matrix.cfg index a7fd479a73..71e930e0b0 100644 --- a/tools/internal_ci/linux/grpc_interop_matrix.cfg +++ b/tools/internal_ci/linux/grpc_interop_matrix.cfg @@ -17,7 +17,7 @@ # Location of the continuous shell script in repository. build_file: "grpc/tools/internal_ci/linux/grpc_interop_matrix.sh" # grpc_interop tests can take 1 hours to complete. -timeout_mins: 60 +timeout_mins: 120 action { define_artifacts { regex: "**/sponge_log.xml" -- cgit v1.2.3 From 95593c5b8bdafaf8bdeda0143b2ce2fa93e62f83 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Tue, 28 Nov 2017 11:35:47 -0800 Subject: Remove unnecessary secure dependences --- BUILD | 1 - bazel/cc_grpc_library.bzl | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/BUILD b/BUILD index 25daba8e1e..c7f66b2430 100644 --- a/BUILD +++ b/BUILD @@ -418,7 +418,6 @@ grpc_cc_library( ], external_deps = [ "nanopb", - "libssl", ], language = "c++", public_hdrs = [ diff --git a/bazel/cc_grpc_library.bzl b/bazel/cc_grpc_library.bzl index afc5543795..94781ed7ae 100644 --- a/bazel/cc_grpc_library.bzl +++ b/bazel/cc_grpc_library.bzl @@ -60,10 +60,10 @@ def cc_grpc_library(name, srcs, deps, proto_only, well_known_protos, generate_mo if use_external: # when this file is used by non-grpc projects - grpc_deps = ["//external:grpc++", "//external:grpc++_codegen_proto", + grpc_deps = ["//external:grpc++_codegen_proto", "//external:protobuf"] else: - grpc_deps = ["//:grpc++", "//:grpc++_codegen_proto", "//external:protobuf"] + grpc_deps = ["//:grpc++_codegen_proto", "//external:protobuf"] native.cc_library( name = name, -- cgit v1.2.3 From dd0f0064164666ab06b2d44217ae10125c1277b4 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Tue, 28 Nov 2017 11:53:55 -0800 Subject: Fix examples build file --- examples/BUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/BUILD b/examples/BUILD index 3e9e508ec2..0f18cfa9ba 100644 --- a/examples/BUILD +++ b/examples/BUILD @@ -42,12 +42,12 @@ cc_binary( name = "greeter_client", srcs = ["cpp/helloworld/greeter_client.cc"], defines = ["BAZEL_BUILD"], - deps = [":helloworld"], + deps = [":helloworld", "//:grpc++"], ) cc_binary( name = "greeter_server", srcs = ["cpp/helloworld/greeter_server.cc"], defines = ["BAZEL_BUILD"], - deps = [":helloworld"], + deps = [":helloworld", "//:grpc++"], ) -- cgit v1.2.3 From b155c5d312dfeedd35714e4510ac87eaa04ae606 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 28 Nov 2017 12:05:41 -0800 Subject: unchange protobuf --- third_party/protobuf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/protobuf b/third_party/protobuf index 80a37e0782..2761122b81 160000 --- a/third_party/protobuf +++ b/third_party/protobuf @@ -1 +1 @@ -Subproject commit 80a37e0782d2d702d52234b62dd4b9ec74fd2c95 +Subproject commit 2761122b810fe8861004ae785cc3ab39f384d342 -- cgit v1.2.3 From 53fa3546f1cd85a1223f7bc843b0e077ab300f2a Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Tue, 28 Nov 2017 12:17:06 -0800 Subject: Update windows build instructions. --- INSTALL.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index 15725bd188..6dfc3ed564 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -94,6 +94,7 @@ on experience with the tools involved. ### Building using CMake (RECOMMENDED) Builds gRPC C and C++ with boringssl. +- Install [Git](https://git-scm.com/). - Install Visual Studio 2015 or 2017 (Visual C++ compiler will be used). - Install [CMake](https://cmake.org/download/). - Install [Active State Perl](https://www.activestate.com/activeperl/) (`choco install activeperl`) @@ -106,11 +107,15 @@ Builds gRPC C and C++ with boringssl. Please note that when using Ninja, you'll still need Visual C++ (part of Visual Studio) installed to be able to compile the C/C++ sources. ``` +> powershell git clone -b ((New-Object System.Net.WebClient).DownloadString(\"https://grpc.io/release\").Trim()) https://github.com/grpc/grpc +> cd grpc +> git submodule update --init > md .build > cd .build > call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x64 > cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release > cmake --build . +> ninja ``` #### cmake: Using Visual Studio 2015 (can only build with OPENSSL_NO_ASM). -- cgit v1.2.3 From 12bfc62e813ecaf7240cc0b719af721fba3ac459 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Tue, 28 Nov 2017 13:21:33 -0800 Subject: Sanity check to make sure that known unsecure target doesn't require security --- tools/run_tests/sanity/check_unsecure.sh | 24 ++++++++++++++++++++++++ tools/run_tests/sanity/sanity_tests.yaml | 1 + 2 files changed, 25 insertions(+) create mode 100755 tools/run_tests/sanity/check_unsecure.sh diff --git a/tools/run_tests/sanity/check_unsecure.sh b/tools/run_tests/sanity/check_unsecure.sh new file mode 100755 index 0000000000..ef9cc612f1 --- /dev/null +++ b/tools/run_tests/sanity/check_unsecure.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# Copyright 2017 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +set -e + +# Make sure that there is no path from a known unsecure target +# to an SSL library + +[[ $(bazel query "somepath(//test/cpp/microbenchmarks:helpers, //external:libssl)" 2>/dev/null | wc -l) -eq 0 ]] + +# Fall through with the exit code of that command diff --git a/tools/run_tests/sanity/sanity_tests.yaml b/tools/run_tests/sanity/sanity_tests.yaml index 81eec4d149..3ce864a8bd 100644 --- a/tools/run_tests/sanity/sanity_tests.yaml +++ b/tools/run_tests/sanity/sanity_tests.yaml @@ -6,6 +6,7 @@ - script: tools/run_tests/sanity/check_submodules.sh - script: tools/run_tests/sanity/check_test_filtering.py - script: tools/run_tests/sanity/check_tracer_sanity.py +- script: tools/run_tests/sanity/check_unsecure.sh - script: tools/run_tests/sanity/core_banned_functions.py - script: tools/run_tests/sanity/core_untyped_structs.sh - script: tools/buildgen/generate_projects.sh -j 3 -- cgit v1.2.3 From 2a0432edc56b6a1b2ade4c30bc3267717eac5a86 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Tue, 28 Nov 2017 13:49:28 -0800 Subject: Remove bash-isms from sanity test --- tools/run_tests/sanity/check_unsecure.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_tests/sanity/check_unsecure.sh b/tools/run_tests/sanity/check_unsecure.sh index ef9cc612f1..aabafedfb8 100755 --- a/tools/run_tests/sanity/check_unsecure.sh +++ b/tools/run_tests/sanity/check_unsecure.sh @@ -19,6 +19,6 @@ set -e # Make sure that there is no path from a known unsecure target # to an SSL library -[[ $(bazel query "somepath(//test/cpp/microbenchmarks:helpers, //external:libssl)" 2>/dev/null | wc -l) -eq 0 ]] +test `bazel query "somepath(//test/cpp/microbenchmarks:helpers, //external:libssl)" 2>/dev/null | wc -l` -eq 0 # Fall through with the exit code of that command -- cgit v1.2.3 From b7b3f72dac0a40375e85f2735670e0bc134a80cf Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 28 Nov 2017 14:43:38 -0800 Subject: Fix uninitialized variable --- .../ext/filters/workarounds/workaround_cronet_compression_filter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc b/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc index 6bbb4d5739..390da52e2f 100644 --- a/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +++ b/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc @@ -139,7 +139,7 @@ static bool parse_user_agent(grpc_mdelem md) { bool grpc_objc_specifier_seen = false; bool cronet_specifier_seen = false; char *major_version_str = user_agent_str, *minor_version_str; - long major_version, minor_version; + long major_version = 0, minor_version = 0; char* head = strtok(user_agent_str, " "); while (head != nullptr) { -- cgit v1.2.3 From 9ab3e5d9194312d6c625ebb9c7614a46e9a25804 Mon Sep 17 00:00:00 2001 From: Noah Eisen Date: Tue, 28 Nov 2017 16:33:50 -0800 Subject: Fix tracer TSAN bug --- src/core/lib/debug/trace.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/lib/debug/trace.cc b/src/core/lib/debug/trace.cc index 4c63983bdc..338ef3343d 100644 --- a/src/core/lib/debug/trace.cc +++ b/src/core/lib/debug/trace.cc @@ -76,7 +76,8 @@ void TraceFlagList::LogAllTracers() { // Flags register themselves on the list during construction TraceFlag::TraceFlag(bool default_enabled, const char* name) - : name_(name), value_(default_enabled) { + : name_(name) { + set_enabled(default_enabled); TraceFlagList::Add(this); } -- cgit v1.2.3 From 1479313244b4e58b3d60316650b6a1b0272364f4 Mon Sep 17 00:00:00 2001 From: Noah Eisen Date: Tue, 28 Nov 2017 17:08:47 -0800 Subject: clang fmt --- src/core/lib/debug/trace.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/lib/debug/trace.cc b/src/core/lib/debug/trace.cc index 338ef3343d..a76c1afb4c 100644 --- a/src/core/lib/debug/trace.cc +++ b/src/core/lib/debug/trace.cc @@ -75,8 +75,7 @@ void TraceFlagList::LogAllTracers() { } // Flags register themselves on the list during construction -TraceFlag::TraceFlag(bool default_enabled, const char* name) - : name_(name) { +TraceFlag::TraceFlag(bool default_enabled, const char* name) : name_(name) { set_enabled(default_enabled); TraceFlagList::Add(this); } -- cgit v1.2.3 From eba68fad77ae6651f33417f06732fc5125b40e5f Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Tue, 28 Nov 2017 17:11:44 -0800 Subject: Add --recursive flag to git clone command. To avoid a later git command. Simpler. --- INSTALL.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 6dfc3ed564..a18f5690a4 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -107,9 +107,8 @@ Builds gRPC C and C++ with boringssl. Please note that when using Ninja, you'll still need Visual C++ (part of Visual Studio) installed to be able to compile the C/C++ sources. ``` -> powershell git clone -b ((New-Object System.Net.WebClient).DownloadString(\"https://grpc.io/release\").Trim()) https://github.com/grpc/grpc +> powershell git clone --recursive -b ((New-Object System.Net.WebClient).DownloadString(\"https://grpc.io/release\").Trim()) https://github.com/grpc/grpc > cd grpc -> git submodule update --init > md .build > cd .build > call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x64 -- cgit v1.2.3 From 3aeff224ed0900707023c89f87f058f90be0612e Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Tue, 28 Nov 2017 23:12:51 -0800 Subject: Remove some dead code from a previous iteration of internal::Call --- include/grpc++/impl/codegen/call.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h index 41e95866cf..af2c2b510c 100644 --- a/include/grpc++/impl/codegen/call.h +++ b/include/grpc++/impl/codegen/call.h @@ -313,11 +313,6 @@ class CallOpSendMessage { WriteOptions write_options_; }; -namespace internal { -template -T Example(); -} // namespace internal - template Status CallOpSendMessage::SendMessage(const M& message, WriteOptions options) { write_options_ = options; -- cgit v1.2.3 From 1fece54633176c0000181fbc41229887e4ffb4f3 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Tue, 28 Nov 2017 23:39:00 -0800 Subject: Add all tests to test/cpp/util bazel BUILD file --- test/cpp/util/BUILD | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/test/cpp/util/BUILD b/test/cpp/util/BUILD index 2559c18c32..19e15b1adf 100644 --- a/test/cpp/util/BUILD +++ b/test/cpp/util/BUILD @@ -43,6 +43,7 @@ grpc_cc_library( "proto_reflection_descriptor_database.h", ], deps = [ + "//:grpc++", "//:grpc++_config_proto", "//src/proto/grpc/reflection/v1alpha:reflection_proto", ], @@ -134,6 +135,105 @@ grpc_cc_library( ], ) +grpc_cc_test( + name = "grpc_tool_test", + srcs = [ + "grpc_tool_test.cc", + ], + deps = [ + ":grpc_cli_libs", + ":test_util", + "//:grpc++_reflection", + "//src/proto/grpc/testing:echo_proto", + "//src/proto/grpc/testing:echo_messages_proto", + "//test/core/util:grpc_test_util", + ], + external_deps = [ + "gtest", + ], +) + +grpc_cc_test( + name = "byte_buffer_test", + srcs = [ + "byte_buffer_test.cc", + ], + deps = [ + ":test_util", + ], + external_deps = [ + "gtest", + ], +) + +grpc_cc_test( + name = "slice_test", + srcs = [ + "slice_test.cc", + ], + deps = [ + ":test_util", + ], + external_deps = [ + "gtest", + ], +) + +grpc_cc_test( + name = "string_ref_test", + srcs = [ + "string_ref_test.cc", + ], + deps = [ + "//:grpc++", + ], + external_deps = [ + "gtest", + ], +) + +grpc_cc_test( + name = "time_test", + srcs = [ + "time_test.cc", + ], + deps = [ + ":test_util", + ], + external_deps = [ + "gtest", + ], +) + +grpc_cc_test( + name = "status_test", + srcs = [ + "status_test.cc", + ], + deps = [ + ":test_util", + ], + external_deps = [ + "gtest", + ], +) + +grpc_cc_test( + name = "cli_call_test", + srcs = [ + "cli_call_test.cc", + ], + deps = [ + ":grpc_cli_libs", + ":test_util", + "//src/proto/grpc/testing:echo_proto", + "//test/core/util:grpc_test_util", + ], + external_deps = [ + "gtest", + ], +) + grpc_cc_test( name = "error_details_test", srcs = [ -- cgit v1.2.3