1 Star 0 Fork 40

wangyangdahai / grpc

forked from src-openEuler / grpc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
grpc-1.31.0-python-grpcio-use-system-abseil.patch 1.89 KB
一键复制 编辑 原始数据 按行查看 历史
eaglegai 提交于 2021-07-06 14:17 . separate abseil-cpp from grpc source
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:
1
https://gitee.com/wangyangdahai/grpc.git
git@gitee.com:wangyangdahai/grpc.git
wangyangdahai
grpc
grpc
master

搜索帮助