diff --git a/Add-ABSL_RANDOM_HWAES_FLAGS.patch b/Add-ABSL_RANDOM_HWAES_FLAGS.patch deleted file mode 100644 index 3a228f0a3e4bf3954859a3a86098ad4075d026eb..0000000000000000000000000000000000000000 --- a/Add-ABSL_RANDOM_HWAES_FLAGS.patch +++ /dev/null @@ -1,91 +0,0 @@ -From bf87ec9e442d554bf1bc5874c1db9607e59899e3 Mon Sep 17 00:00:00 2001 -From: Esun Kim -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 - diff --git a/Copy-channel-args-hash-before-appending-ruby-user-ag.patch b/Copy-channel-args-hash-before-appending-ruby-user-ag.patch deleted file mode 100644 index 6b38a1db058ab65258830140d940c6df74ee3962..0000000000000000000000000000000000000000 --- a/Copy-channel-args-hash-before-appending-ruby-user-ag.patch +++ /dev/null @@ -1,107 +0,0 @@ -From b65daaa52d2e24dadff465a2a84c0e8220282047 Mon Sep 17 00:00:00 2001 -From: Alexander Polcyn -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 - diff --git a/Fix-destruction-race-between-subchannel-and-client_c.patch b/Fix-destruction-race-between-subchannel-and-client_c.patch deleted file mode 100644 index fb410706447390274a865c41bae6995bddef5529..0000000000000000000000000000000000000000 --- a/Fix-destruction-race-between-subchannel-and-client_c.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 590dfe7db024bea1e39b2c0e367e52b631936f7a Mon Sep 17 00:00:00 2001 -From: Vijay Pai -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(elem->call_data); -- if (GPR_LIKELY(calld->subchannel_call_ != nullptr)) { -- calld->subchannel_call_->SetAfterCallStackDestroy(then_schedule_closure); -- then_schedule_closure = nullptr; -- } -+ RefCountedPtr 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 - diff --git a/Fix-use-after-free-by-removing-stream-from-transport.patch b/Fix-use-after-free-by-removing-stream-from-transport.patch deleted file mode 100644 index 82de7b2980d5c8d8fa8e9ab0d04cd3b68a9020cf..0000000000000000000000000000000000000000 --- a/Fix-use-after-free-by-removing-stream-from-transport.patch +++ /dev/null @@ -1,54 +0,0 @@ -From dc9c5ce77feab8ae01e16d7a3c13cd071c46926a Mon Sep 17 00:00:00 2001 -From: Vijay Pai -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(gt); - inproc_stream* s = reinterpret_cast(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 - diff --git a/Ran-generate_proto_ruby.sh-to-update-generated-files.patch b/Ran-generate_proto_ruby.sh-to-update-generated-files.patch deleted file mode 100644 index ee8c7ea7253caa8de37afbd7c23ab38cef97007e..0000000000000000000000000000000000000000 --- a/Ran-generate_proto_ruby.sh-to-update-generated-files.patch +++ /dev/null @@ -1,274 +0,0 @@ -From 0894f21c2fa7cc281bc584c0e08cbbbad1d04b28 Mon Sep 17 00:00:00 2001 -From: Stanley Cheung -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 - diff --git a/add-secure-compile-option-in-Makefile.patch b/add-secure-compile-option-in-Makefile.patch index 4705fdac7d5779b7163dbf4cfb43eea8e1dd45c0..4926838e543bfad82be174bfb74919cf49ebebb4 100644 --- a/add-secure-compile-option-in-Makefile.patch +++ b/add-secure-compile-option-in-Makefile.patch @@ -8,9 +8,9 @@ diff -urN grpc/CMakeLists.txt grpc_new/CMakeLists.txt 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") ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,relro -Wl,-z,now -fPIE -fPIC -fstack-protector-strong -Wp,-D_FORTIFY_SOURCE=2 -O2") ++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,relro -Wl,-z,now -fPIE -fPIC -fstack-protector-strong -Wp,-D_FORTIFY_SOURCE=2 -O2") ++set(_gRPC_ALLTARGETS_LIBRARYIES "${_gRPC_ALLTARGETS_LIBRARYIES} -Wl,-z,relro -Wl,-z,now -pie") if(gRPC_USE_PROTO_LITE) set(_gRPC_PROTOBUF_LIBRARY_NAME "libprotobuf-lite") @@ -23,9 +23,9 @@ index 6ede6e34d2..d6190ecde4 100644 DEFINES += $(EXTRA_DEFINES) LDLIBS += $(EXTRA_LDLIBS) -+CFLAGS += -Wl,-z,now -fPIE -fPIC -+CPPFLAGS += -Wl,-z,now -fstack-protector-strong -+LDFLAGS += -Wl,-z,now -pie ++CFLAGS += -Wl,-z,relro -Wl,-z,now -fPIE -fPIC -fstack-protector-strong -Wp,-D_FORTIFY_SOURCE=2 -O2 ++CPPFLAGS += -Wl,-z,relro -Wl,-z,now -fPIE -fPIC -fstack-protector-strong -Wp,-D_FORTIFY_SOURCE=2 -O2 ++LDFLAGS += -Wl,-z,relro -Wl,-z,now -pie + HOST_CPPFLAGS += $(CPPFLAGS) HOST_CFLAGS += $(CFLAGS) diff --git a/allow-grpcio-to-be-build-against-system-re2.patch b/allow-grpcio-to-be-build-against-system-re2.patch deleted file mode 100644 index 74d364ed5a6fc3d1e0613ae437d02535cfdeec6a..0000000000000000000000000000000000000000 --- a/allow-grpcio-to-be-build-against-system-re2.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 88b5952945662bee3d4b250a4d161b36afbf4f44 Mon Sep 17 00:00:00 2001 -From: Massimiliano Torromeo -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 diff --git a/fix-re2-build-error.patch b/fix-re2-build-error.patch deleted file mode 100644 index 3ba6a83a0fd30e25cd3c8b12a0bf6138f40edc2a..0000000000000000000000000000000000000000 --- a/fix-re2-build-error.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 45e413d2520795e7281e9a592af81620349bc186 Mon Sep 17 00:00:00 2001 -From: Paul Wankadia -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}/cmake/modules/Findc-ares.cmake -+ <%text>${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/Findre2.cmake - DESTINATION <%text>${gRPC_INSTALL_CMAKEDIR}/modules - ) - --- -2.28.0 \ No newline at end of file diff --git a/grpc-1.31.0-python-grpcio-use-system-abseil.patch b/grpc-1.31.0-python-grpcio-use-system-abseil.patch deleted file mode 100644 index c9cebf4a9d9a2b03a51e2f49c5cfdccfaf86bd7f..0000000000000000000000000000000000000000 --- a/grpc-1.31.0-python-grpcio-use-system-abseil.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff -Naur grpc-1.37.0-original/setup.py grpc-1.37.0/setup.py ---- grpc-1.37.0-original/setup.py 2021-04-06 18:48:56.000000000 -0400 -+++ grpc-1.37.0/setup.py 2021-04-08 15:34:35.182802019 -0400 -@@ -28,6 +28,7 @@ - from distutils import util - import os - import os.path -+import pathlib - import pkg_resources - import platform - import re -@@ -154,6 +155,11 @@ - # runtime, the shared library must be installed - BUILD_WITH_SYSTEM_RE2 = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_RE2', False) - -+# Export this variable to use the system installation of abseil. You need to -+# have the header files installed (in /usr/include/absl) and during -+# runtime, the shared library must be installed -+BUILD_WITH_SYSTEM_ABSL = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_ABSL', 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 -@@ -296,6 +302,10 @@ - CORE_C_FILES = filter(lambda x: 'third_party/re2' not in x, CORE_C_FILES) - RE2_INCLUDE = (os.path.join('/usr', 'include', 're2'),) - -+if BUILD_WITH_SYSTEM_ABSL: -+ CORE_C_FILES = filter(lambda x: 'third_party/abseil-cpp' not in x, CORE_C_FILES) -+ ABSL_INCLUDE = (os.path.join('/usr', 'include'),) -+ - EXTENSION_INCLUDE_DIRECTORIES = ((PYTHON_STEM,) + CORE_INCLUDE + ABSL_INCLUDE + - ADDRESS_SORTING_INCLUDE + CARES_INCLUDE + - RE2_INCLUDE + SSL_INCLUDE + UPB_INCLUDE + -@@ -325,6 +335,10 @@ - EXTENSION_LIBRARIES += ('cares',) - if BUILD_WITH_SYSTEM_RE2: - EXTENSION_LIBRARIES += ('re2',) -+if BUILD_WITH_SYSTEM_ABSL: -+ EXTENSION_LIBRARIES += tuple( -+ lib.stem[3:] for lib in pathlib.Path('/usr').glob('lib*/libabsl_*.so') -+ ) - - DEFINE_MACROS = (('OPENSSL_NO_ASM', 1), ('_WIN32_WINNT', 0x600)) - if not DISABLE_LIBC_COMPATIBILITY: diff --git a/grpc-1.31.0.tar.gz b/grpc-1.50.1.tar.gz similarity index 45% rename from grpc-1.31.0.tar.gz rename to grpc-1.50.1.tar.gz index 23f49d3b842f2e916c861d5150e4b7d048084888..cdf67ed980b1f920f834d512d24ae5a167cb3ac1 100644 Binary files a/grpc-1.31.0.tar.gz and b/grpc-1.50.1.tar.gz differ diff --git a/grpc.spec b/grpc.spec index 9dea29e41b9a284198021ee17764e36155fa6d68..70b0a6d15278ededf250dfbe0ea53b897da2275e 100644 --- a/grpc.spec +++ b/grpc.spec @@ -1,33 +1,25 @@ +%global c_so_version 28 +%global cpp_so_version 1.50 +%global cpp_std 17 + Name: grpc -Version: 1.31.0 -Release: 6 +Version: 1.50.1 +Release: 1 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 -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 -Patch0010: grpc-1.31.0-python-grpcio-use-system-abseil.patch +Patch0001: repair-pkgconfig-path.patch +Patch0002: add-secure-compile-option-in-Makefile.patch BuildRequires: gcc-c++ pkgconfig protobuf-devel protobuf-compiler -BuildRequires: openssl-devel c-ares-devel gflags-devel gtest-devel zlib-devel gperftools-devel +BuildRequires: openssl-devel c-ares-devel gtest-devel zlib-devel gperftools-devel BuildRequires: python3-devel python3-setuptools python3-Cython BuildRequires: cmake >= 3.13.0 BuildRequires: pkgconfig(re2) BuildRequires: abseil-cpp-devel -Requires: protobuf-compiler gflags - -Provides: %{name}-plugins = %{version}-%{release} -Obsoletes: %{name}-plugins < %{version}-%{release} +Requires: protobuf-compiler %description gRPC is a modern open source high performance RPC framework that can run in any environment. @@ -44,6 +36,15 @@ Requires: abseil-cpp-devel %description devel Development headers and files for gRPC libraries. +%package plugins +Summary: Protocol buffers compiler plugins for gRPC +# License: same as base package +Requires: grpc = %{version}-%{release} +Requires: protobuf-compiler + +%description plugins +Plugins to the protocol buffers compiler to generate gRPC sources. + %package -n python3-grpcio Summary: Python3 language bindings for gRPC Requires: %{name} = %{version}-%{release} @@ -57,18 +58,26 @@ Python3 bindings for gRPC. sed -i 's:^prefix ?= .*:prefix ?= %{_prefix}:' Makefile sed -i 's:$(prefix)/lib:$(prefix)/%{_lib}:' Makefile sed -i 's:^GTEST_LIB =.*::' Makefile +#avoid downloading +mkdir %{_builddir}/%{name}-%{version}/third_party/opencensus-proto/src +sed -r -i 's/(std=c\+\+)14/\1%{cpp_std}/g' \ + setup.py grpc.gyp Rakefile \ + examples/cpp/*/Makefile \ + examples/cpp/*/CMakeLists.txt \ + tools/run_tests/artifacts/artifact_targets.py \ + tools/distrib/python/grpcio_tools/setup.py %build mkdir -p cmake/build cd cmake/build cmake ../../ -DgRPC_INSTALL=ON\ + -DCMAKE_CXX_STANDARD:STRING=%{cpp_std} \ -DgRPC_CARES_PROVIDER=package \ -DgRPC_PROTOBUF_PROVIDER=package \ -DgRPC_SSL_PROVIDER=package \ -DgRPC_ZLIB_PROVIDER=package \ -DgRPC_RE2_PROVIDER=package \ -DgRPC_ABSL_PROVIDER=package \ - -DgRPC_GFLAGS_PROVIDER=package \ -DgRPC_INSTALL_LIBDIR=%{buildroot}%{_libdir} \ -DgRPC_INSTALL_BINDIR=%{buildroot}%{_bindir} \ -DgRPC_INSTALL_INCLUDEDIR=%{buildroot}%{_includedir} \ @@ -76,7 +85,8 @@ cmake ../../ -DgRPC_INSTALL=ON\ -DgRPC_INSTALL_SHAREDIR=%{buildroot}%{_datadir}/%{name} \ -DgRPC_INSTALL_PKGCONFIGDIR=%{buildroot}%{_libdir}/pkgconfig \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ - -DBUILD_SHARED_LIBS=ON + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_VERBOSE_MAKEFILE=ON make -j24 V=1 # build python module @@ -106,10 +116,12 @@ cd ../.. %doc README.md %license LICENSE -%{_bindir}/grpc_*_plugin - -%{_libdir}/*.so.1* %{_datadir}/%{name} +%{_libdir}/*.so.%{c_so_version}* +%{_libdir}/*.so.%{cpp_so_version}* + +%files plugins +%{_bindir}/grpc_*_plugin %files devel %defattr(-,root,root) @@ -122,14 +134,14 @@ cd ../.. %files -n python3-grpcio %defattr(-,root,root) %{python3_sitearch}/grpc -%{python3_sitearch}/grpcio-%{version}-py?.?.egg-info +%{python3_sitearch}/grpcio-%{version}-py%{python3_version}.egg-info %changelog -* Mon Jul 19 2021 lijingyuan - 1.31.0-6 +* Wed Apr 24 2024 Han Guangyu - 1.50.1-1 - Type:requirement - ID:NA - SUG:NA -- DESC:cancel gdb in buildrequires +- DESC: update to 1.50.1 by merge master commit with adding secure compilation options and cancel gdb in buildrequires * Tue Jul 06 2021 gaihuiying - 1.31.0-5 - Type:requirement @@ -149,7 +161,7 @@ cd ../.. - SUG:NA - DESC:separate re2 from grpc source -* Mon Aug 28 2020 liuxin - 1.31.0-1 +* Fri Aug 28 2020 liuxin - 1.31.0-1 - Type:requirement - ID:NA - SUG:NA diff --git a/repair-gflags-compile-error-with-cmake.patch b/repair-gflags-compile-error-with-cmake.patch deleted file mode 100644 index bb39838f9dcddaa08595ce1200bb41762e7da894..0000000000000000000000000000000000000000 --- a/repair-gflags-compile-error-with-cmake.patch +++ /dev/null @@ -1,17 +0,0 @@ -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") diff --git a/repair-pkgconfig-path.patch b/repair-pkgconfig-path.patch index 69056415552eb71d11112cbb4dbbfae79da5fca1..283a842054fa4c0f83e18aed8936a7517058c8c9 100644 --- a/repair-pkgconfig-path.patch +++ b/repair-pkgconfig-path.patch @@ -16,9 +16,9 @@ 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_BUILD_MSVC_MP_COUNT 0 CACHE STRING "The maximum number of processes for MSVC /MP option") +set(gRPC_INSTALL_PKGCONFIGDIR "lib/pkgconfig" CACHE STRING "Installation directory for pkgconfig") # Options @@ -27,7 +27,7 @@ diff -urN grpc/CMakeLists.txt grpc_new/CMakeLists.txt "${output_filepath}" @ONLY) install(FILES "${output_filepath}" -- DESTINATION "lib/pkgconfig/") +- DESTINATION "${gRPC_INSTALL_LIBDIR}/pkgconfig") + DESTINATION ${gRPC_INSTALL_PKGCONFIGDIR}) endfunction()