updtae to 1.31.0
This commit is contained in:
parent
02f9235901
commit
a666e1e9ab
@ -1,55 +0,0 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index e8635eda2d..6ede6e34d2 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -3214,6 +3214,14 @@ install-headers_cxx:
|
||||
$(E) "[INSTALL] Installing public C++ headers"
|
||||
$(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1
|
||||
$(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1
|
||||
+ $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX1), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1
|
||||
+ $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX1), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1
|
||||
+ $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX2), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1
|
||||
+ $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX2), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1
|
||||
+ $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX3), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1
|
||||
+ $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX3), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1
|
||||
+ $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX4), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1
|
||||
+ $(Q) $(foreach h, $(PUBLIC_HEADERS_CXX4), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1
|
||||
|
||||
install-static: install-static_c install-static_cxx
|
||||
|
||||
@@ -6190,6 +6198,8 @@ PUBLIC_HEADERS_CXX += \
|
||||
include/grpc++/support/stub_options.h \
|
||||
include/grpc++/support/sync_stream.h \
|
||||
include/grpc++/support/time.h \
|
||||
+
|
||||
+PUBLIC_HEADERS_CXX1 += \
|
||||
include/grpcpp/alarm.h \
|
||||
include/grpcpp/alarm_impl.h \
|
||||
include/grpcpp/channel.h \
|
||||
@@ -6267,6 +6277,8 @@ PUBLIC_HEADERS_CXX += \
|
||||
include/grpcpp/grpcpp.h \
|
||||
include/grpcpp/health_check_service_interface.h \
|
||||
include/grpcpp/health_check_service_interface_impl.h \
|
||||
+
|
||||
+PUBLIC_HEADERS_CXX2 += \
|
||||
include/grpcpp/impl/call.h \
|
||||
include/grpcpp/impl/channel_argument_option.h \
|
||||
include/grpcpp/impl/client_unary_call.h \
|
||||
@@ -6320,6 +6332,8 @@ PUBLIC_HEADERS_CXX += \
|
||||
include/grpcpp/impl/server_initializer.h \
|
||||
include/grpcpp/impl/server_initializer_impl.h \
|
||||
include/grpcpp/impl/service_type.h \
|
||||
+
|
||||
+PUBLIC_HEADERS_CXX3 += \
|
||||
include/grpcpp/resource_quota.h \
|
||||
include/grpcpp/resource_quota_impl.h \
|
||||
include/grpcpp/security/auth_context.h \
|
||||
@@ -6350,6 +6364,8 @@ PUBLIC_HEADERS_CXX += \
|
||||
include/grpcpp/server_impl.h \
|
||||
include/grpcpp/server_posix.h \
|
||||
include/grpcpp/server_posix_impl.h \
|
||||
+
|
||||
+PUBLIC_HEADERS_CXX4 += \
|
||||
include/grpcpp/support/async_stream.h \
|
||||
include/grpcpp/support/async_stream_impl.h \
|
||||
include/grpcpp/support/async_unary_call.h \
|
||||
@ -1,15 +0,0 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 6ede6e34d2..d6190ecde4 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -478,6 +478,10 @@ LDFLAGS += $(EXTRA_LDFLAGS)
|
||||
DEFINES += $(EXTRA_DEFINES)
|
||||
LDLIBS += $(EXTRA_LDLIBS)
|
||||
|
||||
+CFLAGS += -Wl,-z,now -fPIE -fPIC
|
||||
+CPPFLAGS += -Wl,-z,now -fstack-protector-strong
|
||||
+LDFLAGS += -Wl,-z,now -pie
|
||||
+
|
||||
HOST_CPPFLAGS += $(CPPFLAGS)
|
||||
HOST_CFLAGS += $(CFLAGS)
|
||||
HOST_CXXFLAGS += $(CXXFLAGS)
|
||||
91
Add-ABSL_RANDOM_HWAES_FLAGS.patch
Normal file
91
Add-ABSL_RANDOM_HWAES_FLAGS.patch
Normal file
@ -0,0 +1,91 @@
|
||||
From bf87ec9e442d554bf1bc5874c1db9607e59899e3 Mon Sep 17 00:00:00 2001
|
||||
From: Esun Kim <veblush@google.com>
|
||||
Date: Wed, 19 Aug 2020 18:17:39 -0700
|
||||
Subject: [PATCH] Add ABSL_RANDOM_HWAES_FLAGS
|
||||
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 9fc06b0edf..d22d4bab72 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -34,6 +34,13 @@ ifeq ($(SYSTEM),MINGW64)
|
||||
SYSTEM = MINGW32
|
||||
endif
|
||||
|
||||
+# Basic machine detection
|
||||
+HOST_MACHINE = $(shell uname -m)
|
||||
+ifeq ($(HOST_MACHINE),x86_64)
|
||||
+HOST_IS_X86_64 = true
|
||||
+else
|
||||
+HOST_IS_X86_64 = false
|
||||
+endif
|
||||
|
||||
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||
ifndef BUILDDIR
|
||||
@@ -696,6 +703,11 @@ CPPFLAGS := -Ithird_party/address_sorting/include $(CPPFLAGS)
|
||||
|
||||
GRPC_ABSEIL_DEP = $(LIBDIR)/$(CONFIG)/libgrpc_abseil.a
|
||||
GRPC_ABSEIL_MERGE_LIBS = $(LIBDIR)/$(CONFIG)/libgrpc_abseil.a
|
||||
+ifeq ($(HOST_IS_X86_64),true)
|
||||
+ABSL_RANDOM_HWAES_FLAGS = -maes -msse4
|
||||
+else
|
||||
+ABSL_RANDOM_HWAES_FLAGS =
|
||||
+endif
|
||||
|
||||
RE2_DEP = $(LIBDIR)/$(CONFIG)/libre2.a
|
||||
RE2_MERGE_OBJS = $(LIBRE2_OBJS)
|
||||
@@ -4508,7 +4520,7 @@ LIBGRPC_ABSEIL_SRC = \
|
||||
|
||||
LIBGRPC_ABSEIL_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC_ABSEIL_SRC))))
|
||||
|
||||
-$(LIBGRPC_ABSEIL_OBJS): CPPFLAGS += -g -maes -msse4 -Ithird_party/abseil-cpp
|
||||
+$(LIBGRPC_ABSEIL_OBJS): CPPFLAGS += -g $(ABSL_RANDOM_HWAES_FLAGS) -Ithird_party/abseil-cpp
|
||||
|
||||
$(LIBDIR)/$(CONFIG)/libgrpc_abseil.a: $(LIBGRPC_ABSEIL_OBJS)
|
||||
$(E) "[AR] Creating $@"
|
||||
diff --git a/build_handwritten.yaml b/build_handwritten.yaml
|
||||
index 26e1af3360..63451d14c3 100644
|
||||
--- a/build_handwritten.yaml
|
||||
+++ b/build_handwritten.yaml
|
||||
@@ -196,7 +196,7 @@ configs:
|
||||
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1:suppressions=test/core/util/ubsan_suppressions.txt
|
||||
defaults:
|
||||
abseil:
|
||||
- CPPFLAGS: -g -maes -msse4 -Ithird_party/abseil-cpp
|
||||
+ CPPFLAGS: -g $(ABSL_RANDOM_HWAES_FLAGS) -Ithird_party/abseil-cpp
|
||||
ares:
|
||||
CFLAGS: -g
|
||||
CPPFLAGS: -Ithird_party/cares -Ithird_party/cares/cares -fvisibility=hidden -D_GNU_SOURCE
|
||||
diff --git a/templates/Makefile.template b/templates/Makefile.template
|
||||
index 897291ba14..581367e0a6 100644
|
||||
--- a/templates/Makefile.template
|
||||
+++ b/templates/Makefile.template
|
||||
@@ -82,6 +82,13 @@
|
||||
SYSTEM = MINGW32
|
||||
endif
|
||||
|
||||
+ # Basic machine detection
|
||||
+ HOST_MACHINE = $(shell uname -m)
|
||||
+ ifeq ($(HOST_MACHINE),x86_64)
|
||||
+ HOST_IS_X86_64 = true
|
||||
+ else
|
||||
+ HOST_IS_X86_64 = false
|
||||
+ endif
|
||||
|
||||
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||
ifndef BUILDDIR
|
||||
@@ -567,6 +574,11 @@
|
||||
|
||||
GRPC_ABSEIL_DEP = $(LIBDIR)/$(CONFIG)/libgrpc_abseil.a
|
||||
GRPC_ABSEIL_MERGE_LIBS = $(LIBDIR)/$(CONFIG)/libgrpc_abseil.a
|
||||
+ ifeq ($(HOST_IS_X86_64),true)
|
||||
+ ABSL_RANDOM_HWAES_FLAGS = -maes -msse4
|
||||
+ else
|
||||
+ ABSL_RANDOM_HWAES_FLAGS =
|
||||
+ endif
|
||||
|
||||
RE2_DEP = $(LIBDIR)/$(CONFIG)/libre2.a
|
||||
RE2_MERGE_OBJS = $(LIBRE2_OBJS)
|
||||
--
|
||||
2.23.0
|
||||
|
||||
107
Copy-channel-args-hash-before-appending-ruby-user-ag.patch
Normal file
107
Copy-channel-args-hash-before-appending-ruby-user-ag.patch
Normal file
@ -0,0 +1,107 @@
|
||||
From b65daaa52d2e24dadff465a2a84c0e8220282047 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Polcyn <apolcyn@google.com>
|
||||
Date: Thu, 13 Aug 2020 00:12:55 -0700
|
||||
Subject: [PATCH] Copy channel args hash before appending ruby user agent
|
||||
|
||||
---
|
||||
src/ruby/lib/grpc/generic/client_stub.rb | 2 +-
|
||||
src/ruby/spec/user_agent_spec.rb | 74 ++++++++++++++++++++++++
|
||||
2 files changed, 75 insertions(+), 1 deletion(-)
|
||||
create mode 100644 src/ruby/spec/user_agent_spec.rb
|
||||
|
||||
diff --git a/src/ruby/lib/grpc/generic/client_stub.rb b/src/ruby/lib/grpc/generic/client_stub.rb
|
||||
index b193f5c4e1..1884dcba24 100644
|
||||
--- a/src/ruby/lib/grpc/generic/client_stub.rb
|
||||
+++ b/src/ruby/lib/grpc/generic/client_stub.rb
|
||||
@@ -100,7 +100,7 @@ module GRPC
|
||||
channel_args: {},
|
||||
interceptors: [])
|
||||
@ch = ClientStub.setup_channel(channel_override, host, creds,
|
||||
- channel_args)
|
||||
+ channel_args.dup)
|
||||
alt_host = channel_args[Core::Channel::SSL_TARGET]
|
||||
@host = alt_host.nil? ? host : alt_host
|
||||
@propagate_mask = propagate_mask
|
||||
diff --git a/src/ruby/spec/user_agent_spec.rb b/src/ruby/spec/user_agent_spec.rb
|
||||
new file mode 100644
|
||||
index 0000000000..a5aa2066db
|
||||
--- /dev/null
|
||||
+++ b/src/ruby/spec/user_agent_spec.rb
|
||||
@@ -0,0 +1,74 @@
|
||||
+# Copyright 2020 gRPC authors.
|
||||
+#
|
||||
+# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
+# you may not use this file except in compliance with the License.
|
||||
+# You may obtain a copy of the License at
|
||||
+#
|
||||
+# http://www.apache.org/licenses/LICENSE-2.0
|
||||
+#
|
||||
+# Unless required by applicable law or agreed to in writing, software
|
||||
+# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
+# See the License for the specific language governing permissions and
|
||||
+# limitations under the License.
|
||||
+
|
||||
+require 'spec_helper'
|
||||
+
|
||||
+# a test service that checks the cert of its peer
|
||||
+class UserAgentEchoService
|
||||
+ include GRPC::GenericService
|
||||
+ rpc :an_rpc, EchoMsg, EchoMsg
|
||||
+
|
||||
+ def an_rpc(_req, call)
|
||||
+ EchoMsg.new(msg: call.metadata['user-agent'])
|
||||
+ end
|
||||
+end
|
||||
+
|
||||
+UserAgentEchoServiceStub = UserAgentEchoService.rpc_stub_class
|
||||
+
|
||||
+describe 'user agent' do
|
||||
+ RpcServer = GRPC::RpcServer
|
||||
+
|
||||
+ before(:all) do
|
||||
+ server_opts = {
|
||||
+ poll_period: 1
|
||||
+ }
|
||||
+ @srv = new_rpc_server_for_testing(**server_opts)
|
||||
+ @port = @srv.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
|
||||
+ @srv.handle(UserAgentEchoService)
|
||||
+ @srv_thd = Thread.new { @srv.run }
|
||||
+ @srv.wait_till_running
|
||||
+ end
|
||||
+
|
||||
+ after(:all) do
|
||||
+ expect(@srv.stopped?).to be(false)
|
||||
+ @srv.stop
|
||||
+ @srv_thd.join
|
||||
+ end
|
||||
+
|
||||
+ it 'client sends expected user agent' do
|
||||
+ stub = UserAgentEchoServiceStub.new("localhost:#{@port}",
|
||||
+ :this_channel_is_insecure,
|
||||
+ {})
|
||||
+ response = stub.an_rpc(EchoMsg.new)
|
||||
+ expected_user_agent_prefix = "grpc-ruby/#{GRPC::VERSION}"
|
||||
+ expect(response.msg.start_with?(expected_user_agent_prefix)).to be true
|
||||
+ # check that the expected user agent prefix occurs in the real user agent exactly once
|
||||
+ expect(response.msg.split(expected_user_agent_prefix).size).to eq 2
|
||||
+ end
|
||||
+
|
||||
+ it 'user agent header does not grow when the same channel args hash is used across multiple stubs' do
|
||||
+ shared_channel_args_hash = {}
|
||||
+ 10.times do
|
||||
+ stub = UserAgentEchoServiceStub.new("localhost:#{@port}",
|
||||
+ :this_channel_is_insecure,
|
||||
+ channel_args: shared_channel_args_hash)
|
||||
+ response = stub.an_rpc(EchoMsg.new)
|
||||
+ puts "got echo response: #{response.msg}"
|
||||
+ expected_user_agent_prefix = "grpc-ruby/#{GRPC::VERSION}"
|
||||
+ expect(response.msg.start_with?(expected_user_agent_prefix)).to be true
|
||||
+ # check that the expected user agent prefix occurs in the real user agent exactly once
|
||||
+ expect(response.msg.split(expected_user_agent_prefix).size).to eq 2
|
||||
+ end
|
||||
+ end
|
||||
+end
|
||||
--
|
||||
2.23.0
|
||||
|
||||
34
Fix-destruction-race-between-subchannel-and-client_c.patch
Normal file
34
Fix-destruction-race-between-subchannel-and-client_c.patch
Normal file
@ -0,0 +1,34 @@
|
||||
From 590dfe7db024bea1e39b2c0e367e52b631936f7a Mon Sep 17 00:00:00 2001
|
||||
From: Vijay Pai <vpai@google.com>
|
||||
Date: Tue, 18 Aug 2020 00:53:09 -0700
|
||||
Subject: [PATCH] Fix destruction race between subchannel and client_channel
|
||||
|
||||
|
||||
diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc
|
||||
index 15a39b2388..1b8f2cb1df 100644
|
||||
--- a/src/core/ext/filters/client_channel/client_channel.cc
|
||||
+++ b/src/core/ext/filters/client_channel/client_channel.cc
|
||||
@@ -2176,13 +2176,14 @@ void CallData::Destroy(grpc_call_element* elem,
|
||||
const grpc_call_final_info* /*final_info*/,
|
||||
grpc_closure* then_schedule_closure) {
|
||||
CallData* calld = static_cast<CallData*>(elem->call_data);
|
||||
- if (GPR_LIKELY(calld->subchannel_call_ != nullptr)) {
|
||||
- calld->subchannel_call_->SetAfterCallStackDestroy(then_schedule_closure);
|
||||
- then_schedule_closure = nullptr;
|
||||
- }
|
||||
+ RefCountedPtr<SubchannelCall> subchannel_call = calld->subchannel_call_;
|
||||
calld->~CallData();
|
||||
- // TODO(yashkt) : This can potentially be a Closure::Run
|
||||
- ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, GRPC_ERROR_NONE);
|
||||
+ if (GPR_LIKELY(subchannel_call != nullptr)) {
|
||||
+ subchannel_call->SetAfterCallStackDestroy(then_schedule_closure);
|
||||
+ } else {
|
||||
+ // TODO(yashkt) : This can potentially be a Closure::Run
|
||||
+ ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, GRPC_ERROR_NONE);
|
||||
+ }
|
||||
}
|
||||
|
||||
void CallData::StartTransportStreamOpBatch(
|
||||
--
|
||||
2.23.0
|
||||
|
||||
54
Fix-use-after-free-by-removing-stream-from-transport.patch
Normal file
54
Fix-use-after-free-by-removing-stream-from-transport.patch
Normal file
@ -0,0 +1,54 @@
|
||||
From dc9c5ce77feab8ae01e16d7a3c13cd071c46926a Mon Sep 17 00:00:00 2001
|
||||
From: Vijay Pai <vpai@google.com>
|
||||
Date: Tue, 18 Aug 2020 00:56:48 -0700
|
||||
Subject: [PATCH] Fix use-after-free by removing stream from transport list on
|
||||
destroy_stream
|
||||
|
||||
|
||||
diff --git a/src/core/ext/transport/inproc/inproc_transport.cc b/src/core/ext/transport/inproc/inproc_transport.cc
|
||||
index 4cf9e900a4..db9a0aff18 100644
|
||||
--- a/src/core/ext/transport/inproc/inproc_transport.cc
|
||||
+++ b/src/core/ext/transport/inproc/inproc_transport.cc
|
||||
@@ -202,11 +202,6 @@ struct inproc_stream {
|
||||
}
|
||||
|
||||
t->unref();
|
||||
-
|
||||
- if (closure_at_destroy) {
|
||||
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure_at_destroy,
|
||||
- GRPC_ERROR_NONE);
|
||||
- }
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
@@ -249,7 +244,6 @@ struct inproc_stream {
|
||||
bool other_side_closed = false; // won't talk anymore
|
||||
bool write_buffer_other_side_closed = false; // on hold
|
||||
grpc_stream_refcount* refs;
|
||||
- grpc_closure* closure_at_destroy = nullptr;
|
||||
|
||||
grpc_core::Arena* arena;
|
||||
|
||||
@@ -1183,12 +1177,17 @@ void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) {
|
||||
gpr_mu_unlock(&t->mu->mu);
|
||||
}
|
||||
|
||||
-void destroy_stream(grpc_transport* /*gt*/, grpc_stream* gs,
|
||||
+void destroy_stream(grpc_transport* gt, grpc_stream* gs,
|
||||
grpc_closure* then_schedule_closure) {
|
||||
INPROC_LOG(GPR_INFO, "destroy_stream %p %p", gs, then_schedule_closure);
|
||||
+ inproc_transport* t = reinterpret_cast<inproc_transport*>(gt);
|
||||
inproc_stream* s = reinterpret_cast<inproc_stream*>(gs);
|
||||
- s->closure_at_destroy = then_schedule_closure;
|
||||
+ gpr_mu_lock(&t->mu->mu);
|
||||
+ close_stream_locked(s);
|
||||
+ gpr_mu_unlock(&t->mu->mu);
|
||||
s->~inproc_stream();
|
||||
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure,
|
||||
+ GRPC_ERROR_NONE);
|
||||
}
|
||||
|
||||
void destroy_transport(grpc_transport* gt) {
|
||||
--
|
||||
2.23.0
|
||||
|
||||
274
Ran-generate_proto_ruby.sh-to-update-generated-files.patch
Normal file
274
Ran-generate_proto_ruby.sh-to-update-generated-files.patch
Normal file
@ -0,0 +1,274 @@
|
||||
From 0894f21c2fa7cc281bc584c0e08cbbbad1d04b28 Mon Sep 17 00:00:00 2001
|
||||
From: Stanley Cheung <stanleycheung@google.com>
|
||||
Date: Thu, 13 Aug 2020 23:00:32 -0700
|
||||
Subject: [PATCH] Ran generate_proto_ruby.sh to update generated files
|
||||
|
||||
---
|
||||
src/ruby/bin/math_services_pb.rb | 8 ++--
|
||||
.../pb/grpc/health/v1/health_services_pb.rb | 4 +-
|
||||
.../pb/src/proto/grpc/testing/messages_pb.rb | 5 +++
|
||||
.../proto/grpc/testing/test_services_pb.rb | 40 +++++++++++++------
|
||||
.../testing/benchmark_service_services_pb.rb | 10 ++---
|
||||
.../qps/src/proto/grpc/testing/messages_pb.rb | 5 +++
|
||||
...report_qps_scenario_service_services_pb.rb | 2 +-
|
||||
.../testing/worker_service_services_pb.rb | 8 ++--
|
||||
8 files changed, 54 insertions(+), 28 deletions(-)
|
||||
|
||||
diff --git a/src/ruby/bin/math_services_pb.rb b/src/ruby/bin/math_services_pb.rb
|
||||
index e6f32e3d01..961117ccfa 100644
|
||||
--- a/src/ruby/bin/math_services_pb.rb
|
||||
+++ b/src/ruby/bin/math_services_pb.rb
|
||||
@@ -31,19 +31,19 @@ module Math
|
||||
|
||||
# Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient
|
||||
# and remainder.
|
||||
- rpc :Div, DivArgs, DivReply
|
||||
+ rpc :Div, ::Math::DivArgs, ::Math::DivReply
|
||||
# DivMany accepts an arbitrary number of division args from the client stream
|
||||
# and sends back the results in the reply stream. The stream continues until
|
||||
# the client closes its end; the server does the same after sending all the
|
||||
# replies. The stream ends immediately if either end aborts.
|
||||
- rpc :DivMany, stream(DivArgs), stream(DivReply)
|
||||
+ rpc :DivMany, stream(::Math::DivArgs), stream(::Math::DivReply)
|
||||
# Fib generates numbers in the Fibonacci sequence. If FibArgs.limit > 0, Fib
|
||||
# generates up to limit numbers; otherwise it continues until the call is
|
||||
# canceled. Unlike Fib above, Fib has no final FibReply.
|
||||
- rpc :Fib, FibArgs, stream(Num)
|
||||
+ rpc :Fib, ::Math::FibArgs, stream(::Math::Num)
|
||||
# Sum sums a stream of numbers, returning the final result once the stream
|
||||
# is closed.
|
||||
- rpc :Sum, stream(Num), Num
|
||||
+ rpc :Sum, stream(::Math::Num), ::Math::Num
|
||||
end
|
||||
|
||||
Stub = Service.rpc_stub_class
|
||||
diff --git a/src/ruby/pb/grpc/health/v1/health_services_pb.rb b/src/ruby/pb/grpc/health/v1/health_services_pb.rb
|
||||
index 5992f1c403..351e7e150a 100644
|
||||
--- a/src/ruby/pb/grpc/health/v1/health_services_pb.rb
|
||||
+++ b/src/ruby/pb/grpc/health/v1/health_services_pb.rb
|
||||
@@ -36,7 +36,7 @@ module Grpc
|
||||
|
||||
# If the requested service is unknown, the call will fail with status
|
||||
# NOT_FOUND.
|
||||
- rpc :Check, HealthCheckRequest, HealthCheckResponse
|
||||
+ rpc :Check, ::Grpc::Health::V1::HealthCheckRequest, ::Grpc::Health::V1::HealthCheckResponse
|
||||
# Performs a watch for the serving status of the requested service.
|
||||
# The server will immediately send back a message indicating the current
|
||||
# serving status. It will then subsequently send a new message whenever
|
||||
@@ -52,7 +52,7 @@ module Grpc
|
||||
# should assume this method is not supported and should not retry the
|
||||
# call. If the call terminates with any other status (including OK),
|
||||
# clients should retry the call with appropriate exponential backoff.
|
||||
- rpc :Watch, HealthCheckRequest, stream(HealthCheckResponse)
|
||||
+ rpc :Watch, ::Grpc::Health::V1::HealthCheckRequest, stream(::Grpc::Health::V1::HealthCheckResponse)
|
||||
end
|
||||
|
||||
Stub = Service.rpc_stub_class
|
||||
diff --git a/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb b/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb
|
||||
index f492ccfa67..d902ae0e73 100644
|
||||
--- a/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb
|
||||
+++ b/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb
|
||||
@@ -71,6 +71,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
||||
add_message "grpc.testing.LoadBalancerStatsResponse" do
|
||||
map :rpcs_by_peer, :string, :int32, 1
|
||||
optional :num_failures, :int32, 2
|
||||
+ map :rpcs_by_method, :string, :message, 3, "grpc.testing.LoadBalancerStatsResponse.RpcsByPeer"
|
||||
+ end
|
||||
+ add_message "grpc.testing.LoadBalancerStatsResponse.RpcsByPeer" do
|
||||
+ map :rpcs_by_peer, :string, :int32, 1
|
||||
end
|
||||
add_enum "grpc.testing.PayloadType" do
|
||||
value :COMPRESSABLE, 0
|
||||
@@ -99,6 +103,7 @@ module Grpc
|
||||
ReconnectInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectInfo").msgclass
|
||||
LoadBalancerStatsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsRequest").msgclass
|
||||
LoadBalancerStatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsResponse").msgclass
|
||||
+ LoadBalancerStatsResponse::RpcsByPeer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsResponse.RpcsByPeer").msgclass
|
||||
PayloadType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadType").enummodule
|
||||
GrpclbRouteType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.GrpclbRouteType").enummodule
|
||||
end
|
||||
diff --git a/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb b/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb
|
||||
index 8138bd0114..115acd0dca 100644
|
||||
--- a/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb
|
||||
+++ b/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb
|
||||
@@ -36,31 +36,31 @@ module Grpc
|
||||
self.service_name = 'grpc.testing.TestService'
|
||||
|
||||
# One empty request followed by one empty response.
|
||||
- rpc :EmptyCall, Empty, Empty
|
||||
+ rpc :EmptyCall, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
|
||||
# One request followed by one response.
|
||||
- rpc :UnaryCall, SimpleRequest, SimpleResponse
|
||||
+ rpc :UnaryCall, ::Grpc::Testing::SimpleRequest, ::Grpc::Testing::SimpleResponse
|
||||
# One request followed by one response. Response has cache control
|
||||
# headers set such that a caching HTTP proxy (such as GFE) can
|
||||
# satisfy subsequent requests.
|
||||
- rpc :CacheableUnaryCall, SimpleRequest, SimpleResponse
|
||||
+ rpc :CacheableUnaryCall, ::Grpc::Testing::SimpleRequest, ::Grpc::Testing::SimpleResponse
|
||||
# One request followed by a sequence of responses (streamed download).
|
||||
# The server returns the payload with client desired type and sizes.
|
||||
- rpc :StreamingOutputCall, StreamingOutputCallRequest, stream(StreamingOutputCallResponse)
|
||||
+ rpc :StreamingOutputCall, ::Grpc::Testing::StreamingOutputCallRequest, stream(::Grpc::Testing::StreamingOutputCallResponse)
|
||||
# A sequence of requests followed by one response (streamed upload).
|
||||
# The server returns the aggregated size of client payload as the result.
|
||||
- rpc :StreamingInputCall, stream(StreamingInputCallRequest), StreamingInputCallResponse
|
||||
+ rpc :StreamingInputCall, stream(::Grpc::Testing::StreamingInputCallRequest), ::Grpc::Testing::StreamingInputCallResponse
|
||||
# A sequence of requests with each request served by the server immediately.
|
||||
# As one request could lead to multiple responses, this interface
|
||||
# demonstrates the idea of full duplexing.
|
||||
- rpc :FullDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse)
|
||||
+ rpc :FullDuplexCall, stream(::Grpc::Testing::StreamingOutputCallRequest), stream(::Grpc::Testing::StreamingOutputCallResponse)
|
||||
# A sequence of requests followed by a sequence of responses.
|
||||
# The server buffers all the client requests and then serves them in order. A
|
||||
# stream of responses are returned to the client when the server starts with
|
||||
# first request.
|
||||
- rpc :HalfDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse)
|
||||
+ rpc :HalfDuplexCall, stream(::Grpc::Testing::StreamingOutputCallRequest), stream(::Grpc::Testing::StreamingOutputCallResponse)
|
||||
# The test server will not implement this method. It will be used
|
||||
# to test the behavior when clients call unimplemented methods.
|
||||
- rpc :UnimplementedCall, Empty, Empty
|
||||
+ rpc :UnimplementedCall, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
|
||||
end
|
||||
|
||||
Stub = Service.rpc_stub_class
|
||||
@@ -77,7 +77,7 @@ module Grpc
|
||||
self.service_name = 'grpc.testing.UnimplementedService'
|
||||
|
||||
# A call that no server should implement
|
||||
- rpc :UnimplementedCall, Empty, Empty
|
||||
+ rpc :UnimplementedCall, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
|
||||
end
|
||||
|
||||
Stub = Service.rpc_stub_class
|
||||
@@ -92,8 +92,8 @@ module Grpc
|
||||
self.unmarshal_class_method = :decode
|
||||
self.service_name = 'grpc.testing.ReconnectService'
|
||||
|
||||
- rpc :Start, ReconnectParams, Empty
|
||||
- rpc :Stop, Empty, ReconnectInfo
|
||||
+ rpc :Start, ::Grpc::Testing::ReconnectParams, ::Grpc::Testing::Empty
|
||||
+ rpc :Stop, ::Grpc::Testing::Empty, ::Grpc::Testing::ReconnectInfo
|
||||
end
|
||||
|
||||
Stub = Service.rpc_stub_class
|
||||
@@ -109,7 +109,23 @@ module Grpc
|
||||
self.service_name = 'grpc.testing.LoadBalancerStatsService'
|
||||
|
||||
# Gets the backend distribution for RPCs sent by a test client.
|
||||
- rpc :GetClientStats, LoadBalancerStatsRequest, LoadBalancerStatsResponse
|
||||
+ rpc :GetClientStats, ::Grpc::Testing::LoadBalancerStatsRequest, ::Grpc::Testing::LoadBalancerStatsResponse
|
||||
+ end
|
||||
+
|
||||
+ Stub = Service.rpc_stub_class
|
||||
+ end
|
||||
+ module XdsUpdateHealthService
|
||||
+ # A service to remotely control health status of an xDS test server.
|
||||
+ class Service
|
||||
+
|
||||
+ include GRPC::GenericService
|
||||
+
|
||||
+ self.marshal_class_method = :encode
|
||||
+ self.unmarshal_class_method = :decode
|
||||
+ self.service_name = 'grpc.testing.XdsUpdateHealthService'
|
||||
+
|
||||
+ rpc :SetServing, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
|
||||
+ rpc :SetNotServing, ::Grpc::Testing::Empty, ::Grpc::Testing::Empty
|
||||
end
|
||||
|
||||
Stub = Service.rpc_stub_class
|
||||
diff --git a/src/ruby/qps/src/proto/grpc/testing/benchmark_service_services_pb.rb b/src/ruby/qps/src/proto/grpc/testing/benchmark_service_services_pb.rb
|
||||
index 65e5a75c4d..63e2d5d20f 100644
|
||||
--- a/src/ruby/qps/src/proto/grpc/testing/benchmark_service_services_pb.rb
|
||||
+++ b/src/ruby/qps/src/proto/grpc/testing/benchmark_service_services_pb.rb
|
||||
@@ -34,20 +34,20 @@ module Grpc
|
||||
|
||||
# One request followed by one response.
|
||||
# The server returns the client payload as-is.
|
||||
- rpc :UnaryCall, SimpleRequest, SimpleResponse
|
||||
+ rpc :UnaryCall, ::Grpc::Testing::SimpleRequest, ::Grpc::Testing::SimpleResponse
|
||||
# Repeated sequence of one request followed by one response.
|
||||
# Should be called streaming ping-pong
|
||||
# The server returns the client payload as-is on each response
|
||||
- rpc :StreamingCall, stream(SimpleRequest), stream(SimpleResponse)
|
||||
+ rpc :StreamingCall, stream(::Grpc::Testing::SimpleRequest), stream(::Grpc::Testing::SimpleResponse)
|
||||
# Single-sided unbounded streaming from client to server
|
||||
# The server returns the client payload as-is once the client does WritesDone
|
||||
- rpc :StreamingFromClient, stream(SimpleRequest), SimpleResponse
|
||||
+ rpc :StreamingFromClient, stream(::Grpc::Testing::SimpleRequest), ::Grpc::Testing::SimpleResponse
|
||||
# Single-sided unbounded streaming from server to client
|
||||
# The server repeatedly returns the client payload as-is
|
||||
- rpc :StreamingFromServer, SimpleRequest, stream(SimpleResponse)
|
||||
+ rpc :StreamingFromServer, ::Grpc::Testing::SimpleRequest, stream(::Grpc::Testing::SimpleResponse)
|
||||
# Two-sided unbounded streaming between server to client
|
||||
# Both sides send the content of their own choice to the other
|
||||
- rpc :StreamingBothWays, stream(SimpleRequest), stream(SimpleResponse)
|
||||
+ rpc :StreamingBothWays, stream(::Grpc::Testing::SimpleRequest), stream(::Grpc::Testing::SimpleResponse)
|
||||
end
|
||||
|
||||
Stub = Service.rpc_stub_class
|
||||
diff --git a/src/ruby/qps/src/proto/grpc/testing/messages_pb.rb b/src/ruby/qps/src/proto/grpc/testing/messages_pb.rb
|
||||
index f492ccfa67..d902ae0e73 100644
|
||||
--- a/src/ruby/qps/src/proto/grpc/testing/messages_pb.rb
|
||||
+++ b/src/ruby/qps/src/proto/grpc/testing/messages_pb.rb
|
||||
@@ -71,6 +71,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
||||
add_message "grpc.testing.LoadBalancerStatsResponse" do
|
||||
map :rpcs_by_peer, :string, :int32, 1
|
||||
optional :num_failures, :int32, 2
|
||||
+ map :rpcs_by_method, :string, :message, 3, "grpc.testing.LoadBalancerStatsResponse.RpcsByPeer"
|
||||
+ end
|
||||
+ add_message "grpc.testing.LoadBalancerStatsResponse.RpcsByPeer" do
|
||||
+ map :rpcs_by_peer, :string, :int32, 1
|
||||
end
|
||||
add_enum "grpc.testing.PayloadType" do
|
||||
value :COMPRESSABLE, 0
|
||||
@@ -99,6 +103,7 @@ module Grpc
|
||||
ReconnectInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectInfo").msgclass
|
||||
LoadBalancerStatsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsRequest").msgclass
|
||||
LoadBalancerStatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsResponse").msgclass
|
||||
+ LoadBalancerStatsResponse::RpcsByPeer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadBalancerStatsResponse.RpcsByPeer").msgclass
|
||||
PayloadType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadType").enummodule
|
||||
GrpclbRouteType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.GrpclbRouteType").enummodule
|
||||
end
|
||||
diff --git a/src/ruby/qps/src/proto/grpc/testing/report_qps_scenario_service_services_pb.rb b/src/ruby/qps/src/proto/grpc/testing/report_qps_scenario_service_services_pb.rb
|
||||
index ddc81bed3d..5e41cfeead 100644
|
||||
--- a/src/ruby/qps/src/proto/grpc/testing/report_qps_scenario_service_services_pb.rb
|
||||
+++ b/src/ruby/qps/src/proto/grpc/testing/report_qps_scenario_service_services_pb.rb
|
||||
@@ -33,7 +33,7 @@ module Grpc
|
||||
self.service_name = 'grpc.testing.ReportQpsScenarioService'
|
||||
|
||||
# Report results of a QPS test benchmark scenario.
|
||||
- rpc :ReportScenario, ScenarioResult, Void
|
||||
+ rpc :ReportScenario, ::Grpc::Testing::ScenarioResult, ::Grpc::Testing::Void
|
||||
end
|
||||
|
||||
Stub = Service.rpc_stub_class
|
||||
diff --git a/src/ruby/qps/src/proto/grpc/testing/worker_service_services_pb.rb b/src/ruby/qps/src/proto/grpc/testing/worker_service_services_pb.rb
|
||||
index a7ecc95757..049db47778 100644
|
||||
--- a/src/ruby/qps/src/proto/grpc/testing/worker_service_services_pb.rb
|
||||
+++ b/src/ruby/qps/src/proto/grpc/testing/worker_service_services_pb.rb
|
||||
@@ -38,18 +38,18 @@ module Grpc
|
||||
# stats. Closing the stream will initiate shutdown of the test server
|
||||
# and once the shutdown has finished, the OK status is sent to terminate
|
||||
# this RPC.
|
||||
- rpc :RunServer, stream(ServerArgs), stream(ServerStatus)
|
||||
+ rpc :RunServer, stream(::Grpc::Testing::ServerArgs), stream(::Grpc::Testing::ServerStatus)
|
||||
# Start client with specified workload.
|
||||
# First request sent specifies the ClientConfig followed by ClientStatus
|
||||
# response. After that, a "Mark" can be sent anytime to request the latest
|
||||
# stats. Closing the stream will initiate shutdown of the test client
|
||||
# and once the shutdown has finished, the OK status is sent to terminate
|
||||
# this RPC.
|
||||
- rpc :RunClient, stream(ClientArgs), stream(ClientStatus)
|
||||
+ rpc :RunClient, stream(::Grpc::Testing::ClientArgs), stream(::Grpc::Testing::ClientStatus)
|
||||
# Just return the core count - unary call
|
||||
- rpc :CoreCount, CoreRequest, CoreResponse
|
||||
+ rpc :CoreCount, ::Grpc::Testing::CoreRequest, ::Grpc::Testing::CoreResponse
|
||||
# Quit this worker
|
||||
- rpc :QuitWorker, Void, Void
|
||||
+ rpc :QuitWorker, ::Grpc::Testing::Void, ::Grpc::Testing::Void
|
||||
end
|
||||
|
||||
Stub = Service.rpc_stub_class
|
||||
--
|
||||
2.23.0
|
||||
|
||||
BIN
abseil-20200225.tar.gz
Normal file
BIN
abseil-20200225.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
32
add-secure-compile-option-in-Makefile.patch
Normal file
32
add-secure-compile-option-in-Makefile.patch
Normal file
@ -0,0 +1,32 @@
|
||||
From:bitcoffee<854182924@qq.com>
|
||||
Reason:add-secure-compile-option-in-Makefile
|
||||
base on author:zhuchunyi commit:b00721fa
|
||||
diff -urN grpc/CMakeLists.txt grpc_new/CMakeLists.txt
|
||||
--- grpc/CMakeLists.txt 2020-08-24 09:14:14.361862041 +0800
|
||||
+++ grpc_new/CMakeLists.txt 2020-08-27 15:36:51.498277936 +0800
|
||||
@@ -225,6 +226,9 @@
|
||||
endif()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_gRPC_C_CXX_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_gRPC_C_CXX_FLAGS}")
|
||||
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,now -fPIE -fPIC")
|
||||
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,now -fstack-protector-strong")
|
||||
+set(_gRPC_ALLTARGETS_LIBRARYIES "${_gRPC_ALLTARGETS_LIBRARYIES} -Wl,-z,now -pie")
|
||||
|
||||
if(gRPC_USE_PROTO_LITE)
|
||||
set(_gRPC_PROTOBUF_LIBRARY_NAME "libprotobuf-lite")
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 6ede6e34d2..d6190ecde4 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -478,6 +478,10 @@ LDFLAGS += $(EXTRA_LDFLAGS)
|
||||
DEFINES += $(EXTRA_DEFINES)
|
||||
LDLIBS += $(EXTRA_LDLIBS)
|
||||
|
||||
+CFLAGS += -Wl,-z,now -fPIE -fPIC
|
||||
+CPPFLAGS += -Wl,-z,now -fstack-protector-strong
|
||||
+LDFLAGS += -Wl,-z,now -pie
|
||||
+
|
||||
HOST_CPPFLAGS += $(CPPFLAGS)
|
||||
HOST_CFLAGS += $(CFLAGS)
|
||||
HOST_CXXFLAGS += $(CXXFLAGS)
|
||||
47
allow-grpcio-to-be-build-against-system-re2.patch
Normal file
47
allow-grpcio-to-be-build-against-system-re2.patch
Normal file
@ -0,0 +1,47 @@
|
||||
From 88b5952945662bee3d4b250a4d161b36afbf4f44 Mon Sep 17 00:00:00 2001
|
||||
From: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
|
||||
Date: Fri, 16 Oct 2020 20:21:31 +0200
|
||||
Subject: [PATCH] Allow grpcio to be built against system re2
|
||||
|
||||
---
|
||||
setup.py | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 184d5457f1a..f7e1fbf7c56 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -133,6 +133,11 @@
|
||||
BUILD_WITH_SYSTEM_CARES = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_CARES',
|
||||
False)
|
||||
|
||||
+# Export this variable to use the system installation of re2. You need to
|
||||
+# have the header files installed (in /usr/include/re2) and during
|
||||
+# runtime, the shared library must be installed
|
||||
+BUILD_WITH_SYSTEM_RE2 = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_RE2', False)
|
||||
+
|
||||
# For local development use only: This skips building gRPC Core and its
|
||||
# dependencies, including protobuf and boringssl. This allows "incremental"
|
||||
# compilation by first building gRPC Core using make, then building only the
|
||||
@@ -258,6 +263,10 @@ def check_linker_need_libatomic():
|
||||
CORE_C_FILES = filter(lambda x: 'third_party/cares' not in x, CORE_C_FILES)
|
||||
CARES_INCLUDE = (os.path.join('/usr', 'include'),)
|
||||
|
||||
+if BUILD_WITH_SYSTEM_RE2:
|
||||
+ CORE_C_FILES = filter(lambda x: 'third_party/re2' not in x, CORE_C_FILES)
|
||||
+ RE2_INCLUDE = (os.path.join('/usr', 'include', 're2'),)
|
||||
+
|
||||
EXTENSION_INCLUDE_DIRECTORIES = ((PYTHON_STEM,) + CORE_INCLUDE + ABSL_INCLUDE +
|
||||
ADDRESS_SORTING_INCLUDE + CARES_INCLUDE +
|
||||
RE2_INCLUDE + SSL_INCLUDE + UPB_INCLUDE +
|
||||
@@ -284,6 +293,8 @@ def check_linker_need_libatomic():
|
||||
EXTENSION_LIBRARIES += ('z',)
|
||||
if BUILD_WITH_SYSTEM_CARES:
|
||||
EXTENSION_LIBRARIES += ('cares',)
|
||||
+if BUILD_WITH_SYSTEM_RE2:
|
||||
+ EXTENSION_LIBRARIES += ('re2',)
|
||||
|
||||
DEFINE_MACROS = (('OPENSSL_NO_ASM', 1), ('_WIN32_WINNT', 0x600))
|
||||
if not DISABLE_LIBC_COMPATIBILITY:
|
||||
---
|
||||
28.1
|
||||
122
fix-re2-build-error.patch
Normal file
122
fix-re2-build-error.patch
Normal file
@ -0,0 +1,122 @@
|
||||
From 45e413d2520795e7281e9a592af81620349bc186 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Wankadia <junyer@google.com>
|
||||
Date: Wed, 9 Sep 2020 04:26:36 -0700
|
||||
Subject: [PATCH] Attempt to find RE2 via CMake and via pkg-config.
|
||||
|
||||
---
|
||||
CMakeLists.txt | 1 +
|
||||
cmake/modules/Findre2.cmake | 58 +++++++++++++++++++++++++++++++
|
||||
cmake/re2.cmake | 6 +---
|
||||
templates/CMakeLists.txt.template | 1 +
|
||||
4 files changed, 61 insertions(+), 5 deletions(-)
|
||||
create mode 100644 cmake/modules/Findre2.cmake
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 4b04d25ac50..cecb4396c57 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -15624,6 +15624,7 @@ install(FILES
|
||||
)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/Findc-ares.cmake
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/Findre2.cmake
|
||||
DESTINATION ${gRPC_INSTALL_CMAKEDIR}/modules
|
||||
)
|
||||
|
||||
diff --git a/cmake/modules/Findre2.cmake b/cmake/modules/Findre2.cmake
|
||||
new file mode 100644
|
||||
index 00000000000..41df4547138
|
||||
--- /dev/null
|
||||
+++ b/cmake/modules/Findre2.cmake
|
||||
@@ -0,0 +1,58 @@
|
||||
+# Copyright 2017 gRPC authors.
|
||||
+#
|
||||
+# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
+# you may not use this file except in compliance with the License.
|
||||
+# You may obtain a copy of the License at
|
||||
+#
|
||||
+# http://www.apache.org/licenses/LICENSE-2.0
|
||||
+#
|
||||
+# Unless required by applicable law or agreed to in writing, software
|
||||
+# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
+# See the License for the specific language governing permissions and
|
||||
+# limitations under the License.
|
||||
+
|
||||
+find_package(re2 QUIET CONFIG)
|
||||
+if(re2_FOUND)
|
||||
+ message(STATUS "Found RE2 via CMake.")
|
||||
+ return()
|
||||
+endif()
|
||||
+
|
||||
+find_package(PkgConfig REQUIRED)
|
||||
+# TODO(junyer): Use the IMPORTED_TARGET option whenever CMake 3.6 (or newer)
|
||||
+# becomes the minimum required: that will take care of the add_library() and
|
||||
+# set_property() calls; then we can simply alias PkgConfig::RE2 as re2::re2.
|
||||
+# For now, we can only set INTERFACE_* properties that existed in CMake 3.5.
|
||||
+pkg_check_modules(RE2 QUIET re2)
|
||||
+if(RE2_FOUND)
|
||||
+ set(re2_FOUND "${RE2_FOUND}")
|
||||
+ add_library(re2::re2 INTERFACE IMPORTED)
|
||||
+ if(RE2_INCLUDE_DIRS)
|
||||
+ set_property(TARGET re2::re2 PROPERTY
|
||||
+ INTERFACE_INCLUDE_DIRECTORIES "${RE2_INCLUDE_DIRS}")
|
||||
+ endif()
|
||||
+ if(RE2_CFLAGS_OTHER)
|
||||
+ # Filter out the -std flag, which is handled by CMAKE_CXX_STANDARD.
|
||||
+ # TODO(junyer): Use the FILTER option whenever CMake 3.6 (or newer)
|
||||
+ # becomes the minimum required: that will allow this to be concise.
|
||||
+ foreach(flag IN LISTS RE2_CFLAGS_OTHER)
|
||||
+ if("${flag}" MATCHES "^-std=")
|
||||
+ list(REMOVE_ITEM RE2_CFLAGS_OTHER "${flag}")
|
||||
+ endif()
|
||||
+ endforeach()
|
||||
+ set_property(TARGET re2::re2 PROPERTY
|
||||
+ INTERFACE_COMPILE_OPTIONS "${RE2_CFLAGS_OTHER}")
|
||||
+ endif()
|
||||
+ if(RE2_LDFLAGS)
|
||||
+ set_property(TARGET re2::re2 PROPERTY
|
||||
+ INTERFACE_LINK_LIBRARIES "${RE2_LDFLAGS}")
|
||||
+ endif()
|
||||
+ message(STATUS "Found RE2 via pkg-config.")
|
||||
+ return()
|
||||
+endif()
|
||||
+
|
||||
+if(re2_FIND_REQUIRED)
|
||||
+ message(FATAL_ERROR "Failed to find RE2.")
|
||||
+elseif(NOT re2_FIND_QUIETLY)
|
||||
+ message(WARNING "Failed to find RE2.")
|
||||
+endif()
|
||||
diff --git a/cmake/re2.cmake b/cmake/re2.cmake
|
||||
index 3e83aae6910..974b0a436e2 100644
|
||||
--- a/cmake/re2.cmake
|
||||
+++ b/cmake/re2.cmake
|
||||
@@ -45,13 +45,9 @@ if(gRPC_RE2_PROVIDER STREQUAL "module")
|
||||
set(gRPC_INSTALL FALSE)
|
||||
endif()
|
||||
elseif(gRPC_RE2_PROVIDER STREQUAL "package")
|
||||
- find_package(re2 REQUIRED CONFIG)
|
||||
-
|
||||
+ find_package(re2 REQUIRED)
|
||||
if(TARGET re2::re2)
|
||||
set(_gRPC_RE2_LIBRARIES re2::re2)
|
||||
- else()
|
||||
- set(_gRPC_RE2_LIBRARIES ${RE2_LIBRARIES})
|
||||
endif()
|
||||
- set(_gRPC_RE2_INCLUDE_DIR ${RE2_INCLUDE_DIRS})
|
||||
set(_gRPC_FIND_RE2 "if(NOT re2_FOUND)\n find_package(re2)\nendif()")
|
||||
endif()
|
||||
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
|
||||
index c7f2556dc92..f7db0fd2d0c 100644
|
||||
--- a/templates/CMakeLists.txt.template
|
||||
+++ b/templates/CMakeLists.txt.template
|
||||
@@ -706,6 +706,7 @@
|
||||
)
|
||||
install(FILES
|
||||
<%text>${CMAKE_CURRENT_SOURCE_DIR}</%text>/cmake/modules/Findc-ares.cmake
|
||||
+ <%text>${CMAKE_CURRENT_SOURCE_DIR}</%text>/cmake/modules/Findre2.cmake
|
||||
DESTINATION <%text>${gRPC_INSTALL_CMAKEDIR}</%text>/modules
|
||||
)
|
||||
|
||||
--
|
||||
2.28.0
|
||||
BIN
googletest-release-1.10.0.tar.gz
Normal file
BIN
googletest-release-1.10.0.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
grpc-1.31.0.tar.gz
Normal file
BIN
grpc-1.31.0.tar.gz
Normal file
Binary file not shown.
93
grpc.spec
93
grpc.spec
@ -1,21 +1,31 @@
|
||||
Name: grpc
|
||||
Version: 1.30.2
|
||||
Release: 1
|
||||
Version: 1.31.0
|
||||
Release: 2
|
||||
Summary: A modern, open source high performance RPC framework that can run in any environment
|
||||
License: ASL 2.0
|
||||
URL: https://www.grpc.io
|
||||
Source0: https://github.com/grpc/grpc/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||
Source1: abseil-cpp-b832dce8489ef7b6231384909fd9b68d5a5ff2b7.tar.gz
|
||||
Source2: v1.5.1.tar.gz
|
||||
Source1: abseil-20200225.tar.gz
|
||||
Source2: benchmark-v1.5.1.tar.gz
|
||||
Source4: googletest-release-1.10.0.tar.gz
|
||||
|
||||
Patch0001: 0001-cxx-Arg-List-Too-Long.patch
|
||||
Patch0002: 0002-add-secure-compile-option-in-Makefile.patch
|
||||
Patch0000: Copy-channel-args-hash-before-appending-ruby-user-ag.patch
|
||||
Patch0001: Ran-generate_proto_ruby.sh-to-update-generated-files.patch
|
||||
Patch0002: Add-ABSL_RANDOM_HWAES_FLAGS.patch
|
||||
Patch0003: Fix-destruction-race-between-subchannel-and-client_c.patch
|
||||
Patch0004: Fix-use-after-free-by-removing-stream-from-transport.patch
|
||||
Patch0005: repair-gflags-compile-error-with-cmake.patch
|
||||
Patch0006: repair-pkgconfig-path.patch
|
||||
Patch0007: add-secure-compile-option-in-Makefile.patch
|
||||
Patch0008: fix-re2-build-error.patch
|
||||
Patch0009: allow-grpcio-to-be-build-against-system-re2.patch
|
||||
|
||||
BuildRequires: gcc-c++ pkgconfig protobuf-devel protobuf-compiler gdb
|
||||
BuildRequires: openssl-devel c-ares-devel gflags-devel gtest-devel zlib-devel gperftools-devel
|
||||
BuildRequires: python3-devel python3-setuptools python3-Cython
|
||||
BuildRequires: grpc
|
||||
Requires: protobuf-compiler
|
||||
BuildRequires: cmake >= 3.13.0
|
||||
BuildRequires: pkgconfig(re2)
|
||||
Requires: protobuf-compiler gflags
|
||||
|
||||
Provides: %{name}-plugins = %{version}-%{release}
|
||||
Provides: %{name}-cli = %{version}-%{release}
|
||||
@ -31,6 +41,7 @@ mile of distributed computing to connect devices, mobile applications and browse
|
||||
%package devel
|
||||
Summary: gRPC library development files
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: pkgconfig(re2)
|
||||
|
||||
%description devel
|
||||
Development headers and files for gRPC libraries.
|
||||
@ -50,25 +61,48 @@ sed -i 's:$(prefix)/lib:$(prefix)/%{_lib}:' Makefile
|
||||
sed -i 's:^GTEST_LIB =.*::' Makefile
|
||||
tar -zxf %{SOURCE1} --strip-components 1 -C %{_builddir}/%{name}-%{version}/third_party/abseil-cpp/
|
||||
tar -zxf %{SOURCE2} --strip-components 1 -C %{_builddir}/%{name}-%{version}/third_party/benchmark/
|
||||
tar -zxf %{SOURCE4} --strip-components 1 -C %{_builddir}/%{name}-%{version}/third_party/googletest/
|
||||
|
||||
%build
|
||||
%make_build shared plugins
|
||||
mkdir -p cmake/build
|
||||
cd cmake/build
|
||||
cmake ../../ -DgRPC_INSTALL=ON\
|
||||
-DgRPC_CARES_PROVIDER=package \
|
||||
-DgRPC_PROTOBUF_PROVIDER=package \
|
||||
-DgRPC_SSL_PROVIDER=package \
|
||||
-DgRPC_ZLIB_PROVIDER=package \
|
||||
-DgRPC_RE2_PROVIDER=package \
|
||||
-DgRPC_GFLAGS_PROVIDER=package \
|
||||
-DgRPC_INSTALL_LIBDIR=%{buildroot}%{_libdir} \
|
||||
-DgRPC_INSTALL_BINDIR=%{buildroot}%{_bindir} \
|
||||
-DgRPC_INSTALL_INCLUDEDIR=%{buildroot}%{_includedir} \
|
||||
-DgRPC_INSTALL_CMAKEDIR=%{buildroot}%{_prefix}/lib/cmake/%{name} \
|
||||
-DgRPC_INSTALL_SHAREDIR=%{buildroot}%{_datadir}/%{name} \
|
||||
-DgRPC_INSTALL_PKGCONFIGDIR=%{buildroot}%{_libdir}/pkgconfig \
|
||||
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
|
||||
-DgRPC_BUILD_TESTS=ON \
|
||||
-DBUILD_SHARED_LIBS=ON
|
||||
make -j24 V=1
|
||||
|
||||
# build python module
|
||||
export GRPC_PYTHON_BUILD_WITH_CYTHON=True
|
||||
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=True
|
||||
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=True
|
||||
export GRPC_PYTHON_BUILD_SYSTEM_CARES=True
|
||||
export GRPC_PYTHON_BUILD_SYSTEM_RE2=True
|
||||
export CFLAGS="%optflags"
|
||||
cd ../..
|
||||
%py3_build
|
||||
|
||||
%install
|
||||
make install prefix="%{buildroot}%{_prefix}"
|
||||
make install-grpc-cli prefix="%{buildroot}%{_prefix}"
|
||||
|
||||
cp -a %{_libdir}/lib{address_sorting,gpr,grpc,grpc_cronet,grpc_unsecure,upb}.so.9* %{buildroot}%{_libdir}
|
||||
cd cmake/build
|
||||
make install/local
|
||||
cp grpc_cli %{buildroot}%{_bindir}
|
||||
cp libgrpc++_test_config.so* %{buildroot}%{_libdir}
|
||||
rm -rf %{buildroot}%{_prefix}/lib
|
||||
|
||||
%delete_la_and_a
|
||||
cd ../..
|
||||
%py3_install
|
||||
|
||||
%ldconfig_scriptlets
|
||||
@ -82,12 +116,13 @@ cp -a %{_libdir}/lib{address_sorting,gpr,grpc,grpc_cronet,grpc_unsecure,upb}.so.
|
||||
%{_bindir}/grpc_*_plugin
|
||||
|
||||
%{_libdir}/*.so.1*
|
||||
%{_libdir}/*.so.9*
|
||||
%{_datadir}/grpc
|
||||
%{_libdir}/*absl*
|
||||
%{_datadir}/%{name}
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/*.so
|
||||
%exclude %{_libdir}/*absl*
|
||||
%{_libdir}/pkgconfig/*
|
||||
%{_includedir}/grpc
|
||||
%{_includedir}/grpc++
|
||||
@ -99,17 +134,35 @@ cp -a %{_libdir}/lib{address_sorting,gpr,grpc,grpc_cronet,grpc_unsecure,upb}.so.
|
||||
%{python3_sitearch}/grpcio-%{version}-py?.?.egg-info
|
||||
|
||||
%changelog
|
||||
* Fri Jul 31 2020 gaihuiying <gaihuiying1@huawei.com> - 1.30.2-1
|
||||
* Wed Dec 09 2020 gaihuiying <gaihuiying1@huawei.com> - 1.31.0-2
|
||||
- Type:requirement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:update grpc version to 1.30.2
|
||||
- DESC:separate re2 from grpc source
|
||||
|
||||
* Tue Jun 9 2020 zhujunhao <zhujunhao8@huawei.com> - 1.28.1-1
|
||||
- upadate to 1.28.1
|
||||
* Mon Aug 28 2020 liuxin <liuxin264@huawei.com> - 1.31.0-1
|
||||
- Type:requirement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:update grpc version to 1.31.0
|
||||
|
||||
* Tue Aug 18 2020 chenyaqiang <chenyaqiang@huawei.com> - 1.28.1-3
|
||||
- rebuild for package build and clarify last changelog info
|
||||
|
||||
* Mon May 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.28.1-2
|
||||
- Type:rebuild
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:update to 1.28.2
|
||||
|
||||
* Mon May 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.28.1-1
|
||||
- Type:requirement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:update to 1.28.1
|
||||
|
||||
* Fri Mar 20 2020 songnannan <songnannan2@huawei.com> - 1.22.0-3
|
||||
- add gdb in buildrequires
|
||||
- add gdb in buildrequires
|
||||
|
||||
* Sat Jan 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.22.0-2
|
||||
- Delete unused patch
|
||||
|
||||
17
repair-gflags-compile-error-with-cmake.patch
Normal file
17
repair-gflags-compile-error-with-cmake.patch
Normal file
@ -0,0 +1,17 @@
|
||||
From: bitcoffee<854182924@qq.com>
|
||||
Reason: repair libgrpc++_test_config.so lost dependence on glfags
|
||||
|
||||
diff -urN grpc/cmake/gflags.cmake grpc_new/cmake/gflags.cmake
|
||||
--- grpc/cmake/gflags.cmake 2020-08-25 10:00:46.356802187 +0800
|
||||
+++ grpc_new/cmake/gflags.cmake 2020-08-25 20:00:19.296009625 +0800
|
||||
@@ -25,8 +25,8 @@
|
||||
elseif(gRPC_GFLAGS_PROVIDER STREQUAL "package")
|
||||
# Use "CONFIG" as there is no built-in cmake module for gflags.
|
||||
find_package(gflags REQUIRED CONFIG)
|
||||
- if(TARGET gflags::gflags)
|
||||
- set(_gRPC_GFLAGS_LIBRARIES gflags::gflags)
|
||||
+ if(TARGET gflags)
|
||||
+ set(_gRPC_GFLAGS_LIBRARIES gflags)
|
||||
endif()
|
||||
set(_gRPC_FIND_GFLAGS "if(NOT gflags_FOUND)\n find_package(gflags CONFIG)\nendif()")
|
||||
elseif(gRPC_GFLAGS_PROVIDER STREQUAL "none")
|
||||
34
repair-pkgconfig-path.patch
Normal file
34
repair-pkgconfig-path.patch
Normal file
@ -0,0 +1,34 @@
|
||||
From: bitcoffee<854182924@qq.com>
|
||||
Reason: pkgconfig install path write dead in the file, modify it
|
||||
diff -urN grpc/cmake/pkg-config-template.pc.in grpc_new/cmake/pkg-config-template.pc.in
|
||||
--- grpc/cmake/pkg-config-template.pc.in 2020-08-21 14:34:20.512037605 +0800
|
||||
+++ grpc_new/cmake/pkg-config-template.pc.in 2020-08-27 20:47:46.372035834 +0800
|
||||
@@ -1,7 +1,7 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
includedir=${prefix}/include
|
||||
-libdir=${exec_prefix}/lib
|
||||
+libdir=${exec_prefix}/lib64
|
||||
|
||||
Name: @PC_NAME@
|
||||
Description: @PC_DESCRIPTION@
|
||||
diff -urN grpc/CMakeLists.txt grpc_new/CMakeLists.txt
|
||||
--- grpc/CMakeLists.txt 2020-08-24 09:14:14.361862041 +0800
|
||||
+++ grpc_new/CMakeLists.txt 2020-08-27 14:50:00.371507303 +0800
|
||||
@@ -42,6 +42,7 @@
|
||||
set(gRPC_INSTALL_INCLUDEDIR "include" CACHE STRING "Installation directory for headers")
|
||||
set(gRPC_INSTALL_CMAKEDIR "lib/cmake/${PACKAGE_NAME}" CACHE STRING "Installation directory for cmake config files")
|
||||
set(gRPC_INSTALL_SHAREDIR "share/grpc" CACHE STRING "Installation directory for root certificates")
|
||||
+set(gRPC_INSTALL_PKGCONFIGDIR "lib/pkgconfig" CACHE STRING "Installation directory for pkgconfig")
|
||||
|
||||
# Options
|
||||
option(gRPC_BUILD_TESTS "Build tests" OFF)
|
||||
@@ -15666,7 +15667,7 @@
|
||||
"${output_filepath}"
|
||||
@ONLY)
|
||||
install(FILES "${output_filepath}"
|
||||
- DESTINATION "lib/pkgconfig/")
|
||||
+ DESTINATION ${gRPC_INSTALL_PKGCONFIGDIR})
|
||||
endfunction()
|
||||
|
||||
# gpr .pc file
|
||||
Loading…
x
Reference in New Issue
Block a user