#1 Only build the Ruby plugin on Fedora >= 30
Merged 5 years ago by avsej. Opened 5 years ago by bochecha.
Unknown source master  into  master

@@ -0,0 +1,43 @@

+ From ad0cae3d6eb5a47e8ec0a52b78013e658aa1720b Mon Sep 17 00:00:00 2001

+ From: Mathieu Bridon <bochecha@daitauha.fr>

+ Date: Mon, 17 Dec 2018 11:41:34 +0100

+ Subject: [PATCH] Do not build the Ruby plugin

+ 

+ Unfortunately, this can't build without protobuf 3.6, so we must disable

+ it for Fedora 28 and 29 which only have protobuf 3.5.

+ ---

+  Makefile | 4 +---

+  1 file changed, 1 insertion(+), 3 deletions(-)

+ 

+ diff --git a/Makefile b/Makefile

+ index 066c191..09ad70a 100644

+ --- a/Makefile

+ +++ b/Makefile

+ @@ -802,7 +802,7 @@ PC_LIBS_GRPCXX =

+  

+  CPPFLAGS := -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include $(CPPFLAGS)

+  

+ -PROTOC_PLUGINS_ALL = $(BINDIR)/$(CONFIG)/grpc_cpp_plugin $(BINDIR)/$(CONFIG)/grpc_csharp_plugin $(BINDIR)/$(CONFIG)/grpc_node_plugin $(BINDIR)/$(CONFIG)/grpc_objective_c_plugin $(BINDIR)/$(CONFIG)/grpc_php_plugin $(BINDIR)/$(CONFIG)/grpc_python_plugin $(BINDIR)/$(CONFIG)/grpc_ruby_plugin

+ +PROTOC_PLUGINS_ALL = $(BINDIR)/$(CONFIG)/grpc_cpp_plugin $(BINDIR)/$(CONFIG)/grpc_csharp_plugin $(BINDIR)/$(CONFIG)/grpc_node_plugin $(BINDIR)/$(CONFIG)/grpc_objective_c_plugin $(BINDIR)/$(CONFIG)/grpc_php_plugin $(BINDIR)/$(CONFIG)/grpc_python_plugin

+  PROTOC_PLUGINS_DIR = $(BINDIR)/$(CONFIG)

+  

+  ifeq ($(HAS_SYSTEM_PROTOBUF),true)

+ @@ -3151,7 +3151,6 @@ install-plugins: $(PROTOC_PLUGINS)

+  	$(Q) $(INSTALL) -d $(prefix)/bin

+  	$(Q) $(INSTALL) $(BINDIR)/$(CONFIG)/grpc_python_plugin $(prefix)/bin/grpc_python_plugin

+  	$(Q) $(INSTALL) -d $(prefix)/bin

+ -	$(Q) $(INSTALL) $(BINDIR)/$(CONFIG)/grpc_ruby_plugin $(prefix)/bin/grpc_ruby_plugin

+  

+  install-grpc-cli: grpc_cli

+  	$(E) "[INSTALL] Installing grpc cli"

+ @@ -7162,7 +7161,6 @@ LIBGRPC_PLUGIN_SUPPORT_SRC = \

+      src/compiler/objective_c_generator.cc \

+      src/compiler/php_generator.cc \

+      src/compiler/python_generator.cc \

+ -    src/compiler/ruby_generator.cc \

+  

+  PUBLIC_HEADERS_CXX += \

+      include/grpc++/impl/codegen/config_protobuf.h \

+ -- 

+ 2.17.2

+ 

file modified
+4
@@ -25,6 +25,10 @@

  # https://github.com/grpc/grpc/pull/15532

  Patch1: 0002-patch-from-15532.patch

  

+ %if 0%{?fedora} < 30

please don't do it this way, the srpm built on f30 won't be buildable on f29.

+ Patch2: 0001-Do-not-build-the-Ruby-plugin.patch

+ %endif

+ 

  %description

  gRPC is a modern open source high performance RPC framework that can run in any

  environment. It can efficiently connect services in and across data centers

Fedora < 30 have protobuf 3.5, which doesn't have the required parts to
build the Ruby plugin.

We can't update protobuf there, because upstream bumped the soname which
goes contrary to the Fedora update policy.

As a result, if we want Fedora 28 and 29 to have gRPC, we have to
disable its Ruby plugin.

Upstream doesn't seem to have an easy way to just not build it, so this
commit introduces a patch to remove it from the Makefile.

This should be okay, since it's only temporary anyway: Fedora 30 (and
future releases) already have a recent enough protobuf so this won't be
necessary any more.

So I just finished tested it. With this patch you can run fedpkg --release=f28 mockbuild and it works.

Of course that means we lose the ruby plugin in Fedora < 30.

I think it is worth it though, as having almost all plugins is better than not having any. :smile:

In my case I need python3-grpcio in Fedora 28+ for Buildstream: https://bugzilla.redhat.com/show_bug.cgi?id=1634449

With this merged, you can request the f28 and f29 branches from releng.

Pull-Request has been merged by avsej

5 years ago

please don't do it this way, the srpm built on f30 won't be buildable on f29.

@ignatenkobrain, I see. I will better always include patch, but apply it conditionally. Right?

please don't do it this way, the srpm built on f30 won't be buildable on f29.

Yeah, I thought the same, but then:

  1. that would have meant not using %autopatch any more (to apply conditionally), and
  2. I can't say I care much about building the SRPM for a distro on another anyway;

I mean, it's trivial for anybody to just fedpkg clone -a grpc && cd grpc && fedpkg --release=fXX mockbuild. Building from SRPMs feels like an antiquated and awkward way to work IMHO.

Of course, @avsej is the maintainer, so that's not my call. :smile:

@bochecha guidelines prohibit this, I can't find it right now.. But it is there.