From b31ec1e81c93d4c9bf30a4600096a6a6f5b90935 Mon Sep 17 00:00:00 2001 From: "David G. Quintas" Date: Wed, 10 Feb 2016 22:48:15 -0800 Subject: [PATCH 01/43] Load balancing first draft. --- doc/load-balancing.md | 96 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 doc/load-balancing.md diff --git a/doc/load-balancing.md b/doc/load-balancing.md new file mode 100644 index 0000000000000..d0941cc0813ea --- /dev/null +++ b/doc/load-balancing.md @@ -0,0 +1,96 @@ +Load Balancing in gRPC +======================= + +## Objective + +To design a load balancing API between a gRPC client and a Load Balancer to +instruct the client how to send load to multiple backend servers. + +## Background + +Prior to any gRPC specifics, we explore some usual way to approach load +balancing. + +## Proxy Model + +Using a proxy provides a solid trustable client that can report load to the load +balancing system. Proxies typically require more resources to operate since they +have temporary copies of the RPC request and response. This model also increases +latency to the RPCs. + +The proxy model was deemed inefficient when considering request heavy services +like storage. + +## Balancing-aware Client + +This thicker client places more of the load balancing logic in the client. For +example, the client could contain many load balancing policies (Round Robin, +Random, etc) used to select servers from a list. In this model, a load balancer +would be responsible for providing a list of servers and let the client choose +the preferred server from the list. + +One of the drawbacks of this approach is writing and maintaining the load +balancing policies in multiple languages and/or versions of the clients. These +policies can be fairly complicated. Some of the algorithms also require client +to server communication so the client would need to get thicker to support +additional RPCs to get health or load information in addition to sending RPCs +for user requests. + +It would also significantly complicate the API: the new design hides the load +balancing complexity of multiple layers and presents it as a simple list of +servers to the client. + +## External Load Balancing Service + +The client load balancing code is kept simple and portable, implementing +straightforward algorithms (ie, Pick First, Round Robin) for server selection. +Complex load balancing algorithms are instead provided by the load balancer. The +client relies on the load balancer to provide _load balancing configuration_ and +_the list of servers_ to which the client should send requests. The balancer +updates the server list as needed to balance the load as well as handle server +unavailability or health issues. The load balancer will make any necessary +complex decisions and inform the client. The load balancer may communicate with +the backend servers to collect load and health information. + +## Proposed Architecture + +The gRPC load balancing approach follows the third approach, by having an +external load balancer which provides simple clients with a list of servers. + +## Client + +When establishing a gRPC stream to the balancer, the client will send an initial +request to the load balancer (via a regular gRPC message). The load balancer +will respond with client config (including, for example, settings for flow +control, RPC deadlines, etc.) or a redirect to another load balancer. If the +balancer did not redirect the client, it will then send a list of servers to the +client. The client will contain simple load balancing logic for choosing the +next server when it needs to send a request. + +## Load Balancer + +The Load Balancer is responsible for providing the client with a list of servers +and client RPC parameters. The balancer chooses when to update the list of +servers and can decide whether to provide a complete list, a subset, or a +specific list of “picked” servers in a particular order. The balancer can +optionally provide an expiration interval after which the server list should no +longer be trusted and should be updated by the balancer. + +The load balancer is may open reporting streams to each server contained in the +server list. These streams are primarily used for load reporting. For example, +Weighted Round Robin requires that the servers report utilization to the load +balancer in order to compute the next list of servers. + +## Server + +The gRPC Server is responsible for answering RPC requests and providing +responses to the client. The server will also report load to the load balancer +if a reporting stream was opened for this purpose. + +### Security + +The load balancer may be separate from the actual server backends and a +compromise of the load balancer should only lead to a compromise of the +loadbalancing functionality. In other words, a compromised load balancer should +not be able to cause a client to trust a (potentially malicious) backend server +any more than in a comparable situation without loadbalancing. From 8003d767b4391d757c808cebf529ea3add23c319 Mon Sep 17 00:00:00 2001 From: "David G. Quintas" Date: Wed, 10 Feb 2016 22:49:50 -0800 Subject: [PATCH 02/43] Update load-balancing.md Typo --- doc/load-balancing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/load-balancing.md b/doc/load-balancing.md index d0941cc0813ea..ffae33fb047a8 100644 --- a/doc/load-balancing.md +++ b/doc/load-balancing.md @@ -8,7 +8,7 @@ instruct the client how to send load to multiple backend servers. ## Background -Prior to any gRPC specifics, we explore some usual way to approach load +Prior to any gRPC specifics, we explore some usual ways to approach load balancing. ## Proxy Model From 8729d03fdf47b535012312fc4b983b0b27b49918 Mon Sep 17 00:00:00 2001 From: "David G. Quintas" Date: Wed, 10 Feb 2016 22:54:36 -0800 Subject: [PATCH 03/43] Update load-balancing.md Formatting --- doc/load-balancing.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/load-balancing.md b/doc/load-balancing.md index ffae33fb047a8..b1a27057abe5a 100644 --- a/doc/load-balancing.md +++ b/doc/load-balancing.md @@ -1,17 +1,17 @@ Load Balancing in gRPC ======================= -## Objective +# Objective To design a load balancing API between a gRPC client and a Load Balancer to instruct the client how to send load to multiple backend servers. -## Background +# Background Prior to any gRPC specifics, we explore some usual ways to approach load balancing. -## Proxy Model +### Proxy Model Using a proxy provides a solid trustable client that can report load to the load balancing system. Proxies typically require more resources to operate since they @@ -21,7 +21,7 @@ latency to the RPCs. The proxy model was deemed inefficient when considering request heavy services like storage. -## Balancing-aware Client +### Balancing-aware Client This thicker client places more of the load balancing logic in the client. For example, the client could contain many load balancing policies (Round Robin, @@ -40,7 +40,7 @@ It would also significantly complicate the API: the new design hides the load balancing complexity of multiple layers and presents it as a simple list of servers to the client. -## External Load Balancing Service +### External Load Balancing Service The client load balancing code is kept simple and portable, implementing straightforward algorithms (ie, Pick First, Round Robin) for server selection. @@ -52,7 +52,7 @@ unavailability or health issues. The load balancer will make any necessary complex decisions and inform the client. The load balancer may communicate with the backend servers to collect load and health information. -## Proposed Architecture +# Proposed Architecture The gRPC load balancing approach follows the third approach, by having an external load balancer which provides simple clients with a list of servers. From 51073f307fb72c8d55fdf699f3a98c5cf695a26f Mon Sep 17 00:00:00 2001 From: "David G. Quintas" Date: Fri, 12 Feb 2016 14:07:42 -0800 Subject: [PATCH 04/43] Update load-balancing.md Addressed comments. --- doc/load-balancing.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/load-balancing.md b/doc/load-balancing.md index b1a27057abe5a..681be02a72f04 100644 --- a/doc/load-balancing.md +++ b/doc/load-balancing.md @@ -25,9 +25,10 @@ like storage. This thicker client places more of the load balancing logic in the client. For example, the client could contain many load balancing policies (Round Robin, -Random, etc) used to select servers from a list. In this model, a load balancer -would be responsible for providing a list of servers and let the client choose -the preferred server from the list. +Random, etc) used to select servers from a list. In this model, a list of +servers would be either statically configured in the client, provided by the +name resolution system, an external load balancer, etc. In any case, the client +is responsible for choosing the preferred server from the list. One of the drawbacks of this approach is writing and maintaining the load balancing policies in multiple languages and/or versions of the clients. These @@ -36,14 +37,14 @@ to server communication so the client would need to get thicker to support additional RPCs to get health or load information in addition to sending RPCs for user requests. -It would also significantly complicate the API: the new design hides the load -balancing complexity of multiple layers and presents it as a simple list of -servers to the client. +It would also significantly complicate the client's code: the new design hides +the load balancing complexity of multiple layers and presents it as a simple +list of servers to the client. ### External Load Balancing Service The client load balancing code is kept simple and portable, implementing -straightforward algorithms (ie, Pick First, Round Robin) for server selection. +well-known algorithms (ie, Round Robin) for server selection. Complex load balancing algorithms are instead provided by the load balancer. The client relies on the load balancer to provide _load balancing configuration_ and _the list of servers_ to which the client should send requests. The balancer @@ -76,7 +77,7 @@ specific list of “picked” servers in a particular order. The balancer can optionally provide an expiration interval after which the server list should no longer be trusted and should be updated by the balancer. -The load balancer is may open reporting streams to each server contained in the +The load balancer may open reporting streams to each server contained in the server list. These streams are primarily used for load reporting. For example, Weighted Round Robin requires that the servers report utilization to the load balancer in order to compute the next list of servers. From cf4daebe2764cb5da664c7b2e406c48ee44dfeaa Mon Sep 17 00:00:00 2001 From: vjpai Date: Mon, 15 Feb 2016 02:33:54 -0800 Subject: [PATCH 05/43] Comment the requirements for changing grpc_poll_function and do poll overrides in such a way as to avoid polling races --- src/core/iomgr/pollset_posix.h | 4 ++++ test/cpp/end2end/async_end2end_test.cc | 16 +++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/core/iomgr/pollset_posix.h b/src/core/iomgr/pollset_posix.h index b34bb09426822..5868b3fa21ce1 100644 --- a/src/core/iomgr/pollset_posix.h +++ b/src/core/iomgr/pollset_posix.h @@ -142,6 +142,10 @@ int grpc_pollset_has_workers(grpc_pollset *pollset); void grpc_remove_fd_from_all_epoll_sets(int fd); /* override to allow tests to hook poll() usage */ +/* NOTE: Any changes to grpc_poll_function must take place when the gRPC + is certainly not doing any polling anywhere. + Otherwise, there might be a race between changing the variable and actually + doing a polling operation */ typedef int (*grpc_poll_function_type)(struct pollfd *, nfds_t, int); extern grpc_poll_function_type grpc_poll_function; extern grpc_wakeup_fd grpc_global_wakeup_fd; diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index a194c615cdfd1..78417fc6d0be4 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -86,21 +86,21 @@ class PollOverride { grpc_poll_function_type prev_; }; -class PollingCheckRegion : public PollOverride { +class PollingOverrider : public PollOverride { public: - explicit PollingCheckRegion(bool allow_blocking) + explicit PollingOverrider(bool allow_blocking) : PollOverride(allow_blocking ? poll : assert_non_blocking_poll) {} }; #else -class PollingCheckRegion { +class PollingOverrider { public: - explicit PollingCheckRegion(bool allow_blocking) {} + explicit PollingOverrider(bool allow_blocking) {} }; #endif -class Verifier : public PollingCheckRegion { +class Verifier { public: - explicit Verifier(bool spin) : PollingCheckRegion(!spin), spin_(spin) {} + explicit Verifier(bool spin) : spin_(spin) {} Verifier& Expect(int i, bool expect_ok) { expectations_[tag(i)] = expect_ok; return *this; @@ -180,7 +180,7 @@ class Verifier : public PollingCheckRegion { class AsyncEnd2endTest : public ::testing::TestWithParam { protected: - AsyncEnd2endTest() {} + AsyncEnd2endTest(): poll_override_(GetParam()) {} void SetUp() GRPC_OVERRIDE { int port = grpc_pick_unused_port_or_die(); @@ -249,6 +249,8 @@ class AsyncEnd2endTest : public ::testing::TestWithParam { std::unique_ptr server_; grpc::testing::EchoTestService::AsyncService service_; std::ostringstream server_address_; + + PollingOverrider poll_override_; }; TEST_P(AsyncEnd2endTest, SimpleRpc) { From ccdea1900fdad3d507617c8b1b639c7f5914d06b Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 16 Feb 2016 08:06:46 -0800 Subject: [PATCH 06/43] Separate timer checking from pollsets --- BUILD | 3 - build.yaml | 1 - gRPC.podspec | 2 - grpc.gemspec | 1 - package.json | 1 - src/core/iomgr/iocp_windows.c | 2 +- src/core/iomgr/iomgr.c | 2 +- src/core/iomgr/pollset_posix.c | 11 ---- src/core/iomgr/pollset_windows.c | 4 -- src/core/iomgr/timer.c | 1 - src/core/iomgr/timer.h | 20 ++++++ src/core/iomgr/timer_internal.h | 61 ------------------- src/core/surface/completion_queue.c | 28 ++++++++- test/core/iomgr/timer_list_test.c | 1 - tools/doxygen/Doxyfile.core.internal | 1 - tools/run_tests/sources_and_headers.json | 4 -- vsprojects/vcxproj/grpc/grpc.vcxproj | 1 - vsprojects/vcxproj/grpc/grpc.vcxproj.filters | 3 - .../grpc_unsecure/grpc_unsecure.vcxproj | 1 - .../grpc_unsecure.vcxproj.filters | 3 - 20 files changed, 48 insertions(+), 103 deletions(-) delete mode 100644 src/core/iomgr/timer_internal.h diff --git a/BUILD b/BUILD index 72d5caa8d4314..24e3e5406616d 100644 --- a/BUILD +++ b/BUILD @@ -231,7 +231,6 @@ cc_library( "src/core/iomgr/time_averaged_stats.h", "src/core/iomgr/timer.h", "src/core/iomgr/timer_heap.h", - "src/core/iomgr/timer_internal.h", "src/core/iomgr/udp_server.h", "src/core/iomgr/wakeup_fd_pipe.h", "src/core/iomgr/wakeup_fd_posix.h", @@ -533,7 +532,6 @@ cc_library( "src/core/iomgr/time_averaged_stats.h", "src/core/iomgr/timer.h", "src/core/iomgr/timer_heap.h", - "src/core/iomgr/timer_internal.h", "src/core/iomgr/udp_server.h", "src/core/iomgr/wakeup_fd_pipe.h", "src/core/iomgr/wakeup_fd_posix.h", @@ -1490,7 +1488,6 @@ objc_library( "src/core/iomgr/time_averaged_stats.h", "src/core/iomgr/timer.h", "src/core/iomgr/timer_heap.h", - "src/core/iomgr/timer_internal.h", "src/core/iomgr/udp_server.h", "src/core/iomgr/wakeup_fd_pipe.h", "src/core/iomgr/wakeup_fd_posix.h", diff --git a/build.yaml b/build.yaml index 7f33ef3f0e580..f8fc48838323a 100644 --- a/build.yaml +++ b/build.yaml @@ -307,7 +307,6 @@ filegroups: - src/core/iomgr/time_averaged_stats.h - src/core/iomgr/timer.h - src/core/iomgr/timer_heap.h - - src/core/iomgr/timer_internal.h - src/core/iomgr/udp_server.h - src/core/iomgr/wakeup_fd_pipe.h - src/core/iomgr/wakeup_fd_posix.h diff --git a/gRPC.podspec b/gRPC.podspec index 5b4d24e4820d6..13c303a8c7b17 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -235,7 +235,6 @@ Pod::Spec.new do |s| 'src/core/iomgr/time_averaged_stats.h', 'src/core/iomgr/timer.h', 'src/core/iomgr/timer_heap.h', - 'src/core/iomgr/timer_internal.h', 'src/core/iomgr/udp_server.h', 'src/core/iomgr/wakeup_fd_pipe.h', 'src/core/iomgr/wakeup_fd_posix.h', @@ -541,7 +540,6 @@ Pod::Spec.new do |s| 'src/core/iomgr/time_averaged_stats.h', 'src/core/iomgr/timer.h', 'src/core/iomgr/timer_heap.h', - 'src/core/iomgr/timer_internal.h', 'src/core/iomgr/udp_server.h', 'src/core/iomgr/wakeup_fd_pipe.h', 'src/core/iomgr/wakeup_fd_posix.h', diff --git a/grpc.gemspec b/grpc.gemspec index 32fe4932a9ff5..4485b440d6adc 100755 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -231,7 +231,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/iomgr/time_averaged_stats.h ) s.files += %w( src/core/iomgr/timer.h ) s.files += %w( src/core/iomgr/timer_heap.h ) - s.files += %w( src/core/iomgr/timer_internal.h ) s.files += %w( src/core/iomgr/udp_server.h ) s.files += %w( src/core/iomgr/wakeup_fd_pipe.h ) s.files += %w( src/core/iomgr/wakeup_fd_posix.h ) diff --git a/package.json b/package.json index 8cbfb2905597b..3042c91680ec3 100644 --- a/package.json +++ b/package.json @@ -176,7 +176,6 @@ "src/core/iomgr/time_averaged_stats.h", "src/core/iomgr/timer.h", "src/core/iomgr/timer_heap.h", - "src/core/iomgr/timer_internal.h", "src/core/iomgr/udp_server.h", "src/core/iomgr/wakeup_fd_pipe.h", "src/core/iomgr/wakeup_fd_posix.h", diff --git a/src/core/iomgr/iocp_windows.c b/src/core/iomgr/iocp_windows.c index 759340e00ef93..807729708ea7e 100644 --- a/src/core/iomgr/iocp_windows.c +++ b/src/core/iomgr/iocp_windows.c @@ -42,7 +42,7 @@ #include #include -#include "src/core/iomgr/timer_internal.h" +#include "src/core/iomgr/timer.h" #include "src/core/iomgr/iocp_windows.h" #include "src/core/iomgr/iomgr_internal.h" #include "src/core/iomgr/socket_windows.h" diff --git a/src/core/iomgr/iomgr.c b/src/core/iomgr/iomgr.c index 212ce5534dd9a..3283b586b06c4 100644 --- a/src/core/iomgr/iomgr.c +++ b/src/core/iomgr/iomgr.c @@ -43,7 +43,7 @@ #include #include "src/core/iomgr/iomgr_internal.h" -#include "src/core/iomgr/timer_internal.h" +#include "src/core/iomgr/timer.h" #include "src/core/support/string.h" static gpr_mu g_mu; diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c index 19ee6650f006c..1063727248a07 100644 --- a/src/core/iomgr/pollset_posix.c +++ b/src/core/iomgr/pollset_posix.c @@ -42,7 +42,6 @@ #include #include -#include "src/core/iomgr/timer_internal.h" #include "src/core/iomgr/fd_posix.h" #include "src/core/iomgr/iomgr_internal.h" #include "src/core/iomgr/socket_utils_posix.h" @@ -274,16 +273,6 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, grpc_exec_ctx_enqueue_list(exec_ctx, &pollset->idle_jobs, NULL); goto done; } - /* Check alarms - these are a global resource so we just ping - each time through on every pollset. - May update deadline to ensure timely wakeups. - TODO(ctiller): can this work be localized? */ - if (grpc_timer_check(exec_ctx, now, &deadline)) { - GPR_TIMER_MARK("grpc_pollset_work.alarm_triggered", 0); - gpr_mu_unlock(&pollset->mu); - locked = 0; - goto done; - } /* If we're shutting down then we don't execute any extended work */ if (pollset->shutting_down) { GPR_TIMER_MARK("grpc_pollset_work.shutting_down", 0); diff --git a/src/core/iomgr/pollset_windows.c b/src/core/iomgr/pollset_windows.c index 02c667836316a..35a956b27fd2b 100644 --- a/src/core/iomgr/pollset_windows.c +++ b/src/core/iomgr/pollset_windows.c @@ -38,7 +38,6 @@ #include #include -#include "src/core/iomgr/timer_internal.h" #include "src/core/iomgr/iomgr_internal.h" #include "src/core/iomgr/iocp_windows.h" #include "src/core/iomgr/pollset.h" @@ -136,9 +135,6 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, worker->kicked = 0; worker->pollset = pollset; gpr_cv_init(&worker->cv); - if (grpc_timer_check(exec_ctx, now, &deadline)) { - goto done; - } if (!pollset->kicked_without_pollers && !pollset->shutting_down) { if (g_active_poller == NULL) { grpc_pollset_worker *next_worker; diff --git a/src/core/iomgr/timer.c b/src/core/iomgr/timer.c index a33d8f63a05bb..5e7fadb7906b3 100644 --- a/src/core/iomgr/timer.c +++ b/src/core/iomgr/timer.c @@ -34,7 +34,6 @@ #include "src/core/iomgr/timer.h" #include "src/core/iomgr/timer_heap.h" -#include "src/core/iomgr/timer_internal.h" #include "src/core/iomgr/time_averaged_stats.h" #include #include diff --git a/src/core/iomgr/timer.h b/src/core/iomgr/timer.h index 720c9d5ab9444..2f74b6e5d3d12 100644 --- a/src/core/iomgr/timer.h +++ b/src/core/iomgr/timer.h @@ -86,4 +86,24 @@ void grpc_timer_init(grpc_exec_ctx *exec_ctx, grpc_timer *timer, Requires: cancel() must happen after add() on a given timer */ void grpc_timer_cancel(grpc_exec_ctx *exec_ctx, grpc_timer *timer); +/* iomgr internal api for dealing with timers */ + +/* Check for timers to be run, and run them. + Return non zero if timer callbacks were executed. + Drops drop_mu if it is non-null before executing callbacks. + If next is non-null, TRY to update *next with the next running timer + IF that timer occurs before *next current value. + *next is never guaranteed to be updated on any given execution; however, + with high probability at least one thread in the system will see an update + at any time slice. */ + +int grpc_timer_check(grpc_exec_ctx* exec_ctx, gpr_timespec now, + gpr_timespec* next); +void grpc_timer_list_init(gpr_timespec now); +void grpc_timer_list_shutdown(grpc_exec_ctx* exec_ctx); + +/* the following must be implemented by each iomgr implementation */ + +void grpc_kick_poller(void); + #endif /* GRPC_INTERNAL_CORE_IOMGR_TIMER_H */ diff --git a/src/core/iomgr/timer_internal.h b/src/core/iomgr/timer_internal.h deleted file mode 100644 index f182e73764627..0000000000000 --- a/src/core/iomgr/timer_internal.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef GRPC_INTERNAL_CORE_IOMGR_TIMER_INTERNAL_H -#define GRPC_INTERNAL_CORE_IOMGR_TIMER_INTERNAL_H - -#include "src/core/iomgr/exec_ctx.h" -#include -#include - -/* iomgr internal api for dealing with timers */ - -/* Check for timers to be run, and run them. - Return non zero if timer callbacks were executed. - Drops drop_mu if it is non-null before executing callbacks. - If next is non-null, TRY to update *next with the next running timer - IF that timer occurs before *next current value. - *next is never guaranteed to be updated on any given execution; however, - with high probability at least one thread in the system will see an update - at any time slice. */ - -int grpc_timer_check(grpc_exec_ctx* exec_ctx, gpr_timespec now, - gpr_timespec* next); -void grpc_timer_list_init(gpr_timespec now); -void grpc_timer_list_shutdown(grpc_exec_ctx* exec_ctx); - -/* the following must be implemented by each iomgr implementation */ - -void grpc_kick_poller(void); - -#endif /* GRPC_INTERNAL_CORE_IOMGR_TIMER_INTERNAL_H */ diff --git a/src/core/surface/completion_queue.c b/src/core/surface/completion_queue.c index 75298eb795c4f..6597c83cdcafe 100644 --- a/src/core/surface/completion_queue.c +++ b/src/core/surface/completion_queue.c @@ -323,7 +323,19 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc, break; } first_loop = 0; - grpc_pollset_work(&exec_ctx, &cc->pollset, &worker, now, deadline); + /* Check alarms - these are a global resource so we just ping + each time through on every pollset. + May update deadline to ensure timely wakeups. + TODO(ctiller): can this work be localized? */ + gpr_timespec iteration_deadline = deadline; + if (grpc_timer_check(&exec_ctx, now, &iteration_deadline)) { + GPR_TIMER_MARK("alarm_triggered", 0); + gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset)); + grpc_exec_ctx_flush(&exec_ctx); + gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset)); + continue; + } + grpc_pollset_work(&exec_ctx, &cc->pollset, &worker, now, iteration_deadline); } GRPC_SURFACE_TRACE_RETURNED_EVENT(cc, &ret); GRPC_CQ_INTERNAL_UNREF(cc, "next"); @@ -427,7 +439,19 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag, break; } first_loop = 0; - grpc_pollset_work(&exec_ctx, &cc->pollset, &worker, now, deadline); + /* Check alarms - these are a global resource so we just ping + each time through on every pollset. + May update deadline to ensure timely wakeups. + TODO(ctiller): can this work be localized? */ + gpr_timespec iteration_deadline = deadline; + if (grpc_timer_check(&exec_ctx, now, &iteration_deadline)) { + GPR_TIMER_MARK("alarm_triggered", 0); + gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset)); + grpc_exec_ctx_flush(&exec_ctx); + gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset)); + continue; + } + grpc_pollset_work(&exec_ctx, &cc->pollset, &worker, now, iteration_deadline); del_plucker(cc, tag, &worker); } done: diff --git a/test/core/iomgr/timer_list_test.c b/test/core/iomgr/timer_list_test.c index 15de87c5a1a44..487527fbf5da2 100644 --- a/test/core/iomgr/timer_list_test.c +++ b/test/core/iomgr/timer_list_test.c @@ -35,7 +35,6 @@ #include -#include "src/core/iomgr/timer_internal.h" #include #include "test/core/util/test_config.h" diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index b6268432335e7..ffc40dfc19b18 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -850,7 +850,6 @@ src/core/iomgr/tcp_windows.h \ src/core/iomgr/time_averaged_stats.h \ src/core/iomgr/timer.h \ src/core/iomgr/timer_heap.h \ -src/core/iomgr/timer_internal.h \ src/core/iomgr/udp_server.h \ src/core/iomgr/wakeup_fd_pipe.h \ src/core/iomgr/wakeup_fd_posix.h \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 6538ddc37e194..fdba0417ca650 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -3032,7 +3032,6 @@ "src/core/iomgr/time_averaged_stats.h", "src/core/iomgr/timer.h", "src/core/iomgr/timer_heap.h", - "src/core/iomgr/timer_internal.h", "src/core/iomgr/udp_server.h", "src/core/iomgr/wakeup_fd_pipe.h", "src/core/iomgr/wakeup_fd_posix.h", @@ -3251,7 +3250,6 @@ "src/core/iomgr/timer.h", "src/core/iomgr/timer_heap.c", "src/core/iomgr/timer_heap.h", - "src/core/iomgr/timer_internal.h", "src/core/iomgr/udp_server.c", "src/core/iomgr/udp_server.h", "src/core/iomgr/wakeup_fd_eventfd.c", @@ -3557,7 +3555,6 @@ "src/core/iomgr/time_averaged_stats.h", "src/core/iomgr/timer.h", "src/core/iomgr/timer_heap.h", - "src/core/iomgr/timer_internal.h", "src/core/iomgr/udp_server.h", "src/core/iomgr/wakeup_fd_pipe.h", "src/core/iomgr/wakeup_fd_posix.h", @@ -3760,7 +3757,6 @@ "src/core/iomgr/timer.h", "src/core/iomgr/timer_heap.c", "src/core/iomgr/timer_heap.h", - "src/core/iomgr/timer_internal.h", "src/core/iomgr/udp_server.c", "src/core/iomgr/udp_server.h", "src/core/iomgr/wakeup_fd_eventfd.c", diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index 76975322be839..8e8f29aee99fd 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -359,7 +359,6 @@ - diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index 4660572f9799d..e55c6673cea96 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -734,9 +734,6 @@ src\core\iomgr - - src\core\iomgr - src\core\iomgr diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index 541000af4041c..af89435885c61 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -335,7 +335,6 @@ - diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index 48814f997e103..809ea59c5f49f 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -629,9 +629,6 @@ src\core\iomgr - - src\core\iomgr - src\core\iomgr From 018879aa9a37fa2351c71d6699e71743a92f6a18 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Tue, 16 Feb 2016 09:20:50 -0800 Subject: [PATCH 07/43] Set up poll overrides --- test/cpp/end2end/async_end2end_test.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index 78417fc6d0be4..aa99061fe983a 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -67,10 +67,10 @@ namespace { void* tag(int i) { return (void*)(intptr_t)i; } #ifdef GPR_POSIX_SOCKET -static int assert_non_blocking_poll(struct pollfd* pfds, nfds_t nfds, +static int non_blocking_poll(struct pollfd* pfds, nfds_t nfds, int timeout) { - GPR_ASSERT(timeout == 0); - return poll(pfds, nfds, timeout); + /* ignore timeout and always use timeout 0 */ + return poll(pfds, nfds, 0); } class PollOverride { @@ -89,7 +89,7 @@ class PollOverride { class PollingOverrider : public PollOverride { public: explicit PollingOverrider(bool allow_blocking) - : PollOverride(allow_blocking ? poll : assert_non_blocking_poll) {} + : PollOverride(allow_blocking ? poll : non_blocking_poll) {} }; #else class PollingOverrider { @@ -180,9 +180,11 @@ class Verifier { class AsyncEnd2endTest : public ::testing::TestWithParam { protected: - AsyncEnd2endTest(): poll_override_(GetParam()) {} + AsyncEnd2endTest() {} void SetUp() GRPC_OVERRIDE { + poll_overrider_.reset(new PollingOverrider(!GetParam())); + int port = grpc_pick_unused_port_or_die(); server_address_ << "localhost:" << port; @@ -202,6 +204,7 @@ class AsyncEnd2endTest : public ::testing::TestWithParam { cq_->Shutdown(); while (cq_->Next(&ignored_tag, &ignored_ok)) ; + poll_overrider_.reset(); } void ResetStub() { @@ -250,7 +253,7 @@ class AsyncEnd2endTest : public ::testing::TestWithParam { grpc::testing::EchoTestService::AsyncService service_; std::ostringstream server_address_; - PollingOverrider poll_override_; + std::unique_ptr poll_overrider_; }; TEST_P(AsyncEnd2endTest, SimpleRpc) { @@ -1089,7 +1092,7 @@ class AsyncEnd2endServerTryCancelTest : public AsyncEnd2endTest { Verifier(GetParam()).Expect(7, true).Verify(cq_.get()); // This is expected to fail in all cases i.e for all values of - // server_try_cancel. This is becasue at this point, either there are no + // server_try_cancel. This is because at this point, either there are no // more msgs from the client (because client called WritesDone) or the RPC // is cancelled on the server srv_stream.Read(&recv_request, tag(8)); From b65eda4c8844f98dcf2d0616406b746ac08e861d Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Tue, 16 Feb 2016 13:48:05 -0800 Subject: [PATCH 08/43] Make the poll override function assert on non-zero timeout if invoked from the end2end test thread itself (done by adding a TLS on that thread) Also clang-format --- test/cpp/end2end/async_end2end_test.cc | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index aa99061fe983a..a15cbd7ee2ec2 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -43,6 +43,7 @@ #include #include #include +#include #include #include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h" @@ -59,6 +60,8 @@ using grpc::testing::EchoRequest; using grpc::testing::EchoResponse; using std::chrono::system_clock; +GPR_TLS_DECL(g_is_async_end2end_test); + namespace grpc { namespace testing { @@ -67,10 +70,12 @@ namespace { void* tag(int i) { return (void*)(intptr_t)i; } #ifdef GPR_POSIX_SOCKET -static int non_blocking_poll(struct pollfd* pfds, nfds_t nfds, - int timeout) { - /* ignore timeout and always use timeout 0 */ - return poll(pfds, nfds, 0); +static int maybe_assert_non_blocking_poll(struct pollfd* pfds, nfds_t nfds, + int timeout) { + if (gpr_tls_get(&g_is_async_end2end_test)) { + GPR_ASSERT(timeout == 0); + } + return poll(pfds, nfds, timeout); } class PollOverride { @@ -89,7 +94,7 @@ class PollOverride { class PollingOverrider : public PollOverride { public: explicit PollingOverrider(bool allow_blocking) - : PollOverride(allow_blocking ? poll : non_blocking_poll) {} + : PollOverride(allow_blocking ? poll : maybe_assert_non_blocking_poll) {} }; #else class PollingOverrider { @@ -195,6 +200,8 @@ class AsyncEnd2endTest : public ::testing::TestWithParam { builder.RegisterService(&service_); cq_ = builder.AddCompletionQueue(); server_ = builder.BuildAndStart(); + + gpr_tls_set(&g_is_async_end2end_test, 1); } void TearDown() GRPC_OVERRIDE { @@ -205,6 +212,7 @@ class AsyncEnd2endTest : public ::testing::TestWithParam { while (cq_->Next(&ignored_tag, &ignored_ok)) ; poll_overrider_.reset(); + gpr_tls_set(&g_is_async_end2end_test, 0); } void ResetStub() { @@ -1169,6 +1177,9 @@ INSTANTIATE_TEST_CASE_P(AsyncEnd2endServerTryCancel, int main(int argc, char** argv) { grpc_test_init(argc, argv); + gpr_tls_init(&g_is_async_end2end_test); ::testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); + int ret = RUN_ALL_TESTS(); + gpr_tls_destroy(&g_is_async_end2end_test); + return ret; } From c02910b07ae492098d7d0c1bca747fbcad742393 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Wed, 17 Feb 2016 12:59:26 -0800 Subject: [PATCH 09/43] Node: add options to modify ProtoBuf behavior --- src/node/index.js | 40 +++++++++++++++++++++++++--------------- src/node/src/client.js | 6 ++++-- src/node/src/common.js | 29 ++++++++++++++++++++++++----- src/node/src/server.js | 7 ++++++- 4 files changed, 59 insertions(+), 23 deletions(-) diff --git a/src/node/index.js b/src/node/index.js index 7eacdc67b1d6a..4e4d12d9e45f1 100644 --- a/src/node/index.js +++ b/src/node/index.js @@ -56,17 +56,18 @@ var grpc = require('./src/grpc_extension'); /** * Load a gRPC object from an existing ProtoBuf.Reflect object. * @param {ProtoBuf.Reflect.Namespace} value The ProtoBuf object to load. + * @param {Object=} options Options to apply to the loaded object * @return {Object} The resulting gRPC object */ -exports.loadObject = function loadObject(value) { +exports.loadObject = function loadObject(value, options) { var result = {}; if (value.className === 'Namespace') { _.each(value.children, function(child) { - result[child.name] = loadObject(child); + result[child.name] = loadObject(child, options); }); return result; } else if (value.className === 'Service') { - return client.makeProtobufClientConstructor(value); + return client.makeProtobufClientConstructor(value, options); } else if (value.className === 'Message' || value.className === 'Enum') { return value.build(); } else { @@ -78,27 +79,36 @@ var loadObject = exports.loadObject; /** * Load a gRPC object from a .proto file. - * @param {string} filename The file to load + * @param {string|{root: string, file: string}} filename The file to load * @param {string=} format The file format to expect. Must be either 'proto' or * 'json'. Defaults to 'proto' + * @param {Object=} options Options to apply to the loaded file * @return {Object} The resulting gRPC object */ -exports.load = function load(filename, format) { +exports.load = function load(filename, format, options) { if (!format) { format = 'proto'; } + var convertFieldsToCamelCaseOriginal = ProtoBuf.convertFieldsToCamelCase; + if(options && options.hasOwnProperty('convertFieldsToCamelCase')) { + ProtoBuf.convertFieldsToCamelCase = options.convertFieldsToCamelCase; + } var builder; - switch(format) { - case 'proto': - builder = ProtoBuf.loadProtoFile(filename); - break; - case 'json': - builder = ProtoBuf.loadJsonFile(filename); - break; - default: - throw new Error('Unrecognized format "' + format + '"'); + try { + switch(format) { + case 'proto': + builder = ProtoBuf.loadProtoFile(filename); + break; + case 'json': + builder = ProtoBuf.loadJsonFile(filename); + break; + default: + throw new Error('Unrecognized format "' + format + '"'); + } + } finally { + ProtoBuf.convertFieldsToCamelCase = convertFieldsToCamelCaseOriginal; } - return loadObject(builder.ns); + return loadObject(builder.ns, options); }; /** diff --git a/src/node/src/client.js b/src/node/src/client.js index b5247a69ee016..5523d6b9a4743 100644 --- a/src/node/src/client.js +++ b/src/node/src/client.js @@ -698,13 +698,15 @@ exports.waitForClientReady = function(client, deadline, callback) { * Creates a constructor for clients for the given service * @param {ProtoBuf.Reflect.Service} service The service to generate a client * for + * @param {Object=} options Options to apply to the client * @return {function(string, Object)} New client constructor */ -exports.makeProtobufClientConstructor = function(service) { - var method_attrs = common.getProtobufServiceAttrs(service, service.name); +exports.makeProtobufClientConstructor = function(service, options) { + var method_attrs = common.getProtobufServiceAttrs(service, service.name, options); var Client = exports.makeClientConstructor( method_attrs, common.fullyQualifiedName(service)); Client.service = service; + Client.service.grpc_options = options; return Client; }; diff --git a/src/node/src/common.js b/src/node/src/common.js index 2e6c01c4d744a..3e6609ab1073f 100644 --- a/src/node/src/common.js +++ b/src/node/src/common.js @@ -44,9 +44,20 @@ var _ = require('lodash'); /** * Get a function that deserializes a specific type of protobuf. * @param {function()} cls The constructor of the message type to deserialize + * @param {bool=} binaryAsBase64 Deserialize bytes fields as base64 instead of binary. + * Defaults to false + * @param {bool=} longsAsStrings Deserialize long values as strings instead of doubles. + * Defaults to true * @return {function(Buffer):cls} The deserialization function */ -exports.deserializeCls = function deserializeCls(cls) { +exports.deserializeCls = function deserializeCls(cls, binaryAsBase64, + longsAsStrings) { + if (binaryAsBase64 === undefined || binaryAsBase64 === null) { + binaryAsBase64 = false; + } + if (longsAsStrings === undefined || longsAsStrings === null) { + longsAsStrings = true; + } /** * Deserialize a buffer to a message object * @param {Buffer} arg_buf The buffer to deserialize @@ -55,7 +66,7 @@ exports.deserializeCls = function deserializeCls(cls) { return function deserialize(arg_buf) { // Convert to a native object with binary fields as Buffers (first argument) // and longs as strings (second argument) - return cls.decode(arg_buf).toRaw(false, true); + return cls.decode(arg_buf).toRaw(binaryAsBase64, longsAsStrings); }; }; @@ -119,19 +130,27 @@ exports.wrapIgnoreNull = function wrapIgnoreNull(func) { /** * Return a map from method names to method attributes for the service. * @param {ProtoBuf.Reflect.Service} service The service to get attributes for + * @param {Object=} options Options to apply to these attributes * @return {Object} The attributes map */ -exports.getProtobufServiceAttrs = function getProtobufServiceAttrs(service) { +exports.getProtobufServiceAttrs = function getProtobufServiceAttrs(service, options) { var prefix = '/' + fullyQualifiedName(service) + '/'; + var binaryAsBase64, longsAsStrings; + if (options) { + binaryAsBase64 = options.binaryAsBase64; + longsAsStrings = options.longsAsStrings; + } return _.object(_.map(service.children, function(method) { return [_.camelCase(method.name), { path: prefix + method.name, requestStream: method.requestStream, responseStream: method.responseStream, requestSerialize: serializeCls(method.resolvedRequestType.build()), - requestDeserialize: deserializeCls(method.resolvedRequestType.build()), + requestDeserialize: deserializeCls(method.resolvedRequestType.build(), + binaryAsBase64, longsAsStrings), responseSerialize: serializeCls(method.resolvedResponseType.build()), - responseDeserialize: deserializeCls(method.resolvedResponseType.build()) + responseDeserialize: deserializeCls(method.resolvedResponseType.build(), + binaryAsBase64, longsAsStrings) }]; })); }; diff --git a/src/node/src/server.js b/src/node/src/server.js index e5aadcd5658e0..0cf7ba3424656 100644 --- a/src/node/src/server.js +++ b/src/node/src/server.js @@ -737,7 +737,12 @@ Server.prototype.addService = function(service, implementation) { * method implementation for the provided service. */ Server.prototype.addProtoService = function(service, implementation) { - this.addService(common.getProtobufServiceAttrs(service), implementation); + var options; + if (service.grpc_options) { + options = service.grpc_options; + } + this.addService(common.getProtobufServiceAttrs(service, options), + implementation); }; /** From 654d2549b752dfd74500f0b5882abaf306cd62c1 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Wed, 17 Feb 2016 15:36:28 -0800 Subject: [PATCH 10/43] Add tests and documentation for new options --- src/node/index.js | 10 ++++++- src/node/src/client.js | 3 +- src/node/src/common.js | 11 +++---- src/node/test/common_test.js | 50 ++++++++++++++++++++++++++++++- src/node/test/test_messages.proto | 5 ++++ 5 files changed, 71 insertions(+), 8 deletions(-) diff --git a/src/node/index.js b/src/node/index.js index 4e4d12d9e45f1..1c197729d776f 100644 --- a/src/node/index.js +++ b/src/node/index.js @@ -78,7 +78,15 @@ exports.loadObject = function loadObject(value, options) { var loadObject = exports.loadObject; /** - * Load a gRPC object from a .proto file. + * Load a gRPC object from a .proto file. The options object can provide the + * following options: + * - convertFieldsToCamelCase: Loads this file with that option on protobuf.js + * set as specified. See + * https://github.com/dcodeIO/protobuf.js/wiki/Advanced-options for details + * - binaryAsBase64: deserialize bytes values as base64 strings instead of + * Buffers. Defaults to false + * - longsAsStrings: deserialize long values as strings instead of objects. + * Defaults to true * @param {string|{root: string, file: string}} filename The file to load * @param {string=} format The file format to expect. Must be either 'proto' or * 'json'. Defaults to 'proto' diff --git a/src/node/src/client.js b/src/node/src/client.js index 5523d6b9a4743..c02c44730e511 100644 --- a/src/node/src/client.js +++ b/src/node/src/client.js @@ -702,7 +702,8 @@ exports.waitForClientReady = function(client, deadline, callback) { * @return {function(string, Object)} New client constructor */ exports.makeProtobufClientConstructor = function(service, options) { - var method_attrs = common.getProtobufServiceAttrs(service, service.name, options); + var method_attrs = common.getProtobufServiceAttrs(service, service.name, + options); var Client = exports.makeClientConstructor( method_attrs, common.fullyQualifiedName(service)); Client.service = service; diff --git a/src/node/src/common.js b/src/node/src/common.js index 3e6609ab1073f..e5217608ecdb5 100644 --- a/src/node/src/common.js +++ b/src/node/src/common.js @@ -44,10 +44,10 @@ var _ = require('lodash'); /** * Get a function that deserializes a specific type of protobuf. * @param {function()} cls The constructor of the message type to deserialize - * @param {bool=} binaryAsBase64 Deserialize bytes fields as base64 instead of binary. - * Defaults to false - * @param {bool=} longsAsStrings Deserialize long values as strings instead of doubles. - * Defaults to true + * @param {bool=} binaryAsBase64 Deserialize bytes fields as base64 strings + * instead of Buffers. Defaults to false + * @param {bool=} longsAsStrings Deserialize long values as strings instead of + * objects. Defaults to true * @return {function(Buffer):cls} The deserialization function */ exports.deserializeCls = function deserializeCls(cls, binaryAsBase64, @@ -133,7 +133,8 @@ exports.wrapIgnoreNull = function wrapIgnoreNull(func) { * @param {Object=} options Options to apply to these attributes * @return {Object} The attributes map */ -exports.getProtobufServiceAttrs = function getProtobufServiceAttrs(service, options) { +exports.getProtobufServiceAttrs = function getProtobufServiceAttrs(service, + options) { var prefix = '/' + fullyQualifiedName(service) + '/'; var binaryAsBase64, longsAsStrings; if (options) { diff --git a/src/node/test/common_test.js b/src/node/test/common_test.js index 08ba429ed7f01..c57b7388f67f5 100644 --- a/src/node/test/common_test.js +++ b/src/node/test/common_test.js @@ -42,7 +42,7 @@ var ProtoBuf = require('protobufjs'); var messages_proto = ProtoBuf.loadProtoFile( __dirname + '/test_messages.proto').build(); -describe('Proto message serialize and deserialize', function() { +describe('Proto message long int serialize and deserialize', function() { var longSerialize = common.serializeCls(messages_proto.LongValues); var longDeserialize = common.deserializeCls(messages_proto.LongValues); var pos_value = '314159265358979'; @@ -87,4 +87,52 @@ describe('Proto message serialize and deserialize', function() { assert.strictEqual(longDeserialize(serialized).sfixed_64.toString(), neg_value); }); + it('should deserialize as a number with the right option set', function() { + var longNumDeserialize = common.deserializeCls(messages_proto.LongValues, + false, false); + var serialized = longSerialize({int_64: pos_value}); + assert.strictEqual(typeof longDeserialize(serialized).int_64, 'string'); + /* With the longsAsStrings option disabled, long values are represented as + * objects with 3 keys: low, high, and unsigned */ + assert.strictEqual(typeof longNumDeserialize(serialized).int_64, 'object'); + }); +}); +describe('Proto message bytes serialize and deserialize', function() { + var sequenceSerialize = common.serializeCls(messages_proto.SequenceValues); + var sequenceDeserialize = common.deserializeCls( + messages_proto.SequenceValues); + var sequenceBase64Deserialize = common.deserializeCls( + messages_proto.SequenceValues, true); + var buffer_val = new Buffer([0x69, 0xb7]); + var base64_val = 'abc='; + it('should preserve a buffer', function() { + var serialized = sequenceSerialize({bytes_field: buffer_val}); + var deserialized = sequenceDeserialize(serialized); + assert.strictEqual(deserialized.bytes_field.compare(buffer_val), 0); + }); + it('should accept base64 encoded strings', function() { + var serialized = sequenceSerialize({bytes_field: base64_val}); + var deserialized = sequenceDeserialize(serialized); + assert.strictEqual(deserialized.bytes_field.compare(buffer_val), 0); + }); + it('should output base64 encoded strings with an option set', function() { + var serialized = sequenceSerialize({bytes_field: base64_val}); + var deserialized = sequenceBase64Deserialize(serialized); + assert.strictEqual(deserialized.bytes_field, base64_val); + }); + /* The next two tests are specific tests to verify that issue + * https://github.com/grpc/grpc/issues/5174 has been fixed. They are skipped + * because they will not pass until a protobuf.js release has been published + * with a fix for https://github.com/dcodeIO/protobuf.js/issues/390 */ + it.skip('should serialize a repeated field as packed by default', function() { + var expected_serialize = new Buffer([0x12, 0x01, 0x01, 0x0a]); + var serialized = sequenceSerialize({repeated_field: [10]}); + assert.strictEqual(expected_serialize.compare(serialized), 0); + }); + it.skip('should deserialize packed or unpacked repeated', function() { + var serialized = new Buffer([0x12, 0x01, 0x01, 0x0a]); + assert.doesNotThrow(function() { + sequenceDeserialize(serialized); + }); + }); }); diff --git a/src/node/test/test_messages.proto b/src/node/test/test_messages.proto index c77a937d3f4e3..d1ffcf996df41 100644 --- a/src/node/test/test_messages.proto +++ b/src/node/test/test_messages.proto @@ -36,3 +36,8 @@ message LongValues { fixed64 fixed_64 = 4; sfixed64 sfixed_64 = 5; } + +message SequenceValues { + bytes bytes_field = 1; + repeated int32 repeated_field = 2; +} \ No newline at end of file From eb62c943389d4b34e8a246a8fe63783aed885a01 Mon Sep 17 00:00:00 2001 From: yang-g Date: Wed, 17 Feb 2016 15:37:25 -0800 Subject: [PATCH 11/43] Add a way to override channel arguments for server creation --- include/grpc++/server.h | 6 ++++-- src/cpp/server/server.cc | 14 ++++++-------- src/cpp/server/server_builder.cc | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/grpc++/server.h b/include/grpc++/server.h index 2a71073a7e2f8..c177805236b62 100644 --- a/include/grpc++/server.h +++ b/include/grpc++/server.h @@ -79,6 +79,8 @@ class Server GRPC_FINAL : public ServerInterface, private GrpcLibrary { class GlobalCallbacks { public: virtual ~GlobalCallbacks() {} + /// Called before server is created. + virtual void UpdateArguments(ChannelArguments* args) {} /// Called before application callback for each synchronous server request virtual void PreSynchronousRequest(ServerContext* context) = 0; /// Called after application callback for each synchronous server request @@ -108,7 +110,7 @@ class Server GRPC_FINAL : public ServerInterface, private GrpcLibrary { /// \param max_message_size Maximum message length that the channel can /// receive. Server(ThreadPoolInterface* thread_pool, bool thread_pool_owned, - int max_message_size, const ChannelArguments& args); + int max_message_size, ChannelArguments* args); /// Register a service. This call does not take ownership of the service. /// The service must exist for the lifetime of the Server instance. @@ -177,7 +179,7 @@ class Server GRPC_FINAL : public ServerInterface, private GrpcLibrary { bool has_generic_service_; // Pointer to the c grpc server. - grpc_server* const server_; + grpc_server* server_; ThreadPoolInterface* thread_pool_; // Whether the thread pool is created and owned by the server. diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index 0d31140924bfc..6d31a608c803d 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -272,27 +272,25 @@ class Server::SyncRequest GRPC_FINAL : public CompletionQueueTag { grpc_completion_queue* cq_; }; -static grpc_server* CreateServer(const ChannelArguments& args) { - grpc_channel_args channel_args; - args.SetChannelArgs(&channel_args); - return grpc_server_create(&channel_args, nullptr); -} - static internal::GrpcLibraryInitializer g_gli_initializer; Server::Server(ThreadPoolInterface* thread_pool, bool thread_pool_owned, - int max_message_size, const ChannelArguments& args) + int max_message_size, ChannelArguments* args) : max_message_size_(max_message_size), started_(false), shutdown_(false), num_running_cb_(0), sync_methods_(new std::list), has_generic_service_(false), - server_(CreateServer(args)), + server_(nullptr), thread_pool_(thread_pool), thread_pool_owned_(thread_pool_owned) { g_gli_initializer.summon(); gpr_once_init(&g_once_init_callbacks, InitGlobalCallbacks); global_callbacks_ = g_callbacks; + global_callbacks_->UpdateArguments(args); + grpc_channel_args channel_args; + args->SetChannelArgs(&channel_args); + server_ = grpc_server_create(&channel_args, nullptr); grpc_server_register_completion_queue(server_, cq_.cq(), nullptr); } diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index c54cf6474f1af..134e5f1d5ff2e 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -103,7 +103,7 @@ std::unique_ptr ServerBuilder::BuildAndStart() { args.SetInt(GRPC_COMPRESSION_ALGORITHM_STATE_ARG, compression_options_.enabled_algorithms_bitset); std::unique_ptr server( - new Server(thread_pool.release(), true, max_message_size_, args)); + new Server(thread_pool.release(), true, max_message_size_, &args)); for (auto cq = cqs_.begin(); cq != cqs_.end(); ++cq) { grpc_server_register_completion_queue(server->server_, (*cq)->cq(), nullptr); From 5acbb9c1e9e93b3fc085cb52e5e6207470bd938a Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Wed, 17 Feb 2016 15:42:01 -0800 Subject: [PATCH 12/43] Sanitize files --- src/node/test/common_test.js | 2 +- src/node/test/test_messages.proto | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/test/common_test.js b/src/node/test/common_test.js index c57b7388f67f5..66a4205f82c79 100644 --- a/src/node/test/common_test.js +++ b/src/node/test/common_test.js @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/node/test/test_messages.proto b/src/node/test/test_messages.proto index d1ffcf996df41..9b8cb875eeb0a 100644 --- a/src/node/test/test_messages.proto +++ b/src/node/test/test_messages.proto @@ -40,4 +40,4 @@ message LongValues { message SequenceValues { bytes bytes_field = 1; repeated int32 repeated_field = 2; -} \ No newline at end of file +} From de808bbea8ff006c370020211116f95d653bb976 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Thu, 18 Feb 2016 01:13:14 +0100 Subject: [PATCH 13/43] Enabling python artifact building for Windows. --- tools/run_tests/artifact_targets.py | 32 +++++++-------- tools/run_tests/build_artifact_python.bat | 47 +++++++++++++++++++++++ 2 files changed, 64 insertions(+), 15 deletions(-) create mode 100644 tools/run_tests/build_artifact_python.bat diff --git a/tools/run_tests/artifact_targets.py b/tools/run_tests/artifact_targets.py index 9cd02c5e432e0..e106639bd1ae4 100644 --- a/tools/run_tests/artifact_targets.py +++ b/tools/run_tests/artifact_targets.py @@ -93,22 +93,23 @@ def pre_build_jobspecs(self): return [] def build_jobspec(self): - if self.platform == 'windows': - raise Exception('Not supported yet.') + environ = {} + if self.platform == 'linux': + if self.arch == 'x86': + environ['SETARCH_CMD'] = 'linux32' + return create_docker_jobspec(self.name, + 'tools/dockerfile/grpc_artifact_linux_%s' % self.arch, + 'tools/run_tests/build_artifact_python.sh', + environ=environ) + elif self.platform == 'windows': + return create_jobspec(self.name, + ['tools\\run_tests\\build_artifact_python.bat'], + shell=True) else: - environ = {} - if self.platform == 'linux': - if self.arch == 'x86': - environ['SETARCH_CMD'] = 'linux32' - return create_docker_jobspec(self.name, - 'tools/dockerfile/grpc_artifact_linux_%s' % self.arch, - 'tools/run_tests/build_artifact_python.sh', - environ=environ) - else: - environ['SKIP_PIP_INSTALL'] = 'TRUE' - return create_jobspec(self.name, - ['tools/run_tests/build_artifact_python.sh'], - environ=environ) + environ['SKIP_PIP_INSTALL'] = 'TRUE' + return create_jobspec(self.name, + ['tools/run_tests/build_artifact_python.sh'], + environ=environ) def __str__(self): return self.name @@ -235,6 +236,7 @@ def targets(): [PythonArtifact('linux', 'x86'), PythonArtifact('linux', 'x64'), PythonArtifact('macos', 'x64'), + PythonArtifact('windows', 'x64'), RubyArtifact('linux', 'x86'), RubyArtifact('linux', 'x64'), RubyArtifact('macos', 'x64')]) diff --git a/tools/run_tests/build_artifact_python.bat b/tools/run_tests/build_artifact_python.bat new file mode 100644 index 0000000000000..525e1946240e2 --- /dev/null +++ b/tools/run_tests/build_artifact_python.bat @@ -0,0 +1,47 @@ +@rem Copyright 2016, Google Inc. +@rem All rights reserved. +@rem +@rem Redistribution and use in source and binary forms, with or without +@rem modification, are permitted provided that the following conditions are +@rem met: +@rem +@rem * Redistributions of source code must retain the above copyright +@rem notice, this list of conditions and the following disclaimer. +@rem * Redistributions in binary form must reproduce the above +@rem copyright notice, this list of conditions and the following disclaimer +@rem in the documentation and/or other materials provided with the +@rem distribution. +@rem * Neither the name of Google Inc. nor the names of its +@rem contributors may be used to endorse or promote products derived from +@rem this software without specific prior written permission. +@rem +@rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +@rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +@rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +@rem A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +@rem OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +@rem SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +@rem LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +@rem DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +@rem THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +@rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +@rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set PATH=%PATH%;C:\Python27\scripts + +pip install --upgrade six +pip install --upgrade setuptools +pip install -rrequirements.txt + +set GRPC_PYTHON_USE_CUSTOM_BDIST=0 +set GRPC_PYTHON_BUILD_WITH_CYTHON=1 + +python setup.py bdist_wheel + +mkdir artifacts +xcopy /Y /I /S dist\* artifacts\ || goto :error + +goto :EOF + +:error +exit /b 1 From 311445fd32956e9383823400c82ce3fcd71b2b31 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 18 Feb 2016 07:31:39 -0800 Subject: [PATCH 14/43] Fix tcp_client_posix_test --- src/core/iomgr/timer.c | 4 ++-- src/core/iomgr/timer.h | 8 ++++---- src/core/surface/completion_queue.c | 6 ++++-- test/core/iomgr/tcp_client_posix_test.c | 26 +++++++++++++++++-------- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/core/iomgr/timer.c b/src/core/iomgr/timer.c index 5e7fadb7906b3..8379fffad0234 100644 --- a/src/core/iomgr/timer.c +++ b/src/core/iomgr/timer.c @@ -335,8 +335,8 @@ static int run_some_expired_timers(grpc_exec_ctx *exec_ctx, gpr_timespec now, return (int)n; } -int grpc_timer_check(grpc_exec_ctx *exec_ctx, gpr_timespec now, - gpr_timespec *next) { +bool grpc_timer_check(grpc_exec_ctx *exec_ctx, gpr_timespec now, + gpr_timespec *next) { GPR_ASSERT(now.clock_type == g_clock_type); return run_some_expired_timers( exec_ctx, now, next, diff --git a/src/core/iomgr/timer.h b/src/core/iomgr/timer.h index 2f74b6e5d3d12..906255ddfb924 100644 --- a/src/core/iomgr/timer.h +++ b/src/core/iomgr/timer.h @@ -89,7 +89,7 @@ void grpc_timer_cancel(grpc_exec_ctx *exec_ctx, grpc_timer *timer); /* iomgr internal api for dealing with timers */ /* Check for timers to be run, and run them. - Return non zero if timer callbacks were executed. + Return true if timer callbacks were executed. Drops drop_mu if it is non-null before executing callbacks. If next is non-null, TRY to update *next with the next running timer IF that timer occurs before *next current value. @@ -97,10 +97,10 @@ void grpc_timer_cancel(grpc_exec_ctx *exec_ctx, grpc_timer *timer); with high probability at least one thread in the system will see an update at any time slice. */ -int grpc_timer_check(grpc_exec_ctx* exec_ctx, gpr_timespec now, - gpr_timespec* next); +bool grpc_timer_check(grpc_exec_ctx *exec_ctx, gpr_timespec now, + gpr_timespec *next); void grpc_timer_list_init(gpr_timespec now); -void grpc_timer_list_shutdown(grpc_exec_ctx* exec_ctx); +void grpc_timer_list_shutdown(grpc_exec_ctx *exec_ctx); /* the following must be implemented by each iomgr implementation */ diff --git a/src/core/surface/completion_queue.c b/src/core/surface/completion_queue.c index 6597c83cdcafe..de295ab941026 100644 --- a/src/core/surface/completion_queue.c +++ b/src/core/surface/completion_queue.c @@ -335,7 +335,8 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc, gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset)); continue; } - grpc_pollset_work(&exec_ctx, &cc->pollset, &worker, now, iteration_deadline); + grpc_pollset_work(&exec_ctx, &cc->pollset, &worker, now, + iteration_deadline); } GRPC_SURFACE_TRACE_RETURNED_EVENT(cc, &ret); GRPC_CQ_INTERNAL_UNREF(cc, "next"); @@ -451,7 +452,8 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag, gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset)); continue; } - grpc_pollset_work(&exec_ctx, &cc->pollset, &worker, now, iteration_deadline); + grpc_pollset_work(&exec_ctx, &cc->pollset, &worker, now, + iteration_deadline); del_plucker(cc, tag, &worker); } done: diff --git a/test/core/iomgr/tcp_client_posix_test.c b/test/core/iomgr/tcp_client_posix_test.c index 9725d8a3b6411..b57478059f016 100644 --- a/test/core/iomgr/tcp_client_posix_test.c +++ b/test/core/iomgr/tcp_client_posix_test.c @@ -45,6 +45,7 @@ #include "src/core/iomgr/iomgr.h" #include "src/core/iomgr/socket_utils_posix.h" +#include "src/core/iomgr/timer.h" #include "test/core/util/test_config.h" static grpc_pollset_set g_pollset_set; @@ -125,11 +126,13 @@ void test_succeeds(void) { gpr_now(GPR_CLOCK_MONOTONIC), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)); gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset)); - grpc_exec_ctx_finish(&exec_ctx); + grpc_exec_ctx_flush(&exec_ctx); gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset)); } gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset)); + + grpc_exec_ctx_finish(&exec_ctx); } void test_fails(void) { @@ -159,14 +162,18 @@ void test_fails(void) { /* wait for the connection callback to finish */ while (g_connections_complete == connections_complete_before) { grpc_pollset_worker worker; - grpc_pollset_work(&exec_ctx, &g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), test_deadline()); + gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC); + gpr_timespec polling_deadline = test_deadline(); + if (!grpc_timer_check(&exec_ctx, now, &polling_deadline)) { + grpc_pollset_work(&exec_ctx, &g_pollset, &worker, now, polling_deadline); + } gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset)); - grpc_exec_ctx_finish(&exec_ctx); + grpc_exec_ctx_flush(&exec_ctx); gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset)); } gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset)); + grpc_exec_ctx_finish(&exec_ctx); } void test_times_out(void) { @@ -243,15 +250,18 @@ void test_times_out(void) { GPR_ASSERT(g_connections_complete == connections_complete_before + is_after_deadline); } - grpc_pollset_work(&exec_ctx, &g_pollset, &worker, - gpr_now(GPR_CLOCK_MONOTONIC), - GRPC_TIMEOUT_MILLIS_TO_DEADLINE(10)); + gpr_timespec polling_deadline = GRPC_TIMEOUT_MILLIS_TO_DEADLINE(10); + if (!grpc_timer_check(&exec_ctx, now, &polling_deadline)) { + grpc_pollset_work(&exec_ctx, &g_pollset, &worker, now, polling_deadline); + } gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset)); - grpc_exec_ctx_finish(&exec_ctx); + grpc_exec_ctx_flush(&exec_ctx); gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset)); } gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset)); + grpc_exec_ctx_finish(&exec_ctx); + close(svr_fd); for (i = 0; i < NUM_CLIENT_CONNECTS; ++i) { close(client_fd[i]); From cb6c7f66d3b08eab81c3d51de4e489fe24c63e4c Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 18 Feb 2016 08:02:45 -0800 Subject: [PATCH 15/43] Fix test --- test/core/iomgr/timer_list_test.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/test/core/iomgr/timer_list_test.c b/test/core/iomgr/timer_list_test.c index 487527fbf5da2..7a21fdd5c1084 100644 --- a/test/core/iomgr/timer_list_test.c +++ b/test/core/iomgr/timer_list_test.c @@ -71,20 +71,19 @@ static void add_test(void) { } /* collect timers. Only the first batch should be ready. */ - GPR_ASSERT(10 == grpc_timer_check(&exec_ctx, - gpr_time_add(start, gpr_time_from_millis( - 500, GPR_TIMESPAN)), - NULL)); + GPR_ASSERT(grpc_timer_check( + &exec_ctx, gpr_time_add(start, gpr_time_from_millis(500, GPR_TIMESPAN)), + NULL)); grpc_exec_ctx_finish(&exec_ctx); for (i = 0; i < 20; i++) { GPR_ASSERT(cb_called[i][1] == (i < 10)); GPR_ASSERT(cb_called[i][0] == 0); } - GPR_ASSERT(0 == grpc_timer_check(&exec_ctx, - gpr_time_add(start, gpr_time_from_millis( - 600, GPR_TIMESPAN)), - NULL)); + GPR_ASSERT(!grpc_timer_check( + &exec_ctx, + gpr_time_add(start, gpr_time_from_millis(600, GPR_TIMESPAN)), + NULL)); grpc_exec_ctx_finish(&exec_ctx); for (i = 0; i < 30; i++) { GPR_ASSERT(cb_called[i][1] == (i < 10)); @@ -92,20 +91,19 @@ static void add_test(void) { } /* collect the rest of the timers */ - GPR_ASSERT(10 == grpc_timer_check( - &exec_ctx, gpr_time_add(start, gpr_time_from_millis( - 1500, GPR_TIMESPAN)), - NULL)); + GPR_ASSERT(grpc_timer_check( + &exec_ctx, gpr_time_add(start, gpr_time_from_millis(1500, GPR_TIMESPAN)), + NULL)); grpc_exec_ctx_finish(&exec_ctx); for (i = 0; i < 30; i++) { GPR_ASSERT(cb_called[i][1] == (i < 20)); GPR_ASSERT(cb_called[i][0] == 0); } - GPR_ASSERT(0 == grpc_timer_check(&exec_ctx, - gpr_time_add(start, gpr_time_from_millis( - 1600, GPR_TIMESPAN)), - NULL)); + GPR_ASSERT(!grpc_timer_check( + &exec_ctx, + gpr_time_add(start, gpr_time_from_millis(1600, GPR_TIMESPAN)), + NULL)); for (i = 0; i < 30; i++) { GPR_ASSERT(cb_called[i][1] == (i < 20)); GPR_ASSERT(cb_called[i][0] == 0); From f315bc198009eff04a53e48cec9b9506c85a2417 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 18 Feb 2016 08:25:15 -0800 Subject: [PATCH 16/43] Fix copyrights --- src/core/iomgr/iomgr.c | 2 +- src/core/iomgr/timer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/iomgr/iomgr.c b/src/core/iomgr/iomgr.c index 3283b586b06c4..04580150f3a71 100644 --- a/src/core/iomgr/iomgr.c +++ b/src/core/iomgr/iomgr.c @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/core/iomgr/timer.h b/src/core/iomgr/timer.h index 906255ddfb924..9ad1e92f42e4c 100644 --- a/src/core/iomgr/timer.h +++ b/src/core/iomgr/timer.h @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without From 7d243df88f359263f4c1ca82a472e49199bd52fe Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 18 Feb 2016 09:58:05 -0800 Subject: [PATCH 17/43] Increase Node's per-test timeout and Ruby's overall test timeout --- tools/run_tests/run_node.bat | 2 +- tools/run_tests/run_node.sh | 9 +++++++-- tools/run_tests/run_tests.py | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/run_tests/run_node.bat b/tools/run_tests/run_node.bat index f5cf01f095984..ad9ca14b8b9d5 100644 --- a/tools/run_tests/run_node.bat +++ b/tools/run_tests/run_node.bat @@ -29,4 +29,4 @@ set JUNIT_REPORT_PATH=src\node\reports.xml set JUNIT_REPORT_STACK=1 -.\node_modules\.bin\mocha.cmd --reporter mocha-jenkins-reporter src\node\test \ No newline at end of file +.\node_modules\.bin\mocha.cmd --reporter mocha-jenkins-reporter --timeout 8000 src\node\test \ No newline at end of file diff --git a/tools/run_tests/run_node.sh b/tools/run_tests/run_node.sh index 40f61d77cc9be..178584ae8ed59 100755 --- a/tools/run_tests/run_node.sh +++ b/tools/run_tests/run_node.sh @@ -41,10 +41,13 @@ cd $(dirname $0)/../.. root=`pwd` +test_directory='src/node/test' +timeout=8000 + if [ "$CONFIG" = "gcov" ] then ./node_modules/.bin/istanbul cover --dir reports/node_coverage \ - -x **/interop/* ./node_modules/.bin/_mocha -- --timeout 8000 src/node/test + -x **/interop/* ./node_modules/.bin/_mocha -- --timeout $timeout $test_directory cd build gcov Release/obj.target/grpc/ext/*.o lcov --base-directory . --directory . -c -o coverage.info @@ -55,5 +58,7 @@ then echo '' > \ ../reports/node_coverage/index.html else - JUNIT_REPORT_PATH=src/node/reports.xml JUNIT_REPORT_STACK=1 ./node_modules/.bin/mocha --reporter mocha-jenkins-reporter src/node/test + JUNIT_REPORT_PATH=src/node/reports.xml JUNIT_REPORT_STACK=1 \ + ./node_modules/.bin/mocha --timeout $timeout \ + --reporter mocha-jenkins-reporter $test_directory fi diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index de3716bc887e7..0b3efa29e3a0b 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -334,13 +334,14 @@ class RubyLanguage(object): def test_specs(self, config, args): return [config.job_spec(['tools/run_tests/run_ruby.sh'], None, + timeout_seconds=10*60, environ=_FORCE_ENVIRON_FOR_WRAPPERS)] def pre_build_steps(self): return [['tools/run_tests/pre_build_ruby.sh']] def make_targets(self, test_regex): - return ['static_c'] + return [] def make_options(self): return [] @@ -1197,4 +1198,3 @@ def _build_and_run( if BuildAndRunError.POST_TEST in errors: exit_code |= 4 sys.exit(exit_code) - From 7a3ee6a3a32e2f1b2820ad06e4565143577f007e Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 18 Feb 2016 10:36:02 -0800 Subject: [PATCH 18/43] rename Preconditions to GrpcPreconditions --- .../Grpc.Auth/GoogleAuthInterceptors.cs | 2 +- src/csharp/Grpc.Core/AsyncAuthInterceptor.cs | 4 +-- src/csharp/Grpc.Core/CallCredentials.cs | 4 +-- src/csharp/Grpc.Core/CallInvocationDetails.cs | 8 ++--- src/csharp/Grpc.Core/CallOptions.cs | 4 +-- src/csharp/Grpc.Core/Channel.cs | 8 ++--- src/csharp/Grpc.Core/ChannelCredentials.cs | 6 ++-- src/csharp/Grpc.Core/ChannelOptions.cs | 10 +++---- .../Grpc.Core/ContextPropagationToken.cs | 2 +- src/csharp/Grpc.Core/Grpc.Core.csproj | 5 ++-- src/csharp/Grpc.Core/GrpcEnvironment.cs | 4 +-- src/csharp/Grpc.Core/Internal/AsyncCall.cs | 16 +++++----- .../Grpc.Core/Internal/AsyncCallBase.cs | 30 +++++++++---------- .../Grpc.Core/Internal/AsyncCallServer.cs | 18 +++++------ .../Internal/CompletionQueueSafeHandle.cs | 2 +- .../Grpc.Core/Internal/CompletionRegistry.cs | 4 +-- src/csharp/Grpc.Core/Internal/Enums.cs | 2 +- .../NativeMetadataCredentialsPlugin.cs | 2 +- .../Grpc.Core/Internal/ServerCallHandler.cs | 8 ++--- .../Internal/ServerCredentialsSafeHandle.cs | 2 +- src/csharp/Grpc.Core/Internal/Timespec.cs | 6 ++-- .../Grpc.Core/Internal/UnmanagedLibrary.cs | 2 +- src/csharp/Grpc.Core/KeyCertificatePair.cs | 4 +-- src/csharp/Grpc.Core/Marshaller.cs | 4 +-- src/csharp/Grpc.Core/Metadata.cs | 16 +++++----- src/csharp/Grpc.Core/Method.cs | 8 ++--- src/csharp/Grpc.Core/Server.cs | 18 +++++------ src/csharp/Grpc.Core/ServerCredentials.cs | 4 +-- src/csharp/Grpc.Core/ServerPort.cs | 4 +-- ...{Preconditions.cs => GrpcPreconditions.cs} | 2 +- .../Grpc.HealthCheck/HealthServiceImpl.cs | 4 +-- .../Grpc.IntegrationTesting/ClientRunners.cs | 4 +-- .../Grpc.IntegrationTesting/Histogram.cs | 4 +-- .../Grpc.IntegrationTesting/ServerRunners.cs | 4 +-- .../WorkerServiceImpl.cs | 4 +-- 35 files changed, 114 insertions(+), 115 deletions(-) rename src/csharp/Grpc.Core/Utils/{Preconditions.cs => GrpcPreconditions.cs} (99%) diff --git a/src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs b/src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs index f77e9c6573d82..96d6ee87ae4d4 100644 --- a/src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs +++ b/src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs @@ -71,7 +71,7 @@ public static AsyncAuthInterceptor FromCredential(ITokenAccess credential) /// The interceptor. public static AsyncAuthInterceptor FromAccessToken(string accessToken) { - Preconditions.CheckNotNull(accessToken); + GrpcPreconditions.CheckNotNull(accessToken); return new AsyncAuthInterceptor(async (context, metadata) => { metadata.Add(CreateBearerTokenHeader(accessToken)); diff --git a/src/csharp/Grpc.Core/AsyncAuthInterceptor.cs b/src/csharp/Grpc.Core/AsyncAuthInterceptor.cs index 5c9ab048120b6..1ad229092876b 100644 --- a/src/csharp/Grpc.Core/AsyncAuthInterceptor.cs +++ b/src/csharp/Grpc.Core/AsyncAuthInterceptor.cs @@ -61,8 +61,8 @@ public class AuthInterceptorContext /// public AuthInterceptorContext(string serviceUrl, string methodName) { - this.serviceUrl = Preconditions.CheckNotNull(serviceUrl); - this.methodName = Preconditions.CheckNotNull(methodName); + this.serviceUrl = GrpcPreconditions.CheckNotNull(serviceUrl); + this.methodName = GrpcPreconditions.CheckNotNull(methodName); } /// diff --git a/src/csharp/Grpc.Core/CallCredentials.cs b/src/csharp/Grpc.Core/CallCredentials.cs index a71c8904fe76a..7476b0ca165b0 100644 --- a/src/csharp/Grpc.Core/CallCredentials.cs +++ b/src/csharp/Grpc.Core/CallCredentials.cs @@ -87,7 +87,7 @@ internal sealed class MetadataCredentials : CallCredentials /// authentication interceptor public MetadataCredentials(AsyncAuthInterceptor interceptor) { - this.interceptor = Preconditions.CheckNotNull(interceptor); + this.interceptor = GrpcPreconditions.CheckNotNull(interceptor); } internal override CallCredentialsSafeHandle ToNativeCredentials() @@ -111,7 +111,7 @@ internal sealed class CompositeCallCredentials : CallCredentials /// credentials to compose public CompositeCallCredentials(params CallCredentials[] credentials) { - Preconditions.CheckArgument(credentials.Length >= 2, "Composite credentials object can only be created from 2 or more credentials."); + GrpcPreconditions.CheckArgument(credentials.Length >= 2, "Composite credentials object can only be created from 2 or more credentials."); this.credentials = new List(credentials); } diff --git a/src/csharp/Grpc.Core/CallInvocationDetails.cs b/src/csharp/Grpc.Core/CallInvocationDetails.cs index 8228b8f317f92..98db8546144bf 100644 --- a/src/csharp/Grpc.Core/CallInvocationDetails.cs +++ b/src/csharp/Grpc.Core/CallInvocationDetails.cs @@ -85,11 +85,11 @@ public CallInvocationDetails(Channel channel, Method method /// Call options. public CallInvocationDetails(Channel channel, string method, string host, Marshaller requestMarshaller, Marshaller responseMarshaller, CallOptions options) { - this.channel = Preconditions.CheckNotNull(channel, "channel"); - this.method = Preconditions.CheckNotNull(method, "method"); + this.channel = GrpcPreconditions.CheckNotNull(channel, "channel"); + this.method = GrpcPreconditions.CheckNotNull(method, "method"); this.host = host; - this.requestMarshaller = Preconditions.CheckNotNull(requestMarshaller, "requestMarshaller"); - this.responseMarshaller = Preconditions.CheckNotNull(responseMarshaller, "responseMarshaller"); + this.requestMarshaller = GrpcPreconditions.CheckNotNull(requestMarshaller, "requestMarshaller"); + this.responseMarshaller = GrpcPreconditions.CheckNotNull(responseMarshaller, "responseMarshaller"); this.options = options; } diff --git a/src/csharp/Grpc.Core/CallOptions.cs b/src/csharp/Grpc.Core/CallOptions.cs index 1fda80cb901b1..caf8210d917fd 100644 --- a/src/csharp/Grpc.Core/CallOptions.cs +++ b/src/csharp/Grpc.Core/CallOptions.cs @@ -176,13 +176,13 @@ internal CallOptions Normalize() { if (propagationToken.Options.IsPropagateDeadline) { - Preconditions.CheckArgument(!newOptions.deadline.HasValue, + GrpcPreconditions.CheckArgument(!newOptions.deadline.HasValue, "Cannot propagate deadline from parent call. The deadline has already been set explicitly."); newOptions.deadline = propagationToken.ParentDeadline; } if (propagationToken.Options.IsPropagateCancellation) { - Preconditions.CheckArgument(!newOptions.cancellationToken.CanBeCanceled, + GrpcPreconditions.CheckArgument(!newOptions.cancellationToken.CanBeCanceled, "Cannot propagate cancellation token from parent call. The cancellation token has already been set to a non-default value."); newOptions.cancellationToken = propagationToken.ParentCancellationToken; } diff --git a/src/csharp/Grpc.Core/Channel.cs b/src/csharp/Grpc.Core/Channel.cs index d8d43c7998d1b..89981b1849bf5 100644 --- a/src/csharp/Grpc.Core/Channel.cs +++ b/src/csharp/Grpc.Core/Channel.cs @@ -68,7 +68,7 @@ public class Channel /// Channel options. public Channel(string target, ChannelCredentials credentials, IEnumerable options = null) { - this.target = Preconditions.CheckNotNull(target, "target"); + this.target = GrpcPreconditions.CheckNotNull(target, "target"); this.options = CreateOptionsDictionary(options); EnsureUserAgentChannelOption(this.options); this.environment = GrpcEnvironment.AddRef(); @@ -117,7 +117,7 @@ public ChannelState State /// public Task WaitForStateChangedAsync(ChannelState lastObservedState, DateTime? deadline = null) { - Preconditions.CheckArgument(lastObservedState != ChannelState.FatalFailure, + GrpcPreconditions.CheckArgument(lastObservedState != ChannelState.FatalFailure, "FatalFailure is a terminal state. No further state changes can occur."); var tcs = new TaskCompletionSource(); var deadlineTimespec = deadline.HasValue ? Timespec.FromDateTime(deadline.Value) : Timespec.InfFuture; @@ -184,7 +184,7 @@ public async Task ShutdownAsync() { lock (myLock) { - Preconditions.CheckState(!shutdownRequested); + GrpcPreconditions.CheckState(!shutdownRequested); shutdownRequested = true; } @@ -221,7 +221,7 @@ internal void AddCallReference(object call) bool success = false; handle.DangerousAddRef(ref success); - Preconditions.CheckState(success); + GrpcPreconditions.CheckState(success); } internal void RemoveCallReference(object call) diff --git a/src/csharp/Grpc.Core/ChannelCredentials.cs b/src/csharp/Grpc.Core/ChannelCredentials.cs index 5d96958e7c082..db0cefef8b7db 100644 --- a/src/csharp/Grpc.Core/ChannelCredentials.cs +++ b/src/csharp/Grpc.Core/ChannelCredentials.cs @@ -183,9 +183,9 @@ internal sealed class CompositeChannelCredentials : ChannelCredentials /// channelCredentials to compose public CompositeChannelCredentials(ChannelCredentials channelCredentials, CallCredentials callCredentials) { - this.channelCredentials = Preconditions.CheckNotNull(channelCredentials); - this.callCredentials = Preconditions.CheckNotNull(callCredentials); - Preconditions.CheckArgument(channelCredentials.IsComposable, "Supplied channel credentials do not allow composition."); + this.channelCredentials = GrpcPreconditions.CheckNotNull(channelCredentials); + this.callCredentials = GrpcPreconditions.CheckNotNull(callCredentials); + GrpcPreconditions.CheckArgument(channelCredentials.IsComposable, "Supplied channel credentials do not allow composition."); } internal override ChannelCredentialsSafeHandle ToNativeCredentials() diff --git a/src/csharp/Grpc.Core/ChannelOptions.cs b/src/csharp/Grpc.Core/ChannelOptions.cs index d70673cf781f3..b6eeceabc4c21 100644 --- a/src/csharp/Grpc.Core/ChannelOptions.cs +++ b/src/csharp/Grpc.Core/ChannelOptions.cs @@ -73,8 +73,8 @@ public enum OptionType public ChannelOption(string name, string stringValue) { this.type = OptionType.String; - this.name = Preconditions.CheckNotNull(name, "name"); - this.stringValue = Preconditions.CheckNotNull(stringValue, "stringValue"); + this.name = GrpcPreconditions.CheckNotNull(name, "name"); + this.stringValue = GrpcPreconditions.CheckNotNull(stringValue, "stringValue"); } /// @@ -85,7 +85,7 @@ public ChannelOption(string name, string stringValue) public ChannelOption(string name, int intValue) { this.type = OptionType.Integer; - this.name = Preconditions.CheckNotNull(name, "name"); + this.name = GrpcPreconditions.CheckNotNull(name, "name"); this.intValue = intValue; } @@ -118,7 +118,7 @@ public int IntValue { get { - Preconditions.CheckState(type == OptionType.Integer); + GrpcPreconditions.CheckState(type == OptionType.Integer); return intValue; } } @@ -130,7 +130,7 @@ public string StringValue { get { - Preconditions.CheckState(type == OptionType.String); + GrpcPreconditions.CheckState(type == OptionType.String); return stringValue; } } diff --git a/src/csharp/Grpc.Core/ContextPropagationToken.cs b/src/csharp/Grpc.Core/ContextPropagationToken.cs index 1d899b97fd55d..935498246a149 100644 --- a/src/csharp/Grpc.Core/ContextPropagationToken.cs +++ b/src/csharp/Grpc.Core/ContextPropagationToken.cs @@ -68,7 +68,7 @@ public class ContextPropagationToken internal ContextPropagationToken(CallSafeHandle parentCall, DateTime deadline, CancellationToken cancellationToken, ContextPropagationOptions options) { - this.parentCall = Preconditions.CheckNotNull(parentCall); + this.parentCall = GrpcPreconditions.CheckNotNull(parentCall); this.deadline = deadline; this.cancellationToken = cancellationToken; this.options = options ?? ContextPropagationOptions.Default; diff --git a/src/csharp/Grpc.Core/Grpc.Core.csproj b/src/csharp/Grpc.Core/Grpc.Core.csproj index 8d7d2cae0deff..3189835ccd913 100644 --- a/src/csharp/Grpc.Core/Grpc.Core.csproj +++ b/src/csharp/Grpc.Core/Grpc.Core.csproj @@ -39,8 +39,7 @@ - - False + ..\packages\Ix-Async.1.2.5\lib\net45\System.Interactive.Async.dll @@ -91,7 +90,6 @@ - @@ -130,6 +128,7 @@ + diff --git a/src/csharp/Grpc.Core/GrpcEnvironment.cs b/src/csharp/Grpc.Core/GrpcEnvironment.cs index f3aa3d79de629..86b37b8660196 100644 --- a/src/csharp/Grpc.Core/GrpcEnvironment.cs +++ b/src/csharp/Grpc.Core/GrpcEnvironment.cs @@ -83,7 +83,7 @@ internal static void Release() { lock (staticLock) { - Preconditions.CheckState(refCount > 0); + GrpcPreconditions.CheckState(refCount > 0); refCount--; if (refCount == 0) { @@ -118,7 +118,7 @@ public static ILogger Logger /// public static void SetLogger(ILogger customLogger) { - Preconditions.CheckNotNull(customLogger, "customLogger"); + GrpcPreconditions.CheckNotNull(customLogger, "customLogger"); logger = customLogger; } diff --git a/src/csharp/Grpc.Core/Internal/AsyncCall.cs b/src/csharp/Grpc.Core/Internal/AsyncCall.cs index 7dc4490281d04..2caba260b3a24 100644 --- a/src/csharp/Grpc.Core/Internal/AsyncCall.cs +++ b/src/csharp/Grpc.Core/Internal/AsyncCall.cs @@ -99,7 +99,7 @@ public TResponse UnaryCall(TRequest msg) lock (myLock) { - Preconditions.CheckState(!started); + GrpcPreconditions.CheckState(!started); started = true; Initialize(cq); @@ -141,7 +141,7 @@ public Task UnaryCallAsync(TRequest msg) { lock (myLock) { - Preconditions.CheckState(!started); + GrpcPreconditions.CheckState(!started); started = true; Initialize(environment.CompletionQueue); @@ -168,7 +168,7 @@ public Task ClientStreamingCallAsync() { lock (myLock) { - Preconditions.CheckState(!started); + GrpcPreconditions.CheckState(!started); started = true; Initialize(environment.CompletionQueue); @@ -192,7 +192,7 @@ public void StartServerStreamingCall(TRequest msg) { lock (myLock) { - Preconditions.CheckState(!started); + GrpcPreconditions.CheckState(!started); started = true; Initialize(environment.CompletionQueue); @@ -217,7 +217,7 @@ public void StartDuplexStreamingCall() { lock (myLock) { - Preconditions.CheckState(!started); + GrpcPreconditions.CheckState(!started); started = true; Initialize(environment.CompletionQueue); @@ -257,7 +257,7 @@ public void StartSendCloseFromClient(AsyncCompletionDelegate completionD { lock (myLock) { - Preconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null"); + GrpcPreconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null"); CheckSendingAllowed(); call.StartSendCloseFromClient(HandleHalfclosed); @@ -297,7 +297,7 @@ public Status GetStatus() { lock (myLock) { - Preconditions.CheckState(finishedStatus.HasValue, "Status can only be accessed once the call has finished."); + GrpcPreconditions.CheckState(finishedStatus.HasValue, "Status can only be accessed once the call has finished."); return finishedStatus.Value.Status; } } @@ -310,7 +310,7 @@ public Metadata GetTrailers() { lock (myLock) { - Preconditions.CheckState(finishedStatus.HasValue, "Trailers can only be accessed once the call has finished."); + GrpcPreconditions.CheckState(finishedStatus.HasValue, "Trailers can only be accessed once the call has finished."); return finishedStatus.Value.Trailers; } } diff --git a/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs b/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs index 81a9a40fcc382..45d4c3e078c41 100644 --- a/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs +++ b/src/csharp/Grpc.Core/Internal/AsyncCallBase.cs @@ -79,9 +79,9 @@ internal abstract class AsyncCallBase public AsyncCallBase(Func serializer, Func deserializer, GrpcEnvironment environment) { - this.serializer = Preconditions.CheckNotNull(serializer); - this.deserializer = Preconditions.CheckNotNull(deserializer); - this.environment = Preconditions.CheckNotNull(environment); + this.serializer = GrpcPreconditions.CheckNotNull(serializer); + this.deserializer = GrpcPreconditions.CheckNotNull(deserializer); + this.environment = GrpcPreconditions.CheckNotNull(environment); } /// @@ -91,7 +91,7 @@ public void Cancel() { lock (myLock) { - Preconditions.CheckState(started); + GrpcPreconditions.CheckState(started); cancelRequested = true; if (!disposed) @@ -135,7 +135,7 @@ protected void StartSendMessageInternal(TWrite msg, WriteFlags writeFlags, Async lock (myLock) { - Preconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null"); + GrpcPreconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null"); CheckSendingAllowed(); call.StartSendMessage(HandleSendFinished, payload, writeFlags, !initialMetadataSent); @@ -154,7 +154,7 @@ protected void StartReadMessageInternal(AsyncCompletionDelegate completio { lock (myLock) { - Preconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null"); + GrpcPreconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null"); CheckReadingAllowed(); call.StartReceiveMessage(HandleReadFinished); @@ -204,22 +204,22 @@ protected virtual void OnAfterReleaseResources() protected void CheckSendingAllowed() { - Preconditions.CheckState(started); + GrpcPreconditions.CheckState(started); CheckNotCancelled(); - Preconditions.CheckState(!disposed); + GrpcPreconditions.CheckState(!disposed); - Preconditions.CheckState(!halfcloseRequested, "Already halfclosed."); - Preconditions.CheckState(!finished, "Already finished."); - Preconditions.CheckState(sendCompletionDelegate == null, "Only one write can be pending at a time"); + GrpcPreconditions.CheckState(!halfcloseRequested, "Already halfclosed."); + GrpcPreconditions.CheckState(!finished, "Already finished."); + GrpcPreconditions.CheckState(sendCompletionDelegate == null, "Only one write can be pending at a time"); } protected virtual void CheckReadingAllowed() { - Preconditions.CheckState(started); - Preconditions.CheckState(!disposed); + GrpcPreconditions.CheckState(started); + GrpcPreconditions.CheckState(!disposed); - Preconditions.CheckState(!readingDone, "Stream has already been closed."); - Preconditions.CheckState(readCompletionDelegate == null, "Only one read can be pending at a time"); + GrpcPreconditions.CheckState(!readingDone, "Stream has already been closed."); + GrpcPreconditions.CheckState(readCompletionDelegate == null, "Only one read can be pending at a time"); } protected void CheckNotCancelled() diff --git a/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs b/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs index 6752d3fab330a..b72cbd795f639 100644 --- a/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs +++ b/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs @@ -53,7 +53,7 @@ internal class AsyncCallServer : AsyncCallBase serializer, Func deserializer, GrpcEnvironment environment, Server server) : base(serializer, deserializer, environment) { - this.server = Preconditions.CheckNotNull(server); + this.server = GrpcPreconditions.CheckNotNull(server); } public void Initialize(CallSafeHandle call) @@ -71,7 +71,7 @@ public Task ServerSideCallAsync() { lock (myLock) { - Preconditions.CheckNotNull(call); + GrpcPreconditions.CheckNotNull(call); started = true; @@ -108,14 +108,14 @@ public void StartSendInitialMetadata(Metadata headers, AsyncCompletionDelegate public static void CheckOk(this GRPCCallError callError) { - Preconditions.CheckState(callError == GRPCCallError.OK, "Call error: " + callError); + GrpcPreconditions.CheckState(callError == GRPCCallError.OK, "Call error: " + callError); } } diff --git a/src/csharp/Grpc.Core/Internal/NativeMetadataCredentialsPlugin.cs b/src/csharp/Grpc.Core/Internal/NativeMetadataCredentialsPlugin.cs index 36b865c09cc2e..e810ffcdd03d5 100644 --- a/src/csharp/Grpc.Core/Internal/NativeMetadataCredentialsPlugin.cs +++ b/src/csharp/Grpc.Core/Internal/NativeMetadataCredentialsPlugin.cs @@ -53,7 +53,7 @@ internal class NativeMetadataCredentialsPlugin public NativeMetadataCredentialsPlugin(AsyncAuthInterceptor interceptor) { - this.interceptor = Preconditions.CheckNotNull(interceptor, "interceptor"); + this.interceptor = GrpcPreconditions.CheckNotNull(interceptor, "interceptor"); this.nativeInterceptor = NativeMetadataInterceptorHandler; // Make sure the callback doesn't get garbage collected until it is destroyed. diff --git a/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs b/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs index de66759b94bde..1f83e51548ebd 100644 --- a/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs +++ b/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs @@ -78,10 +78,10 @@ public async Task HandleCall(ServerRpcNew newRpc, GrpcEnvironment environment) var context = HandlerUtils.NewContext(newRpc, asyncCall.Peer, responseStream, asyncCall.CancellationToken); try { - Preconditions.CheckArgument(await requestStream.MoveNext().ConfigureAwait(false)); + GrpcPreconditions.CheckArgument(await requestStream.MoveNext().ConfigureAwait(false)); var request = requestStream.Current; // TODO(jtattermusch): we need to read the full stream so that native callhandle gets deallocated. - Preconditions.CheckArgument(!await requestStream.MoveNext().ConfigureAwait(false)); + GrpcPreconditions.CheckArgument(!await requestStream.MoveNext().ConfigureAwait(false)); var result = await handler(request, context).ConfigureAwait(false); status = context.Status; await responseStream.WriteAsync(result).ConfigureAwait(false); @@ -134,10 +134,10 @@ public async Task HandleCall(ServerRpcNew newRpc, GrpcEnvironment environment) var context = HandlerUtils.NewContext(newRpc, asyncCall.Peer, responseStream, asyncCall.CancellationToken); try { - Preconditions.CheckArgument(await requestStream.MoveNext().ConfigureAwait(false)); + GrpcPreconditions.CheckArgument(await requestStream.MoveNext().ConfigureAwait(false)); var request = requestStream.Current; // TODO(jtattermusch): we need to read the full stream so that native callhandle gets deallocated. - Preconditions.CheckArgument(!await requestStream.MoveNext().ConfigureAwait(false)); + GrpcPreconditions.CheckArgument(!await requestStream.MoveNext().ConfigureAwait(false)); await handler(request, responseStream, context).ConfigureAwait(false); status = context.Status; } diff --git a/src/csharp/Grpc.Core/Internal/ServerCredentialsSafeHandle.cs b/src/csharp/Grpc.Core/Internal/ServerCredentialsSafeHandle.cs index a1d080c7f1c70..a50f35799028e 100644 --- a/src/csharp/Grpc.Core/Internal/ServerCredentialsSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/ServerCredentialsSafeHandle.cs @@ -49,7 +49,7 @@ private ServerCredentialsSafeHandle() public static ServerCredentialsSafeHandle CreateSslCredentials(string pemRootCerts, string[] keyCertPairCertChainArray, string[] keyCertPairPrivateKeyArray, bool forceClientAuth) { - Preconditions.CheckArgument(keyCertPairCertChainArray.Length == keyCertPairPrivateKeyArray.Length); + GrpcPreconditions.CheckArgument(keyCertPairCertChainArray.Length == keyCertPairPrivateKeyArray.Length); return Native.grpcsharp_ssl_server_credentials_create(pemRootCerts, keyCertPairCertChainArray, keyCertPairPrivateKeyArray, new UIntPtr((ulong)keyCertPairCertChainArray.Length), diff --git a/src/csharp/Grpc.Core/Internal/Timespec.cs b/src/csharp/Grpc.Core/Internal/Timespec.cs index 148d877da5a2e..754be4e03531e 100644 --- a/src/csharp/Grpc.Core/Internal/Timespec.cs +++ b/src/csharp/Grpc.Core/Internal/Timespec.cs @@ -141,8 +141,8 @@ public Timespec ToClockType(GPRClockType targetClock) /// public DateTime ToDateTime() { - Preconditions.CheckState(tv_nsec >= 0 && tv_nsec < NanosPerSecond); - Preconditions.CheckState(clock_type == GPRClockType.Realtime); + GrpcPreconditions.CheckState(tv_nsec >= 0 && tv_nsec < NanosPerSecond); + GrpcPreconditions.CheckState(clock_type == GPRClockType.Realtime); // fast path for InfFuture if (this.Equals(InfFuture)) @@ -195,7 +195,7 @@ public static Timespec FromDateTime(DateTime dateTime) return Timespec.InfPast; } - Preconditions.CheckArgument(dateTime.Kind == DateTimeKind.Utc, "dateTime needs of kind DateTimeKind.Utc or be equal to DateTime.MaxValue or DateTime.MinValue."); + GrpcPreconditions.CheckArgument(dateTime.Kind == DateTimeKind.Utc, "dateTime needs of kind DateTimeKind.Utc or be equal to DateTime.MaxValue or DateTime.MinValue."); try { diff --git a/src/csharp/Grpc.Core/Internal/UnmanagedLibrary.cs b/src/csharp/Grpc.Core/Internal/UnmanagedLibrary.cs index 95a8797e3eefd..e763c1502575a 100644 --- a/src/csharp/Grpc.Core/Internal/UnmanagedLibrary.cs +++ b/src/csharp/Grpc.Core/Internal/UnmanagedLibrary.cs @@ -65,7 +65,7 @@ internal class UnmanagedLibrary public UnmanagedLibrary(string libraryPath) { - this.libraryPath = Preconditions.CheckNotNull(libraryPath); + this.libraryPath = GrpcPreconditions.CheckNotNull(libraryPath); if (!File.Exists(this.libraryPath)) { diff --git a/src/csharp/Grpc.Core/KeyCertificatePair.cs b/src/csharp/Grpc.Core/KeyCertificatePair.cs index 6f691975e997f..a8f3bb073d64a 100644 --- a/src/csharp/Grpc.Core/KeyCertificatePair.cs +++ b/src/csharp/Grpc.Core/KeyCertificatePair.cs @@ -54,8 +54,8 @@ public sealed class KeyCertificatePair /// PEM encoded private key. public KeyCertificatePair(string certificateChain, string privateKey) { - this.certificateChain = Preconditions.CheckNotNull(certificateChain, "certificateChain"); - this.privateKey = Preconditions.CheckNotNull(privateKey, "privateKey"); + this.certificateChain = GrpcPreconditions.CheckNotNull(certificateChain, "certificateChain"); + this.privateKey = GrpcPreconditions.CheckNotNull(privateKey, "privateKey"); } /// diff --git a/src/csharp/Grpc.Core/Marshaller.cs b/src/csharp/Grpc.Core/Marshaller.cs index 3493d2d38f05b..d86e75b3cb1f8 100644 --- a/src/csharp/Grpc.Core/Marshaller.cs +++ b/src/csharp/Grpc.Core/Marshaller.cs @@ -51,8 +51,8 @@ public class Marshaller /// Function that will be used to deserialize messages. public Marshaller(Func serializer, Func deserializer) { - this.serializer = Preconditions.CheckNotNull(serializer, "serializer"); - this.deserializer = Preconditions.CheckNotNull(deserializer, "deserializer"); + this.serializer = GrpcPreconditions.CheckNotNull(serializer, "serializer"); + this.deserializer = GrpcPreconditions.CheckNotNull(deserializer, "deserializer"); } /// diff --git a/src/csharp/Grpc.Core/Metadata.cs b/src/csharp/Grpc.Core/Metadata.cs index 21bdf4f114507..75e63212b154d 100644 --- a/src/csharp/Grpc.Core/Metadata.cs +++ b/src/csharp/Grpc.Core/Metadata.cs @@ -179,7 +179,7 @@ IEnumerator System.Collections.IEnumerable.GetEnumerator() private void CheckWriteable() { - Preconditions.CheckState(!readOnly, "Object is read only"); + GrpcPreconditions.CheckState(!readOnly, "Object is read only"); } #endregion @@ -211,10 +211,10 @@ private Entry(string key, string value, byte[] valueBytes) public Entry(string key, byte[] valueBytes) { this.key = NormalizeKey(key); - Preconditions.CheckArgument(this.key.EndsWith(BinaryHeaderSuffix), + GrpcPreconditions.CheckArgument(this.key.EndsWith(BinaryHeaderSuffix), "Key for binary valued metadata entry needs to have suffix indicating binary value."); this.value = null; - Preconditions.CheckNotNull(valueBytes, "valueBytes"); + GrpcPreconditions.CheckNotNull(valueBytes, "valueBytes"); this.valueBytes = new byte[valueBytes.Length]; Buffer.BlockCopy(valueBytes, 0, this.valueBytes, 0, valueBytes.Length); // defensive copy to guarantee immutability } @@ -227,9 +227,9 @@ public Entry(string key, byte[] valueBytes) public Entry(string key, string value) { this.key = NormalizeKey(key); - Preconditions.CheckArgument(!this.key.EndsWith(BinaryHeaderSuffix), + GrpcPreconditions.CheckArgument(!this.key.EndsWith(BinaryHeaderSuffix), "Key for ASCII valued metadata entry cannot have suffix indicating binary value."); - this.value = Preconditions.CheckNotNull(value, "value"); + this.value = GrpcPreconditions.CheckNotNull(value, "value"); this.valueBytes = null; } @@ -270,7 +270,7 @@ public string Value { get { - Preconditions.CheckState(!IsBinary, "Cannot access string value of a binary metadata entry"); + GrpcPreconditions.CheckState(!IsBinary, "Cannot access string value of a binary metadata entry"); return value ?? Encoding.GetString(valueBytes); } } @@ -323,8 +323,8 @@ internal static Entry CreateUnsafe(string key, byte[] valueBytes) private static string NormalizeKey(string key) { - var normalized = Preconditions.CheckNotNull(key, "key").ToLower(CultureInfo.InvariantCulture); - Preconditions.CheckArgument(ValidKeyRegex.IsMatch(normalized), + var normalized = GrpcPreconditions.CheckNotNull(key, "key").ToLower(CultureInfo.InvariantCulture); + GrpcPreconditions.CheckArgument(ValidKeyRegex.IsMatch(normalized), "Metadata entry key not valid. Keys can only contain lowercase alphanumeric characters, underscores and hyphens."); return normalized; } diff --git a/src/csharp/Grpc.Core/Method.cs b/src/csharp/Grpc.Core/Method.cs index 99162a7d5dd06..0cf041be2bc4e 100644 --- a/src/csharp/Grpc.Core/Method.cs +++ b/src/csharp/Grpc.Core/Method.cs @@ -106,10 +106,10 @@ public class Method : IMethod public Method(MethodType type, string serviceName, string name, Marshaller requestMarshaller, Marshaller responseMarshaller) { this.type = type; - this.serviceName = Preconditions.CheckNotNull(serviceName, "serviceName"); - this.name = Preconditions.CheckNotNull(name, "name"); - this.requestMarshaller = Preconditions.CheckNotNull(requestMarshaller, "requestMarshaller"); - this.responseMarshaller = Preconditions.CheckNotNull(responseMarshaller, "responseMarshaller"); + this.serviceName = GrpcPreconditions.CheckNotNull(serviceName, "serviceName"); + this.name = GrpcPreconditions.CheckNotNull(name, "name"); + this.requestMarshaller = GrpcPreconditions.CheckNotNull(requestMarshaller, "requestMarshaller"); + this.responseMarshaller = GrpcPreconditions.CheckNotNull(responseMarshaller, "responseMarshaller"); this.fullName = GetFullName(serviceName, name); } diff --git a/src/csharp/Grpc.Core/Server.cs b/src/csharp/Grpc.Core/Server.cs index d120f95fdf98e..5b61b7f060f0d 100644 --- a/src/csharp/Grpc.Core/Server.cs +++ b/src/csharp/Grpc.Core/Server.cs @@ -125,7 +125,7 @@ public void Start() { lock (myLock) { - Preconditions.CheckState(!startRequested); + GrpcPreconditions.CheckState(!startRequested); startRequested = true; handle.Start(); @@ -142,8 +142,8 @@ public async Task ShutdownAsync() { lock (myLock) { - Preconditions.CheckState(startRequested); - Preconditions.CheckState(!shutdownRequested); + GrpcPreconditions.CheckState(startRequested); + GrpcPreconditions.CheckState(!shutdownRequested); shutdownRequested = true; } @@ -162,8 +162,8 @@ public async Task KillAsync() { lock (myLock) { - Preconditions.CheckState(startRequested); - Preconditions.CheckState(!shutdownRequested); + GrpcPreconditions.CheckState(startRequested); + GrpcPreconditions.CheckState(!shutdownRequested); shutdownRequested = true; } @@ -181,7 +181,7 @@ internal void AddCallReference(object call) bool success = false; handle.DangerousAddRef(ref success); - Preconditions.CheckState(success); + GrpcPreconditions.CheckState(success); } internal void RemoveCallReference(object call) @@ -197,7 +197,7 @@ private void AddServiceDefinitionInternal(ServerServiceDefinition serviceDefinit { lock (myLock) { - Preconditions.CheckState(!startRequested); + GrpcPreconditions.CheckState(!startRequested); foreach (var entry in serviceDefinition.CallHandlers) { callHandlers.Add(entry.Key, entry.Value); @@ -213,8 +213,8 @@ private int AddPortInternal(ServerPort serverPort) { lock (myLock) { - Preconditions.CheckNotNull(serverPort.Credentials, "serverPort"); - Preconditions.CheckState(!startRequested); + GrpcPreconditions.CheckNotNull(serverPort.Credentials, "serverPort"); + GrpcPreconditions.CheckState(!startRequested); var address = string.Format("{0}:{1}", serverPort.Host, serverPort.Port); int boundPort; using (var nativeCredentials = serverPort.Credentials.ToNativeCredentials()) diff --git a/src/csharp/Grpc.Core/ServerCredentials.cs b/src/csharp/Grpc.Core/ServerCredentials.cs index 3c6703d30e518..ace4820027bd1 100644 --- a/src/csharp/Grpc.Core/ServerCredentials.cs +++ b/src/csharp/Grpc.Core/ServerCredentials.cs @@ -90,11 +90,11 @@ public class SslServerCredentials : ServerCredentials public SslServerCredentials(IEnumerable keyCertificatePairs, string rootCertificates, bool forceClientAuth) { this.keyCertificatePairs = new List(keyCertificatePairs).AsReadOnly(); - Preconditions.CheckArgument(this.keyCertificatePairs.Count > 0, + GrpcPreconditions.CheckArgument(this.keyCertificatePairs.Count > 0, "At least one KeyCertificatePair needs to be provided."); if (forceClientAuth) { - Preconditions.CheckNotNull(rootCertificates, + GrpcPreconditions.CheckNotNull(rootCertificates, "Cannot force client authentication unless you provide rootCertificates."); } this.rootCertificates = rootCertificates; diff --git a/src/csharp/Grpc.Core/ServerPort.cs b/src/csharp/Grpc.Core/ServerPort.cs index 598404d04592f..afae0846ddf26 100644 --- a/src/csharp/Grpc.Core/ServerPort.cs +++ b/src/csharp/Grpc.Core/ServerPort.cs @@ -62,9 +62,9 @@ public class ServerPort /// credentials to use to secure this port. public ServerPort(string host, int port, ServerCredentials credentials) { - this.host = Preconditions.CheckNotNull(host, "host"); + this.host = GrpcPreconditions.CheckNotNull(host, "host"); this.port = port; - this.credentials = Preconditions.CheckNotNull(credentials, "credentials"); + this.credentials = GrpcPreconditions.CheckNotNull(credentials, "credentials"); } /// diff --git a/src/csharp/Grpc.Core/Utils/Preconditions.cs b/src/csharp/Grpc.Core/Utils/GrpcPreconditions.cs similarity index 99% rename from src/csharp/Grpc.Core/Utils/Preconditions.cs rename to src/csharp/Grpc.Core/Utils/GrpcPreconditions.cs index a8ab603391fc8..fcfe97a09b0d4 100644 --- a/src/csharp/Grpc.Core/Utils/Preconditions.cs +++ b/src/csharp/Grpc.Core/Utils/GrpcPreconditions.cs @@ -38,7 +38,7 @@ namespace Grpc.Core.Utils /// /// Utility methods to simplify checking preconditions in the code. /// - public static class Preconditions + public static class GrpcPreconditions { /// /// Throws if condition is false. diff --git a/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs b/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs index 26c6445c357e5..0de9d3b61fd93 100644 --- a/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs +++ b/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs @@ -127,8 +127,8 @@ private struct Key { public Key(string host, string service) { - this.Host = Preconditions.CheckNotNull(host); - this.Service = Preconditions.CheckNotNull(service); + this.Host = GrpcPreconditions.CheckNotNull(host); + this.Service = GrpcPreconditions.CheckNotNull(service); } readonly string Host; diff --git a/src/csharp/Grpc.IntegrationTesting/ClientRunners.cs b/src/csharp/Grpc.IntegrationTesting/ClientRunners.cs index e9e659cb1fb18..5e91d4a96ce91 100644 --- a/src/csharp/Grpc.IntegrationTesting/ClientRunners.cs +++ b/src/csharp/Grpc.IntegrationTesting/ClientRunners.cs @@ -58,7 +58,7 @@ public static class ClientRunners public static IClientRunner CreateStarted(ClientConfig config) { string target = config.ServerTargets.Single(); - Grpc.Core.Utils.Preconditions.CheckArgument(config.LoadParams.LoadCase == LoadParams.LoadOneofCase.ClosedLoop); + GrpcPreconditions.CheckArgument(config.LoadParams.LoadCase == LoadParams.LoadOneofCase.ClosedLoop); var credentials = config.SecurityParams != null ? TestCredentials.CreateSslCredentials() : ChannelCredentials.Insecure; var channel = new Channel(target, credentials); @@ -95,7 +95,7 @@ public class SyncUnaryClientRunner : IClientRunner public SyncUnaryClientRunner(Channel channel, int payloadSize, HistogramParams histogramParams) { - this.channel = Grpc.Core.Utils.Preconditions.CheckNotNull(channel); + this.channel = GrpcPreconditions.CheckNotNull(channel); this.payloadSize = payloadSize; this.histogram = new Histogram(histogramParams.Resolution, histogramParams.MaxPossible); diff --git a/src/csharp/Grpc.IntegrationTesting/Histogram.cs b/src/csharp/Grpc.IntegrationTesting/Histogram.cs index 7e7cb2c4de0d5..28d1f078a935d 100644 --- a/src/csharp/Grpc.IntegrationTesting/Histogram.cs +++ b/src/csharp/Grpc.IntegrationTesting/Histogram.cs @@ -66,8 +66,8 @@ public class Histogram public Histogram(double resolution, double maxPossible) { - Grpc.Core.Utils.Preconditions.CheckArgument(resolution > 0); - Grpc.Core.Utils.Preconditions.CheckArgument(maxPossible > 0); + GrpcPreconditions.CheckArgument(resolution > 0); + GrpcPreconditions.CheckArgument(maxPossible > 0); this.maxPossible = maxPossible; this.multiplier = 1.0 + resolution; this.oneOnLogMultiplier = 1.0 / Math.Log(1.0 + resolution); diff --git a/src/csharp/Grpc.IntegrationTesting/ServerRunners.cs b/src/csharp/Grpc.IntegrationTesting/ServerRunners.cs index e8be7758cee6f..b89a5d329c068 100644 --- a/src/csharp/Grpc.IntegrationTesting/ServerRunners.cs +++ b/src/csharp/Grpc.IntegrationTesting/ServerRunners.cs @@ -57,7 +57,7 @@ public static class ServerRunners /// public static IServerRunner CreateStarted(ServerConfig config) { - Grpc.Core.Utils.Preconditions.CheckArgument(config.ServerType == ServerType.ASYNC_SERVER); + GrpcPreconditions.CheckArgument(config.ServerType == ServerType.ASYNC_SERVER); var credentials = config.SecurityParams != null ? TestCredentials.CreateSslServerCredentials() : ServerCredentials.Insecure; // TODO: qps_driver needs to setup payload properly... @@ -83,7 +83,7 @@ public class ServerRunnerImpl : IServerRunner public ServerRunnerImpl(Server server) { - this.server = Grpc.Core.Utils.Preconditions.CheckNotNull(server); + this.server = GrpcPreconditions.CheckNotNull(server); } public int BoundPort diff --git a/src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs b/src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs index bb2918bf463dc..b9c68ece2a582 100644 --- a/src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs +++ b/src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs @@ -49,7 +49,7 @@ public class WorkerServiceImpl : WorkerService.IWorkerService { public async Task RunServer(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { - Grpc.Core.Utils.Preconditions.CheckState(await requestStream.MoveNext()); + GrpcPreconditions.CheckState(await requestStream.MoveNext()); var serverConfig = requestStream.Current.Setup; var runner = ServerRunners.CreateStarted(serverConfig); @@ -73,7 +73,7 @@ await responseStream.WriteAsync(new ServerStatus public async Task RunClient(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { - Grpc.Core.Utils.Preconditions.CheckState(await requestStream.MoveNext()); + GrpcPreconditions.CheckState(await requestStream.MoveNext()); var clientConfig = requestStream.Current.Setup; var runner = ClientRunners.CreateStarted(clientConfig); From 0f892567ee54651857368d26e89dc36bd5dea240 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 18 Feb 2016 10:37:02 -0800 Subject: [PATCH 19/43] update copyrights --- src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs | 2 +- src/csharp/Grpc.Core/AsyncAuthInterceptor.cs | 2 +- src/csharp/Grpc.Core/CallCredentials.cs | 2 +- src/csharp/Grpc.Core/CallInvocationDetails.cs | 2 +- src/csharp/Grpc.Core/CallOptions.cs | 2 +- src/csharp/Grpc.Core/Channel.cs | 2 +- src/csharp/Grpc.Core/ChannelCredentials.cs | 2 +- src/csharp/Grpc.Core/ChannelOptions.cs | 2 +- src/csharp/Grpc.Core/ContextPropagationToken.cs | 2 +- src/csharp/Grpc.Core/Internal/CompletionRegistry.cs | 2 +- src/csharp/Grpc.Core/Internal/Enums.cs | 2 +- src/csharp/Grpc.Core/Internal/ServerCallHandler.cs | 2 +- src/csharp/Grpc.Core/KeyCertificatePair.cs | 2 +- src/csharp/Grpc.Core/Marshaller.cs | 2 +- src/csharp/Grpc.Core/Metadata.cs | 2 +- src/csharp/Grpc.Core/Method.cs | 2 +- src/csharp/Grpc.Core/Server.cs | 2 +- src/csharp/Grpc.Core/ServerCredentials.cs | 2 +- src/csharp/Grpc.Core/ServerPort.cs | 2 +- src/csharp/Grpc.Core/Utils/GrpcPreconditions.cs | 2 +- src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs | 2 +- src/csharp/Grpc.IntegrationTesting/ClientRunners.cs | 2 +- src/csharp/Grpc.IntegrationTesting/Histogram.cs | 2 +- src/csharp/Grpc.IntegrationTesting/ServerRunners.cs | 2 +- src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs b/src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs index 96d6ee87ae4d4..1837f5c74bd03 100644 --- a/src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs +++ b/src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/AsyncAuthInterceptor.cs b/src/csharp/Grpc.Core/AsyncAuthInterceptor.cs index 1ad229092876b..5ba06d6509741 100644 --- a/src/csharp/Grpc.Core/AsyncAuthInterceptor.cs +++ b/src/csharp/Grpc.Core/AsyncAuthInterceptor.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/CallCredentials.cs b/src/csharp/Grpc.Core/CallCredentials.cs index 7476b0ca165b0..7cd41d04806a6 100644 --- a/src/csharp/Grpc.Core/CallCredentials.cs +++ b/src/csharp/Grpc.Core/CallCredentials.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/CallInvocationDetails.cs b/src/csharp/Grpc.Core/CallInvocationDetails.cs index 98db8546144bf..52bfbe6edbe1f 100644 --- a/src/csharp/Grpc.Core/CallInvocationDetails.cs +++ b/src/csharp/Grpc.Core/CallInvocationDetails.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/CallOptions.cs b/src/csharp/Grpc.Core/CallOptions.cs index caf8210d917fd..7bd95d4ba80e2 100644 --- a/src/csharp/Grpc.Core/CallOptions.cs +++ b/src/csharp/Grpc.Core/CallOptions.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/Channel.cs b/src/csharp/Grpc.Core/Channel.cs index 89981b1849bf5..d7a482d86ffdc 100644 --- a/src/csharp/Grpc.Core/Channel.cs +++ b/src/csharp/Grpc.Core/Channel.cs @@ -1,5 +1,5 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/ChannelCredentials.cs b/src/csharp/Grpc.Core/ChannelCredentials.cs index db0cefef8b7db..03cda284008a9 100644 --- a/src/csharp/Grpc.Core/ChannelCredentials.cs +++ b/src/csharp/Grpc.Core/ChannelCredentials.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/ChannelOptions.cs b/src/csharp/Grpc.Core/ChannelOptions.cs index b6eeceabc4c21..65e15e21e9974 100644 --- a/src/csharp/Grpc.Core/ChannelOptions.cs +++ b/src/csharp/Grpc.Core/ChannelOptions.cs @@ -1,5 +1,5 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/ContextPropagationToken.cs b/src/csharp/Grpc.Core/ContextPropagationToken.cs index 935498246a149..c0f638f837d18 100644 --- a/src/csharp/Grpc.Core/ContextPropagationToken.cs +++ b/src/csharp/Grpc.Core/ContextPropagationToken.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs b/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs index 628844f242218..3a293e162621a 100644 --- a/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs +++ b/src/csharp/Grpc.Core/Internal/CompletionRegistry.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/Internal/Enums.cs b/src/csharp/Grpc.Core/Internal/Enums.cs index 74f86d2a3044a..098e7c0e99e57 100644 --- a/src/csharp/Grpc.Core/Internal/Enums.cs +++ b/src/csharp/Grpc.Core/Internal/Enums.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs b/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs index 1f83e51548ebd..ccf144de2def6 100644 --- a/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs +++ b/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/KeyCertificatePair.cs b/src/csharp/Grpc.Core/KeyCertificatePair.cs index a8f3bb073d64a..0fb6817986f83 100644 --- a/src/csharp/Grpc.Core/KeyCertificatePair.cs +++ b/src/csharp/Grpc.Core/KeyCertificatePair.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/Marshaller.cs b/src/csharp/Grpc.Core/Marshaller.cs index d86e75b3cb1f8..5847248c1aaea 100644 --- a/src/csharp/Grpc.Core/Marshaller.cs +++ b/src/csharp/Grpc.Core/Marshaller.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/Metadata.cs b/src/csharp/Grpc.Core/Metadata.cs index 75e63212b154d..aa22f840d6c31 100644 --- a/src/csharp/Grpc.Core/Metadata.cs +++ b/src/csharp/Grpc.Core/Metadata.cs @@ -1,5 +1,5 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/Method.cs b/src/csharp/Grpc.Core/Method.cs index 0cf041be2bc4e..3870076f7f9c7 100644 --- a/src/csharp/Grpc.Core/Method.cs +++ b/src/csharp/Grpc.Core/Method.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/Server.cs b/src/csharp/Grpc.Core/Server.cs index 5b61b7f060f0d..5d0fc6b1f0c81 100644 --- a/src/csharp/Grpc.Core/Server.cs +++ b/src/csharp/Grpc.Core/Server.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/ServerCredentials.cs b/src/csharp/Grpc.Core/ServerCredentials.cs index ace4820027bd1..456d331c9c317 100644 --- a/src/csharp/Grpc.Core/ServerCredentials.cs +++ b/src/csharp/Grpc.Core/ServerCredentials.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/ServerPort.cs b/src/csharp/Grpc.Core/ServerPort.cs index afae0846ddf26..10ddcb782fc34 100644 --- a/src/csharp/Grpc.Core/ServerPort.cs +++ b/src/csharp/Grpc.Core/ServerPort.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.Core/Utils/GrpcPreconditions.cs b/src/csharp/Grpc.Core/Utils/GrpcPreconditions.cs index fcfe97a09b0d4..76bf04ce8b209 100644 --- a/src/csharp/Grpc.Core/Utils/GrpcPreconditions.cs +++ b/src/csharp/Grpc.Core/Utils/GrpcPreconditions.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs b/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs index 0de9d3b61fd93..e2ad1a834bfd5 100644 --- a/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs +++ b/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs @@ -1,5 +1,5 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.IntegrationTesting/ClientRunners.cs b/src/csharp/Grpc.IntegrationTesting/ClientRunners.cs index 5e91d4a96ce91..c4016012cbb63 100644 --- a/src/csharp/Grpc.IntegrationTesting/ClientRunners.cs +++ b/src/csharp/Grpc.IntegrationTesting/ClientRunners.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.IntegrationTesting/Histogram.cs b/src/csharp/Grpc.IntegrationTesting/Histogram.cs index 28d1f078a935d..08a674d8178dc 100644 --- a/src/csharp/Grpc.IntegrationTesting/Histogram.cs +++ b/src/csharp/Grpc.IntegrationTesting/Histogram.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.IntegrationTesting/ServerRunners.cs b/src/csharp/Grpc.IntegrationTesting/ServerRunners.cs index b89a5d329c068..9b09b9bdd340d 100644 --- a/src/csharp/Grpc.IntegrationTesting/ServerRunners.cs +++ b/src/csharp/Grpc.IntegrationTesting/ServerRunners.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without diff --git a/src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs b/src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs index b9c68ece2a582..59ecebf5a21ec 100644 --- a/src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs +++ b/src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs @@ -1,6 +1,6 @@ #region Copyright notice and license -// Copyright 2015, Google Inc. +// Copyright 2015-2016, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without From 7d2a3e1917ebfd4e1262020b021b3bf09d238c86 Mon Sep 17 00:00:00 2001 From: yang-g Date: Thu, 18 Feb 2016 15:41:56 -0800 Subject: [PATCH 20/43] Refactor end2end_test. Make the credentials a separate library. --- Makefile | 3 + build.yaml | 2 + test/cpp/end2end/end2end_test.cc | 58 +++++++-------- test/cpp/util/test_credentials_provider.cc | 74 +++++++++++++++++++ test/cpp/util/test_credentials_provider.h | 61 +++++++++++++++ tools/run_tests/sources_and_headers.json | 7 +- .../grpc++_test_util/grpc++_test_util.vcxproj | 3 + .../grpc++_test_util.vcxproj.filters | 6 ++ 8 files changed, 181 insertions(+), 33 deletions(-) create mode 100644 test/cpp/util/test_credentials_provider.cc create mode 100644 test/cpp/util/test_credentials_provider.h diff --git a/Makefile b/Makefile index 6c7febdabc327..62e873dad718e 100644 --- a/Makefile +++ b/Makefile @@ -3162,6 +3162,7 @@ LIBGRPC++_TEST_UTIL_SRC = \ test/cpp/util/create_test_channel.cc \ test/cpp/util/string_ref_helper.cc \ test/cpp/util/subprocess.cc \ + test/cpp/util/test_credentials_provider.cc \ LIBGRPC++_TEST_UTIL_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC++_TEST_UTIL_SRC)))) @@ -3212,6 +3213,7 @@ $(OBJDIR)/$(CONFIG)/test/cpp/util/cli_call.o: $(GENDIR)/src/proto/grpc/testing/e $(OBJDIR)/$(CONFIG)/test/cpp/util/create_test_channel.o: $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc $(GENDIR)/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.cc $(OBJDIR)/$(CONFIG)/test/cpp/util/string_ref_helper.o: $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc $(GENDIR)/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.cc $(OBJDIR)/$(CONFIG)/test/cpp/util/subprocess.o: $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc $(GENDIR)/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/util/test_credentials_provider.o: $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc $(GENDIR)/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.cc LIBGRPC++_UNSECURE_SRC = \ @@ -13015,6 +13017,7 @@ test/cpp/util/create_test_channel.cc: $(OPENSSL_DEP) test/cpp/util/string_ref_helper.cc: $(OPENSSL_DEP) test/cpp/util/subprocess.cc: $(OPENSSL_DEP) test/cpp/util/test_config.cc: $(OPENSSL_DEP) +test/cpp/util/test_credentials_provider.cc: $(OPENSSL_DEP) endif .PHONY: all strip tools dep_error openssl_dep_error openssl_dep_message git_update stop buildtests buildtests_c buildtests_cxx test test_c test_cxx install install_c install_cxx install-headers install-headers_c install-headers_cxx install-shared install-shared_c install-shared_cxx install-static install-static_c install-static_cxx strip strip-shared strip-static strip_c strip-shared_c strip-static_c strip_cxx strip-shared_cxx strip-static_cxx dep_c dep_cxx bins_dep_c bins_dep_cxx clean diff --git a/build.yaml b/build.yaml index b639b5d21e677..5b1878eb9f17e 100644 --- a/build.yaml +++ b/build.yaml @@ -716,6 +716,7 @@ libs: - test/cpp/util/create_test_channel.h - test/cpp/util/string_ref_helper.h - test/cpp/util/subprocess.h + - test/cpp/util/test_credentials_provider.h src: - src/proto/grpc/testing/echo_messages.proto - src/proto/grpc/testing/echo.proto @@ -726,6 +727,7 @@ libs: - test/cpp/util/create_test_channel.cc - test/cpp/util/string_ref_helper.cc - test/cpp/util/subprocess.cc + - test/cpp/util/test_credentials_provider.cc deps: - grpc++ - grpc_test_util diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index c8523847ab2cd..df9aae7436fc4 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -51,11 +51,11 @@ #include "src/core/security/credentials.h" #include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h" #include "src/proto/grpc/testing/echo.grpc.pb.h" -#include "test/core/end2end/data/ssl_test_data.h" #include "test/core/util/port.h" #include "test/core/util/test_config.h" #include "test/cpp/end2end/test_service_impl.h" #include "test/cpp/util/string_ref_helper.h" +#include "test/cpp/util/test_credentials_provider.h" using grpc::testing::EchoRequest; using grpc::testing::EchoResponse; @@ -191,12 +191,14 @@ class TestServiceImplDupPkg class TestScenario { public: - TestScenario(bool proxy, bool tls) : use_proxy(proxy), use_tls(tls) {} + TestScenario(bool proxy, const grpc::string& creds_type) + : use_proxy(proxy), credentials_type(creds_type) {} void Log() const { - gpr_log(GPR_INFO, "Scenario: proxy %d, tls %d", use_proxy, use_tls); + gpr_log(GPR_INFO, "Scenario: proxy %d, credentials %s", use_proxy, + credentials_type.c_str()); } bool use_proxy; - bool use_tls; + const grpc::string credentials_type; }; class End2endTest : public ::testing::TestWithParam { @@ -220,14 +222,8 @@ class End2endTest : public ::testing::TestWithParam { server_address_ << "127.0.0.1:" << port; // Setup server ServerBuilder builder; - auto server_creds = InsecureServerCredentials(); - if (GetParam().use_tls) { - SslServerCredentialsOptions::PemKeyCertPair pkcp = {test_server1_key, - test_server1_cert}; - SslServerCredentialsOptions ssl_opts; - ssl_opts.pem_root_certs = ""; - ssl_opts.pem_key_cert_pairs.push_back(pkcp); - server_creds = SslServerCredentials(ssl_opts); + auto server_creds = GetServerCredentials(GetParam().credentials_type); + if (GetParam().credentials_type != kInsecureCredentialsType) { server_creds->SetAuthMetadataProcessor(processor); } builder.AddListeningPort(server_address_.str(), server_creds); @@ -246,12 +242,8 @@ class End2endTest : public ::testing::TestWithParam { } EXPECT_TRUE(is_server_started_); ChannelArguments args; - auto channel_creds = InsecureChannelCredentials(); - if (GetParam().use_tls) { - SslCredentialsOptions ssl_opts = {test_root_cert, "", ""}; - args.SetSslTargetNameOverride("foo.test.google.fr"); - channel_creds = SslCredentials(ssl_opts); - } + auto channel_creds = + GetChannelCredentials(GetParam().credentials_type, &args); if (!user_agent_prefix_.empty()) { args.SetUserAgentPrefix(user_agent_prefix_); } @@ -941,7 +933,7 @@ TEST_P(End2endTest, ChannelState) { // Takes 10s. TEST_P(End2endTest, ChannelStateTimeout) { - if (GetParam().use_tls) { + if (GetParam().credentials_type != kInsecureCredentialsType) { return; } int port = grpc_pick_unused_port_or_die(); @@ -1150,7 +1142,7 @@ class SecureEnd2endTest : public End2endTest { protected: SecureEnd2endTest() { GPR_ASSERT(!GetParam().use_proxy); - GPR_ASSERT(GetParam().use_tls); + GPR_ASSERT(GetParam().credentials_type != kInsecureCredentialsType); } }; @@ -1373,21 +1365,25 @@ TEST_P(SecureEnd2endTest, ClientAuthContext) { EXPECT_EQ("*.test.youtube.com", ToString(auth_ctx->GetPeerIdentity()[2])); } -INSTANTIATE_TEST_CASE_P(End2end, End2endTest, - ::testing::Values(TestScenario(false, false), - TestScenario(false, true))); +INSTANTIATE_TEST_CASE_P( + End2end, End2endTest, + ::testing::Values(TestScenario(false, kInsecureCredentialsType), + TestScenario(false, kTlsCredentialsType))); -INSTANTIATE_TEST_CASE_P(End2endServerTryCancel, End2endServerTryCancelTest, - ::testing::Values(TestScenario(false, false))); +INSTANTIATE_TEST_CASE_P( + End2endServerTryCancel, End2endServerTryCancelTest, + ::testing::Values(TestScenario(false, kInsecureCredentialsType))); -INSTANTIATE_TEST_CASE_P(ProxyEnd2end, ProxyEnd2endTest, - ::testing::Values(TestScenario(false, false), - TestScenario(false, true), - TestScenario(true, false), - TestScenario(true, true))); +INSTANTIATE_TEST_CASE_P( + ProxyEnd2end, ProxyEnd2endTest, + ::testing::Values(TestScenario(false, kInsecureCredentialsType), + TestScenario(false, kTlsCredentialsType), + TestScenario(true, kInsecureCredentialsType), + TestScenario(true, kTlsCredentialsType))); INSTANTIATE_TEST_CASE_P(SecureEnd2end, SecureEnd2endTest, - ::testing::Values(TestScenario(false, true))); + ::testing::Values(TestScenario(false, + kTlsCredentialsType))); } // namespace } // namespace testing diff --git a/test/cpp/util/test_credentials_provider.cc b/test/cpp/util/test_credentials_provider.cc new file mode 100644 index 0000000000000..f8380cdb65a47 --- /dev/null +++ b/test/cpp/util/test_credentials_provider.cc @@ -0,0 +1,74 @@ + +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "test/cpp/util/test_credentials_provider.h" + +#include "test/core/end2end/data/ssl_test_data.h" + +namespace grpc { +namespace testing { + +std::shared_ptr GetChannelCredentials( + const grpc::string& type, ChannelArguments* args) { + if (type == kInsecureCredentialsType) { + return InsecureChannelCredentials(); + } else if (type == kTlsCredentialsType) { + SslCredentialsOptions ssl_opts = {test_root_cert, "", ""}; + args->SetSslTargetNameOverride("foo.test.google.fr"); + return SslCredentials(ssl_opts); + } else { + gpr_log(GPR_ERROR, "Unsupported credentials type %s.", type.c_str()); + } + return nullptr; +} + +std::shared_ptr GetServerCredentials( + const grpc::string& type) { + if (type == kInsecureCredentialsType) { + return InsecureServerCredentials(); + } else if (type == kTlsCredentialsType) { + SslServerCredentialsOptions::PemKeyCertPair pkcp = {test_server1_key, + test_server1_cert}; + SslServerCredentialsOptions ssl_opts; + ssl_opts.pem_root_certs = ""; + ssl_opts.pem_key_cert_pairs.push_back(pkcp); + return SslServerCredentials(ssl_opts); + } else { + gpr_log(GPR_ERROR, "Unsupported credentials type %s.", type.c_str()); + } + return nullptr; +} + +} // namespace testing +} // namespace grpc diff --git a/test/cpp/util/test_credentials_provider.h b/test/cpp/util/test_credentials_provider.h new file mode 100644 index 0000000000000..4f25e3be66d30 --- /dev/null +++ b/test/cpp/util/test_credentials_provider.h @@ -0,0 +1,61 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef GRPC_TEST_CPP_UTIL_TEST_CREDENTIALS_PROVIDER_H +#define GRPC_TEST_CPP_UTIL_TEST_CREDENTIALS_PROVIDER_H + +#include + +#include +#include +#include + +namespace grpc { +namespace testing { + +const char kInsecureCredentialsType[] = "INSECURE_CREDENTIALS"; +const char kTlsCredentialsType[] = "TLS_CREDENTIALS"; + +// Provide channel credentials according to the given type. Alter the channel +// arguments if needed. +std::shared_ptr GetChannelCredentials( + const grpc::string& type, ChannelArguments* args); + +// Provide server credentials according to the given type. +std::shared_ptr GetServerCredentials( + const grpc::string& type); + +} // namespace testing +} // namespace grpc + +#endif // GRPC_TEST_CPP_UTIL_TEST_CREDENTIALS_PROVIDER_H diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 5b1b67439db1f..80edd6d4679c2 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -4186,7 +4186,8 @@ "test/cpp/util/cli_call.h", "test/cpp/util/create_test_channel.h", "test/cpp/util/string_ref_helper.h", - "test/cpp/util/subprocess.h" + "test/cpp/util/subprocess.h", + "test/cpp/util/test_credentials_provider.h" ], "language": "c++", "name": "grpc++_test_util", @@ -4202,7 +4203,9 @@ "test/cpp/util/string_ref_helper.cc", "test/cpp/util/string_ref_helper.h", "test/cpp/util/subprocess.cc", - "test/cpp/util/subprocess.h" + "test/cpp/util/subprocess.h", + "test/cpp/util/test_credentials_provider.cc", + "test/cpp/util/test_credentials_provider.h" ] }, { diff --git a/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj b/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj index 3d353716a9e5b..33860af620b65 100644 --- a/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj +++ b/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj @@ -153,6 +153,7 @@ + @@ -191,6 +192,8 @@ + + diff --git a/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj.filters b/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj.filters index 27ac6751b94c9..b35ba1fd91c8d 100644 --- a/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj.filters +++ b/vsprojects/vcxproj/grpc++_test_util/grpc++_test_util.vcxproj.filters @@ -28,6 +28,9 @@ test\cpp\util + + test\cpp\util + @@ -48,6 +51,9 @@ test\cpp\util + + test\cpp\util + From 5152cd29f8541d7600b7ddc3d9db188ad59ea673 Mon Sep 17 00:00:00 2001 From: yang-g Date: Thu, 18 Feb 2016 16:37:51 -0800 Subject: [PATCH 21/43] make an enum --- test/cpp/end2end/end2end_test.cc | 62 ++++++++++++++-------- test/cpp/util/test_credentials_provider.cc | 28 +++++++--- test/cpp/util/test_credentials_provider.h | 13 +++-- 3 files changed, 69 insertions(+), 34 deletions(-) diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index df9aae7436fc4..2169afb8169bc 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -191,14 +191,14 @@ class TestServiceImplDupPkg class TestScenario { public: - TestScenario(bool proxy, const grpc::string& creds_type) - : use_proxy(proxy), credentials_type(creds_type) {} + TestScenario(bool proxy, TestCredentialsType type) + : use_proxy(proxy), credentials_type(type) {} void Log() const { gpr_log(GPR_INFO, "Scenario: proxy %d, credentials %s", use_proxy, - credentials_type.c_str()); + TestCredentialsTypeToString(credentials_type).c_str()); } bool use_proxy; - const grpc::string credentials_type; + TestCredentialsType credentials_type; }; class End2endTest : public ::testing::TestWithParam { @@ -223,7 +223,7 @@ class End2endTest : public ::testing::TestWithParam { // Setup server ServerBuilder builder; auto server_creds = GetServerCredentials(GetParam().credentials_type); - if (GetParam().credentials_type != kInsecureCredentialsType) { + if (GetParam().credentials_type != INSECURE_CREDENTIALS) { server_creds->SetAuthMetadataProcessor(processor); } builder.AddListeningPort(server_address_.str(), server_creds); @@ -933,7 +933,7 @@ TEST_P(End2endTest, ChannelState) { // Takes 10s. TEST_P(End2endTest, ChannelStateTimeout) { - if (GetParam().credentials_type != kInsecureCredentialsType) { + if (GetParam().credentials_type != INSECURE_CREDENTIALS) { return; } int port = grpc_pick_unused_port_or_die(); @@ -1142,7 +1142,7 @@ class SecureEnd2endTest : public End2endTest { protected: SecureEnd2endTest() { GPR_ASSERT(!GetParam().use_proxy); - GPR_ASSERT(GetParam().credentials_type != kInsecureCredentialsType); + GPR_ASSERT(GetParam().credentials_type != INSECURE_CREDENTIALS); } }; @@ -1365,25 +1365,43 @@ TEST_P(SecureEnd2endTest, ClientAuthContext) { EXPECT_EQ("*.test.youtube.com", ToString(auth_ctx->GetPeerIdentity()[2])); } -INSTANTIATE_TEST_CASE_P( - End2end, End2endTest, - ::testing::Values(TestScenario(false, kInsecureCredentialsType), - TestScenario(false, kTlsCredentialsType))); +std::vector CreateTestScenarios(bool use_proxy, + bool test_insecure, + bool test_secure) { + std::vector scenarios; + for (int i = INSECURE_CREDENTIALS; i < MAX_CREDENTIALS_TYPE; i++) { + if (i == INSECURE_CREDENTIALS && !test_insecure) { + continue; + } + if (i != INSECURE_CREDENTIALS && !test_secure) { + continue; + } + if (use_proxy) { + scenarios.push_back( + TestScenario(true, static_cast(i))); + } + scenarios.push_back( + TestScenario(false, static_cast(i))); + } + GPR_ASSERT(!scenarios.empty()); + return scenarios; +} + +INSTANTIATE_TEST_CASE_P(End2end, End2endTest, + ::testing::ValuesIn(CreateTestScenarios(false, true, + true))); -INSTANTIATE_TEST_CASE_P( - End2endServerTryCancel, End2endServerTryCancelTest, - ::testing::Values(TestScenario(false, kInsecureCredentialsType))); +INSTANTIATE_TEST_CASE_P(End2endServerTryCancel, End2endServerTryCancelTest, + ::testing::ValuesIn(CreateTestScenarios(false, true, + false))); -INSTANTIATE_TEST_CASE_P( - ProxyEnd2end, ProxyEnd2endTest, - ::testing::Values(TestScenario(false, kInsecureCredentialsType), - TestScenario(false, kTlsCredentialsType), - TestScenario(true, kInsecureCredentialsType), - TestScenario(true, kTlsCredentialsType))); +INSTANTIATE_TEST_CASE_P(ProxyEnd2end, ProxyEnd2endTest, + ::testing::ValuesIn(CreateTestScenarios(true, true, + true))); INSTANTIATE_TEST_CASE_P(SecureEnd2end, SecureEnd2endTest, - ::testing::Values(TestScenario(false, - kTlsCredentialsType))); + ::testing::ValuesIn(CreateTestScenarios(false, false, + true))); } // namespace } // namespace testing diff --git a/test/cpp/util/test_credentials_provider.cc b/test/cpp/util/test_credentials_provider.cc index f8380cdb65a47..9746ca692a741 100644 --- a/test/cpp/util/test_credentials_provider.cc +++ b/test/cpp/util/test_credentials_provider.cc @@ -40,24 +40,24 @@ namespace grpc { namespace testing { std::shared_ptr GetChannelCredentials( - const grpc::string& type, ChannelArguments* args) { - if (type == kInsecureCredentialsType) { + TestCredentialsType type, ChannelArguments* args) { + if (type == INSECURE_CREDENTIALS) { return InsecureChannelCredentials(); - } else if (type == kTlsCredentialsType) { + } else if (type == TLS_CREDENTIALS) { SslCredentialsOptions ssl_opts = {test_root_cert, "", ""}; args->SetSslTargetNameOverride("foo.test.google.fr"); return SslCredentials(ssl_opts); } else { - gpr_log(GPR_ERROR, "Unsupported credentials type %s.", type.c_str()); + gpr_log(GPR_ERROR, "Unsupported credentials type %d.", type); } return nullptr; } std::shared_ptr GetServerCredentials( - const grpc::string& type) { - if (type == kInsecureCredentialsType) { + TestCredentialsType type) { + if (type == INSECURE_CREDENTIALS) { return InsecureServerCredentials(); - } else if (type == kTlsCredentialsType) { + } else if (type == TLS_CREDENTIALS) { SslServerCredentialsOptions::PemKeyCertPair pkcp = {test_server1_key, test_server1_cert}; SslServerCredentialsOptions ssl_opts; @@ -65,10 +65,22 @@ std::shared_ptr GetServerCredentials( ssl_opts.pem_key_cert_pairs.push_back(pkcp); return SslServerCredentials(ssl_opts); } else { - gpr_log(GPR_ERROR, "Unsupported credentials type %s.", type.c_str()); + gpr_log(GPR_ERROR, "Unsupported credentials type %d.", type); } return nullptr; } +grpc::string TestCredentialsTypeToString(TestCredentialsType type) { + switch (type) { + case INSECURE_CREDENTIALS: + return "INSECURE_CREDENTIALS"; + case TLS_CREDENTIALS: + return "TLS_CREDENTIALS"; + default: + break; + } + return "UNKNOWN"; +} + } // namespace testing } // namespace grpc diff --git a/test/cpp/util/test_credentials_provider.h b/test/cpp/util/test_credentials_provider.h index 4f25e3be66d30..005254a652137 100644 --- a/test/cpp/util/test_credentials_provider.h +++ b/test/cpp/util/test_credentials_provider.h @@ -43,17 +43,22 @@ namespace grpc { namespace testing { -const char kInsecureCredentialsType[] = "INSECURE_CREDENTIALS"; -const char kTlsCredentialsType[] = "TLS_CREDENTIALS"; +enum TestCredentialsType { + INSECURE_CREDENTIALS = 0, + TLS_CREDENTIALS, + MAX_CREDENTIALS_TYPE +}; // Provide channel credentials according to the given type. Alter the channel // arguments if needed. std::shared_ptr GetChannelCredentials( - const grpc::string& type, ChannelArguments* args); + TestCredentialsType type, ChannelArguments* args); // Provide server credentials according to the given type. std::shared_ptr GetServerCredentials( - const grpc::string& type); + TestCredentialsType type); + +grpc::string TestCredentialsTypeToString(TestCredentialsType type); } // namespace testing } // namespace grpc From 3ba2eba9eb4842e4d43956a2d8c8d447eace507f Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Fri, 19 Feb 2016 01:39:59 +0100 Subject: [PATCH 22/43] Adding grpc_dll project. --- Makefile | 41 +++- build.yaml | 20 ++ tools/run_tests/sources_and_headers.json | 12 ++ vsprojects/buildtests_c.sln | 21 ++ vsprojects/grpc.sln | 21 ++ vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj | 193 ++++++++++++++++++ .../vcxproj/grpc_dll/grpc_dll.vcxproj.filters | 15 ++ 7 files changed, 322 insertions(+), 1 deletion(-) create mode 100644 vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj create mode 100644 vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj.filters diff --git a/Makefile b/Makefile index cce7118829f3e..8b967adcc4474 100644 --- a/Makefile +++ b/Makefile @@ -1102,7 +1102,7 @@ plugins: $(PROTOC_PLUGINS) privatelibs: privatelibs_c privatelibs_cxx -privatelibs_c: $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libz.a $(LIBDIR)/$(CONFIG)/libbad_client_test.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a +privatelibs_c: $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_dll.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libz.a $(LIBDIR)/$(CONFIG)/libbad_client_test.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a pc_c: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc pc_c_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc @@ -2540,6 +2540,44 @@ endif endif +LIBGRPC_DLL_SRC = \ + grpc.def \ + + +LIBGRPC_DLL_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC_DLL_SRC)))) + + +ifeq ($(NO_SECURE),true) + +# You can't build secure libraries if you don't have OpenSSL. + +$(LIBDIR)/$(CONFIG)/libgrpc_dll.a: openssl_dep_error + + +else + + +$(LIBDIR)/$(CONFIG)/libgrpc_dll.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBGRPC_DLL_OBJS) + $(E) "[AR] Creating $@" + $(Q) mkdir -p `dirname $@` + $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_dll.a + $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libgrpc_dll.a $(LIBGRPC_DLL_OBJS) +ifeq ($(SYSTEM),Darwin) + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_dll.a +endif + + + + +endif + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(LIBGRPC_DLL_OBJS:.o=.dep) +endif +endif + + LIBGRPC_TEST_UTIL_SRC = \ test/core/end2end/data/server1_cert.c \ test/core/end2end/data/server1_key.c \ @@ -12952,6 +12990,7 @@ ifneq ($(OPENSSL_DEP),) # This is to ensure the embedded OpenSSL is built beforehand, properly # installing headers to their final destination on the drive. We need this # otherwise parallel compilation will fail if a source is compiled first. +grpc.def: $(OPENSSL_DEP) src/core/httpcli/httpcli_security_connector.c: $(OPENSSL_DEP) src/core/security/base64.c: $(OPENSSL_DEP) src/core/security/client_auth_filter.c: $(OPENSSL_DEP) diff --git a/build.yaml b/build.yaml index dc7fce3213f5a..5a42e1386a338 100644 --- a/build.yaml +++ b/build.yaml @@ -587,6 +587,26 @@ libs: - grpc.dependencies.openssl - grpc.dependencies.zlib vs_project_guid: '{29D16885-7228-4C31-81ED-5F9187C7F2A9}' +- name: grpc_dll + build: private + language: c + src: + - grpc.def + deps: + - grpc + - gpr + deps_linkage: static + dll: only + vs_config_type: DynamicLibrary + vs_packages: + - grpc.dependencies.openssl + - grpc.dependencies.zlib + vs_project_guid: '{A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}' + vs_props: + - zlib + - openssl + - winsock + - global - name: grpc_test_util build: private language: c diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index a5ff6b51b820a..028f7272e6e47 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -3414,6 +3414,18 @@ "src/core/tsi/transport_security_interface.h" ] }, + { + "deps": [ + "gpr", + "grpc" + ], + "headers": [], + "language": "c", + "name": "grpc_dll", + "src": [ + "grpc.def" + ] + }, { "deps": [ "gpr", diff --git a/vsprojects/buildtests_c.sln b/vsprojects/buildtests_c.sln index b30941ff73894..0f754c1b843e0 100644 --- a/vsprojects/buildtests_c.sln +++ b/vsprojects/buildtests_c.sln @@ -24,6 +24,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc", "vcxproj\.\grpc\grpc {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_dll", "vcxproj\.\grpc_dll\grpc_dll.vcxproj", "{A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}" + ProjectSection(myProperties) = preProject + lib = "True" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9} + {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_test_util", "vcxproj\.\grpc_test_util\grpc_test_util.vcxproj", "{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}" ProjectSection(myProperties) = preProject lib = "True" @@ -1375,6 +1384,18 @@ Global {29D16885-7228-4C31-81ED-5F9187C7F2A9}.Release-DLL|Win32.Build.0 = Release-DLL|Win32 {29D16885-7228-4C31-81ED-5F9187C7F2A9}.Release-DLL|x64.ActiveCfg = Release-DLL|x64 {29D16885-7228-4C31-81ED-5F9187C7F2A9}.Release-DLL|x64.Build.0 = Release-DLL|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug|Win32.ActiveCfg = Debug|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug|x64.ActiveCfg = Debug|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release|Win32.ActiveCfg = Release|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release|x64.ActiveCfg = Release|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|Win32.ActiveCfg = Debug-DLL|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|Win32.Build.0 = Debug-DLL|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|x64.ActiveCfg = Debug-DLL|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|x64.Build.0 = Debug-DLL|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|Win32.ActiveCfg = Release-DLL|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|Win32.Build.0 = Release-DLL|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|x64.ActiveCfg = Release-DLL|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|x64.Build.0 = Release-DLL|x64 {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Debug|Win32.ActiveCfg = Debug|Win32 {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Debug|x64.ActiveCfg = Debug|x64 {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/vsprojects/grpc.sln b/vsprojects/grpc.sln index ad9198341ad67..41a227434f90a 100644 --- a/vsprojects/grpc.sln +++ b/vsprojects/grpc.sln @@ -24,6 +24,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc", "vcxproj\.\grpc\grpc {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_dll", "vcxproj\.\grpc_dll\grpc_dll.vcxproj", "{A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}" + ProjectSection(myProperties) = preProject + lib = "True" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9} + {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_test_util", "vcxproj\.\grpc_test_util\grpc_test_util.vcxproj", "{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}" ProjectSection(myProperties) = preProject lib = "True" @@ -220,6 +229,18 @@ Global {29D16885-7228-4C31-81ED-5F9187C7F2A9}.Release-DLL|Win32.Build.0 = Release-DLL|Win32 {29D16885-7228-4C31-81ED-5F9187C7F2A9}.Release-DLL|x64.ActiveCfg = Release-DLL|x64 {29D16885-7228-4C31-81ED-5F9187C7F2A9}.Release-DLL|x64.Build.0 = Release-DLL|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug|Win32.ActiveCfg = Debug|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug|x64.ActiveCfg = Debug|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release|Win32.ActiveCfg = Release|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release|x64.ActiveCfg = Release|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|Win32.ActiveCfg = Debug-DLL|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|Win32.Build.0 = Debug-DLL|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|x64.ActiveCfg = Debug-DLL|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|x64.Build.0 = Debug-DLL|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|Win32.ActiveCfg = Release-DLL|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|Win32.Build.0 = Release-DLL|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|x64.ActiveCfg = Release-DLL|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|x64.Build.0 = Release-DLL|x64 {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Debug|Win32.ActiveCfg = Debug|Win32 {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Debug|x64.ActiveCfg = Debug|x64 {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj b/vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj new file mode 100644 index 0000000000000..a4ba4fdff349b --- /dev/null +++ b/vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj @@ -0,0 +1,193 @@ + + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0} + true + $(SolutionDir)IntDir\$(MSBuildProjectName)\ + + + + v100 + + + v110 + + + v120 + + + v140 + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + false + true + Unicode + + + + + + + + + + + + + + grpc_dll + static + Debug + static + Debug + + + grpc_dll + static + Release + static + Release + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + true + None + false + + + Windows + true + false + + + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + true + None + false + + + Windows + true + false + + + + + + NotUsing + Level3 + MaxSpeed + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + true + true + MultiThreaded + true + None + false + + + Windows + true + false + true + true + + + + + + NotUsing + Level3 + MaxSpeed + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + true + true + MultiThreaded + true + None + false + + + Windows + true + false + true + true + + + + + + + + + + {29D16885-7228-4C31-81ED-5F9187C7F2A9} + + + {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + diff --git a/vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj.filters b/vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj.filters new file mode 100644 index 0000000000000..eb012a641d404 --- /dev/null +++ b/vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj.filters @@ -0,0 +1,15 @@ + + + + + + + + + + + {4e0e4342-caa8-2d9f-65d2-1430409e58a9} + + + + From 2e8fdbac7733b18655c61339a579cfb1eddcf42c Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Fri, 19 Feb 2016 02:09:47 +0100 Subject: [PATCH 23/43] Building the dlls. --- BUILD | 140 ++++++------ Makefile | 44 ++-- binding.gyp | 42 ++-- build.yaml | 83 +++---- gRPC.podspec | 98 ++++---- grpc.gemspec | 70 +++--- package.json | 70 +++--- src/python/grpcio/grpc_core_dependencies.py | 42 ++-- .../vsprojects/vcxproj.filters_defs.include | 5 + templates/vsprojects/vcxproj_defs.include | 14 ++ tools/doxygen/Doxyfile.core.internal | 70 +++--- tools/run_tests/build_artifact_python.bat | 14 ++ tools/run_tests/sources_and_headers.json | 4 +- vsprojects/buildtests_c.sln | 22 +- vsprojects/grpc.sln | 22 +- vsprojects/vcxproj/grpc/grpc.vcxproj | 112 +++++----- vsprojects/vcxproj/grpc/grpc.vcxproj.filters | 210 +++++++++--------- vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj | 15 +- .../vcxproj/grpc_dll/grpc_dll.vcxproj.filters | 7 +- 19 files changed, 562 insertions(+), 522 deletions(-) diff --git a/BUILD b/BUILD index 495af2a49cf19..09f53f9863ba6 100644 --- a/BUILD +++ b/BUILD @@ -154,20 +154,6 @@ cc_library( cc_library( name = "grpc", srcs = [ - "src/core/security/auth_filters.h", - "src/core/security/base64.h", - "src/core/security/credentials.h", - "src/core/security/handshake.h", - "src/core/security/json_token.h", - "src/core/security/jwt_verifier.h", - "src/core/security/secure_endpoint.h", - "src/core/security/security_connector.h", - "src/core/security/security_context.h", - "src/core/tsi/fake_transport_security.h", - "src/core/tsi/ssl_transport_security.h", - "src/core/tsi/ssl_types.h", - "src/core/tsi/transport_security.h", - "src/core/tsi/transport_security_interface.h", "src/core/census/grpc_filter.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", @@ -281,30 +267,23 @@ cc_library( "src/core/transport/static_metadata.h", "src/core/transport/transport.h", "src/core/transport/transport_impl.h", + "src/core/security/auth_filters.h", + "src/core/security/base64.h", + "src/core/security/credentials.h", + "src/core/security/handshake.h", + "src/core/security/json_token.h", + "src/core/security/jwt_verifier.h", + "src/core/security/secure_endpoint.h", + "src/core/security/security_connector.h", + "src/core/security/security_context.h", + "src/core/tsi/fake_transport_security.h", + "src/core/tsi/ssl_transport_security.h", + "src/core/tsi/ssl_types.h", + "src/core/tsi/transport_security.h", + "src/core/tsi/transport_security_interface.h", "src/core/census/aggregation.h", "src/core/census/log.h", "src/core/census/rpc_metric_id.h", - "src/core/httpcli/httpcli_security_connector.c", - "src/core/security/base64.c", - "src/core/security/client_auth_filter.c", - "src/core/security/credentials.c", - "src/core/security/credentials_metadata.c", - "src/core/security/credentials_posix.c", - "src/core/security/credentials_win32.c", - "src/core/security/google_default_credentials.c", - "src/core/security/handshake.c", - "src/core/security/json_token.c", - "src/core/security/jwt_verifier.c", - "src/core/security/secure_endpoint.c", - "src/core/security/security_connector.c", - "src/core/security/security_context.c", - "src/core/security/server_auth_filter.c", - "src/core/security/server_secure_chttp2.c", - "src/core/surface/init_secure.c", - "src/core/surface/secure_channel_create.c", - "src/core/tsi/fake_transport_security.c", - "src/core/tsi/ssl_transport_security.c", - "src/core/tsi/transport_security.c", "src/core/census/grpc_context.c", "src/core/census/grpc_filter.c", "src/core/channel/channel_args.c", @@ -432,6 +411,27 @@ cc_library( "src/core/transport/static_metadata.c", "src/core/transport/transport.c", "src/core/transport/transport_op_string.c", + "src/core/httpcli/httpcli_security_connector.c", + "src/core/security/base64.c", + "src/core/security/client_auth_filter.c", + "src/core/security/credentials.c", + "src/core/security/credentials_metadata.c", + "src/core/security/credentials_posix.c", + "src/core/security/credentials_win32.c", + "src/core/security/google_default_credentials.c", + "src/core/security/handshake.c", + "src/core/security/json_token.c", + "src/core/security/jwt_verifier.c", + "src/core/security/secure_endpoint.c", + "src/core/security/security_connector.c", + "src/core/security/security_context.c", + "src/core/security/server_auth_filter.c", + "src/core/security/server_secure_chttp2.c", + "src/core/surface/init_secure.c", + "src/core/surface/secure_channel_create.c", + "src/core/tsi/fake_transport_security.c", + "src/core/tsi/ssl_transport_security.c", + "src/core/tsi/transport_security.c", "src/core/census/context.c", "src/core/census/initialize.c", "src/core/census/log.c", @@ -1245,27 +1245,6 @@ objc_library( objc_library( name = "grpc_objc", srcs = [ - "src/core/httpcli/httpcli_security_connector.c", - "src/core/security/base64.c", - "src/core/security/client_auth_filter.c", - "src/core/security/credentials.c", - "src/core/security/credentials_metadata.c", - "src/core/security/credentials_posix.c", - "src/core/security/credentials_win32.c", - "src/core/security/google_default_credentials.c", - "src/core/security/handshake.c", - "src/core/security/json_token.c", - "src/core/security/jwt_verifier.c", - "src/core/security/secure_endpoint.c", - "src/core/security/security_connector.c", - "src/core/security/security_context.c", - "src/core/security/server_auth_filter.c", - "src/core/security/server_secure_chttp2.c", - "src/core/surface/init_secure.c", - "src/core/surface/secure_channel_create.c", - "src/core/tsi/fake_transport_security.c", - "src/core/tsi/ssl_transport_security.c", - "src/core/tsi/transport_security.c", "src/core/census/grpc_context.c", "src/core/census/grpc_filter.c", "src/core/channel/channel_args.c", @@ -1393,6 +1372,27 @@ objc_library( "src/core/transport/static_metadata.c", "src/core/transport/transport.c", "src/core/transport/transport_op_string.c", + "src/core/httpcli/httpcli_security_connector.c", + "src/core/security/base64.c", + "src/core/security/client_auth_filter.c", + "src/core/security/credentials.c", + "src/core/security/credentials_metadata.c", + "src/core/security/credentials_posix.c", + "src/core/security/credentials_win32.c", + "src/core/security/google_default_credentials.c", + "src/core/security/handshake.c", + "src/core/security/json_token.c", + "src/core/security/jwt_verifier.c", + "src/core/security/secure_endpoint.c", + "src/core/security/security_connector.c", + "src/core/security/security_context.c", + "src/core/security/server_auth_filter.c", + "src/core/security/server_secure_chttp2.c", + "src/core/surface/init_secure.c", + "src/core/surface/secure_channel_create.c", + "src/core/tsi/fake_transport_security.c", + "src/core/tsi/ssl_transport_security.c", + "src/core/tsi/transport_security.c", "src/core/census/context.c", "src/core/census/initialize.c", "src/core/census/log.c", @@ -1414,20 +1414,6 @@ objc_library( "include/grpc/grpc.h", "include/grpc/status.h", "include/grpc/census.h", - "src/core/security/auth_filters.h", - "src/core/security/base64.h", - "src/core/security/credentials.h", - "src/core/security/handshake.h", - "src/core/security/json_token.h", - "src/core/security/jwt_verifier.h", - "src/core/security/secure_endpoint.h", - "src/core/security/security_connector.h", - "src/core/security/security_context.h", - "src/core/tsi/fake_transport_security.h", - "src/core/tsi/ssl_transport_security.h", - "src/core/tsi/ssl_types.h", - "src/core/tsi/transport_security.h", - "src/core/tsi/transport_security_interface.h", "src/core/census/grpc_filter.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", @@ -1541,6 +1527,20 @@ objc_library( "src/core/transport/static_metadata.h", "src/core/transport/transport.h", "src/core/transport/transport_impl.h", + "src/core/security/auth_filters.h", + "src/core/security/base64.h", + "src/core/security/credentials.h", + "src/core/security/handshake.h", + "src/core/security/json_token.h", + "src/core/security/jwt_verifier.h", + "src/core/security/secure_endpoint.h", + "src/core/security/security_connector.h", + "src/core/security/security_context.h", + "src/core/tsi/fake_transport_security.h", + "src/core/tsi/ssl_transport_security.h", + "src/core/tsi/ssl_types.h", + "src/core/tsi/transport_security.h", + "src/core/tsi/transport_security_interface.h", "src/core/census/aggregation.h", "src/core/census/log.h", "src/core/census/rpc_metric_id.h", diff --git a/Makefile b/Makefile index 8b967adcc4474..c53b7437ad04d 100644 --- a/Makefile +++ b/Makefile @@ -2318,27 +2318,6 @@ endif LIBGRPC_SRC = \ - src/core/httpcli/httpcli_security_connector.c \ - src/core/security/base64.c \ - src/core/security/client_auth_filter.c \ - src/core/security/credentials.c \ - src/core/security/credentials_metadata.c \ - src/core/security/credentials_posix.c \ - src/core/security/credentials_win32.c \ - src/core/security/google_default_credentials.c \ - src/core/security/handshake.c \ - src/core/security/json_token.c \ - src/core/security/jwt_verifier.c \ - src/core/security/secure_endpoint.c \ - src/core/security/security_connector.c \ - src/core/security/security_context.c \ - src/core/security/server_auth_filter.c \ - src/core/security/server_secure_chttp2.c \ - src/core/surface/init_secure.c \ - src/core/surface/secure_channel_create.c \ - src/core/tsi/fake_transport_security.c \ - src/core/tsi/ssl_transport_security.c \ - src/core/tsi/transport_security.c \ src/core/census/grpc_context.c \ src/core/census/grpc_filter.c \ src/core/channel/channel_args.c \ @@ -2466,6 +2445,27 @@ LIBGRPC_SRC = \ src/core/transport/static_metadata.c \ src/core/transport/transport.c \ src/core/transport/transport_op_string.c \ + src/core/httpcli/httpcli_security_connector.c \ + src/core/security/base64.c \ + src/core/security/client_auth_filter.c \ + src/core/security/credentials.c \ + src/core/security/credentials_metadata.c \ + src/core/security/credentials_posix.c \ + src/core/security/credentials_win32.c \ + src/core/security/google_default_credentials.c \ + src/core/security/handshake.c \ + src/core/security/json_token.c \ + src/core/security/jwt_verifier.c \ + src/core/security/secure_endpoint.c \ + src/core/security/security_connector.c \ + src/core/security/security_context.c \ + src/core/security/server_auth_filter.c \ + src/core/security/server_secure_chttp2.c \ + src/core/surface/init_secure.c \ + src/core/surface/secure_channel_create.c \ + src/core/tsi/fake_transport_security.c \ + src/core/tsi/ssl_transport_security.c \ + src/core/tsi/transport_security.c \ src/core/census/context.c \ src/core/census/initialize.c \ src/core/census/log.c \ @@ -2541,7 +2541,6 @@ endif LIBGRPC_DLL_SRC = \ - grpc.def \ LIBGRPC_DLL_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC_DLL_SRC)))) @@ -12990,7 +12989,6 @@ ifneq ($(OPENSSL_DEP),) # This is to ensure the embedded OpenSSL is built beforehand, properly # installing headers to their final destination on the drive. We need this # otherwise parallel compilation will fail if a source is compiled first. -grpc.def: $(OPENSSL_DEP) src/core/httpcli/httpcli_security_connector.c: $(OPENSSL_DEP) src/core/security/base64.c: $(OPENSSL_DEP) src/core/security/client_auth_filter.c: $(OPENSSL_DEP) diff --git a/binding.gyp b/binding.gyp index 6d7f75ece4a15..59356d30637ff 100644 --- a/binding.gyp +++ b/binding.gyp @@ -557,27 +557,6 @@ 'gpr', ], 'sources': [ - 'src/core/httpcli/httpcli_security_connector.c', - 'src/core/security/base64.c', - 'src/core/security/client_auth_filter.c', - 'src/core/security/credentials.c', - 'src/core/security/credentials_metadata.c', - 'src/core/security/credentials_posix.c', - 'src/core/security/credentials_win32.c', - 'src/core/security/google_default_credentials.c', - 'src/core/security/handshake.c', - 'src/core/security/json_token.c', - 'src/core/security/jwt_verifier.c', - 'src/core/security/secure_endpoint.c', - 'src/core/security/security_connector.c', - 'src/core/security/security_context.c', - 'src/core/security/server_auth_filter.c', - 'src/core/security/server_secure_chttp2.c', - 'src/core/surface/init_secure.c', - 'src/core/surface/secure_channel_create.c', - 'src/core/tsi/fake_transport_security.c', - 'src/core/tsi/ssl_transport_security.c', - 'src/core/tsi/transport_security.c', 'src/core/census/grpc_context.c', 'src/core/census/grpc_filter.c', 'src/core/channel/channel_args.c', @@ -705,6 +684,27 @@ 'src/core/transport/static_metadata.c', 'src/core/transport/transport.c', 'src/core/transport/transport_op_string.c', + 'src/core/httpcli/httpcli_security_connector.c', + 'src/core/security/base64.c', + 'src/core/security/client_auth_filter.c', + 'src/core/security/credentials.c', + 'src/core/security/credentials_metadata.c', + 'src/core/security/credentials_posix.c', + 'src/core/security/credentials_win32.c', + 'src/core/security/google_default_credentials.c', + 'src/core/security/handshake.c', + 'src/core/security/json_token.c', + 'src/core/security/jwt_verifier.c', + 'src/core/security/secure_endpoint.c', + 'src/core/security/security_connector.c', + 'src/core/security/security_context.c', + 'src/core/security/server_auth_filter.c', + 'src/core/security/server_secure_chttp2.c', + 'src/core/surface/init_secure.c', + 'src/core/surface/secure_channel_create.c', + 'src/core/tsi/fake_transport_security.c', + 'src/core/tsi/ssl_transport_security.c', + 'src/core/tsi/transport_security.c', 'src/core/census/context.c', 'src/core/census/initialize.c', 'src/core/census/log.c', diff --git a/build.yaml b/build.yaml index 5a42e1386a338..de741d6cb6a09 100644 --- a/build.yaml +++ b/build.yaml @@ -493,6 +493,44 @@ filegroups: - include/grpc/impl/codegen/grpc_types.h - include/grpc/impl/codegen/propagation_bits.h - include/grpc/impl/codegen/status.h +- name: grpc_secure + headers: + - src/core/security/auth_filters.h + - src/core/security/base64.h + - src/core/security/credentials.h + - src/core/security/handshake.h + - src/core/security/json_token.h + - src/core/security/jwt_verifier.h + - src/core/security/secure_endpoint.h + - src/core/security/security_connector.h + - src/core/security/security_context.h + - src/core/tsi/fake_transport_security.h + - src/core/tsi/ssl_transport_security.h + - src/core/tsi/ssl_types.h + - src/core/tsi/transport_security.h + - src/core/tsi/transport_security_interface.h + src: + - src/core/httpcli/httpcli_security_connector.c + - src/core/security/base64.c + - src/core/security/client_auth_filter.c + - src/core/security/credentials.c + - src/core/security/credentials_metadata.c + - src/core/security/credentials_posix.c + - src/core/security/credentials_win32.c + - src/core/security/google_default_credentials.c + - src/core/security/handshake.c + - src/core/security/json_token.c + - src/core/security/jwt_verifier.c + - src/core/security/secure_endpoint.c + - src/core/security/security_connector.c + - src/core/security/security_context.c + - src/core/security/server_auth_filter.c + - src/core/security/server_secure_chttp2.c + - src/core/surface/init_secure.c + - src/core/surface/secure_channel_create.c + - src/core/tsi/fake_transport_security.c + - src/core/tsi/ssl_transport_security.c + - src/core/tsi/transport_security.c - name: grpc_test_util_base headers: - test/core/end2end/cq_verifier.h @@ -536,43 +574,6 @@ libs: language: c public_headers: - include/grpc/grpc_security.h - headers: - - src/core/security/auth_filters.h - - src/core/security/base64.h - - src/core/security/credentials.h - - src/core/security/handshake.h - - src/core/security/json_token.h - - src/core/security/jwt_verifier.h - - src/core/security/secure_endpoint.h - - src/core/security/security_connector.h - - src/core/security/security_context.h - - src/core/tsi/fake_transport_security.h - - src/core/tsi/ssl_transport_security.h - - src/core/tsi/ssl_types.h - - src/core/tsi/transport_security.h - - src/core/tsi/transport_security_interface.h - src: - - src/core/httpcli/httpcli_security_connector.c - - src/core/security/base64.c - - src/core/security/client_auth_filter.c - - src/core/security/credentials.c - - src/core/security/credentials_metadata.c - - src/core/security/credentials_posix.c - - src/core/security/credentials_win32.c - - src/core/security/google_default_credentials.c - - src/core/security/handshake.c - - src/core/security/json_token.c - - src/core/security/jwt_verifier.c - - src/core/security/secure_endpoint.c - - src/core/security/security_connector.c - - src/core/security/security_context.c - - src/core/security/server_auth_filter.c - - src/core/security/server_secure_chttp2.c - - src/core/surface/init_secure.c - - src/core/surface/secure_channel_create.c - - src/core/tsi/fake_transport_security.c - - src/core/tsi/ssl_transport_security.c - - src/core/tsi/transport_security.c deps: - gpr baselib: true @@ -581,6 +582,7 @@ libs: filegroups: - grpc_codegen - grpc_base + - grpc_secure - census secure: true vs_packages: @@ -590,13 +592,12 @@ libs: - name: grpc_dll build: private language: c - src: - - grpc.def + src: [] deps: - - grpc - gpr + - grpc deps_linkage: static - dll: only + dll_def: grpc.def vs_config_type: DynamicLibrary vs_packages: - grpc.dependencies.openssl diff --git a/gRPC.podspec b/gRPC.podspec index c930bbd994540..036deeaaf1186 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -158,20 +158,6 @@ Pod::Spec.new do |s| 'src/core/support/time_win32.c', 'src/core/support/tls_pthread.c', 'src/core/support/wrap_memcpy.c', - 'src/core/security/auth_filters.h', - 'src/core/security/base64.h', - 'src/core/security/credentials.h', - 'src/core/security/handshake.h', - 'src/core/security/json_token.h', - 'src/core/security/jwt_verifier.h', - 'src/core/security/secure_endpoint.h', - 'src/core/security/security_connector.h', - 'src/core/security/security_context.h', - 'src/core/tsi/fake_transport_security.h', - 'src/core/tsi/ssl_transport_security.h', - 'src/core/tsi/ssl_types.h', - 'src/core/tsi/transport_security.h', - 'src/core/tsi/transport_security_interface.h', 'src/core/census/grpc_filter.h', 'src/core/channel/channel_args.h', 'src/core/channel/channel_stack.h', @@ -285,6 +271,20 @@ Pod::Spec.new do |s| 'src/core/transport/static_metadata.h', 'src/core/transport/transport.h', 'src/core/transport/transport_impl.h', + 'src/core/security/auth_filters.h', + 'src/core/security/base64.h', + 'src/core/security/credentials.h', + 'src/core/security/handshake.h', + 'src/core/security/json_token.h', + 'src/core/security/jwt_verifier.h', + 'src/core/security/secure_endpoint.h', + 'src/core/security/security_connector.h', + 'src/core/security/security_context.h', + 'src/core/tsi/fake_transport_security.h', + 'src/core/tsi/ssl_transport_security.h', + 'src/core/tsi/ssl_types.h', + 'src/core/tsi/transport_security.h', + 'src/core/tsi/transport_security_interface.h', 'src/core/census/aggregation.h', 'src/core/census/log.h', 'src/core/census/rpc_metric_id.h', @@ -301,27 +301,6 @@ Pod::Spec.new do |s| 'include/grpc/grpc.h', 'include/grpc/status.h', 'include/grpc/census.h', - 'src/core/httpcli/httpcli_security_connector.c', - 'src/core/security/base64.c', - 'src/core/security/client_auth_filter.c', - 'src/core/security/credentials.c', - 'src/core/security/credentials_metadata.c', - 'src/core/security/credentials_posix.c', - 'src/core/security/credentials_win32.c', - 'src/core/security/google_default_credentials.c', - 'src/core/security/handshake.c', - 'src/core/security/json_token.c', - 'src/core/security/jwt_verifier.c', - 'src/core/security/secure_endpoint.c', - 'src/core/security/security_connector.c', - 'src/core/security/security_context.c', - 'src/core/security/server_auth_filter.c', - 'src/core/security/server_secure_chttp2.c', - 'src/core/surface/init_secure.c', - 'src/core/surface/secure_channel_create.c', - 'src/core/tsi/fake_transport_security.c', - 'src/core/tsi/ssl_transport_security.c', - 'src/core/tsi/transport_security.c', 'src/core/census/grpc_context.c', 'src/core/census/grpc_filter.c', 'src/core/channel/channel_args.c', @@ -449,6 +428,27 @@ Pod::Spec.new do |s| 'src/core/transport/static_metadata.c', 'src/core/transport/transport.c', 'src/core/transport/transport_op_string.c', + 'src/core/httpcli/httpcli_security_connector.c', + 'src/core/security/base64.c', + 'src/core/security/client_auth_filter.c', + 'src/core/security/credentials.c', + 'src/core/security/credentials_metadata.c', + 'src/core/security/credentials_posix.c', + 'src/core/security/credentials_win32.c', + 'src/core/security/google_default_credentials.c', + 'src/core/security/handshake.c', + 'src/core/security/json_token.c', + 'src/core/security/jwt_verifier.c', + 'src/core/security/secure_endpoint.c', + 'src/core/security/security_connector.c', + 'src/core/security/security_context.c', + 'src/core/security/server_auth_filter.c', + 'src/core/security/server_secure_chttp2.c', + 'src/core/surface/init_secure.c', + 'src/core/surface/secure_channel_create.c', + 'src/core/tsi/fake_transport_security.c', + 'src/core/tsi/ssl_transport_security.c', + 'src/core/tsi/transport_security.c', 'src/core/census/context.c', 'src/core/census/initialize.c', 'src/core/census/log.c', @@ -466,20 +466,6 @@ Pod::Spec.new do |s| 'src/core/support/string_win32.h', 'src/core/support/thd_internal.h', 'src/core/support/time_precise.h', - 'src/core/security/auth_filters.h', - 'src/core/security/base64.h', - 'src/core/security/credentials.h', - 'src/core/security/handshake.h', - 'src/core/security/json_token.h', - 'src/core/security/jwt_verifier.h', - 'src/core/security/secure_endpoint.h', - 'src/core/security/security_connector.h', - 'src/core/security/security_context.h', - 'src/core/tsi/fake_transport_security.h', - 'src/core/tsi/ssl_transport_security.h', - 'src/core/tsi/ssl_types.h', - 'src/core/tsi/transport_security.h', - 'src/core/tsi/transport_security_interface.h', 'src/core/census/grpc_filter.h', 'src/core/channel/channel_args.h', 'src/core/channel/channel_stack.h', @@ -593,6 +579,20 @@ Pod::Spec.new do |s| 'src/core/transport/static_metadata.h', 'src/core/transport/transport.h', 'src/core/transport/transport_impl.h', + 'src/core/security/auth_filters.h', + 'src/core/security/base64.h', + 'src/core/security/credentials.h', + 'src/core/security/handshake.h', + 'src/core/security/json_token.h', + 'src/core/security/jwt_verifier.h', + 'src/core/security/secure_endpoint.h', + 'src/core/security/security_connector.h', + 'src/core/security/security_context.h', + 'src/core/tsi/fake_transport_security.h', + 'src/core/tsi/ssl_transport_security.h', + 'src/core/tsi/ssl_types.h', + 'src/core/tsi/transport_security.h', + 'src/core/tsi/transport_security_interface.h', 'src/core/census/aggregation.h', 'src/core/census/log.h', 'src/core/census/rpc_metric_id.h' diff --git a/grpc.gemspec b/grpc.gemspec index 4a4a928f4ede2..792222a2ce104 100755 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -154,20 +154,6 @@ Gem::Specification.new do |s| s.files += %w( include/grpc/grpc.h ) s.files += %w( include/grpc/status.h ) s.files += %w( include/grpc/census.h ) - s.files += %w( src/core/security/auth_filters.h ) - s.files += %w( src/core/security/base64.h ) - s.files += %w( src/core/security/credentials.h ) - s.files += %w( src/core/security/handshake.h ) - s.files += %w( src/core/security/json_token.h ) - s.files += %w( src/core/security/jwt_verifier.h ) - s.files += %w( src/core/security/secure_endpoint.h ) - s.files += %w( src/core/security/security_connector.h ) - s.files += %w( src/core/security/security_context.h ) - s.files += %w( src/core/tsi/fake_transport_security.h ) - s.files += %w( src/core/tsi/ssl_transport_security.h ) - s.files += %w( src/core/tsi/ssl_types.h ) - s.files += %w( src/core/tsi/transport_security.h ) - s.files += %w( src/core/tsi/transport_security_interface.h ) s.files += %w( src/core/census/grpc_filter.h ) s.files += %w( src/core/channel/channel_args.h ) s.files += %w( src/core/channel/channel_stack.h ) @@ -281,30 +267,23 @@ Gem::Specification.new do |s| s.files += %w( src/core/transport/static_metadata.h ) s.files += %w( src/core/transport/transport.h ) s.files += %w( src/core/transport/transport_impl.h ) + s.files += %w( src/core/security/auth_filters.h ) + s.files += %w( src/core/security/base64.h ) + s.files += %w( src/core/security/credentials.h ) + s.files += %w( src/core/security/handshake.h ) + s.files += %w( src/core/security/json_token.h ) + s.files += %w( src/core/security/jwt_verifier.h ) + s.files += %w( src/core/security/secure_endpoint.h ) + s.files += %w( src/core/security/security_connector.h ) + s.files += %w( src/core/security/security_context.h ) + s.files += %w( src/core/tsi/fake_transport_security.h ) + s.files += %w( src/core/tsi/ssl_transport_security.h ) + s.files += %w( src/core/tsi/ssl_types.h ) + s.files += %w( src/core/tsi/transport_security.h ) + s.files += %w( src/core/tsi/transport_security_interface.h ) s.files += %w( src/core/census/aggregation.h ) s.files += %w( src/core/census/log.h ) s.files += %w( src/core/census/rpc_metric_id.h ) - s.files += %w( src/core/httpcli/httpcli_security_connector.c ) - s.files += %w( src/core/security/base64.c ) - s.files += %w( src/core/security/client_auth_filter.c ) - s.files += %w( src/core/security/credentials.c ) - s.files += %w( src/core/security/credentials_metadata.c ) - s.files += %w( src/core/security/credentials_posix.c ) - s.files += %w( src/core/security/credentials_win32.c ) - s.files += %w( src/core/security/google_default_credentials.c ) - s.files += %w( src/core/security/handshake.c ) - s.files += %w( src/core/security/json_token.c ) - s.files += %w( src/core/security/jwt_verifier.c ) - s.files += %w( src/core/security/secure_endpoint.c ) - s.files += %w( src/core/security/security_connector.c ) - s.files += %w( src/core/security/security_context.c ) - s.files += %w( src/core/security/server_auth_filter.c ) - s.files += %w( src/core/security/server_secure_chttp2.c ) - s.files += %w( src/core/surface/init_secure.c ) - s.files += %w( src/core/surface/secure_channel_create.c ) - s.files += %w( src/core/tsi/fake_transport_security.c ) - s.files += %w( src/core/tsi/ssl_transport_security.c ) - s.files += %w( src/core/tsi/transport_security.c ) s.files += %w( src/core/census/grpc_context.c ) s.files += %w( src/core/census/grpc_filter.c ) s.files += %w( src/core/channel/channel_args.c ) @@ -432,6 +411,27 @@ Gem::Specification.new do |s| s.files += %w( src/core/transport/static_metadata.c ) s.files += %w( src/core/transport/transport.c ) s.files += %w( src/core/transport/transport_op_string.c ) + s.files += %w( src/core/httpcli/httpcli_security_connector.c ) + s.files += %w( src/core/security/base64.c ) + s.files += %w( src/core/security/client_auth_filter.c ) + s.files += %w( src/core/security/credentials.c ) + s.files += %w( src/core/security/credentials_metadata.c ) + s.files += %w( src/core/security/credentials_posix.c ) + s.files += %w( src/core/security/credentials_win32.c ) + s.files += %w( src/core/security/google_default_credentials.c ) + s.files += %w( src/core/security/handshake.c ) + s.files += %w( src/core/security/json_token.c ) + s.files += %w( src/core/security/jwt_verifier.c ) + s.files += %w( src/core/security/secure_endpoint.c ) + s.files += %w( src/core/security/security_connector.c ) + s.files += %w( src/core/security/security_context.c ) + s.files += %w( src/core/security/server_auth_filter.c ) + s.files += %w( src/core/security/server_secure_chttp2.c ) + s.files += %w( src/core/surface/init_secure.c ) + s.files += %w( src/core/surface/secure_channel_create.c ) + s.files += %w( src/core/tsi/fake_transport_security.c ) + s.files += %w( src/core/tsi/ssl_transport_security.c ) + s.files += %w( src/core/tsi/transport_security.c ) s.files += %w( src/core/census/context.c ) s.files += %w( src/core/census/initialize.c ) s.files += %w( src/core/census/log.c ) diff --git a/package.json b/package.json index f814e3ccd5001..0feb027071714 100644 --- a/package.json +++ b/package.json @@ -99,20 +99,6 @@ "include/grpc/grpc.h", "include/grpc/status.h", "include/grpc/census.h", - "src/core/security/auth_filters.h", - "src/core/security/base64.h", - "src/core/security/credentials.h", - "src/core/security/handshake.h", - "src/core/security/json_token.h", - "src/core/security/jwt_verifier.h", - "src/core/security/secure_endpoint.h", - "src/core/security/security_connector.h", - "src/core/security/security_context.h", - "src/core/tsi/fake_transport_security.h", - "src/core/tsi/ssl_transport_security.h", - "src/core/tsi/ssl_types.h", - "src/core/tsi/transport_security.h", - "src/core/tsi/transport_security_interface.h", "src/core/census/grpc_filter.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", @@ -226,30 +212,23 @@ "src/core/transport/static_metadata.h", "src/core/transport/transport.h", "src/core/transport/transport_impl.h", + "src/core/security/auth_filters.h", + "src/core/security/base64.h", + "src/core/security/credentials.h", + "src/core/security/handshake.h", + "src/core/security/json_token.h", + "src/core/security/jwt_verifier.h", + "src/core/security/secure_endpoint.h", + "src/core/security/security_connector.h", + "src/core/security/security_context.h", + "src/core/tsi/fake_transport_security.h", + "src/core/tsi/ssl_transport_security.h", + "src/core/tsi/ssl_types.h", + "src/core/tsi/transport_security.h", + "src/core/tsi/transport_security_interface.h", "src/core/census/aggregation.h", "src/core/census/log.h", "src/core/census/rpc_metric_id.h", - "src/core/httpcli/httpcli_security_connector.c", - "src/core/security/base64.c", - "src/core/security/client_auth_filter.c", - "src/core/security/credentials.c", - "src/core/security/credentials_metadata.c", - "src/core/security/credentials_posix.c", - "src/core/security/credentials_win32.c", - "src/core/security/google_default_credentials.c", - "src/core/security/handshake.c", - "src/core/security/json_token.c", - "src/core/security/jwt_verifier.c", - "src/core/security/secure_endpoint.c", - "src/core/security/security_connector.c", - "src/core/security/security_context.c", - "src/core/security/server_auth_filter.c", - "src/core/security/server_secure_chttp2.c", - "src/core/surface/init_secure.c", - "src/core/surface/secure_channel_create.c", - "src/core/tsi/fake_transport_security.c", - "src/core/tsi/ssl_transport_security.c", - "src/core/tsi/transport_security.c", "src/core/census/grpc_context.c", "src/core/census/grpc_filter.c", "src/core/channel/channel_args.c", @@ -377,6 +356,27 @@ "src/core/transport/static_metadata.c", "src/core/transport/transport.c", "src/core/transport/transport_op_string.c", + "src/core/httpcli/httpcli_security_connector.c", + "src/core/security/base64.c", + "src/core/security/client_auth_filter.c", + "src/core/security/credentials.c", + "src/core/security/credentials_metadata.c", + "src/core/security/credentials_posix.c", + "src/core/security/credentials_win32.c", + "src/core/security/google_default_credentials.c", + "src/core/security/handshake.c", + "src/core/security/json_token.c", + "src/core/security/jwt_verifier.c", + "src/core/security/secure_endpoint.c", + "src/core/security/security_connector.c", + "src/core/security/security_context.c", + "src/core/security/server_auth_filter.c", + "src/core/security/server_secure_chttp2.c", + "src/core/surface/init_secure.c", + "src/core/surface/secure_channel_create.c", + "src/core/tsi/fake_transport_security.c", + "src/core/tsi/ssl_transport_security.c", + "src/core/tsi/transport_security.c", "src/core/census/context.c", "src/core/census/initialize.c", "src/core/census/log.c", diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 632a7c4c081e2..976bfff60c8d5 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -73,27 +73,6 @@ 'src/core/support/time_win32.c', 'src/core/support/tls_pthread.c', 'src/core/support/wrap_memcpy.c', - 'src/core/httpcli/httpcli_security_connector.c', - 'src/core/security/base64.c', - 'src/core/security/client_auth_filter.c', - 'src/core/security/credentials.c', - 'src/core/security/credentials_metadata.c', - 'src/core/security/credentials_posix.c', - 'src/core/security/credentials_win32.c', - 'src/core/security/google_default_credentials.c', - 'src/core/security/handshake.c', - 'src/core/security/json_token.c', - 'src/core/security/jwt_verifier.c', - 'src/core/security/secure_endpoint.c', - 'src/core/security/security_connector.c', - 'src/core/security/security_context.c', - 'src/core/security/server_auth_filter.c', - 'src/core/security/server_secure_chttp2.c', - 'src/core/surface/init_secure.c', - 'src/core/surface/secure_channel_create.c', - 'src/core/tsi/fake_transport_security.c', - 'src/core/tsi/ssl_transport_security.c', - 'src/core/tsi/transport_security.c', 'src/core/census/grpc_context.c', 'src/core/census/grpc_filter.c', 'src/core/channel/channel_args.c', @@ -221,6 +200,27 @@ 'src/core/transport/static_metadata.c', 'src/core/transport/transport.c', 'src/core/transport/transport_op_string.c', + 'src/core/httpcli/httpcli_security_connector.c', + 'src/core/security/base64.c', + 'src/core/security/client_auth_filter.c', + 'src/core/security/credentials.c', + 'src/core/security/credentials_metadata.c', + 'src/core/security/credentials_posix.c', + 'src/core/security/credentials_win32.c', + 'src/core/security/google_default_credentials.c', + 'src/core/security/handshake.c', + 'src/core/security/json_token.c', + 'src/core/security/jwt_verifier.c', + 'src/core/security/secure_endpoint.c', + 'src/core/security/security_connector.c', + 'src/core/security/security_context.c', + 'src/core/security/server_auth_filter.c', + 'src/core/security/server_secure_chttp2.c', + 'src/core/surface/init_secure.c', + 'src/core/surface/secure_channel_create.c', + 'src/core/tsi/fake_transport_security.c', + 'src/core/tsi/ssl_transport_security.c', + 'src/core/tsi/transport_security.c', 'src/core/census/context.c', 'src/core/census/initialize.c', 'src/core/census/log.c', diff --git a/templates/vsprojects/vcxproj.filters_defs.include b/templates/vsprojects/vcxproj.filters_defs.include index 7e2fbac147bf9..e7df8db76378c 100644 --- a/templates/vsprojects/vcxproj.filters_defs.include +++ b/templates/vsprojects/vcxproj.filters_defs.include @@ -23,6 +23,11 @@ % endfor % endif + % if project.get('dll_def', None): + + + + % endif % if project.get('public_headers',[]): % for public_header in project.public_headers: diff --git a/templates/vsprojects/vcxproj_defs.include b/templates/vsprojects/vcxproj_defs.include index b57c27f76aa45..e598f1319b845 100644 --- a/templates/vsprojects/vcxproj_defs.include +++ b/templates/vsprojects/vcxproj_defs.include @@ -2,6 +2,9 @@ <%def name="to_windows_path(path)">${path.replace('/','\\')}\ <%def name="get_subsystem(is_library)">${'Windows' if is_library else 'Console'}\ <%def name="item_definition_group(project, target, debug, dll, _64bit)">\ +<% + repo_root = '$(SolutionDir)\..' +%>\ NotUsing @@ -23,6 +26,12 @@ ${get_subsystem(project.is_library)} true false +% if project.get("noentry", False): + true +% endif +% if project.get("dll_def", None): + ${repo_root}\${to_windows_path(project.dll_def)} +% endif % if not debug: true true @@ -194,6 +203,11 @@ ${gen_package_props(packages, repo_root)}\ % endfor % endif + % if project.get('dll_def', None): + + + + % endif % if project.get('src',[]): % for src_name in project.src: diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 502fe39844dcb..e49c67501b015 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -773,20 +773,6 @@ include/grpc/compression.h \ include/grpc/grpc.h \ include/grpc/status.h \ include/grpc/census.h \ -src/core/security/auth_filters.h \ -src/core/security/base64.h \ -src/core/security/credentials.h \ -src/core/security/handshake.h \ -src/core/security/json_token.h \ -src/core/security/jwt_verifier.h \ -src/core/security/secure_endpoint.h \ -src/core/security/security_connector.h \ -src/core/security/security_context.h \ -src/core/tsi/fake_transport_security.h \ -src/core/tsi/ssl_transport_security.h \ -src/core/tsi/ssl_types.h \ -src/core/tsi/transport_security.h \ -src/core/tsi/transport_security_interface.h \ src/core/census/grpc_filter.h \ src/core/channel/channel_args.h \ src/core/channel/channel_stack.h \ @@ -900,30 +886,23 @@ src/core/transport/metadata_batch.h \ src/core/transport/static_metadata.h \ src/core/transport/transport.h \ src/core/transport/transport_impl.h \ +src/core/security/auth_filters.h \ +src/core/security/base64.h \ +src/core/security/credentials.h \ +src/core/security/handshake.h \ +src/core/security/json_token.h \ +src/core/security/jwt_verifier.h \ +src/core/security/secure_endpoint.h \ +src/core/security/security_connector.h \ +src/core/security/security_context.h \ +src/core/tsi/fake_transport_security.h \ +src/core/tsi/ssl_transport_security.h \ +src/core/tsi/ssl_types.h \ +src/core/tsi/transport_security.h \ +src/core/tsi/transport_security_interface.h \ src/core/census/aggregation.h \ src/core/census/log.h \ src/core/census/rpc_metric_id.h \ -src/core/httpcli/httpcli_security_connector.c \ -src/core/security/base64.c \ -src/core/security/client_auth_filter.c \ -src/core/security/credentials.c \ -src/core/security/credentials_metadata.c \ -src/core/security/credentials_posix.c \ -src/core/security/credentials_win32.c \ -src/core/security/google_default_credentials.c \ -src/core/security/handshake.c \ -src/core/security/json_token.c \ -src/core/security/jwt_verifier.c \ -src/core/security/secure_endpoint.c \ -src/core/security/security_connector.c \ -src/core/security/security_context.c \ -src/core/security/server_auth_filter.c \ -src/core/security/server_secure_chttp2.c \ -src/core/surface/init_secure.c \ -src/core/surface/secure_channel_create.c \ -src/core/tsi/fake_transport_security.c \ -src/core/tsi/ssl_transport_security.c \ -src/core/tsi/transport_security.c \ src/core/census/grpc_context.c \ src/core/census/grpc_filter.c \ src/core/channel/channel_args.c \ @@ -1051,6 +1030,27 @@ src/core/transport/metadata_batch.c \ src/core/transport/static_metadata.c \ src/core/transport/transport.c \ src/core/transport/transport_op_string.c \ +src/core/httpcli/httpcli_security_connector.c \ +src/core/security/base64.c \ +src/core/security/client_auth_filter.c \ +src/core/security/credentials.c \ +src/core/security/credentials_metadata.c \ +src/core/security/credentials_posix.c \ +src/core/security/credentials_win32.c \ +src/core/security/google_default_credentials.c \ +src/core/security/handshake.c \ +src/core/security/json_token.c \ +src/core/security/jwt_verifier.c \ +src/core/security/secure_endpoint.c \ +src/core/security/security_connector.c \ +src/core/security/security_context.c \ +src/core/security/server_auth_filter.c \ +src/core/security/server_secure_chttp2.c \ +src/core/surface/init_secure.c \ +src/core/surface/secure_channel_create.c \ +src/core/tsi/fake_transport_security.c \ +src/core/tsi/ssl_transport_security.c \ +src/core/tsi/transport_security.c \ src/core/census/context.c \ src/core/census/initialize.c \ src/core/census/log.c \ diff --git a/tools/run_tests/build_artifact_python.bat b/tools/run_tests/build_artifact_python.bat index 525e1946240e2..4fc0749e7053d 100644 --- a/tools/run_tests/build_artifact_python.bat +++ b/tools/run_tests/build_artifact_python.bat @@ -27,6 +27,20 @@ @rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set NUGET=C:\nuget\nuget.exe +%NUGET% restore vsprojects\grpc.sln || goto :error + + +@call vsprojects\build_vs2013.bat vsprojects\grpc.sln /t:grpc_dll /p:Configuration=Release /p:PlatformToolset=v120 /p:Platform=Win32 || goto :error +@call vsprojects\build_vs2013.bat vsprojects\grpc.sln /t:grpc_dll /p:Configuration=Release /p:PlatformToolset=v120 /p:Platform=x64 || goto :error + +mkdir src\python\grpcio\grpc\_cython\_windows + +copy /Y vsprojects\Release\grpc_dll.dll src\python\grpcio\grpc\_cython\_windows\grpc_c.32.python || goto :error +copy /Y vsprojects\x64\Release\grpc_dll.dll src\python\grpcio\grpc\_cython\_windows\grpc_c.64.python || goto :error + + set PATH=%PATH%;C:\Python27\scripts pip install --upgrade six diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 028f7272e6e47..c4a0774d6ea0c 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -3422,9 +3422,7 @@ "headers": [], "language": "c", "name": "grpc_dll", - "src": [ - "grpc.def" - ] + "src": [] }, { "deps": [ diff --git a/vsprojects/buildtests_c.sln b/vsprojects/buildtests_c.sln index 0f754c1b843e0..3a337576d1e02 100644 --- a/vsprojects/buildtests_c.sln +++ b/vsprojects/buildtests_c.sln @@ -29,8 +29,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_dll", "vcxproj\.\grpc_ lib = "True" EndProjectSection ProjectSection(ProjectDependencies) = postProject - {29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9} {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + {29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_test_util", "vcxproj\.\grpc_test_util\grpc_test_util.vcxproj", "{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}" @@ -1388,14 +1388,18 @@ Global {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug|x64.ActiveCfg = Debug|x64 {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release|Win32.ActiveCfg = Release|Win32 {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release|x64.ActiveCfg = Release|x64 - {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|Win32.ActiveCfg = Debug-DLL|Win32 - {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|Win32.Build.0 = Debug-DLL|Win32 - {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|x64.ActiveCfg = Debug-DLL|x64 - {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|x64.Build.0 = Debug-DLL|x64 - {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|Win32.ActiveCfg = Release-DLL|Win32 - {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|Win32.Build.0 = Release-DLL|Win32 - {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|x64.ActiveCfg = Release-DLL|x64 - {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|x64.Build.0 = Release-DLL|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug|Win32.Build.0 = Debug|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug|x64.Build.0 = Debug|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release|Win32.Build.0 = Release|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release|x64.Build.0 = Release|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|Win32.ActiveCfg = Debug|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|Win32.Build.0 = Debug|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|x64.ActiveCfg = Debug|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|x64.Build.0 = Debug|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|Win32.ActiveCfg = Release|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|Win32.Build.0 = Release|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|x64.ActiveCfg = Release|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|x64.Build.0 = Release|x64 {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Debug|Win32.ActiveCfg = Debug|Win32 {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Debug|x64.ActiveCfg = Debug|x64 {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/vsprojects/grpc.sln b/vsprojects/grpc.sln index 41a227434f90a..3f6b3379728a7 100644 --- a/vsprojects/grpc.sln +++ b/vsprojects/grpc.sln @@ -29,8 +29,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_dll", "vcxproj\.\grpc_ lib = "True" EndProjectSection ProjectSection(ProjectDependencies) = postProject - {29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9} {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + {29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_test_util", "vcxproj\.\grpc_test_util\grpc_test_util.vcxproj", "{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}" @@ -233,14 +233,18 @@ Global {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug|x64.ActiveCfg = Debug|x64 {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release|Win32.ActiveCfg = Release|Win32 {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release|x64.ActiveCfg = Release|x64 - {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|Win32.ActiveCfg = Debug-DLL|Win32 - {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|Win32.Build.0 = Debug-DLL|Win32 - {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|x64.ActiveCfg = Debug-DLL|x64 - {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|x64.Build.0 = Debug-DLL|x64 - {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|Win32.ActiveCfg = Release-DLL|Win32 - {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|Win32.Build.0 = Release-DLL|Win32 - {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|x64.ActiveCfg = Release-DLL|x64 - {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|x64.Build.0 = Release-DLL|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug|Win32.Build.0 = Debug|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug|x64.Build.0 = Debug|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release|Win32.Build.0 = Release|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release|x64.Build.0 = Release|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|Win32.ActiveCfg = Debug|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|Win32.Build.0 = Debug|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|x64.ActiveCfg = Debug|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Debug-DLL|x64.Build.0 = Debug|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|Win32.ActiveCfg = Release|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|Win32.Build.0 = Release|Win32 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|x64.ActiveCfg = Release|x64 + {A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}.Release-DLL|x64.Build.0 = Release|x64 {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Debug|Win32.ActiveCfg = Debug|Win32 {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Debug|x64.ActiveCfg = Debug|x64 {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index faef347883fba..b364bad03f974 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -282,20 +282,6 @@ - - - - - - - - - - - - - - @@ -409,53 +395,25 @@ + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -710,6 +668,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index 9afcbf0053530..7c19b8ab4db78 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -1,69 +1,6 @@ - - src\core\httpcli - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\surface - - - src\core\surface - - - src\core\tsi - - - src\core\tsi - - - src\core\tsi - src\core\census @@ -445,6 +382,69 @@ src\core\transport + + src\core\httpcli + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\surface + + + src\core\surface + + + src\core\tsi + + + src\core\tsi + + + src\core\tsi + src\core\census @@ -506,48 +506,6 @@ - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\security - - - src\core\tsi - - - src\core\tsi - - - src\core\tsi - - - src\core\tsi - - - src\core\tsi - src\core\census @@ -887,6 +845,48 @@ src\core\transport + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\tsi + + + src\core\tsi + + + src\core\tsi + + + src\core\tsi + + + src\core\tsi + src\core\census diff --git a/vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj b/vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj index a4ba4fdff349b..cafc9518674a2 100644 --- a/vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj +++ b/vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj @@ -89,6 +89,7 @@ Windows true false + $(SolutionDir)\..\grpc.def @@ -108,6 +109,7 @@ Windows true false + $(SolutionDir)\..\grpc.def @@ -129,6 +131,7 @@ Windows true false + $(SolutionDir)\..\grpc.def true true @@ -152,22 +155,26 @@ Windows true false + $(SolutionDir)\..\grpc.def true true - + + + + - - {29D16885-7228-4C31-81ED-5F9187C7F2A9} - {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + + {29D16885-7228-4C31-81ED-5F9187C7F2A9} + diff --git a/vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj.filters b/vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj.filters index eb012a641d404..8493ace0a2486 100644 --- a/vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_dll/grpc_dll.vcxproj.filters @@ -1,15 +1,10 @@ - - - + - - {4e0e4342-caa8-2d9f-65d2-1430409e58a9} - From 17197ddc714d5268a6b1fca678ac8b94ed74f3bd Mon Sep 17 00:00:00 2001 From: yang-g Date: Fri, 19 Feb 2016 00:04:22 -0800 Subject: [PATCH 24/43] Revert "make an enum" This reverts commit 5152cd29f8541d7600b7ddc3d9db188ad59ea673. --- test/cpp/end2end/end2end_test.cc | 62 ++++++++-------------- test/cpp/util/test_credentials_provider.cc | 28 +++------- test/cpp/util/test_credentials_provider.h | 13 ++--- 3 files changed, 34 insertions(+), 69 deletions(-) diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index 2169afb8169bc..df9aae7436fc4 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -191,14 +191,14 @@ class TestServiceImplDupPkg class TestScenario { public: - TestScenario(bool proxy, TestCredentialsType type) - : use_proxy(proxy), credentials_type(type) {} + TestScenario(bool proxy, const grpc::string& creds_type) + : use_proxy(proxy), credentials_type(creds_type) {} void Log() const { gpr_log(GPR_INFO, "Scenario: proxy %d, credentials %s", use_proxy, - TestCredentialsTypeToString(credentials_type).c_str()); + credentials_type.c_str()); } bool use_proxy; - TestCredentialsType credentials_type; + const grpc::string credentials_type; }; class End2endTest : public ::testing::TestWithParam { @@ -223,7 +223,7 @@ class End2endTest : public ::testing::TestWithParam { // Setup server ServerBuilder builder; auto server_creds = GetServerCredentials(GetParam().credentials_type); - if (GetParam().credentials_type != INSECURE_CREDENTIALS) { + if (GetParam().credentials_type != kInsecureCredentialsType) { server_creds->SetAuthMetadataProcessor(processor); } builder.AddListeningPort(server_address_.str(), server_creds); @@ -933,7 +933,7 @@ TEST_P(End2endTest, ChannelState) { // Takes 10s. TEST_P(End2endTest, ChannelStateTimeout) { - if (GetParam().credentials_type != INSECURE_CREDENTIALS) { + if (GetParam().credentials_type != kInsecureCredentialsType) { return; } int port = grpc_pick_unused_port_or_die(); @@ -1142,7 +1142,7 @@ class SecureEnd2endTest : public End2endTest { protected: SecureEnd2endTest() { GPR_ASSERT(!GetParam().use_proxy); - GPR_ASSERT(GetParam().credentials_type != INSECURE_CREDENTIALS); + GPR_ASSERT(GetParam().credentials_type != kInsecureCredentialsType); } }; @@ -1365,43 +1365,25 @@ TEST_P(SecureEnd2endTest, ClientAuthContext) { EXPECT_EQ("*.test.youtube.com", ToString(auth_ctx->GetPeerIdentity()[2])); } -std::vector CreateTestScenarios(bool use_proxy, - bool test_insecure, - bool test_secure) { - std::vector scenarios; - for (int i = INSECURE_CREDENTIALS; i < MAX_CREDENTIALS_TYPE; i++) { - if (i == INSECURE_CREDENTIALS && !test_insecure) { - continue; - } - if (i != INSECURE_CREDENTIALS && !test_secure) { - continue; - } - if (use_proxy) { - scenarios.push_back( - TestScenario(true, static_cast(i))); - } - scenarios.push_back( - TestScenario(false, static_cast(i))); - } - GPR_ASSERT(!scenarios.empty()); - return scenarios; -} - -INSTANTIATE_TEST_CASE_P(End2end, End2endTest, - ::testing::ValuesIn(CreateTestScenarios(false, true, - true))); +INSTANTIATE_TEST_CASE_P( + End2end, End2endTest, + ::testing::Values(TestScenario(false, kInsecureCredentialsType), + TestScenario(false, kTlsCredentialsType))); -INSTANTIATE_TEST_CASE_P(End2endServerTryCancel, End2endServerTryCancelTest, - ::testing::ValuesIn(CreateTestScenarios(false, true, - false))); +INSTANTIATE_TEST_CASE_P( + End2endServerTryCancel, End2endServerTryCancelTest, + ::testing::Values(TestScenario(false, kInsecureCredentialsType))); -INSTANTIATE_TEST_CASE_P(ProxyEnd2end, ProxyEnd2endTest, - ::testing::ValuesIn(CreateTestScenarios(true, true, - true))); +INSTANTIATE_TEST_CASE_P( + ProxyEnd2end, ProxyEnd2endTest, + ::testing::Values(TestScenario(false, kInsecureCredentialsType), + TestScenario(false, kTlsCredentialsType), + TestScenario(true, kInsecureCredentialsType), + TestScenario(true, kTlsCredentialsType))); INSTANTIATE_TEST_CASE_P(SecureEnd2end, SecureEnd2endTest, - ::testing::ValuesIn(CreateTestScenarios(false, false, - true))); + ::testing::Values(TestScenario(false, + kTlsCredentialsType))); } // namespace } // namespace testing diff --git a/test/cpp/util/test_credentials_provider.cc b/test/cpp/util/test_credentials_provider.cc index 9746ca692a741..f8380cdb65a47 100644 --- a/test/cpp/util/test_credentials_provider.cc +++ b/test/cpp/util/test_credentials_provider.cc @@ -40,24 +40,24 @@ namespace grpc { namespace testing { std::shared_ptr GetChannelCredentials( - TestCredentialsType type, ChannelArguments* args) { - if (type == INSECURE_CREDENTIALS) { + const grpc::string& type, ChannelArguments* args) { + if (type == kInsecureCredentialsType) { return InsecureChannelCredentials(); - } else if (type == TLS_CREDENTIALS) { + } else if (type == kTlsCredentialsType) { SslCredentialsOptions ssl_opts = {test_root_cert, "", ""}; args->SetSslTargetNameOverride("foo.test.google.fr"); return SslCredentials(ssl_opts); } else { - gpr_log(GPR_ERROR, "Unsupported credentials type %d.", type); + gpr_log(GPR_ERROR, "Unsupported credentials type %s.", type.c_str()); } return nullptr; } std::shared_ptr GetServerCredentials( - TestCredentialsType type) { - if (type == INSECURE_CREDENTIALS) { + const grpc::string& type) { + if (type == kInsecureCredentialsType) { return InsecureServerCredentials(); - } else if (type == TLS_CREDENTIALS) { + } else if (type == kTlsCredentialsType) { SslServerCredentialsOptions::PemKeyCertPair pkcp = {test_server1_key, test_server1_cert}; SslServerCredentialsOptions ssl_opts; @@ -65,22 +65,10 @@ std::shared_ptr GetServerCredentials( ssl_opts.pem_key_cert_pairs.push_back(pkcp); return SslServerCredentials(ssl_opts); } else { - gpr_log(GPR_ERROR, "Unsupported credentials type %d.", type); + gpr_log(GPR_ERROR, "Unsupported credentials type %s.", type.c_str()); } return nullptr; } -grpc::string TestCredentialsTypeToString(TestCredentialsType type) { - switch (type) { - case INSECURE_CREDENTIALS: - return "INSECURE_CREDENTIALS"; - case TLS_CREDENTIALS: - return "TLS_CREDENTIALS"; - default: - break; - } - return "UNKNOWN"; -} - } // namespace testing } // namespace grpc diff --git a/test/cpp/util/test_credentials_provider.h b/test/cpp/util/test_credentials_provider.h index 005254a652137..4f25e3be66d30 100644 --- a/test/cpp/util/test_credentials_provider.h +++ b/test/cpp/util/test_credentials_provider.h @@ -43,22 +43,17 @@ namespace grpc { namespace testing { -enum TestCredentialsType { - INSECURE_CREDENTIALS = 0, - TLS_CREDENTIALS, - MAX_CREDENTIALS_TYPE -}; +const char kInsecureCredentialsType[] = "INSECURE_CREDENTIALS"; +const char kTlsCredentialsType[] = "TLS_CREDENTIALS"; // Provide channel credentials according to the given type. Alter the channel // arguments if needed. std::shared_ptr GetChannelCredentials( - TestCredentialsType type, ChannelArguments* args); + const grpc::string& type, ChannelArguments* args); // Provide server credentials according to the given type. std::shared_ptr GetServerCredentials( - TestCredentialsType type); - -grpc::string TestCredentialsTypeToString(TestCredentialsType type); + const grpc::string& type); } // namespace testing } // namespace grpc From 4c8aed3dbad9fdf749052a79d8f5f608bfb120fe Mon Sep 17 00:00:00 2001 From: yang-g Date: Fri, 19 Feb 2016 00:19:39 -0800 Subject: [PATCH 25/43] Add a helper to return all the secure types --- test/cpp/end2end/end2end_test.cc | 51 ++++++++++++++-------- test/cpp/util/test_credentials_provider.cc | 6 +++ test/cpp/util/test_credentials_provider.h | 3 ++ 3 files changed, 43 insertions(+), 17 deletions(-) diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index df9aae7436fc4..ce8e4d2a10976 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -1365,25 +1365,42 @@ TEST_P(SecureEnd2endTest, ClientAuthContext) { EXPECT_EQ("*.test.youtube.com", ToString(auth_ctx->GetPeerIdentity()[2])); } -INSTANTIATE_TEST_CASE_P( - End2end, End2endTest, - ::testing::Values(TestScenario(false, kInsecureCredentialsType), - TestScenario(false, kTlsCredentialsType))); - -INSTANTIATE_TEST_CASE_P( - End2endServerTryCancel, End2endServerTryCancelTest, - ::testing::Values(TestScenario(false, kInsecureCredentialsType))); - -INSTANTIATE_TEST_CASE_P( - ProxyEnd2end, ProxyEnd2endTest, - ::testing::Values(TestScenario(false, kInsecureCredentialsType), - TestScenario(false, kTlsCredentialsType), - TestScenario(true, kInsecureCredentialsType), - TestScenario(true, kTlsCredentialsType))); +std::vector CreateTestScenarios(bool use_proxy, + bool test_insecure, + bool test_secure) { + std::vector scenarios; + std::vector credentials_types; + if (test_secure) { + credentials_types = GetSecureCredentialsTypeList(); + } + if (test_insecure) { + credentials_types.push_back(kInsecureCredentialsType); + } + for (auto it = credentials_types.begin(); it != credentials_types.end(); + ++it) { + scenarios.push_back(TestScenario(false, *it)); + if (use_proxy) { + scenarios.push_back(TestScenario(true, *it)); + } + } + return scenarios; +} + +INSTANTIATE_TEST_CASE_P(End2end, End2endTest, + ::testing::ValuesIn(CreateTestScenarios(false, true, + true))); + +INSTANTIATE_TEST_CASE_P(End2endServerTryCancel, End2endServerTryCancelTest, + ::testing::ValuesIn(CreateTestScenarios(false, true, + false))); + +INSTANTIATE_TEST_CASE_P(ProxyEnd2end, ProxyEnd2endTest, + ::testing::ValuesIn(CreateTestScenarios(true, true, + true))); INSTANTIATE_TEST_CASE_P(SecureEnd2end, SecureEnd2endTest, - ::testing::Values(TestScenario(false, - kTlsCredentialsType))); + ::testing::ValuesIn(CreateTestScenarios(false, false, + true))); } // namespace } // namespace testing diff --git a/test/cpp/util/test_credentials_provider.cc b/test/cpp/util/test_credentials_provider.cc index f8380cdb65a47..69651700feb84 100644 --- a/test/cpp/util/test_credentials_provider.cc +++ b/test/cpp/util/test_credentials_provider.cc @@ -70,5 +70,11 @@ std::shared_ptr GetServerCredentials( return nullptr; } +std::vector GetSecureCredentialsTypeList() { + std::vector types; + types.push_back(kTlsCredentialsType); + return types; +} + } // namespace testing } // namespace grpc diff --git a/test/cpp/util/test_credentials_provider.h b/test/cpp/util/test_credentials_provider.h index 4f25e3be66d30..f4105d94b830f 100644 --- a/test/cpp/util/test_credentials_provider.h +++ b/test/cpp/util/test_credentials_provider.h @@ -55,6 +55,9 @@ std::shared_ptr GetChannelCredentials( std::shared_ptr GetServerCredentials( const grpc::string& type); +// Provide a list of secure credentials type. +std::vector GetSecureCredentialsTypeList(); + } // namespace testing } // namespace grpc From 12a0a2c20b5f377b4495d257ee961a111c3dff6e Mon Sep 17 00:00:00 2001 From: yang-g Date: Fri, 19 Feb 2016 00:22:20 -0800 Subject: [PATCH 26/43] move tls type name to .cc file --- test/cpp/util/test_credentials_provider.cc | 2 ++ test/cpp/util/test_credentials_provider.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/cpp/util/test_credentials_provider.cc b/test/cpp/util/test_credentials_provider.cc index 69651700feb84..1086e14258b0c 100644 --- a/test/cpp/util/test_credentials_provider.cc +++ b/test/cpp/util/test_credentials_provider.cc @@ -39,6 +39,8 @@ namespace grpc { namespace testing { +const char kTlsCredentialsType[] = "TLS_CREDENTIALS"; + std::shared_ptr GetChannelCredentials( const grpc::string& type, ChannelArguments* args) { if (type == kInsecureCredentialsType) { diff --git a/test/cpp/util/test_credentials_provider.h b/test/cpp/util/test_credentials_provider.h index f4105d94b830f..f7253051a97dd 100644 --- a/test/cpp/util/test_credentials_provider.h +++ b/test/cpp/util/test_credentials_provider.h @@ -44,7 +44,6 @@ namespace grpc { namespace testing { const char kInsecureCredentialsType[] = "INSECURE_CREDENTIALS"; -const char kTlsCredentialsType[] = "TLS_CREDENTIALS"; // Provide channel credentials according to the given type. Alter the channel // arguments if needed. From 021d1ed5ce2f55ffe15dc8755e5a5e59e791f833 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Fri, 19 Feb 2016 17:27:49 +0000 Subject: [PATCH 27/43] Skeleton Summer of Code ideas page --- summerofcode/ideas.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 summerofcode/ideas.md diff --git a/summerofcode/ideas.md b/summerofcode/ideas.md new file mode 100644 index 0000000000000..073262339b1df --- /dev/null +++ b/summerofcode/ideas.md @@ -0,0 +1,4 @@ +Google Summer of Code 2016 gRPC Ideas +===================================== + +(Skeleton for now.) From 090a251ea57bc5f6219f06aa8ac75193a0312279 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 19 Feb 2016 11:32:31 -0800 Subject: [PATCH 28/43] Node: fix metadata validation bug, improve error reporting --- src/node/ext/call_credentials.cc | 3 ++- src/node/ext/node_grpc.cc | 9 ++++++--- src/node/src/credentials.js | 5 +++++ src/node/src/metadata.js | 5 +++-- tools/run_tests/run_interop_tests.py | 24 ++++++++++++------------ 5 files changed, 28 insertions(+), 18 deletions(-) diff --git a/src/node/ext/call_credentials.cc b/src/node/ext/call_credentials.cc index 91acb8625477d..4bd0d1ab7df0e 100644 --- a/src/node/ext/call_credentials.cc +++ b/src/node/ext/call_credentials.cc @@ -187,7 +187,8 @@ NAN_METHOD(PluginCallback) { shared_ptr resources(new Resources); grpc_status_code code = static_cast( Nan::To(info[0]).FromJust()); - char *details = *Utf8String(info[1]); + Utf8String details_utf8_str(info[1]); + char *details = *details_utf8_str; grpc_metadata_array array; if (!CreateMetadataArray(Nan::To(info[2]).ToLocalChecked(), &array, resources)){ diff --git a/src/node/ext/node_grpc.cc b/src/node/ext/node_grpc.cc index 654c5aed09bcd..0c71b2d610d44 100644 --- a/src/node/ext/node_grpc.cc +++ b/src/node/ext/node_grpc.cc @@ -237,7 +237,8 @@ NAN_METHOD(MetadataKeyIsLegal) { "headerKeyIsLegal's argument must be a string"); } Local key = Nan::To(info[0]).ToLocalChecked(); - char *key_str = *Nan::Utf8String(key); + Nan::Utf8String key_utf8_str(key); + char *key_str = *key_utf8_str; info.GetReturnValue().Set(static_cast( grpc_header_key_is_legal(key_str, static_cast(key->Length())))); } @@ -248,7 +249,8 @@ NAN_METHOD(MetadataNonbinValueIsLegal) { "metadataNonbinValueIsLegal's argument must be a string"); } Local value = Nan::To(info[0]).ToLocalChecked(); - char *value_str = *Nan::Utf8String(value); + Nan::Utf8String value_utf8_str(value); + char *value_str = *value_utf8_str; info.GetReturnValue().Set(static_cast( grpc_header_nonbin_value_is_legal( value_str, static_cast(value->Length())))); @@ -260,7 +262,8 @@ NAN_METHOD(MetadataKeyIsBinary) { "metadataKeyIsLegal's argument must be a string"); } Local key = Nan::To(info[0]).ToLocalChecked(); - char *key_str = *Nan::Utf8String(key); + Nan::Utf8String key_utf8_str(key); + char *key_str = *key_utf8_str; info.GetReturnValue().Set(static_cast( grpc_is_binary_header(key_str, static_cast(key->Length())))); } diff --git a/src/node/src/credentials.js b/src/node/src/credentials.js index 710ab6d879cd3..1d73723cc0645 100644 --- a/src/node/src/credentials.js +++ b/src/node/src/credentials.js @@ -98,6 +98,8 @@ exports.createFromMetadataGenerator = function(metadata_generator) { message = error.message; if (error.hasOwnProperty('code')) { code = error.code; + } else { + code = grpc.status.UNAUTHENTICATED; } if (!metadata) { metadata = new Metadata(); @@ -116,13 +118,16 @@ exports.createFromMetadataGenerator = function(metadata_generator) { exports.createFromGoogleCredential = function(google_credential) { return exports.createFromMetadataGenerator(function(auth_context, callback) { var service_url = auth_context.service_url; + console.log('Service URL:', service_url); google_credential.getRequestMetadata(service_url, function(err, header) { if (err) { + console.log('Auth error:', err); callback(err); return; } var metadata = new Metadata(); metadata.add('authorization', header.Authorization); + console.log(header.Authorization); callback(null, metadata); }); }); diff --git a/src/node/src/metadata.js b/src/node/src/metadata.js index 51a9f8a21622d..33d7ea1cf7a82 100644 --- a/src/node/src/metadata.js +++ b/src/node/src/metadata.js @@ -64,7 +64,7 @@ function normalizeKey(key) { if (grpc.metadataKeyIsLegal(key)) { return key; } else { - throw new Error('Metadata key contains illegal characters'); + throw new Error('Metadata key"' + key + '" contains illegal characters'); } } @@ -79,7 +79,8 @@ function validate(key, value) { 'keys that don\'t end with \'-bin\' must have String values'); } if (!grpc.metadataNonbinValueIsLegal(value)) { - throw new Error('Metadata string value contains illegal characters'); + throw new Error('Metadata string value "' + value + + '" contains illegal characters'); } } } diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index 76be932aeff47..df3ab90a839fa 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -422,7 +422,7 @@ def _job_kill_handler(job): time.sleep(2) -def cloud_to_prod_jobspec(language, test_case, server_host_name, +def cloud_to_prod_jobspec(language, test_case, server_host_name, server_host_detail, docker_image=None, auth=False): """Creates jobspec for cloud-to-prod interop test""" container_name = None @@ -441,7 +441,7 @@ def cloud_to_prod_jobspec(language, test_case, server_host_name, cwd = language.client_cwd if docker_image: - container_name = dockerjob.random_name('interop_client_%s' % + container_name = dockerjob.random_name('interop_client_%s' % language.safename) cmdline = docker_run_cmdline(cmdline, image=docker_image, @@ -457,7 +457,7 @@ def cloud_to_prod_jobspec(language, test_case, server_host_name, cmdline=cmdline, cwd=cwd, environ=environ, - shortname='%s:%s:%s:%s' % (suite_name, server_host_name, language, + shortname='%s:%s:%s:%s' % (suite_name, server_host_name, language, test_case), timeout_seconds=90, flake_retries=5 if args.allow_flakes else 0, @@ -575,18 +575,18 @@ def aggregate_http2_results(stdout): 'percent': 1.0 * passed / (passed + failed) } -# A dictionary of prod servers to test. +# A dictionary of prod servers to test. # Format: server_name: (server_host, server_host_override, errors_allowed) # TODO(adelez): implement logic for errors_allowed where if the indicated tests # fail, they don't impact the overall test result. prod_servers = { - 'default': ('grpc-test.sandbox.googleapis.com', + 'default': ('grpc-test.sandbox.googleapis.com', 'grpc-test.sandbox.googleapis.com', False), - 'gateway_v2': ('grpc-test2.sandbox.googleapis.com', + 'gateway_v2': ('grpc-test2.sandbox.googleapis.com', 'grpc-test2.sandbox.googleapis.com', True), - 'cloud_gateway': ('216.239.32.255', 'grpc-test.sandbox.googleapis.com', + 'cloud_gateway': ('216.239.32.255', 'grpc-test.sandbox.googleapis.com', False), - 'cloud_gateway_v2': ('216.239.32.255', 'grpc-test2.sandbox.googleapis.com', + 'cloud_gateway_v2': ('216.239.32.255', 'grpc-test2.sandbox.googleapis.com', True) } @@ -720,7 +720,7 @@ def aggregate_http2_results(stdout): if not test_case in language.unimplemented_test_cases(): if not test_case in _SKIP_ADVANCED + _SKIP_COMPRESSION: test_job = cloud_to_prod_jobspec( - language, test_case, server_host_name, + language, test_case, server_host_name, prod_servers[server_host_name], docker_image=docker_images.get(str(language))) jobs.append(test_job) @@ -728,7 +728,7 @@ def aggregate_http2_results(stdout): if args.http2_interop: for test_case in _HTTP2_TEST_CASES: test_job = cloud_to_prod_jobspec( - http2Interop, test_case, server_host_name, + http2Interop, test_case, server_host_name, prod_servers[server_host_name], docker_image=docker_images.get(str(http2Interop))) jobs.append(test_job) @@ -739,7 +739,7 @@ def aggregate_http2_results(stdout): for test_case in _AUTH_TEST_CASES: if not test_case in language.unimplemented_test_cases(): test_job = cloud_to_prod_jobspec( - language, test_case, server_host_name, + language, test_case, server_host_name, prod_servers[server_host_name], docker_image=docker_images.get(str(language)), auth=True) jobs.append(test_job) @@ -802,7 +802,7 @@ def aggregate_http2_results(stdout): report_utils.render_interop_html_report( set([str(l) for l in languages]), servers, _TEST_CASES, _AUTH_TEST_CASES, _HTTP2_TEST_CASES, resultset, num_failures, - args.cloud_to_prod_auth or args.cloud_to_prod, args.prod_servers, + args.cloud_to_prod_auth or args.cloud_to_prod, args.prod_servers, args.http2_interop) finally: From bcd78fe845853780ac3d32a5f175f4bfd451837e Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Fri, 19 Feb 2016 15:39:16 -0800 Subject: [PATCH 29/43] Added missing virtual dtor --- include/grpc++/impl/codegen/call.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h index e65349ddd3a2d..5e450b0d248a3 100644 --- a/include/grpc++/impl/codegen/call.h +++ b/include/grpc++/impl/codegen/call.h @@ -272,6 +272,7 @@ namespace CallOpGenericRecvMessageHelper { class DeserializeFunc { public: virtual Status Deserialize(grpc_byte_buffer* buf, int max_message_size) = 0; + virtual ~DeserializeFunc() {} }; template @@ -283,6 +284,8 @@ class DeserializeFuncType GRPC_FINAL : public DeserializeFunc { return SerializationTraits::Deserialize(buf, message_, max_message_size); } + ~DeserializeFuncType() override {} + private: R* message_; // Not a managed pointer because management is external to this }; From a3d7794df60b407a552befebf45c92e23415ab52 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 19 Feb 2016 15:52:14 -0800 Subject: [PATCH 30/43] Add more reflection information to Node client classes --- src/node/src/client.js | 4 ++-- src/node/src/common.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/node/src/client.js b/src/node/src/client.js index c02c44730e511..c65dd7365037a 100644 --- a/src/node/src/client.js +++ b/src/node/src/client.js @@ -648,8 +648,8 @@ exports.makeClientConstructor = function(methods, serviceName) { var deserialize = attrs.responseDeserialize; Client.prototype[name] = requester_makers[method_type]( attrs.path, serialize, deserialize); - Client.prototype[name].serialize = serialize; - Client.prototype[name].deserialize = deserialize; + // Associate all provided attributes with the method + _.assign(Client.prototype[name], attrs); }); return Client; diff --git a/src/node/src/common.js b/src/node/src/common.js index e5217608ecdb5..7705a275fcee2 100644 --- a/src/node/src/common.js +++ b/src/node/src/common.js @@ -146,6 +146,8 @@ exports.getProtobufServiceAttrs = function getProtobufServiceAttrs(service, path: prefix + method.name, requestStream: method.requestStream, responseStream: method.responseStream, + requestType: method.resolvedRequestType, + responseType: method.resolvedResponseType, requestSerialize: serializeCls(method.resolvedRequestType.build()), requestDeserialize: deserializeCls(method.resolvedRequestType.build(), binaryAsBase64, longsAsStrings), From c10348a55536525dc2b0d2972208b2f746cc75ce Mon Sep 17 00:00:00 2001 From: yang-g Date: Fri, 19 Feb 2016 16:05:10 -0800 Subject: [PATCH 31/43] Add custom_metadata test case --- test/cpp/interop/client.cc | 6 ++- test/cpp/interop/interop_client.cc | 72 ++++++++++++++++++++++++++++++ test/cpp/interop/interop_client.h | 1 + test/cpp/interop/server.cc | 22 +++++++++ 4 files changed, 100 insertions(+), 1 deletion(-) diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index cb9b396beb55c..8e81e432e7965 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -74,6 +74,7 @@ DEFINE_string(test_case, "large_unary", "oauth2_auth_token: raw oauth2 access token auth; " "per_rpc_creds: raw oauth2 access token on a single rpc; " "status_code_and_message: verify status code & message; " + "custom_metadata: server will echo custom metadata;" "all : all of above."); DEFINE_string(default_service_account, "", "Email of GCE default service account"); @@ -129,6 +130,8 @@ int main(int argc, char** argv) { client.DoPerRpcCreds(json_key); } else if (FLAGS_test_case == "status_code_and_message") { client.DoStatusWithMessage(); + } else if (FLAGS_test_case == "custom_metadata") { + client.DoCustomMetadata(); } else if (FLAGS_test_case == "all") { client.DoEmpty(); client.DoLargeUnary(); @@ -142,6 +145,7 @@ int main(int argc, char** argv) { client.DoTimeoutOnSleepingServer(); client.DoEmptyStream(); client.DoStatusWithMessage(); + client.DoCustomMetadata(); // service_account_creds and jwt_token_creds can only run with ssl. if (FLAGS_use_tls) { grpc::string json_key = GetServiceAccountJsonKey(); @@ -159,7 +163,7 @@ int main(int argc, char** argv) { "server_compressed_streaming|half_duplex|ping_pong|cancel_after_begin|" "cancel_after_first_response|timeout_on_sleeping_server|empty_stream|" "compute_engine_creds|jwt_token_creds|oauth2_auth_token|per_rpc_creds", - FLAGS_test_case.c_str()); + "status_code_and_message|custom_metadata", FLAGS_test_case.c_str()); ret = 1; } diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index b06310781a247..46f6fdac4092e 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -625,5 +625,77 @@ void InteropClient::DoStatusWithMessage() { gpr_log(GPR_DEBUG, "Done testing Status and Message"); } +void InteropClient::DoCustomMetadata() { + const grpc::string kEchoInitialMetadataKey("x-grpc-test-echo-initial"); + const grpc::string kInitialMetadataValue("test_initial_metadata_value"); + const grpc::string kEchoTrailingBinMetadataKey( + "x-grpc-test-echo-trailing-bin"); + const grpc::string kTrailingBinValue("\x0a\x0b\x0a\x0b\x0a\x0b"); + ; + + { + gpr_log(GPR_DEBUG, "Sending RPC with custom metadata"); + ClientContext context; + context.AddMetadata(kEchoInitialMetadataKey, kInitialMetadataValue); + context.AddMetadata(kEchoTrailingBinMetadataKey, kTrailingBinValue); + SimpleRequest request; + SimpleResponse response; + request.set_response_size(kLargeResponseSize); + grpc::string payload(kLargeRequestSize, '\0'); + request.mutable_payload()->set_body(payload.c_str(), kLargeRequestSize); + + Status s = serviceStub_.Get()->UnaryCall(&context, request, &response); + AssertOkOrPrintErrorStatus(s); + const auto& server_initial_metadata = context.GetServerInitialMetadata(); + auto iter = server_initial_metadata.find(kEchoInitialMetadataKey); + GPR_ASSERT(iter != server_initial_metadata.end()); + GPR_ASSERT(iter->second.data() == kInitialMetadataValue); + const auto& server_trailing_metadata = context.GetServerTrailingMetadata(); + iter = server_trailing_metadata.find(kEchoTrailingBinMetadataKey); + GPR_ASSERT(iter != server_trailing_metadata.end()); + GPR_ASSERT(grpc::string(iter->second.begin(), iter->second.end()) == + kTrailingBinValue); + + gpr_log(GPR_DEBUG, "Done testing RPC with custom metadata"); + } + + { + gpr_log(GPR_DEBUG, "Sending stream with custom metadata"); + ClientContext context; + context.AddMetadata(kEchoInitialMetadataKey, kInitialMetadataValue); + context.AddMetadata(kEchoTrailingBinMetadataKey, kTrailingBinValue); + std::unique_ptr> + stream(serviceStub_.Get()->FullDuplexCall(&context)); + + StreamingOutputCallRequest request; + request.set_response_type(PayloadType::COMPRESSABLE); + ResponseParameters* response_parameter = request.add_response_parameters(); + response_parameter->set_size(kLargeResponseSize); + grpc::string payload(kLargeRequestSize, '\0'); + request.mutable_payload()->set_body(payload.c_str(), kLargeRequestSize); + StreamingOutputCallResponse response; + GPR_ASSERT(stream->Write(request)); + stream->WritesDone(); + GPR_ASSERT(stream->Read(&response)); + GPR_ASSERT(response.payload().body() == + grpc::string(kLargeResponseSize, '\0')); + GPR_ASSERT(!stream->Read(&response)); + Status s = stream->Finish(); + AssertOkOrPrintErrorStatus(s); + const auto& server_initial_metadata = context.GetServerInitialMetadata(); + auto iter = server_initial_metadata.find(kEchoInitialMetadataKey); + GPR_ASSERT(iter != server_initial_metadata.end()); + GPR_ASSERT(iter->second.data() == kInitialMetadataValue); + const auto& server_trailing_metadata = context.GetServerTrailingMetadata(); + iter = server_trailing_metadata.find(kEchoTrailingBinMetadataKey); + GPR_ASSERT(iter != server_trailing_metadata.end()); + GPR_ASSERT(grpc::string(iter->second.begin(), iter->second.end()) == + kTrailingBinValue); + + gpr_log(GPR_DEBUG, "Done testing stream with custom metadata"); + } +} + } // namespace testing } // namespace grpc diff --git a/test/cpp/interop/interop_client.h b/test/cpp/interop/interop_client.h index 3ecd3803985ee..92f57f7bddbcf 100644 --- a/test/cpp/interop/interop_client.h +++ b/test/cpp/interop/interop_client.h @@ -75,6 +75,7 @@ class InteropClient { void DoTimeoutOnSleepingServer(); void DoEmptyStream(); void DoStatusWithMessage(); + void DoCustomMetadata(); // Auth tests. // username is a string containing the user email void DoJwtTokenCreds(const grpc::string& username); diff --git a/test/cpp/interop/server.cc b/test/cpp/interop/server.cc index cdca060c237ff..bf576322b40f3 100644 --- a/test/cpp/interop/server.cc +++ b/test/cpp/interop/server.cc @@ -80,6 +80,26 @@ using grpc::Status; static bool got_sigint = false; static const char* kRandomFile = "test/cpp/interop/rnd.dat"; +const char kEchoInitialMetadataKey[] = "x-grpc-test-echo-initial"; +const char kEchoTrailingBinMetadataKey[] = "x-grpc-test-echo-trailing-bin"; + +void MaybeEchoMetadata(ServerContext* context) { + const auto& client_metadata = context->client_metadata(); + GPR_ASSERT(client_metadata.count(kEchoInitialMetadataKey) <= 1); + GPR_ASSERT(client_metadata.count(kEchoTrailingBinMetadataKey) <= 1); + + auto iter = client_metadata.find(kEchoInitialMetadataKey); + if (iter != client_metadata.end()) { + context->AddInitialMetadata(kEchoInitialMetadataKey, iter->second.data()); + } + iter = client_metadata.find(kEchoTrailingBinMetadataKey); + if (iter != client_metadata.end()) { + context->AddTrailingMetadata( + kEchoTrailingBinMetadataKey, + grpc::string(iter->second.begin(), iter->second.end())); + } +} + bool SetPayload(PayloadType type, int size, Payload* payload) { PayloadType response_type; if (type == PayloadType::RANDOM) { @@ -135,6 +155,7 @@ class TestServiceImpl : public TestService::Service { Status UnaryCall(ServerContext* context, const SimpleRequest* request, SimpleResponse* response) { + MaybeEchoMetadata(context); SetResponseCompression(context, *request); if (request->response_size() > 0) { if (!SetPayload(request->response_type(), request->response_size(), @@ -192,6 +213,7 @@ class TestServiceImpl : public TestService::Service { ServerContext* context, ServerReaderWriter* stream) { + MaybeEchoMetadata(context); StreamingOutputCallRequest request; StreamingOutputCallResponse response; bool write_success = true; From 6a4e473d4ab40f60f719876fa0f72f4dcb2a5d37 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 20 Feb 2016 01:30:57 +0100 Subject: [PATCH 32/43] 32 bits support. --- tools/run_tests/artifact_targets.py | 11 ++++++++++- tools/run_tests/build_artifact_python.bat | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/run_tests/artifact_targets.py b/tools/run_tests/artifact_targets.py index e106639bd1ae4..b565fbb3f0357 100644 --- a/tools/run_tests/artifact_targets.py +++ b/tools/run_tests/artifact_targets.py @@ -80,6 +80,11 @@ def macos_arch_env(arch): return {'CFLAGS': arch_arg, 'LDFLAGS': arch_arg} +python_version_arch_map = { + 'x86': 'Python27_32bits', + 'x64': 'Python27' +} + class PythonArtifact: """Builds Python artifacts.""" @@ -88,6 +93,7 @@ def __init__(self, platform, arch): self.platform = platform self.arch = arch self.labels = ['artifact', 'python', platform, arch] + self.python_version = python_version_arch_map[arch] def pre_build_jobspecs(self): return [] @@ -103,7 +109,9 @@ def build_jobspec(self): environ=environ) elif self.platform == 'windows': return create_jobspec(self.name, - ['tools\\run_tests\\build_artifact_python.bat'], + ['tools\\run_tests\\build_artifact_python.bat', + self.python_version + ], shell=True) else: environ['SKIP_PIP_INSTALL'] = 'TRUE' @@ -236,6 +244,7 @@ def targets(): [PythonArtifact('linux', 'x86'), PythonArtifact('linux', 'x64'), PythonArtifact('macos', 'x64'), + PythonArtifact('windows', 'x86'), PythonArtifact('windows', 'x64'), RubyArtifact('linux', 'x86'), RubyArtifact('linux', 'x64'), diff --git a/tools/run_tests/build_artifact_python.bat b/tools/run_tests/build_artifact_python.bat index 4fc0749e7053d..023d394549425 100644 --- a/tools/run_tests/build_artifact_python.bat +++ b/tools/run_tests/build_artifact_python.bat @@ -41,7 +41,7 @@ copy /Y vsprojects\Release\grpc_dll.dll src\python\grpcio\grpc\_cython\_windows\ copy /Y vsprojects\x64\Release\grpc_dll.dll src\python\grpcio\grpc\_cython\_windows\grpc_c.64.python || goto :error -set PATH=%PATH%;C:\Python27\scripts +set PATH=C:\%1;C:\%1\scripts;%PATH% pip install --upgrade six pip install --upgrade setuptools From af0e24858e80bdd2872ac9a0168ed85557e4e3e3 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 19 Feb 2016 16:31:37 -0800 Subject: [PATCH 33/43] Fix copyrights --- src/node/ext/call_credentials.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/ext/call_credentials.cc b/src/node/ext/call_credentials.cc index 4bd0d1ab7df0e..98696db23254c 100644 --- a/src/node/ext/call_credentials.cc +++ b/src/node/ext/call_credentials.cc @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without From 23a329838588eb3dc7bcfee365007c5194288912 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Sun, 21 Feb 2016 22:43:21 -0800 Subject: [PATCH 34/43] Fix plucking problem --- src/core/surface/completion_queue.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/surface/completion_queue.c b/src/core/surface/completion_queue.c index de295ab941026..0a80680f02e3b 100644 --- a/src/core/surface/completion_queue.c +++ b/src/core/surface/completion_queue.c @@ -333,10 +333,10 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc, gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset)); grpc_exec_ctx_flush(&exec_ctx); gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset)); - continue; + } else { + grpc_pollset_work(&exec_ctx, &cc->pollset, &worker, now, + iteration_deadline); } - grpc_pollset_work(&exec_ctx, &cc->pollset, &worker, now, - iteration_deadline); } GRPC_SURFACE_TRACE_RETURNED_EVENT(cc, &ret); GRPC_CQ_INTERNAL_UNREF(cc, "next"); @@ -450,10 +450,10 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag, gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset)); grpc_exec_ctx_flush(&exec_ctx); gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset)); - continue; + } else { + grpc_pollset_work(&exec_ctx, &cc->pollset, &worker, now, + iteration_deadline); } - grpc_pollset_work(&exec_ctx, &cc->pollset, &worker, now, - iteration_deadline); del_plucker(cc, tag, &worker); } done: From 262da45be70ff67dddb3886e77f9761119d58b3b Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Mon, 22 Feb 2016 09:26:18 -0800 Subject: [PATCH 35/43] Put in some performance tests to be run on PRs and master --- tools/jenkins/run_performance.sh | 80 +++++++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 2 deletions(-) diff --git a/tools/jenkins/run_performance.sh b/tools/jenkins/run_performance.sh index d7e73d4272b61..a5f5181f1ebd0 100755 --- a/tools/jenkins/run_performance.sh +++ b/tools/jenkins/run_performance.sh @@ -49,7 +49,83 @@ PID2=$! export QPS_WORKERS="localhost:10000,localhost:10010" -bins/$config/qps_driver +# big is the size in bytes of large messages (0 is the size otherwise) +big=65536 + +# wide is the number of client channels in multi-channel tests (1 otherwise) +wide=64 + +# deep is the number of RPCs outstanding on a channel in non-ping-pong tests +# (the value used is 1 otherwise) +deep=100 + +# +# Get total core count +cores=`grep -c ^processor /proc/cpuinfo` +halfcores=`expr $cores / 2` + +for secure in true false; do + # Scenario 1: generic async streaming ping-pong (contentionless latency) + bins/$config/qps_driver --rpc_type=STREAMING --client_type=ASYNC_CLIENT \ + --server_type=ASYNC_GENERIC_SERVER --outstanding_rpcs_per_channel=1 \ + --client_channels=1 --bbuf_req_size=0 --bbuf_resp_size=0 \ + --async_client_threads=1 --async_server_threads=1 --secure_test=$secure \ + --num_servers=1 --num_clients=1 \ + --server_core_limit=$halfcores --client_core_limit=0 + + # Scenario 2: generic async streaming "unconstrained" (QPS) + bins/$config/qps_driver --rpc_type=STREAMING --client_type=ASYNC_CLIENT \ + --server_type=ASYNC_GENERIC_SERVER --outstanding_rpcs_per_channel=$deep \ + --client_channels=$wide --bbuf_req_size=0 --bbuf_resp_size=0 \ + --async_client_threads=0 --async_server_threads=0 --secure_test=$secure \ + --num_servers=1 --num_clients=0 \ + --server_core_limit=$halfcores --client_core_limit=0 |& tee /tmp/qps-test.$$ + + # Scenario 2b: QPS with a single server core + bins/$config/qps_driver --rpc_type=STREAMING --client_type=ASYNC_CLIENT \ + --server_type=ASYNC_GENERIC_SERVER --outstanding_rpcs_per_channel=$deep \ + --client_channels=$wide --bbuf_req_size=0 --bbuf_resp_size=0 \ + --async_client_threads=0 --async_server_threads=0 --secure_test=$secure \ + --num_servers=1 --num_clients=0 --server_core_limit=1 --client_core_limit=0 + + # Scenario 2c: protobuf-based QPS + bins/$config/qps_driver --rpc_type=STREAMING --client_type=ASYNC_CLIENT \ + --server_type=ASYNC_SERVER --outstanding_rpcs_per_channel=$deep \ + --client_channels=$wide --simple_req_size=0 --simple_resp_size=0 \ + --async_client_threads=0 --async_server_threads=0 --secure_test=$secure \ + --num_servers=1 --num_clients=0 \ + --server_core_limit=$halfcores --client_core_limit=0 + + # Scenario 3: Latency at sub-peak load (all clients equally loaded) + for loadfactor in 0.7; do + bins/$config/qps_driver --rpc_type=STREAMING --client_type=ASYNC_CLIENT \ + --server_type=ASYNC_GENERIC_SERVER --outstanding_rpcs_per_channel=$deep \ + --client_channels=$wide --bbuf_req_size=0 --bbuf_resp_size=0 \ + --async_client_threads=0 --async_server_threads=0 --secure_test=$secure \ + --num_servers=1 --num_clients=0 --poisson_load=`awk -v lf=$loadfactor \ + '$5 == "QPS:" {print int(lf * $6); exit}' /tmp/qps-test.$$` \ + --server_core_limit=$halfcores --client_core_limit=0 + done + + rm /tmp/qps-test.$$ + + # Scenario 4: Single-channel bidirectional throughput test (like TCP_STREAM). + bins/$config/qps_driver --rpc_type=STREAMING --client_type=ASYNC_CLIENT \ + --server_type=ASYNC_GENERIC_SERVER --outstanding_rpcs_per_channel=$deep \ + --client_channels=1 --bbuf_req_size=$big --bbuf_resp_size=$big \ + --async_client_threads=1 --async_server_threads=1 --secure_test=$secure \ + --num_servers=1 --num_clients=1 \ + --server_core_limit=$halfcores --client_core_limit=0 + + # Scenario 5: Sync unary ping-pong with protobufs + bins/$config/qps_driver --rpc_type=UNARY --client_type=SYNC_CLIENT \ + --server_type=SYNC_SERVER --outstanding_rpcs_per_channel=1 \ + --client_channels=1 --simple_req_size=0 --simple_resp_size=0 \ + --secure_test=$secure --num_servers=1 --num_clients=1 \ + --server_core_limit=$halfcores --client_core_limit=0 + +done + +bins/$config/qps_driver --quit=true -kill -2 $PID1 $PID2 wait From ad0df7bf1fa9a2ad6302016cfbe0b86793f810c5 Mon Sep 17 00:00:00 2001 From: yang-g Date: Mon, 22 Feb 2016 10:00:20 -0800 Subject: [PATCH 36/43] Discard the read buffer on stream error --- src/core/transport/chttp2_transport.c | 5 +++++ test/cpp/end2end/async_end2end_test.cc | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 617d98875c301..c3efc36cc5d5d 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -1019,6 +1019,11 @@ static void check_read_ops(grpc_exec_ctx *exec_ctx, stream_global->recv_initial_metadata_ready = NULL; } if (stream_global->recv_message_ready != NULL) { + while (stream_global->seen_error && + (bs = grpc_chttp2_incoming_frame_queue_pop( + &stream_global->incoming_frames)) != NULL) { + grpc_byte_stream_destroy(exec_ctx, bs); + } if (stream_global->incoming_frames.head != NULL) { *stream_global->recv_message = grpc_chttp2_incoming_frame_queue_pop( &stream_global->incoming_frames); diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index a15cbd7ee2ec2..9ca3bf98f85c4 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -989,6 +989,10 @@ class AsyncEnd2endServerTryCancelTest : public AsyncEnd2endTest { if (server_try_cancel == CANCEL_AFTER_PROCESSING) { ServerTryCancel(&srv_ctx); + + // Client reads may fail bacause it is notified that the stream is + // cancelled. + ignore_cq_result = true; } // Client attemts to read the three messages from the server From 364be644d0beba5f62bfe7f6b3a80f3836a1cd52 Mon Sep 17 00:00:00 2001 From: yang-g Date: Mon, 22 Feb 2016 10:04:43 -0800 Subject: [PATCH 37/43] copyright of course --- test/cpp/interop/client.cc | 2 +- test/cpp/interop/interop_client.h | 2 +- test/cpp/interop/server.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index 8e81e432e7965..788adefd24b01 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/cpp/interop/interop_client.h b/test/cpp/interop/interop_client.h index 92f57f7bddbcf..3f57f3c7336ff 100644 --- a/test/cpp/interop/interop_client.h +++ b/test/cpp/interop/interop_client.h @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/cpp/interop/server.cc b/test/cpp/interop/server.cc index bf576322b40f3..63eca6a5ef1e7 100644 --- a/test/cpp/interop/server.cc +++ b/test/cpp/interop/server.cc @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without From 276e32d0fbbfab490fd26dcbfb4e65c3c87f31ae Mon Sep 17 00:00:00 2001 From: yang-g Date: Mon, 22 Feb 2016 13:15:30 -0800 Subject: [PATCH 38/43] Fix race between add_writing_stalled and destroy stream --- src/core/transport/chttp2/internal.h | 9 +++++++-- src/core/transport/chttp2/stream_lists.c | 22 ++++++++++++++++++---- src/core/transport/chttp2/writing.c | 10 +++++----- src/core/transport/chttp2_transport.c | 2 +- 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/src/core/transport/chttp2/internal.h b/src/core/transport/chttp2/internal.h index 0e1e2c42650f8..d76d31be23f2f 100644 --- a/src/core/transport/chttp2/internal.h +++ b/src/core/transport/chttp2/internal.h @@ -485,7 +485,8 @@ struct grpc_chttp2_stream { /** Someone is unlocking the transport mutex: check to see if writes are required, and schedule them if so */ -int grpc_chttp2_unlocking_check_writes(grpc_chttp2_transport_global *global, +int grpc_chttp2_unlocking_check_writes(grpc_exec_ctx *exec_ctx, + grpc_chttp2_transport_global *global, grpc_chttp2_transport_writing *writing, int is_parsing); void grpc_chttp2_perform_writes( @@ -568,8 +569,12 @@ void grpc_chttp2_list_add_writing_stalled_by_transport( grpc_chttp2_transport_writing *transport_writing, grpc_chttp2_stream_writing *stream_writing); void grpc_chttp2_list_flush_writing_stalled_by_transport( - grpc_chttp2_transport_writing *transport_writing, bool is_window_available); + grpc_exec_ctx *exec_ctx, grpc_chttp2_transport_writing *transport_writing, + bool is_window_available); +void grpc_chttp2_list_add_stalled_by_transport( + grpc_chttp2_transport_writing *transport_writing, + grpc_chttp2_stream_writing *stream_writing); int grpc_chttp2_list_pop_stalled_by_transport( grpc_chttp2_transport_global *transport_global, grpc_chttp2_stream_global **stream_global); diff --git a/src/core/transport/chttp2/stream_lists.c b/src/core/transport/chttp2/stream_lists.c index 2f31a47cb3df6..b284c78818381 100644 --- a/src/core/transport/chttp2/stream_lists.c +++ b/src/core/transport/chttp2/stream_lists.c @@ -316,13 +316,16 @@ int grpc_chttp2_list_pop_check_read_ops( void grpc_chttp2_list_add_writing_stalled_by_transport( grpc_chttp2_transport_writing *transport_writing, grpc_chttp2_stream_writing *stream_writing) { - stream_list_add(TRANSPORT_FROM_WRITING(transport_writing), - STREAM_FROM_WRITING(stream_writing), + grpc_chttp2_stream *stream = STREAM_FROM_WRITING(stream_writing); + if (!stream->included[GRPC_CHTTP2_LIST_WRITING_STALLED_BY_TRANSPORT]) { + GRPC_CHTTP2_STREAM_REF(&stream->global, "chttp2_writing_stalled"); + } + stream_list_add(TRANSPORT_FROM_WRITING(transport_writing), stream, GRPC_CHTTP2_LIST_WRITING_STALLED_BY_TRANSPORT); } void grpc_chttp2_list_flush_writing_stalled_by_transport( - grpc_chttp2_transport_writing *transport_writing, + grpc_exec_ctx *exec_ctx, grpc_chttp2_transport_writing *transport_writing, bool is_window_available) { grpc_chttp2_stream *stream; grpc_chttp2_transport *transport = TRANSPORT_FROM_WRITING(transport_writing); @@ -331,11 +334,22 @@ void grpc_chttp2_list_flush_writing_stalled_by_transport( if (is_window_available) { grpc_chttp2_list_add_writable_stream(&transport->global, &stream->global); } else { - stream_list_add(transport, stream, GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT); + grpc_chttp2_list_add_stalled_by_transport(transport_writing, + &stream->writing); } + GRPC_CHTTP2_STREAM_UNREF(exec_ctx, &stream->global, + "chttp2_writing_stalled"); } } +void grpc_chttp2_list_add_stalled_by_transport( + grpc_chttp2_transport_writing *transport_writing, + grpc_chttp2_stream_writing *stream_writing) { + stream_list_add(TRANSPORT_FROM_WRITING(transport_writing), + STREAM_FROM_WRITING(stream_writing), + GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT); +} + int grpc_chttp2_list_pop_stalled_by_transport( grpc_chttp2_transport_global *transport_global, grpc_chttp2_stream_global **stream_global) { diff --git a/src/core/transport/chttp2/writing.c b/src/core/transport/chttp2/writing.c index cafecf1046581..356fd8174a769 100644 --- a/src/core/transport/chttp2/writing.c +++ b/src/core/transport/chttp2/writing.c @@ -44,7 +44,7 @@ static void finalize_outbuf(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport_writing *transport_writing); int grpc_chttp2_unlocking_check_writes( - grpc_chttp2_transport_global *transport_global, + grpc_exec_ctx *exec_ctx, grpc_chttp2_transport_global *transport_global, grpc_chttp2_transport_writing *transport_writing, int is_parsing) { grpc_chttp2_stream_global *stream_global; grpc_chttp2_stream_writing *stream_writing; @@ -76,8 +76,8 @@ int grpc_chttp2_unlocking_check_writes( GRPC_CHTTP2_FLOW_MOVE_TRANSPORT("write", transport_writing, outgoing_window, transport_global, outgoing_window); bool is_window_available = transport_writing->outgoing_window > 0; - grpc_chttp2_list_flush_writing_stalled_by_transport(transport_writing, - is_window_available); + grpc_chttp2_list_flush_writing_stalled_by_transport( + exec_ctx, transport_writing, is_window_available); /* for each grpc_chttp2_stream that's become writable, frame it's data (according to available window sizes) and add to the output buffer */ @@ -133,8 +133,8 @@ int grpc_chttp2_unlocking_check_writes( GRPC_CHTTP2_STREAM_REF(stream_global, "chttp2_writing"); } } else { - grpc_chttp2_list_add_writing_stalled_by_transport(transport_writing, - stream_writing); + grpc_chttp2_list_add_stalled_by_transport(transport_writing, + stream_writing); } } if (stream_global->send_trailing_metadata) { diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 617d98875c301..89e64876af70b 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -598,7 +598,7 @@ static void lock(grpc_chttp2_transport *t) { gpr_mu_lock(&t->mu); } static void unlock(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t) { GPR_TIMER_BEGIN("unlock", 0); if (!t->writing_active && !t->closed && - grpc_chttp2_unlocking_check_writes(&t->global, &t->writing, + grpc_chttp2_unlocking_check_writes(exec_ctx, &t->global, &t->writing, t->parsing_active)) { t->writing_active = 1; REF_TRANSPORT(t, "writing"); From 4699415750c31cf8a7ff803e57b3499735796e27 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Mon, 22 Feb 2016 13:26:48 -0800 Subject: [PATCH 39/43] Fix sanity --- tools/jenkins/run_performance.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/jenkins/run_performance.sh b/tools/jenkins/run_performance.sh index a5f5181f1ebd0..c80685b23a09d 100755 --- a/tools/jenkins/run_performance.sh +++ b/tools/jenkins/run_performance.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without From 777154411167400e19201bc32dce4eccbae1a55b Mon Sep 17 00:00:00 2001 From: Alistair Veitch Date: Mon, 22 Feb 2016 14:20:25 -0800 Subject: [PATCH 40/43] rename census log files to avoid build breakage on MacOS --- BUILD | 12 ++++++------ Makefile | 8 ++++---- binding.gyp | 2 +- build.yaml | 6 +++--- gRPC.podspec | 6 +++--- grpc.gemspec | 4 ++-- package.json | 4 ++-- src/core/census/{log.c => mlog.c} | 2 +- src/core/census/{log.h => mlog.h} | 6 ++++-- src/python/grpcio/grpc_core_dependencies.py | 2 +- test/core/census/{log_test.c => mlog_test.c} | 2 +- tools/doxygen/Doxyfile.core.internal | 4 ++-- tools/run_tests/sources_and_headers.json | 14 +++++++------- vsprojects/vcxproj/grpc/grpc.vcxproj | 4 ++-- vsprojects/vcxproj/grpc/grpc.vcxproj.filters | 4 ++-- .../vcxproj/grpc_unsecure/grpc_unsecure.vcxproj | 4 ++-- .../grpc_unsecure/grpc_unsecure.vcxproj.filters | 4 ++-- .../test/census_log_test/census_log_test.vcxproj | 2 +- .../census_log_test.vcxproj.filters | 2 +- 19 files changed, 47 insertions(+), 45 deletions(-) rename src/core/census/{log.c => mlog.c} (99%) rename src/core/census/{log.h => mlog.h} (96%) rename test/core/census/{log_test.c => mlog_test.c} (99%) diff --git a/BUILD b/BUILD index 0a5139d447fdf..f6c4338493aa8 100644 --- a/BUILD +++ b/BUILD @@ -283,7 +283,7 @@ cc_library( "src/core/tsi/transport_security.h", "src/core/tsi/transport_security_interface.h", "src/core/census/aggregation.h", - "src/core/census/log.h", + "src/core/census/mlog.h", "src/core/census/rpc_metric_id.h", "src/core/census/grpc_context.c", "src/core/census/grpc_filter.c", @@ -436,7 +436,7 @@ cc_library( "src/core/tsi/transport_security.c", "src/core/census/context.c", "src/core/census/initialize.c", - "src/core/census/log.c", + "src/core/census/mlog.c", "src/core/census/operation.c", "src/core/census/placeholders.c", "src/core/census/tracing.c", @@ -589,7 +589,7 @@ cc_library( "src/core/transport/transport.h", "src/core/transport/transport_impl.h", "src/core/census/aggregation.h", - "src/core/census/log.h", + "src/core/census/mlog.h", "src/core/census/rpc_metric_id.h", "src/core/surface/init_unsecure.c", "src/core/census/grpc_context.c", @@ -722,7 +722,7 @@ cc_library( "src/core/transport/transport_op_string.c", "src/core/census/context.c", "src/core/census/initialize.c", - "src/core/census/log.c", + "src/core/census/mlog.c", "src/core/census/operation.c", "src/core/census/placeholders.c", "src/core/census/tracing.c", @@ -1400,7 +1400,7 @@ objc_library( "src/core/tsi/transport_security.c", "src/core/census/context.c", "src/core/census/initialize.c", - "src/core/census/log.c", + "src/core/census/mlog.c", "src/core/census/operation.c", "src/core/census/placeholders.c", "src/core/census/tracing.c", @@ -1548,7 +1548,7 @@ objc_library( "src/core/tsi/transport_security.h", "src/core/tsi/transport_security_interface.h", "src/core/census/aggregation.h", - "src/core/census/log.h", + "src/core/census/mlog.h", "src/core/census/rpc_metric_id.h", ], includes = [ diff --git a/Makefile b/Makefile index 51b892187beca..f285d5a01c3c8 100644 --- a/Makefile +++ b/Makefile @@ -2469,7 +2469,7 @@ LIBGRPC_SRC = \ src/core/tsi/transport_security.c \ src/core/census/context.c \ src/core/census/initialize.c \ - src/core/census/log.c \ + src/core/census/mlog.c \ src/core/census/operation.c \ src/core/census/placeholders.c \ src/core/census/tracing.c \ @@ -2792,7 +2792,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/transport/transport_op_string.c \ src/core/census/context.c \ src/core/census/initialize.c \ - src/core/census/log.c \ + src/core/census/mlog.c \ src/core/census/operation.c \ src/core/census/placeholders.c \ src/core/census/tracing.c \ @@ -5877,7 +5877,7 @@ endif CENSUS_LOG_TEST_SRC = \ - test/core/census/log_test.c \ + test/core/census/mlog_test.c \ CENSUS_LOG_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CENSUS_LOG_TEST_SRC)))) ifeq ($(NO_SECURE),true) @@ -5897,7 +5897,7 @@ $(BINDIR)/$(CONFIG)/census_log_test: $(CENSUS_LOG_TEST_OBJS) $(LIBDIR)/$(CONFIG) endif -$(OBJDIR)/$(CONFIG)/test/core/census/log_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/test/core/census/mlog_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a deps_census_log_test: $(CENSUS_LOG_TEST_OBJS:.o=.dep) diff --git a/binding.gyp b/binding.gyp index a2a64fff13af7..0f5817e8dc2fa 100644 --- a/binding.gyp +++ b/binding.gyp @@ -708,7 +708,7 @@ 'src/core/tsi/transport_security.c', 'src/core/census/context.c', 'src/core/census/initialize.c', - 'src/core/census/log.c', + 'src/core/census/mlog.c', 'src/core/census/operation.c', 'src/core/census/placeholders.c', 'src/core/census/tracing.c', diff --git a/build.yaml b/build.yaml index cb6cb56844829..793cb8292dc0a 100644 --- a/build.yaml +++ b/build.yaml @@ -14,12 +14,12 @@ filegroups: - include/grpc/census.h headers: - src/core/census/aggregation.h - - src/core/census/log.h + - src/core/census/mlog.h - src/core/census/rpc_metric_id.h src: - src/core/census/context.c - src/core/census/initialize.c - - src/core/census/log.c + - src/core/census/mlog.c - src/core/census/operation.c - src/core/census/placeholders.c - src/core/census/tracing.c @@ -982,7 +982,7 @@ targets: build: test language: c src: - - test/core/census/log_test.c + - test/core/census/mlog_test.c deps: - grpc_test_util - grpc diff --git a/gRPC.podspec b/gRPC.podspec index d2d151b96ecba..b40c80a081257 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -287,7 +287,7 @@ Pod::Spec.new do |s| 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_interface.h', 'src/core/census/aggregation.h', - 'src/core/census/log.h', + 'src/core/census/mlog.h', 'src/core/census/rpc_metric_id.h', 'include/grpc/grpc_security.h', 'include/grpc/impl/codegen/byte_buffer.h', @@ -453,7 +453,7 @@ Pod::Spec.new do |s| 'src/core/tsi/transport_security.c', 'src/core/census/context.c', 'src/core/census/initialize.c', - 'src/core/census/log.c', + 'src/core/census/mlog.c', 'src/core/census/operation.c', 'src/core/census/placeholders.c', 'src/core/census/tracing.c' @@ -597,7 +597,7 @@ Pod::Spec.new do |s| 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_interface.h', 'src/core/census/aggregation.h', - 'src/core/census/log.h', + 'src/core/census/mlog.h', 'src/core/census/rpc_metric_id.h' ss.header_mappings_dir = '.' diff --git a/grpc.gemspec b/grpc.gemspec index 061b0f2e94337..ae8cfaf7c905b 100755 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -283,7 +283,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/tsi/transport_security.h ) s.files += %w( src/core/tsi/transport_security_interface.h ) s.files += %w( src/core/census/aggregation.h ) - s.files += %w( src/core/census/log.h ) + s.files += %w( src/core/census/mlog.h ) s.files += %w( src/core/census/rpc_metric_id.h ) s.files += %w( src/core/census/grpc_context.c ) s.files += %w( src/core/census/grpc_filter.c ) @@ -436,7 +436,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/tsi/transport_security.c ) s.files += %w( src/core/census/context.c ) s.files += %w( src/core/census/initialize.c ) - s.files += %w( src/core/census/log.c ) + s.files += %w( src/core/census/mlog.c ) s.files += %w( src/core/census/operation.c ) s.files += %w( src/core/census/placeholders.c ) s.files += %w( src/core/census/tracing.c ) diff --git a/package.json b/package.json index 0f7f4545ce826..d843020eaf3e0 100644 --- a/package.json +++ b/package.json @@ -228,7 +228,7 @@ "src/core/tsi/transport_security.h", "src/core/tsi/transport_security_interface.h", "src/core/census/aggregation.h", - "src/core/census/log.h", + "src/core/census/mlog.h", "src/core/census/rpc_metric_id.h", "src/core/census/grpc_context.c", "src/core/census/grpc_filter.c", @@ -381,7 +381,7 @@ "src/core/tsi/transport_security.c", "src/core/census/context.c", "src/core/census/initialize.c", - "src/core/census/log.c", + "src/core/census/mlog.c", "src/core/census/operation.c", "src/core/census/placeholders.c", "src/core/census/tracing.c", diff --git a/src/core/census/log.c b/src/core/census/mlog.c similarity index 99% rename from src/core/census/log.c rename to src/core/census/mlog.c index 91b26941b83a3..a2cc46d3f261c 100644 --- a/src/core/census/log.c +++ b/src/core/census/mlog.c @@ -88,7 +88,7 @@ // include the name of the structure, which will be passed as the first // argument. E.g. cl_block_initialize() will initialize a cl_block. -#include "src/core/census/log.h" +#include "src/core/census/mlog.h" #include #include #include diff --git a/src/core/census/log.h b/src/core/census/mlog.h similarity index 96% rename from src/core/census/log.h rename to src/core/census/mlog.h index 05daea066f597..aaba9e1535622 100644 --- a/src/core/census/log.h +++ b/src/core/census/mlog.h @@ -31,8 +31,10 @@ * */ -#ifndef GRPC_INTERNAL_CORE_CENSUS_LOG_H -#define GRPC_INTERNAL_CORE_CENSUS_LOG_H +/* A very fast in-memory log, optimized for multiple writers. */ + +#ifndef GRPC_INTERNAL_CORE_CENSUS_MLOG_H +#define GRPC_INTERNAL_CORE_CENSUS_MLOG_H #include #include diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index f43ac5c0a53ab..a002a5a0a8d45 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -224,7 +224,7 @@ 'src/core/tsi/transport_security.c', 'src/core/census/context.c', 'src/core/census/initialize.c', - 'src/core/census/log.c', + 'src/core/census/mlog.c', 'src/core/census/operation.c', 'src/core/census/placeholders.c', 'src/core/census/tracing.c', diff --git a/test/core/census/log_test.c b/test/core/census/mlog_test.c similarity index 99% rename from test/core/census/log_test.c rename to test/core/census/mlog_test.c index b68ca115045b9..5b6c5946ab579 100644 --- a/test/core/census/log_test.c +++ b/test/core/census/mlog_test.c @@ -31,7 +31,7 @@ * */ -#include "src/core/census/log.h" +#include "src/core/census/mlog.h" #include #include #include diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 84250e74c5902..b48901e910a7f 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -902,7 +902,7 @@ src/core/tsi/ssl_types.h \ src/core/tsi/transport_security.h \ src/core/tsi/transport_security_interface.h \ src/core/census/aggregation.h \ -src/core/census/log.h \ +src/core/census/mlog.h \ src/core/census/rpc_metric_id.h \ src/core/census/grpc_context.c \ src/core/census/grpc_filter.c \ @@ -1055,7 +1055,7 @@ src/core/tsi/ssl_transport_security.c \ src/core/tsi/transport_security.c \ src/core/census/context.c \ src/core/census/initialize.c \ -src/core/census/log.c \ +src/core/census/mlog.c \ src/core/census/operation.c \ src/core/census/placeholders.c \ src/core/census/tracing.c \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 3cdd7b453cbbc..b22a5a135f83c 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -92,7 +92,7 @@ "language": "c", "name": "census_log_test", "src": [ - "test/core/census/log_test.c" + "test/core/census/mlog_test.c" ] }, { @@ -2983,7 +2983,7 @@ "include/grpc/status.h", "src/core/census/aggregation.h", "src/core/census/grpc_filter.h", - "src/core/census/log.h", + "src/core/census/mlog.h", "src/core/census/rpc_metric_id.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", @@ -3135,8 +3135,8 @@ "src/core/census/grpc_filter.c", "src/core/census/grpc_filter.h", "src/core/census/initialize.c", - "src/core/census/log.c", - "src/core/census/log.h", + "src/core/census/mlog.c", + "src/core/census/mlog.h", "src/core/census/operation.c", "src/core/census/placeholders.c", "src/core/census/rpc_metric_id.h", @@ -3524,7 +3524,7 @@ "include/grpc/status.h", "src/core/census/aggregation.h", "src/core/census/grpc_filter.h", - "src/core/census/log.h", + "src/core/census/mlog.h", "src/core/census/rpc_metric_id.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", @@ -3661,8 +3661,8 @@ "src/core/census/grpc_filter.c", "src/core/census/grpc_filter.h", "src/core/census/initialize.c", - "src/core/census/log.c", - "src/core/census/log.h", + "src/core/census/mlog.c", + "src/core/census/mlog.h", "src/core/census/operation.c", "src/core/census/placeholders.c", "src/core/census/rpc_metric_id.h", diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index a426e41d0a379..ebab196fcbf8b 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -411,7 +411,7 @@ - + @@ -717,7 +717,7 @@ - + diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index 0b99cba0777c2..68fc952fd624c 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -454,7 +454,7 @@ src\core\census - + src\core\census @@ -896,7 +896,7 @@ src\core\census - + src\core\census diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index 2092397136f13..5daa7900f8ff3 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -387,7 +387,7 @@ - + @@ -653,7 +653,7 @@ - + diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index f6e5275b79938..68f136398bd25 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -394,7 +394,7 @@ src\core\census - + src\core\census @@ -791,7 +791,7 @@ src\core\census - + src\core\census diff --git a/vsprojects/vcxproj/test/census_log_test/census_log_test.vcxproj b/vsprojects/vcxproj/test/census_log_test/census_log_test.vcxproj index 851086d663539..9f2480085b54c 100644 --- a/vsprojects/vcxproj/test/census_log_test/census_log_test.vcxproj +++ b/vsprojects/vcxproj/test/census_log_test/census_log_test.vcxproj @@ -158,7 +158,7 @@ - + diff --git a/vsprojects/vcxproj/test/census_log_test/census_log_test.vcxproj.filters b/vsprojects/vcxproj/test/census_log_test/census_log_test.vcxproj.filters index 135c77847f926..8b70dcb2a41be 100644 --- a/vsprojects/vcxproj/test/census_log_test/census_log_test.vcxproj.filters +++ b/vsprojects/vcxproj/test/census_log_test/census_log_test.vcxproj.filters @@ -1,7 +1,7 @@ - + test\core\census From e0dbd3f92dd4aed9e518e7de139ebb8d0c747802 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Tue, 23 Feb 2016 00:21:38 +0100 Subject: [PATCH 41/43] Fixing MacOS. --- Makefile | 169 ++++++++++++++---------------------- build.yaml | 2 + templates/Makefile.template | 50 ++++++++++- 3 files changed, 116 insertions(+), 105 deletions(-) diff --git a/Makefile b/Makefile index f285d5a01c3c8..3037af3491ce2 100644 --- a/Makefile +++ b/Makefile @@ -247,7 +247,7 @@ STRIP ?= strip --strip-unneeded else ifeq ($(SYSTEM),Darwin) ifeq ($(origin AR), default) -AR = libtool -o +AR = libtool -no_warning_for_no_symbols -o endif STRIP ?= strip -x else @@ -1102,7 +1102,7 @@ plugins: $(PROTOC_PLUGINS) privatelibs: privatelibs_c privatelibs_cxx -privatelibs_c: $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_dll.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libz.a $(LIBDIR)/$(CONFIG)/libbad_client_test.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a +privatelibs_c: $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libz.a $(LIBDIR)/$(CONFIG)/libbad_client_test.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a pc_c: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc pc_c_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc @@ -2265,7 +2265,7 @@ $(LIBDIR)/$(CONFIG)/libgpr.a: $(ZLIB_DEP) $(LIBGPR_OBJS) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgpr.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBGPR_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgpr.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libgpr.a endif @@ -2306,7 +2306,7 @@ $(LIBDIR)/$(CONFIG)/libgpr_test_util.a: $(ZLIB_DEP) $(LIBGPR_TEST_UTIL_OBJS) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBGPR_TEST_UTIL_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgpr_test_util.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libgpr_test_util.a endif @@ -2509,7 +2509,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBGRPC_OBJS) $(LIB $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBGRPC_OBJS) $(LIBGPR_OBJS) $(ZLIB_MERGE_OBJS) $(OPENSSL_MERGE_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libgrpc.a endif @@ -2541,43 +2541,6 @@ endif endif -LIBGRPC_DLL_SRC = \ - - -LIBGRPC_DLL_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC_DLL_SRC)))) - - -ifeq ($(NO_SECURE),true) - -# You can't build secure libraries if you don't have OpenSSL. - -$(LIBDIR)/$(CONFIG)/libgrpc_dll.a: openssl_dep_error - - -else - - -$(LIBDIR)/$(CONFIG)/libgrpc_dll.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBGRPC_DLL_OBJS) - $(E) "[AR] Creating $@" - $(Q) mkdir -p `dirname $@` - $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_dll.a - $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libgrpc_dll.a $(LIBGRPC_DLL_OBJS) -ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_dll.a -endif - - - - -endif - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(LIBGRPC_DLL_OBJS:.o=.dep) -endif -endif - - LIBGRPC_TEST_UTIL_SRC = \ test/core/end2end/data/server1_cert.c \ test/core/end2end/data/server1_key.c \ @@ -2613,7 +2576,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBGRPC_TE $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBGRPC_TEST_UTIL_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a endif @@ -2649,7 +2612,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a: $(ZLIB_DEP) $(LIBGRPC_TEST_UT $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBGRPC_TEST_UTIL_UNSECURE_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a endif @@ -2820,7 +2783,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a: $(ZLIB_DEP) $(LIBGRPC_UNSECURE_OBJS) $ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBGRPC_UNSECURE_OBJS) $(LIBGPR_OBJS) $(ZLIB_MERGE_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a endif @@ -2863,7 +2826,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc_zookeeper.a: $(ZLIB_DEP) $(LIBGRPC_ZOOKEEPER_OBJS) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_zookeeper.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libgrpc_zookeeper.a $(LIBGRPC_ZOOKEEPER_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_zookeeper.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libgrpc_zookeeper.a endif @@ -2914,7 +2877,7 @@ $(LIBDIR)/$(CONFIG)/libreconnect_server.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBRECON $(Q) rm -f $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBRECONNECT_SERVER_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libreconnect_server.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libreconnect_server.a endif @@ -2952,7 +2915,7 @@ $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBTEST_T $(Q) rm -f $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBTEST_TCP_SERVER_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a endif @@ -3107,7 +3070,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc++.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTOBUF_DEP) $(LI $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc++.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBGRPC++_OBJS) $(LIBGPR_OBJS) $(ZLIB_MERGE_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc++.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libgrpc++.a endif @@ -3172,7 +3135,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTOB $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBGRPC++_TEST_CONFIG_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a endif @@ -3229,7 +3192,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTOBUF $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBGRPC++_TEST_UTIL_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a endif @@ -3378,7 +3341,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBGRPC $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(LIBGRPC++_UNSECURE_OBJS) $(LIBGPR_OBJS) $(ZLIB_MERGE_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a endif @@ -3486,7 +3449,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc_plugin_support.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIB $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_plugin_support.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libgrpc_plugin_support.a $(LIBGRPC_PLUGIN_SUPPORT_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_plugin_support.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libgrpc_plugin_support.a endif @@ -3531,7 +3494,7 @@ $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PRO $(Q) rm -f $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBINTEROP_CLIENT_HELPER_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a endif @@ -3584,7 +3547,7 @@ $(LIBDIR)/$(CONFIG)/libinterop_client_main.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTO $(Q) rm -f $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBINTEROP_CLIENT_MAIN_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libinterop_client_main.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libinterop_client_main.a endif @@ -3634,7 +3597,7 @@ $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PRO $(Q) rm -f $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBINTEROP_SERVER_HELPER_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a endif @@ -3685,7 +3648,7 @@ $(LIBDIR)/$(CONFIG)/libinterop_server_main.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTO $(Q) rm -f $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBINTEROP_SERVER_MAIN_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libinterop_server_main.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libinterop_server_main.a endif @@ -3750,7 +3713,7 @@ $(LIBDIR)/$(CONFIG)/libqps.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTOBUF_DEP) $(LIBQP $(Q) rm -f $(LIBDIR)/$(CONFIG)/libqps.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBQPS_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libqps.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libqps.a endif @@ -3802,7 +3765,7 @@ $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBGRPC_C $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.a $(LIBGRPC_CSHARP_EXT_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.a endif @@ -4142,7 +4105,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl.a: $(ZLIB_DEP) $(LIBBORINGSSL_OBJS) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl.a $(LIBBORINGSSL_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl.a endif @@ -4179,7 +4142,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIB $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a $(LIBBORINGSSL_TEST_UTIL_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a endif @@ -4216,7 +4179,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $( $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a $(LIBBORINGSSL_AES_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a endif @@ -4253,7 +4216,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a $(LIBBORINGSSL_BASE64_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a endif @@ -4290,7 +4253,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $( $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a $(LIBBORINGSSL_BIO_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a endif @@ -4327,7 +4290,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(L $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a $(LIBBORINGSSL_BN_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a endif @@ -4364,7 +4327,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a $(LIBBORINGSSL_BYTESTRING_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a endif @@ -4401,7 +4364,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a $(LIBBORINGSSL_AEAD_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a endif @@ -4438,7 +4401,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a $(LIBBORINGSSL_CIPHER_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a endif @@ -4475,7 +4438,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a $(LIBBORINGSSL_CMAC_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a endif @@ -4503,7 +4466,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_constant_time_test_lib.a: $(ZLIB_DEP) $(LIBBOR $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_constant_time_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_constant_time_test_lib.a $(LIBBORINGSSL_CONSTANT_TIME_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_constant_time_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_constant_time_test_lib.a endif @@ -4538,7 +4501,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a $(LIBBORINGSSL_ED25519_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a endif @@ -4575,7 +4538,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a $(LIBBORINGSSL_X25519_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a endif @@ -4612,7 +4575,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(L $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a $(LIBBORINGSSL_DH_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a endif @@ -4649,7 +4612,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a $(LIBBORINGSSL_DIGEST_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a endif @@ -4677,7 +4640,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_dsa_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_DSA $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_dsa_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_dsa_test_lib.a $(LIBBORINGSSL_DSA_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_dsa_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_dsa_test_lib.a endif @@ -4712,7 +4675,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(L $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a $(LIBBORINGSSL_EC_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a endif @@ -4740,7 +4703,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_example_mul_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_example_mul_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_example_mul_lib.a $(LIBBORINGSSL_EXAMPLE_MUL_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_example_mul_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_example_mul_lib.a endif @@ -4775,7 +4738,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a $(LIBBORINGSSL_ECDSA_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a endif @@ -4812,7 +4775,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $( $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a $(LIBBORINGSSL_ERR_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a endif @@ -4849,7 +4812,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_D $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a $(LIBBORINGSSL_EVP_EXTRA_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a endif @@ -4886,7 +4849,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $( $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a $(LIBBORINGSSL_EVP_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a endif @@ -4923,7 +4886,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a $(LIBBORINGSSL_PBKDF_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a endif @@ -4951,7 +4914,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_hkdf_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_HK $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_hkdf_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_hkdf_test_lib.a $(LIBBORINGSSL_HKDF_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_hkdf_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_hkdf_test_lib.a endif @@ -4986,7 +4949,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a $(LIBBORINGSSL_HMAC_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a endif @@ -5014,7 +4977,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_lhash_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_L $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_lhash_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_lhash_test_lib.a $(LIBBORINGSSL_LHASH_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_lhash_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_lhash_test_lib.a endif @@ -5040,7 +5003,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_gcm_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_GCM $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_gcm_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_gcm_test_lib.a $(LIBBORINGSSL_GCM_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_gcm_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_gcm_test_lib.a endif @@ -5075,7 +5038,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a $(LIBBORINGSSL_PKCS12_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a endif @@ -5112,7 +5075,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a $(LIBBORINGSSL_PKCS8_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a endif @@ -5149,7 +5112,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DE $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a $(LIBBORINGSSL_POLY1305_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a endif @@ -5177,7 +5140,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_refcount_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSS $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_refcount_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_refcount_test_lib.a $(LIBBORINGSSL_REFCOUNT_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_refcount_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_refcount_test_lib.a endif @@ -5212,7 +5175,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $( $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a $(LIBBORINGSSL_RSA_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a endif @@ -5240,7 +5203,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_thread_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_thread_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_thread_test_lib.a $(LIBBORINGSSL_THREAD_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_thread_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_thread_test_lib.a endif @@ -5266,7 +5229,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_pkcs7_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_P $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_pkcs7_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_pkcs7_test_lib.a $(LIBBORINGSSL_PKCS7_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_pkcs7_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_pkcs7_test_lib.a endif @@ -5292,7 +5255,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_tab_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_TAB $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_tab_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_tab_test_lib.a $(LIBBORINGSSL_TAB_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_tab_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_tab_test_lib.a endif @@ -5318,7 +5281,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_v3name_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_v3name_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_v3name_test_lib.a $(LIBBORINGSSL_V3NAME_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_v3name_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_v3name_test_lib.a endif @@ -5344,7 +5307,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_pqueue_test_lib.a: $(ZLIB_DEP) $(LIBBORINGSSL_ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_pqueue_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_pqueue_test_lib.a $(LIBBORINGSSL_PQUEUE_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_pqueue_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_pqueue_test_lib.a endif @@ -5379,7 +5342,7 @@ $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $( $(Q) rm -f $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a $(LIBBORINGSSL_SSL_TEST_LIB_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a endif @@ -5420,7 +5383,7 @@ $(LIBDIR)/$(CONFIG)/libz.a: $(LIBZ_OBJS) $(Q) rm -f $(LIBDIR)/$(CONFIG)/libz.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libz.a $(LIBZ_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libz.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libz.a endif @@ -5454,7 +5417,7 @@ $(LIBDIR)/$(CONFIG)/libbad_client_test.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBBAD_CL $(Q) rm -f $(LIBDIR)/$(CONFIG)/libbad_client_test.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libbad_client_test.a $(LIBBAD_CLIENT_TEST_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libbad_client_test.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libbad_client_test.a endif @@ -5492,7 +5455,7 @@ $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBBA $(Q) rm -f $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBBAD_SSL_TEST_SERVER_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a endif @@ -5566,7 +5529,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_tests.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBEND2END_ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBEND2END_TESTS_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_tests.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libend2end_tests.a endif @@ -5629,7 +5592,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a: $(ZLIB_DEP) $(LIBEND2END_NOSEC_TE $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBEND2END_NOSEC_TESTS_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a endif @@ -5665,7 +5628,7 @@ $(LIBDIR)/$(CONFIG)/libend2end_certs.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIBEND2END_ $(Q) rm -f $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(LIBEND2END_CERTS_OBJS) ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/libend2end_certs.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libend2end_certs.a endif diff --git a/build.yaml b/build.yaml index 793cb8292dc0a..54f6e4c499b87 100644 --- a/build.yaml +++ b/build.yaml @@ -598,6 +598,8 @@ libs: deps: - gpr - grpc + build_system: + - visual_studio deps_linkage: static dll_def: grpc.def vs_config_type: DynamicLibrary diff --git a/templates/Makefile.template b/templates/Makefile.template index 218f492837c7a..7aa6ad71e26a2 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -159,7 +159,7 @@ else ifeq ($(SYSTEM),Darwin) ifeq ($(origin AR), default) - AR = libtool -o + AR = libtool -no_warning_for_no_symbols -o endif STRIP ?= strip -x else @@ -790,18 +790,22 @@ static_c: pc_c pc_c_unsecure cache.mk pc_c_zookeeper\ % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.build == 'all' and lib.language == 'c' and not lib.get('external_deps', None): $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ % endif + % endif % endfor static_zookeeper_libs static_cxx: pc_cxx pc_cxx_unsecure cache.mk \ % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.build == 'all' and lib.language == 'c++': $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ % endif + % endif % endfor @@ -809,40 +813,50 @@ shared_c: pc_c pc_c_unsecure cache.mk pc_c_zookeeper\ % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.build == 'all' and lib.language == 'c' and not lib.get('external_deps', None): $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)\ % endif + % endif % endfor shared_zookeeper_libs shared_cxx: pc_cxx pc_cxx_unsecure cache.mk\ % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.build == 'all' and lib.language == 'c++': $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)\ % endif + % endif % endfor shared_csharp: shared_c \ % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.build == 'all' and lib.language == 'csharp': $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)\ % endif + % endif % endfor ifeq ($(HAS_ZOOKEEPER),true) static_zookeeper_libs:\ % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.build == 'all' and lib.language == 'c' and 'zookeeper' in lib.get('external_deps', []): $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ % endif + % endif % endfor shared_zookeeper_libs:\ % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.build == 'all' and lib.language == 'c' and 'zookeeper' in lib.get('external_deps', []): $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)\ % endif + % endif % endfor else @@ -861,9 +875,11 @@ privatelibs_c: \ % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.build == 'private' and lib.language == 'c' and not lib.get('external_deps', None) and not lib.boringssl: $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ % endif + % endif % endfor pc_c: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc @@ -882,18 +898,22 @@ privatelibs_cxx: \ % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.build == 'private' and lib.language == 'c++' and not lib.get('external_deps', None): $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ % endif + % endif % endfor ifeq ($(HAS_ZOOKEEPER),true) privatelibs_zookeeper: \ % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.build == 'private' and lib.language == 'c++' and zookeeper in lib.get('external_deps', []): $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ % endif + % endif % endfor else @@ -1044,6 +1064,7 @@ strip-static_c: static_c ifeq ($(CONFIG),opt) % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.language == "c": % if lib.build == "all": % if not lib.get('external_deps', None): @@ -1052,9 +1073,11 @@ % endif % endif % endif + % endif % endfor ifeq ($(HAS_ZOOKEEPER),true) % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.language == "c": % if lib.build == "all": % if 'zookeeper' in lib.get('external_deps', []): @@ -1063,6 +1086,7 @@ % endif % endif % endif + % endif % endfor endif endif @@ -1070,18 +1094,21 @@ strip-static_cxx: static_cxx ifeq ($(CONFIG),opt) % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.language == "c++": % if lib.build == "all": $(E) "[STRIP] Stripping lib${lib.name}.a" $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a % endif % endif + % endif % endfor endif strip-shared_c: shared_c ifeq ($(CONFIG),opt) % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.language == "c": % if lib.build == "all": % if not lib.get('external_deps', None): @@ -1090,9 +1117,11 @@ % endif % endif % endif + % endif % endfor ifeq ($(HAS_ZOOKEEPER),true) % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.language == "c": % if lib.build == "all": % if 'zookeeper' in lib.get('external_deps', []): @@ -1101,6 +1130,7 @@ % endif % endif % endif + % endif % endfor endif endif @@ -1108,24 +1138,28 @@ strip-shared_cxx: shared_cxx ifeq ($(CONFIG),opt) % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.language == "c++": % if lib.build == "all": $(E) "[STRIP] Stripping $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) % endif % endif + % endif % endfor endif strip-shared_csharp: shared_csharp ifeq ($(CONFIG),opt) % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.language == "csharp": % if lib.build == "all": $(E) "[STRIP] Stripping $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) % endif % endif + % endif % endfor endif @@ -1234,6 +1268,7 @@ install-static_c: static_c strip-static_c install-pkg-config_c % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.language == "c": % if lib.build == "all": % if not lib.get('external_deps', None): @@ -1243,9 +1278,11 @@ % endif % endif % endif + % endif % endfor ifeq ($(HAS_ZOOKEEPER),true) % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.language == "c": % if lib.build == "all": % if 'zookeeper' in lib.get('external_deps', []): @@ -1255,11 +1292,13 @@ % endif % endif % endif + % endif % endfor endif install-static_cxx: static_cxx strip-static_cxx install-pkg-config_cxx % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.language == "c++": % if lib.build == "all": $(E) "[INSTALL] Installing lib${lib.name}.a" @@ -1267,10 +1306,12 @@ $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(prefix)/lib/lib${lib.name}.a % endif % endif + % endif % endfor <%def name="install_shared(lang_filter)">\ % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.language == lang_filter: % if lib.build == "all": % if not lib.get('external_deps', None): @@ -1286,9 +1327,11 @@ % endif % endif % endif + % endif % endfor ifeq ($(HAS_ZOOKEEPER),true) % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): % if lib.language == lang_filter: % if lib.build == "all": % if 'zookeeper' in lib.get('external_deps', []): @@ -1304,6 +1347,7 @@ % endif % endif % endif + % endif % endfor endif ifneq ($(SYSTEM),MINGW32) @@ -1383,7 +1427,9 @@ # The various libraries % for lib in libs: + % if 'Makefile' in lib.get('build_system', ['Makefile']): ${makelib(lib)} + % endif % endfor @@ -1498,7 +1544,7 @@ % endif ifeq ($(SYSTEM),Darwin) - $(Q) ranlib $(LIBDIR)/$(CONFIG)/lib${lib.name}.a + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/lib${lib.name}.a endif <% From bfc7adaa714b5d8a3b0dca4a25d572dbd92039be Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Mon, 22 Feb 2016 15:42:18 -0800 Subject: [PATCH 42/43] Added option to echo back user agent for testing --- test/cpp/interop/server.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/cpp/interop/server.cc b/test/cpp/interop/server.cc index 63eca6a5ef1e7..18ac35d551c48 100644 --- a/test/cpp/interop/server.cc +++ b/test/cpp/interop/server.cc @@ -82,6 +82,7 @@ static const char* kRandomFile = "test/cpp/interop/rnd.dat"; const char kEchoInitialMetadataKey[] = "x-grpc-test-echo-initial"; const char kEchoTrailingBinMetadataKey[] = "x-grpc-test-echo-trailing-bin"; +const char kEchoUserAgentKey[] = "x-grpc-test-echo-useragent"; void MaybeEchoMetadata(ServerContext* context) { const auto& client_metadata = context->client_metadata(); @@ -98,6 +99,15 @@ void MaybeEchoMetadata(ServerContext* context) { kEchoTrailingBinMetadataKey, grpc::string(iter->second.begin(), iter->second.end())); } + // Check if client sent a magic key in the header that makes us echo + // back the user-agent (for testing purpose) + iter = client_metadata.find(kEchoUserAgentKey); + if (iter != client_metadata.end()) { + iter = client_metadata.find("user-agent"); + if (iter != client_metadata.end()) { + context->AddInitialMetadata(kEchoUserAgentKey, iter->second.data()); + } + } } bool SetPayload(PayloadType type, int size, Payload* payload) { @@ -150,6 +160,7 @@ class TestServiceImpl : public TestService::Service { public: Status EmptyCall(ServerContext* context, const grpc::testing::Empty* request, grpc::testing::Empty* response) { + MaybeEchoMetadata(context); return Status::OK; } From 5fc09525ed01c8f889247e61efe9a4d9fb8ef2b5 Mon Sep 17 00:00:00 2001 From: Kailash Sethuraman Date: Mon, 22 Feb 2016 17:28:12 -0800 Subject: [PATCH 43/43] Add initial set of SoC ideas --- summerofcode/ideas.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/summerofcode/ideas.md b/summerofcode/ideas.md index 073262339b1df..b14d3f7b6ad37 100644 --- a/summerofcode/ideas.md +++ b/summerofcode/ideas.md @@ -1,4 +1,22 @@ -Google Summer of Code 2016 gRPC Ideas -===================================== +# gRPC Summer of Code Project Ideas -(Skeleton for now.) +C Core: + +1. Port gRPC to one of (Free, Net, Open) BSD platforms and create packages for them. Add kqueue support in the process. +2. Fix gRPC C-core's URI parser. The current parser does not qualify as a standard parser according to [RFC3986]( https://tools.ietf.org/html/rfc3986). Write test suites to verify this and make changes necessary to make the URI parser compliant. +3. HPACK compression efficiency evaluation - Figure out how to benchmark gRPC's compression efficiency (both in terms of bytes on the wire and cpu cycles). Implement benchmarks. Potentially extend this to other standalone implementations -- Java and Go. + + +gRPC Python: + + 1. Evaluate the port of gRPC's Python implementation to PyPy. Investigate the state of [Cython support](http://docs.cython.org/src/userguide/pypy.html) to do this or potentially explore cffi + 2. Develop and test Python 3.5 Support for gRPC. Make necessary changes to port gRPC and package it for supported platforms. + +gRPC Ruby/Java: + +1. jRuby support for gRPC. Develop a jRuby wrapper for gRPC based on grpc-java and ensure that it is API compatible with the existing Ruby implementation and passes all tests. + + +Other: + +1. Develop a Wireshark plugin for the gRPC protocol. Provide documentation and tutorials for this plugin. Bonus: consider set-up and use with the mobile clients.