[packages/grpc] - up to 1.42.0, python2 support is gone

baggins baggins at pld-linux.org
Wed Dec 1 23:45:54 CET 2021


commit 53fc12f464ef02d6714b3f22c22963e9e16b9fdd
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Wed Dec 1 23:45:36 2021 +0100

    - up to 1.42.0, python2 support is gone

 grpc-system-absl.patch    | 92 ++++++++++++++++++++++++++++++++++++-----------
 grpc-system-openssl.patch | 12 +++----
 grpc-system-re2.patch     | 32 -----------------
 grpc-x32.patch            |  6 ++--
 grpc.spec                 | 90 +++++++++++-----------------------------------
 5 files changed, 101 insertions(+), 131 deletions(-)
---
diff --git a/grpc.spec b/grpc.spec
index 4ffe212..2d38ca1 100644
--- a/grpc.spec
+++ b/grpc.spec
@@ -4,24 +4,22 @@
 #
 # Conditional build:
 %bcond_without	apidocs		# (Python) API docs build
-%bcond_without	python2		# CPython 2.x module
 %bcond_without	python3		# CPython 3.x module
 #
 Summary:	RPC library and framework
 Summary(pl.UTF-8):	Biblioteka i szkielet RPC
 Name:		grpc
-Version:	1.32.0
-Release:	6
+Version:	1.42.0
+Release:	1
 License:	Apache v2.0
 Group:		Libraries
 #Source0Download: https://github.com/grpc/grpc/releases
 Source0:	https://github.com/grpc/grpc/archive/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	e2afa783e763d5f6bc09b664b907ff25
+# Source0-md5:	a70efa855423401d92ec6f53dbb24ad7
 Patch0:		%{name}-system-absl.patch
 Patch1:		%{name}-sphinx.patch
 Patch2:		%{name}-x32.patch
 Patch3:		%{name}-libdir.patch
-Patch4:		%{name}-system-re2.patch
 Patch5:		%{name}-system-openssl.patch
 URL:		https://grpc.io/
 BuildRequires:	abseil-cpp-devel
@@ -35,10 +33,6 @@ BuildRequires:	re2-devel >= 20200801
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
 BuildRequires:	zlib-devel
-%if %{with python2}
-BuildRequires:	python-Cython >= 0.23
-BuildRequires:	python-modules >= 1:2.7
-%endif
 %if %{with python3}
 BuildRequires:	python3-Cython >= 0.23
 BuildRequires:	python3-modules >= 1:3.5
@@ -88,23 +82,6 @@ API documentation for gRPC library.
 %description apidocs -l pl.UTF-8
 Dokumentacja API biblioteki gRPC.
 
-%package -n python-grpcio
-Summary:	HTTP/2 based RPC framework
-Summary(pl.UTF-8):	Szkielet RPC oparty na HTTP/2
-Group:		Libraries/Python
-
-%description -n python-grpcio
-gRPC is a modern, open source, high-performance remote procedure call
-(RPC) framework that can run anywhere. gRPC enables client and server
-applications to communicate transparently, and simplifies the building
-of connected systems.
-
-%description -n python-grpcio -l pl.UTF-8
-gRPC to nowoczesny, mający otwarty źródła, wydajny szkielet zdalnych
-wywołań procedur (RPC - Remote Procedure Call). Pozwala na
-przezroczystą komunikację klienta i serwera, upraszcza tworzenie
-systemów połączonych.
-
 %package -n python3-grpcio
 Summary:	HTTP/2 based RPC framework
 Summary(pl.UTF-8):	Szkielet RPC oparty na HTTP/2
@@ -122,16 +99,16 @@ wywołań procedur (RPC - Remote Procedure Call). Pozwala na
 przezroczystą komunikację klienta i serwera, upraszcza tworzenie
 systemów połączonych.
 
-%package -n python-grpcio-apidocs
+%package -n python3-grpcio-apidocs
 Summary:	API documentation for Python gRPC library
 Summary(pl.UTF-8):	Dokumentacja API biblioteki Pythona gRPC
 Group:		Documentation
 BuildArch:	noarch
 
-%description -n python-grpcio-apidocs
+%description -n python3-grpcio-apidocs
 API documentation for Python gRPC library.
 
-%description -n python-grpcio-apidocs -l pl.UTF-8
+%description -n python3-grpcio-apidocs -l pl.UTF-8
 Dokumentacja API biblioteki Pythona gRPC.
 
 %prep
@@ -140,13 +117,13 @@ Dokumentacja API biblioteki Pythona gRPC.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
-%patch4 -p1
 %patch5 -p1
 
 %build
 install -d build
 cd build
 %cmake .. \
+	-DCMAKE_CXX_STANDARD=17 \
 	-DgRPC_INSTALL_CMAKEDIR:PATH=%{_lib}/cmake/grpc \
 	-DgRPC_INSTALL_LIBDIR:PATH=%{_lib} \
 	-DgRPC_ABSL_PROVIDER=package \
@@ -165,10 +142,6 @@ export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
 export GRPC_PYTHON_BUILD_SYSTEM_RE2=1
 export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1
 
-%if %{with python2}
-%py_build
-%endif
-
 %if %{with python3}
 %if %{with apidocs}
 export GRPC_PYTHON_ENABLE_DOCUMENTATION_BUILD=1
@@ -192,12 +165,6 @@ export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
 export GRPC_PYTHON_BUILD_SYSTEM_RE2=1
 export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1
 
-%if %{with python2}
-%py_install
-
-%py_postclean
-%endif
-
 %if %{with python3}
 %py3_install
 %endif
@@ -223,30 +190,30 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/grpc_python_plugin
 %attr(755,root,root) %{_bindir}/grpc_ruby_plugin
 %attr(755,root,root) %{_libdir}/libgpr.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libgpr.so.12
+%attr(755,root,root) %ghost %{_libdir}/libgpr.so.20
 %attr(755,root,root) %{_libdir}/libgrpc.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libgrpc.so.12
+%attr(755,root,root) %ghost %{_libdir}/libgrpc.so.20
 %attr(755,root,root) %{_libdir}/libgrpc_plugin_support.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libgrpc_plugin_support.so.1
+%attr(755,root,root) %ghost %{_libdir}/libgrpc_plugin_support.so.1.42
 %attr(755,root,root) %{_libdir}/libgrpc_unsecure.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libgrpc_unsecure.so.12
+%attr(755,root,root) %ghost %{_libdir}/libgrpc_unsecure.so.20
 %attr(755,root,root) %{_libdir}/libgrpc++.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libgrpc++.so.1
+%attr(755,root,root) %ghost %{_libdir}/libgrpc++.so.1.42
 %attr(755,root,root) %{_libdir}/libgrpc++_alts.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libgrpc++_alts.so.1
+%attr(755,root,root) %ghost %{_libdir}/libgrpc++_alts.so.1.42
 %attr(755,root,root) %{_libdir}/libgrpc++_error_details.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libgrpc++_error_details.so.1
+%attr(755,root,root) %ghost %{_libdir}/libgrpc++_error_details.so.1.42
 %attr(755,root,root) %{_libdir}/libgrpc++_reflection.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libgrpc++_reflection.so.1
+%attr(755,root,root) %ghost %{_libdir}/libgrpc++_reflection.so.1.42
 %attr(755,root,root) %{_libdir}/libgrpc++_unsecure.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libgrpc++_unsecure.so.1
+%attr(755,root,root) %ghost %{_libdir}/libgrpc++_unsecure.so.1.42
 %attr(755,root,root) %{_libdir}/libgrpcpp_channelz.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libgrpcpp_channelz.so.1
+%attr(755,root,root) %ghost %{_libdir}/libgrpcpp_channelz.so.1.42
 # TODO: use system libs instead
 %attr(755,root,root) %{_libdir}/libaddress_sorting.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libaddress_sorting.so.12
+%attr(755,root,root) %ghost %{_libdir}/libaddress_sorting.so.20
 %attr(755,root,root) %{_libdir}/libupb.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libupb.so.12
+%attr(755,root,root) %ghost %{_libdir}/libupb.so.20
 %{_datadir}/grpc
 
 %files devel
@@ -277,23 +244,6 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %{_docdir}/%{name}-apidocs-%{version}
 
-%if %{with python2}
-%files -n python-grpcio
-%defattr(644,root,root,755)
-%dir %{py_sitedir}/grpc
-%{py_sitedir}/grpc/*.py[co]
-%dir %{py_sitedir}/grpc/_cython
-%attr(755,root,root) %{py_sitedir}/grpc/_cython/cygrpc.so
-%{py_sitedir}/grpc/_cython/__init__.py[co]
-%{py_sitedir}/grpc/_cython/_credentials
-%{py_sitedir}/grpc/_cython/_cygrpc
-%{py_sitedir}/grpc/aio
-%{py_sitedir}/grpc/beta
-%{py_sitedir}/grpc/experimental
-%{py_sitedir}/grpc/framework
-%{py_sitedir}/grpcio-%{version}-py*.egg-info
-%endif
-
 %if %{with python3}
 %files -n python3-grpcio
 %defattr(644,root,root,755)
@@ -314,7 +264,7 @@ rm -rf $RPM_BUILD_ROOT
 %endif
 
 %if %{with apidocs}
-%files -n python-grpcio-apidocs
+%files -n python3-grpcio-apidocs
 %defattr(644,root,root,755)
 %doc doc/python/sphinx/_build/html/{_static,*.html,*.js}
 %endif
diff --git a/grpc-system-absl.patch b/grpc-system-absl.patch
index c06a4dc..5289f01 100644
--- a/grpc-system-absl.patch
+++ b/grpc-system-absl.patch
@@ -2,14 +2,14 @@ diff -urNp -x '*.orig' grpc-1.32.0.org/setup.py grpc-1.32.0/setup.py
 --- grpc-1.32.0.org/setup.py	2020-09-08 23:00:06.000000000 +0200
 +++ grpc-1.32.0/setup.py	2021-03-04 23:29:26.600732792 +0100
 @@ -132,6 +132,8 @@ BUILD_WITH_SYSTEM_ZLIB = os.environ.get(
- BUILD_WITH_SYSTEM_CARES = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_CARES',
-                                          False)
+ BUILD_WITH_SYSTEM_CARES = _env_bool_value('GRPC_PYTHON_BUILD_SYSTEM_CARES',
+                                           'False')
  
 +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
+ # 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
 @@ -246,6 +248,10 @@ if BUILD_WITH_SYSTEM_CARES:
      CORE_C_FILES = filter(lambda x: 'third_party/cares' not in x, CORE_C_FILES)
      CARES_INCLUDE = (os.path.join('/usr', 'include'),)
@@ -18,23 +18,75 @@ diff -urNp -x '*.orig' grpc-1.32.0.org/setup.py grpc-1.32.0/setup.py
 +    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 +
-@@ -272,6 +278,16 @@ if BUILD_WITH_SYSTEM_ZLIB:
-     EXTENSION_LIBRARIES += ('z',)
- if BUILD_WITH_SYSTEM_CARES:
+ 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'),)
+@@ -272,6 +278,12 @@ if BUILD_WITH_SYSTEM_ZLIB:
      EXTENSION_LIBRARIES += ('cares',)
+ if BUILD_WITH_SYSTEM_RE2:
+     EXTENSION_LIBRARIES += ('re2',)
 +if BUILD_WITH_SYSTEM_ABSL:
-+    EXTENSION_LIBRARIES += ('absl_base', 'absl_exponential_biased', 'absl_malloc_internal',
-+                            'absl_raw_logging_internal', 'absl_spinlock_wait', 'absl_throw_delegate',
-+                            'absl_log_severity', 'absl_hashtablez_sampler', 'absl_raw_hash_set',
-+                            'absl_debugging_internal', 'absl_demangle_internal', 'absl_stacktrace',
-+                            'absl_symbolize', 'absl_city', 'absl_hash', 'absl_int128', 'absl_status',
-+                            'absl_strings', 'absl_cord', 'absl_strings_internal',
-+                            'absl_str_format_internal', 'absl_synchronization', 'absl_time',
-+                            'absl_civil_time', 'absl_time_zone', 'absl_bad_optional_access',
-+                            'absl_bad_variant_access')
++    EXTENSION_LIBRARIES += ('absl_bad_optional_access', 'absl_bad_variant_access', 'absl_base','absl_city',
++                            'absl_civil_time', 'absl_cord', 'absl_debugging_internal', 'absl_demangle_internal',
++                            'absl_exponential_biased', 'absl_graphcycles_internal', 'absl_hash', 'absl_hashtablez_sampler',
++                            'absl_int128', 'absl_log_severity', 'absl_malloc_internal', 'absl_raw_hash_set',
++                            'absl_raw_logging_internal', 'absl_spinlock_wait', 'absl_stacktrace', 'absl_status')
  
  DEFINE_MACROS = (('_WIN32_WINNT', 0x600),)
  asm_files = []
+--- grpc-1.42.0/CMakeLists.txt~	2021-12-01 22:42:50.000000000 +0100
++++ grpc-1.42.0/CMakeLists.txt	2021-12-01 22:54:59.760044195 +0100
+@@ -98,53 +98,23 @@
+ set_property(CACHE gRPC_ABSL_PROVIDER PROPERTY STRINGS "module" "package")
+ 
+ set(gRPC_ABSL_USED_TARGETS
+-  absl_algorithm
+-  absl_algorithm_container
+-  absl_atomic_hook
+   absl_bad_optional_access
+   absl_bad_variant_access
+   absl_base
+-  absl_base_internal
+-  absl_bind_front
+-  absl_bits
+   absl_city
+   absl_civil_time
+-  absl_compressed_tuple
+-  absl_config
+-  absl_container_common
+-  absl_container_memory
+   absl_cord
+-  absl_core_headers
+   absl_debugging_internal
+   absl_demangle_internal
+-  absl_dynamic_annotations
+-  absl_endian
+-  absl_errno_saver
+   absl_exponential_biased
+-  absl_fixed_array
+-  absl_flat_hash_map
+-  absl_function_ref
+   absl_graphcycles_internal
+   absl_hash
+-  absl_hash_function_defaults
+-  absl_hash_policy_traits
+-  absl_hashtable_debug_hooks
+   absl_hashtablez_sampler
+-  absl_have_sse
+-  absl_inlined_vector
+-  absl_inlined_vector_internal
+   absl_int128
+-  absl_kernel_timeout_internal
+-  absl_layout
+   absl_log_severity
+   absl_malloc_internal
+-  absl_memory
+-  absl_numeric_representation
+-  absl_optional
+-  absl_raw_hash_map
+   absl_raw_hash_set
+   absl_raw_logging_internal
+-  absl_span
+   absl_spinlock_wait
+   absl_stacktrace
+   absl_status
diff --git a/grpc-system-openssl.patch b/grpc-system-openssl.patch
index 13409ec..d9f122b 100644
--- a/grpc-system-openssl.patch
+++ b/grpc-system-openssl.patch
@@ -2,11 +2,11 @@ diff -urNp -x '*.orig' grpc-1.32.0.org/setup.py grpc-1.32.0/setup.py
 --- grpc-1.32.0.org/setup.py	2021-03-04 23:29:29.994075500 +0100
 +++ grpc-1.32.0/setup.py	2021-03-04 23:29:30.220742787 +0100
 @@ -106,7 +106,7 @@ CLASSIFIERS = [
- ]
  
- BUILD_WITH_BORING_SSL_ASM = os.environ.get('GRPC_BUILD_WITH_BORING_SSL_ASM',
--                                           True)
-+                                           False)
  
- # Environment variable to determine whether or not the Cython extension should
- # *use* Cython or use the generated C files. Note that this requires the C files
+ BUILD_WITH_BORING_SSL_ASM = _env_bool_value('GRPC_BUILD_WITH_BORING_SSL_ASM',
+-                                            'True')
++                                            'False')
+ 
+ # Export this environment variable to override the platform variant that will
+ # be chosen for boringssl assembly optimizations. This option is useful when
diff --git a/grpc-system-re2.patch b/grpc-system-re2.patch
deleted file mode 100644
index 859e42e..0000000
--- a/grpc-system-re2.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-diff -urNp -x '*.orig' grpc-1.32.0.org/setup.py grpc-1.32.0/setup.py
---- grpc-1.32.0.org/setup.py	2021-03-04 23:29:29.267406836 +0100
-+++ grpc-1.32.0/setup.py	2021-03-04 23:29:29.490740783 +0100
-@@ -134,6 +134,8 @@ BUILD_WITH_SYSTEM_CARES = os.environ.get
- 
- BUILD_WITH_SYSTEM_ABSL = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_ABSL', False)
- 
-+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
-@@ -252,6 +254,10 @@ 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'),)
- 
-+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'),)
-+
- EXTENSION_INCLUDE_DIRECTORIES = ((PYTHON_STEM,) + CORE_INCLUDE + ABSL_INCLUDE +
-                                  ADDRESS_SORTING_INCLUDE + CARES_INCLUDE +
-                                  RE2_INCLUDE + SSL_INCLUDE + UPB_INCLUDE +
-@@ -288,6 +294,8 @@ if BUILD_WITH_SYSTEM_ABSL:
-                             'absl_str_format_internal', 'absl_synchronization', 'absl_time',
-                             'absl_civil_time', 'absl_time_zone', 'absl_bad_optional_access',
-                             'absl_bad_variant_access')
-+if BUILD_WITH_SYSTEM_RE2:
-+    EXTENSION_LIBRARIES += ('re2',)
- 
- DEFINE_MACROS = (('_WIN32_WINNT', 0x600),)
- asm_files = []
diff --git a/grpc-x32.patch b/grpc-x32.patch
index ba61c57..cb3cbde 100644
--- a/grpc-x32.patch
+++ b/grpc-x32.patch
@@ -5,8 +5,8 @@ diff -urNp -x '*.orig' grpc-1.32.0.org/src/core/lib/gpr/wrap_memcpy.cc grpc-1.32
  
  extern "C" {
  #ifdef __linux__
--#if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT)
-+#if defined(__x86_64__) && !defined(__ILP32__) && !defined(GPR_MUSL_LIBC_COMPAT)
+-#if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT) && \
++#if defined(__x86_64__) && !defined(__ILP32__) && !defined(GPR_MUSL_LIBC_COMPAT) && \
+     !defined(__ANDROID__)
  __asm__(".symver memcpy,memcpy at GLIBC_2.2.5");
  void* __wrap_memcpy(void* destination, const void* source, size_t num) {
-   return memcpy(destination, source, num);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/grpc.git/commitdiff/53fc12f464ef02d6714b3f22c22963e9e16b9fdd



More information about the pld-cvs-commit mailing list