diff options
Diffstat (limited to 'net-libs/grpc/files')
4 files changed, 222 insertions, 0 deletions
diff --git a/net-libs/grpc/files/0006-grpc-1.12.1-allow-system-openssl.patch b/net-libs/grpc/files/0006-grpc-1.12.1-allow-system-openssl.patch new file mode 100644 index 000000000000..61fd830d64d4 --- /dev/null +++ b/net-libs/grpc/files/0006-grpc-1.12.1-allow-system-openssl.patch @@ -0,0 +1,65 @@ +From 30ce693621d61efb8596503a0da212077a8c4daa Mon Sep 17 00:00:00 2001 +From: Thomas Bechtold <tbechtold@suse.com> +Date: Thu, 24 May 2018 17:12:13 +0200 +Subject: [PATCH] Allow building the python module with system openssl + +When building the python module and using the new +GRPC_PYTHON_BUILD_SYSTEM_OPENSSL env variable, the third party +boringssl code is not compiled. Instead, the openssl shared library +installed on the system is used during runtime. +This is useful for distributions who don't want to include code copies +but use shared libraries instead. +--- + setup.py | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +diff --git a/setup.py b/setup.py +index 99d1a1c504e..3a5ed56c641 100644 +--- a/setup.py ++++ b/setup.py +@@ -35,7 +35,7 @@ + PY3 = sys.version_info.major == 3 + PYTHON_STEM = os.path.join('src', 'python', 'grpcio') + CORE_INCLUDE = ('include', '.',) +-BORINGSSL_INCLUDE = (os.path.join('third_party', 'boringssl', 'include'),) ++SSL_INCLUDE = (os.path.join('third_party', 'boringssl', 'include'),) + ZLIB_INCLUDE = (os.path.join('third_party', 'zlib'),) + CARES_INCLUDE = ( + os.path.join('third_party', 'cares'), +@@ -84,6 +84,12 @@ + # present, then it will still attempt to use Cython. + BUILD_WITH_CYTHON = os.environ.get('GRPC_PYTHON_BUILD_WITH_CYTHON', False) + ++# Export this variable to use the system installation of openssl. You need to ++# have the header files installed (in /usr/include/openssl) and during ++# runtime, the shared libary must be installed ++BUILD_WITH_SYSTEM_OPENSSL = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_OPENSSL', ++ False) ++ + # Environment variable to determine whether or not to enable coverage analysis + # in Cython modules. + ENABLE_CYTHON_TRACING = os.environ.get( +@@ -148,8 +154,13 @@ + if "win32" in sys.platform: + CORE_C_FILES = filter(lambda x: 'third_party/cares' not in x, CORE_C_FILES) + ++if BUILD_WITH_SYSTEM_OPENSSL: ++ CORE_C_FILES = filter(lambda x: 'third_party/boringssl' not in x, CORE_C_FILES) ++ CORE_C_FILES = filter(lambda x: 'src/boringssl' not in x, CORE_C_FILES) ++ SSL_INCLUDE = (os.path.join('/usr', 'include', 'openssl'),) ++ + EXTENSION_INCLUDE_DIRECTORIES = ( +- (PYTHON_STEM,) + CORE_INCLUDE + BORINGSSL_INCLUDE + ZLIB_INCLUDE + ++ (PYTHON_STEM,) + CORE_INCLUDE + SSL_INCLUDE + ZLIB_INCLUDE + + CARES_INCLUDE + ADDRESS_SORTING_INCLUDE) + + EXTENSION_LIBRARIES = () +@@ -159,6 +170,8 @@ + EXTENSION_LIBRARIES += ('m',) + if "win32" in sys.platform: + EXTENSION_LIBRARIES += ('advapi32', 'ws2_32',) ++if BUILD_WITH_SYSTEM_OPENSSL: ++ EXTENSION_LIBRARIES += ('ssl', 'crypto',) + + DEFINE_MACROS = ( + ('OPENSSL_NO_ASM', 1), ('_WIN32_WINNT', 0x600), diff --git a/net-libs/grpc/files/0007-grpc-1.12.1-allow-system-zlib.patch b/net-libs/grpc/files/0007-grpc-1.12.1-allow-system-zlib.patch new file mode 100644 index 000000000000..6964642b119d --- /dev/null +++ b/net-libs/grpc/files/0007-grpc-1.12.1-allow-system-zlib.patch @@ -0,0 +1,52 @@ +From 3823d9048102bce79e165584c62a1a5b91810aeb Mon Sep 17 00:00:00 2001 +From: Thomas Bechtold <tbechtold@suse.com> +Date: Fri, 25 May 2018 06:52:23 +0200 +Subject: [PATCH] Allow building the python module with system zlib + +When building the python module and using the new +GRPC_PYTHON_BUILD_SYSTEM_ZLIB env variable, the third party zlib code +is not compiled. Instead, the zlib shared library installed on the +system is used during runtime. +This is useful for distributions who don't want to include code copies +but use shared libraries instead. +--- + setup.py | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/setup.py b/setup.py +index 3a5ed56c641..483d3ac1682 100644 +--- a/setup.py ++++ b/setup.py +@@ -90,6 +90,12 @@ + BUILD_WITH_SYSTEM_OPENSSL = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_OPENSSL', + False) + ++# Export this variable to use the system installation of zlib. You need to ++# have the header files installed (in /usr/include/) and during ++# runtime, the shared libary must be installed ++BUILD_WITH_SYSTEM_ZLIB = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_ZLIB', ++ False) ++ + # Environment variable to determine whether or not to enable coverage analysis + # in Cython modules. + ENABLE_CYTHON_TRACING = os.environ.get( +@@ -159,6 +165,10 @@ + CORE_C_FILES = filter(lambda x: 'src/boringssl' not in x, CORE_C_FILES) + SSL_INCLUDE = (os.path.join('/usr', 'include', 'openssl'),) + ++if BUILD_WITH_SYSTEM_ZLIB: ++ CORE_C_FILES = filter(lambda x: 'third_party/zlib' not in x, CORE_C_FILES) ++ ZLIB_INCLUDE = (os.path.join('/usr', 'include'),) ++ + EXTENSION_INCLUDE_DIRECTORIES = ( + (PYTHON_STEM,) + CORE_INCLUDE + SSL_INCLUDE + ZLIB_INCLUDE + + CARES_INCLUDE + ADDRESS_SORTING_INCLUDE) +@@ -172,6 +182,8 @@ + EXTENSION_LIBRARIES += ('advapi32', 'ws2_32',) + if BUILD_WITH_SYSTEM_OPENSSL: + EXTENSION_LIBRARIES += ('ssl', 'crypto',) ++if BUILD_WITH_SYSTEM_ZLIB: ++ EXTENSION_LIBRARIES += ('z',) + + DEFINE_MACROS = ( + ('OPENSSL_NO_ASM', 1), ('_WIN32_WINNT', 0x600), diff --git a/net-libs/grpc/files/0008-grpc-1.12.1-allow-system-cares.patch b/net-libs/grpc/files/0008-grpc-1.12.1-allow-system-cares.patch new file mode 100644 index 000000000000..c2e20f3994f4 --- /dev/null +++ b/net-libs/grpc/files/0008-grpc-1.12.1-allow-system-cares.patch @@ -0,0 +1,52 @@ +From 78a6e04ec1efc2dc839f0329dcff732940e27fd9 Mon Sep 17 00:00:00 2001 +From: Thomas Bechtold <tbechtold@suse.com> +Date: Fri, 25 May 2018 07:08:05 +0200 +Subject: [PATCH] Allow building the python module with system cares + +When building the python module and using the new +GRPC_PYTHON_BUILD_SYSTEM_CARES env variable, the third party cares code +is not compiled. Instead, the cares shared library installed on the +system is used during runtime. +This is useful for distributions who don't want to include code copies +but use shared libraries instead. +--- + setup.py | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/setup.py b/setup.py +index 483d3ac1682..43c25aafeb9 100644 +--- a/setup.py ++++ b/setup.py +@@ -96,6 +96,12 @@ + BUILD_WITH_SYSTEM_ZLIB = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_ZLIB', + False) + ++# Export this variable to use the system installation of cares. You need to ++# have the header files installed (in /usr/include/) and during ++# runtime, the shared libary must be installed ++BUILD_WITH_SYSTEM_CARES = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_CARES', ++ False) ++ + # Environment variable to determine whether or not to enable coverage analysis + # in Cython modules. + ENABLE_CYTHON_TRACING = os.environ.get( +@@ -169,6 +175,10 @@ + CORE_C_FILES = filter(lambda x: 'third_party/zlib' not in x, CORE_C_FILES) + ZLIB_INCLUDE = (os.path.join('/usr', 'include'),) + ++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'),) ++ + EXTENSION_INCLUDE_DIRECTORIES = ( + (PYTHON_STEM,) + CORE_INCLUDE + SSL_INCLUDE + ZLIB_INCLUDE + + CARES_INCLUDE + ADDRESS_SORTING_INCLUDE) +@@ -184,6 +194,8 @@ + EXTENSION_LIBRARIES += ('ssl', 'crypto',) + if BUILD_WITH_SYSTEM_ZLIB: + EXTENSION_LIBRARIES += ('z',) ++if BUILD_WITH_SYSTEM_CARES: ++ EXTENSION_LIBRARIES += ('cares',) + + DEFINE_MACROS = ( + ('OPENSSL_NO_ASM', 1), ('_WIN32_WINNT', 0x600), diff --git a/net-libs/grpc/files/0009-grpc-1.12.1-gcc8-fixes.patch b/net-libs/grpc/files/0009-grpc-1.12.1-gcc8-fixes.patch new file mode 100644 index 000000000000..a9168f165e19 --- /dev/null +++ b/net-libs/grpc/files/0009-grpc-1.12.1-gcc8-fixes.patch @@ -0,0 +1,53 @@ +--- a/tmp/alts_transport_security.cc.ORIG 2018-04-13 20:08:11.000000000 +0200 ++++ b/src/core/tsi/alts_transport_security.cc 2018-05-20 16:54:49.995787548 +0200 +@@ -45,7 +45,7 @@ + } + + void grpc_tsi_alts_init() { +- memset(&g_alts_resource, 0, sizeof(alts_shared_resource)); ++ memset((void*)&g_alts_resource, 0, sizeof(alts_shared_resource)); + gpr_mu_init(&g_alts_resource.mu); + gpr_cv_init(&g_alts_resource.cv); + } +--- a/tmp/client_channel.cc.ORIG 2018-04-13 20:08:11.000000000 +0200 ++++ b/src/core/ext/filters/client_channel/client_channel.cc 2018-05-20 17:07:20.604746186 +0200 +@@ -416,7 +416,7 @@ + grpc_uri* uri = grpc_uri_parse(server_uri, true); + GPR_ASSERT(uri->path[0] != '\0'); + service_config_parsing_state parsing_state; +- memset(&parsing_state, 0, sizeof(parsing_state)); ++ memset((void*)&parsing_state, 0, sizeof(parsing_state)); + parsing_state.server_name = + uri->path[0] == '/' ? uri->path + 1 : uri->path; + service_config->ParseGlobalParams(parse_retry_throttle_params, +--- a/tmp/channel.cc.ORIG 2018-04-13 20:08:11.000000000 +0200 ++++ b/src/core/lib/surface/channel.cc 2018-05-20 16:58:01.632776988 +0200 +@@ -103,7 +103,7 @@ + return channel; + } + +- memset(channel, 0, sizeof(*channel)); ++ memset((void*)channel, 0, sizeof(*channel)); + channel->target = target; + channel->is_client = grpc_channel_stack_type_is_client(channel_stack_type); + size_t channel_tracer_max_nodes = 0; // default to off +@@ -280,7 +280,7 @@ + } + + grpc_call_create_args args; +- memset(&args, 0, sizeof(args)); ++ memset((void*)&args, 0, sizeof(args)); + args.channel = channel; + args.parent = parent_call; + args.propagation_mask = propagation_mask; +--- a/tmp/flow_control.cc.ORIG 2018-04-13 20:08:11.000000000 +0200 ++++ b/src/core/ext/transport/chttp2/transport/flow_control.cc 2018-05-20 17:09:47.055738116 +0200 +@@ -187,7 +187,7 @@ + uint32_t TransportFlowControl::MaybeSendUpdate(bool writing_anyway) { + FlowControlTrace trace("t updt sent", this, nullptr); + const uint32_t target_announced_window = +- static_cast<const uint32_t>(target_window()); ++ static_cast<uint32_t>(target_window()); + if ((writing_anyway || announced_window_ <= target_announced_window / 2) && + announced_window_ != target_announced_window) { + const uint32_t announce = static_cast<uint32_t> GPR_CLAMP( |