diff --git a/0001-cxx-Arg-List-Too-Long.patch b/0001-cxx-Arg-List-Too-Long.patch deleted file mode 100644 index 0e0d4571c4b17d318707a8bf7fbdaf398d976636..0000000000000000000000000000000000000000 --- a/0001-cxx-Arg-List-Too-Long.patch +++ /dev/null @@ -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/support/sync_stream_impl.h \ - include/grpcpp/support/time.h \ - include/grpcpp/support/validate_service_config.h \ -+ -+PUBLIC_HEADERS_CXX2 += \ - include/grpc/support/alloc.h \ - include/grpc/support/atm.h \ - include/grpc/support/atm_gcc_atomic.h \ -@@ -6320,6 +6332,8 @@ PUBLIC_HEADERS_CXX += \ - include/grpc/impl/codegen/propagation_bits.h \ - include/grpc/impl/codegen/slice.h \ - include/grpc/impl/codegen/status.h \ -+ -+PUBLIC_HEADERS_CXX3 += \ - include/grpc++/impl/codegen/async_stream.h \ - include/grpc++/impl/codegen/async_unary_call.h \ - include/grpc++/impl/codegen/byte_buffer.h \ -@@ -6350,6 +6364,8 @@ PUBLIC_HEADERS_CXX += \ - include/grpc++/impl/codegen/stub_options.h \ - include/grpc++/impl/codegen/sync_stream.h \ - include/grpc++/impl/codegen/time.h \ -+ -+PUBLIC_HEADERS_CXX4 += \ - include/grpcpp/impl/codegen/async_generic_service.h \ - include/grpcpp/impl/codegen/async_stream.h \ - include/grpcpp/impl/codegen/async_stream_impl.h \ diff --git a/Add-ABSL_RANDOM_HWAES_FLAGS.patch b/Add-ABSL_RANDOM_HWAES_FLAGS.patch new file mode 100644 index 0000000000000000000000000000000000000000..3a228f0a3e4bf3954859a3a86098ad4075d026eb --- /dev/null +++ b/Add-ABSL_RANDOM_HWAES_FLAGS.patch @@ -0,0 +1,91 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..6b38a1db058ab65258830140d940c6df74ee3962 --- /dev/null +++ b/Copy-channel-args-hash-before-appending-ruby-user-ag.patch @@ -0,0 +1,107 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..fb410706447390274a865c41bae6995bddef5529 --- /dev/null +++ b/Fix-destruction-race-between-subchannel-and-client_c.patch @@ -0,0 +1,34 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..82de7b2980d5c8d8fa8e9ab0d04cd3b68a9020cf --- /dev/null +++ b/Fix-use-after-free-by-removing-stream-from-transport.patch @@ -0,0 +1,54 @@ +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 new file mode 100644 index 0000000000000000000000000000000000000000..ee8c7ea7253caa8de37afbd7c23ab38cef97007e --- /dev/null +++ b/Ran-generate_proto_ruby.sh-to-update-generated-files.patch @@ -0,0 +1,274 @@ +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/abseil-20200225.tar.gz b/abseil-20200225.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3b14c5553ff25487f3e9aa1193d6823181494965 Binary files /dev/null and b/abseil-20200225.tar.gz differ diff --git a/abseil-cpp-b832dce8489ef7b6231384909fd9b68d5a5ff2b7.tar.gz b/abseil-cpp-b832dce8489ef7b6231384909fd9b68d5a5ff2b7.tar.gz deleted file mode 100644 index 62bdb43a09c9b4d4699b25b130e8c2b4c158b3fd..0000000000000000000000000000000000000000 Binary files a/abseil-cpp-b832dce8489ef7b6231384909fd9b68d5a5ff2b7.tar.gz and /dev/null differ diff --git a/0002-add-secure-compile-option-in-Makefile.patch b/add-secure-compile-option-in-Makefile.patch similarity index 34% rename from 0002-add-secure-compile-option-in-Makefile.patch rename to add-secure-compile-option-in-Makefile.patch index 40010cb67df457efb5eb6565b90bb79d825af0a3..4705fdac7d5779b7163dbf4cfb43eea8e1dd45c0 100644 --- a/0002-add-secure-compile-option-in-Makefile.patch +++ b/add-secure-compile-option-in-Makefile.patch @@ -1,3 +1,20 @@ +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 @@ -5,7 +22,7 @@ index 6ede6e34d2..d6190ecde4 100644 @@ -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 diff --git a/benchmark-v1.5.1.tar.gz b/benchmark-v1.5.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..f716263d02258b87d4bccc32d89f0783ab1efc56 Binary files /dev/null and b/benchmark-v1.5.1.tar.gz differ diff --git a/googletest-release-1.10.0.tar.gz b/googletest-release-1.10.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ab10868ee252de6b39dcb5e708bc7b5700a2bee7 Binary files /dev/null and b/googletest-release-1.10.0.tar.gz differ diff --git a/grpc-1.28.1.tar.gz b/grpc-1.31.0.tar.gz similarity index 47% rename from grpc-1.28.1.tar.gz rename to grpc-1.31.0.tar.gz index 2266421918507d9afca37f50ad5436ce51d08526..23f49d3b842f2e916c861d5150e4b7d048084888 100644 Binary files a/grpc-1.28.1.tar.gz and b/grpc-1.31.0.tar.gz differ diff --git a/grpc.spec b/grpc.spec index 922173e415cd6a3da2c4b4d952ea798ee8e622e8..28aae8d1c92dfe7382e27a147dcab65683a2f2e7 100644 --- a/grpc.spec +++ b/grpc.spec @@ -1,19 +1,29 @@ Name: grpc -Version: 1.28.1 -Release: 3 +Version: 1.31.0 +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 -Source1: abseil-cpp-b832dce8489ef7b6231384909fd9b68d5a5ff2b7.tar.gz - -Patch9000: 0001-cxx-Arg-List-Too-Long.patch -Patch9001: 0002-add-secure-compile-option-in-Makefile.patch +Source1: abseil-20200225.tar.gz +Source2: benchmark-v1.5.1.tar.gz +Source3: re2-2020-08-01.tar.gz +Source4: googletest-release-1.10.0.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 BuildRequires: gcc-c++ pkgconfig protobuf-devel protobuf-compiler gdb -BuildRequires: openssl-devel c-ares-devel gflags-devel gtest-devel zlib-devel gperftools-devel +BuildRequires: openssl-devel c-ares-devel gflags-devel gtest-devel zlib-devel gperftools-devel re2-devel BuildRequires: python3-devel python3-setuptools python3-Cython -Requires: protobuf-compiler +BuildRequires: cmake >= 3.13.0 +Requires: protobuf-compiler gflags Provides: %{name}-plugins = %{version}-%{release} Provides: %{name}-cli = %{version}-%{release} @@ -42,14 +52,35 @@ Requires: %{name} = %{version}-%{release} Python3 bindings for gRPC. %prep -%autosetup -p1 +%autosetup -p1 -n %{name}-%{version} sed -i 's:^prefix ?= .*:prefix ?= %{_prefix}:' Makefile 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 %{SOURCE3} --strip-components 1 -C %{_builddir}/%{name}-%{version}/third_party/re2/ +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_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} \ + -DBUILD_SHARED_LIBS=ON +make %{_smp_mflags} +cd ../.. +make grpc_cli # build python module export GRPC_PYTHON_BUILD_WITH_CYTHON=True @@ -60,8 +91,12 @@ export CFLAGS="%optflags" %py3_build %install -make install prefix="%{buildroot}%{_prefix}" -make install-grpc-cli prefix="%{buildroot}%{_prefix}" +cd cmake/build +make install/local +cd ../.. +cp bins/opt/grpc_cli %{buildroot}%{_bindir} +rm -rf %{buildroot}%{_prefix}/lib + %delete_la_and_a %py3_install @@ -76,8 +111,10 @@ make install-grpc-cli prefix="%{buildroot}%{_prefix}" %{_bindir}/grpc_*_plugin %{_libdir}/*.so.1* -%{_libdir}/*.so.9* -%{_datadir}/grpc +%{_libdir}/*.so.11* +%{_libdir}/*absl* +%{_libdir}/*re2* +%{_datadir}/%{name} %files devel %defattr(-,root,root) @@ -93,6 +130,12 @@ make install-grpc-cli prefix="%{buildroot}%{_prefix}" %{python3_sitearch}/grpcio-%{version}-py?.?.egg-info %changelog +* Mon Aug 28 2020 liuxin - 1.31.0-1 +- Type:requirement +- ID:NA +- SUG:NA +- DESC:update grpc version to 1.31.0 + * Tue Aug 18 2020 chenyaqiang - 1.28.1-3 - rebuild for package build and clarify last changelog info diff --git a/grpc.yaml b/grpc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..224ede1a4f963c403925c055b439e7a4e962aa4b --- /dev/null +++ b/grpc.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: grpc/grpc +tag_prefix: ^v +seperator: . diff --git a/re2-2020-08-01.tar.gz b/re2-2020-08-01.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..eb0f49dcb443dad9f60011f4c5fe2d324e043557 Binary files /dev/null and b/re2-2020-08-01.tar.gz differ diff --git a/repair-gflags-compile-error-with-cmake.patch b/repair-gflags-compile-error-with-cmake.patch new file mode 100644 index 0000000000000000000000000000000000000000..bb39838f9dcddaa08595ce1200bb41762e7da894 --- /dev/null +++ b/repair-gflags-compile-error-with-cmake.patch @@ -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") diff --git a/repair-pkgconfig-path.patch b/repair-pkgconfig-path.patch new file mode 100644 index 0000000000000000000000000000000000000000..69056415552eb71d11112cbb4dbbfae79da5fca1 --- /dev/null +++ b/repair-pkgconfig-path.patch @@ -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