From b9936f62abf48097edd231878c7137aeaa39518f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 15 Mar 2022 09:18:24 -0700 Subject: python3-grpcio, python3-grpcio-tools: Upgrade to 1.44.0 - Fix build on ppc64le/musl - Add patch to fix abseil on ppc64 - Changes are here [1] [1] https://github.com/grpc/grpc/releases/tag/v1.44.0 Signed-off-by: Khem Raj Signed-off-by: tgamblin --- ...up.py-Do-not-mix-C-and-C-compiler-options.patch | 13 ++-- .../python/python3-grpcio-tools_1.41.1.bb | 22 ------ .../python/python3-grpcio-tools_1.44.0.bb | 17 +++++ ...up.py-Do-not-mix-C-and-C-compiler-options.patch | 17 ++--- .../python/python3-grpcio/abseil-ppc-fixes.patch | 79 ++++++++++++++++++++++ .../python/python3-grpcio_1.43.0.bb | 48 ------------- .../python/python3-grpcio_1.44.0.bb | 46 +++++++++++++ 7 files changed, 151 insertions(+), 91 deletions(-) delete mode 100644 meta-python/recipes-devtools/python/python3-grpcio-tools_1.41.1.bb create mode 100644 meta-python/recipes-devtools/python/python3-grpcio-tools_1.44.0.bb create mode 100644 meta-python/recipes-devtools/python/python3-grpcio/abseil-ppc-fixes.patch delete mode 100644 meta-python/recipes-devtools/python/python3-grpcio_1.43.0.bb create mode 100644 meta-python/recipes-devtools/python/python3-grpcio_1.44.0.bb (limited to 'meta-python') diff --git a/meta-python/recipes-devtools/python/python3-grpcio-tools/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch b/meta-python/recipes-devtools/python/python3-grpcio-tools/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch index aef67b5748..4713da174f 100644 --- a/meta-python/recipes-devtools/python/python3-grpcio-tools/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch +++ b/meta-python/recipes-devtools/python/python3-grpcio-tools/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch @@ -26,11 +26,9 @@ Signed-off-by: Khem Raj setup.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -diff --git a/setup.py b/setup.py -index a316038..70aa174 100644 --- a/setup.py +++ b/setup.py -@@ -76,8 +76,11 @@ def check_linker_need_libatomic(): +@@ -87,8 +87,11 @@ def check_linker_need_libatomic(): """Test if linker on system needs libatomic.""" code_test = (b'#include \n' + b'int main() { return std::atomic{}; }') @@ -44,15 +42,12 @@ index a316038..70aa174 100644 stdin=PIPE, stdout=PIPE, stderr=PIPE) -@@ -87,7 +90,7 @@ def check_linker_need_libatomic(): +@@ -98,7 +101,7 @@ def check_linker_need_libatomic(): # Double-check to see if -latomic actually can solve the problem. # https://github.com/grpc/grpc/issues/22491 cpp_test = subprocess.Popen( -- [cxx, '-x', 'c++', '-std=c++11', '-latomic', '-'], -+ [cxx, cxx_args, '-x', 'c++', '-std=c++11', '-latomic', '-'], +- [cxx, '-x', 'c++', '-std=c++11', '-', '-latomic'], ++ [cxx, cxx_args, '-x', 'c++', '-std=c++11', '-', '-latomic'], stdin=PIPE, stdout=PIPE, stderr=PIPE) --- -2.30.1 - diff --git a/meta-python/recipes-devtools/python/python3-grpcio-tools_1.41.1.bb b/meta-python/recipes-devtools/python/python3-grpcio-tools_1.41.1.bb deleted file mode 100644 index fdc4ad9cc2..0000000000 --- a/meta-python/recipes-devtools/python/python3-grpcio-tools_1.41.1.bb +++ /dev/null @@ -1,22 +0,0 @@ -DESCRIPTION = "Google gRPC tools" -HOMEPAGE = "http://www.grpc.io/" -SECTION = "devel/python" - -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=7145f7cdd263359b62d342a02f005515" - -inherit pypi setuptools3 - -DEPENDS += "${PYTHON_PN}-grpcio" - -SRC_URI += "file://0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch" - -SRC_URI[sha256sum] = "f16e4c63996ca8fe0af1eb9c4a07e5207874c4a69f890ccb824cd858521d981f" - -RDEPENDS:${PN} = "${PYTHON_PN}-grpcio" - -BBCLASSEXTEND = "native nativesdk" - -# Needs abseil-cpp which does not build for ppc64le/musl -COMPATIBLE_HOST:libc-musl:powerpc64le = "null" - diff --git a/meta-python/recipes-devtools/python/python3-grpcio-tools_1.44.0.bb b/meta-python/recipes-devtools/python/python3-grpcio-tools_1.44.0.bb new file mode 100644 index 0000000000..1b219fc950 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-grpcio-tools_1.44.0.bb @@ -0,0 +1,17 @@ +DESCRIPTION = "Google gRPC tools" +HOMEPAGE = "http://www.grpc.io/" +SECTION = "devel/python" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=7145f7cdd263359b62d342a02f005515" + +inherit pypi setuptools3 + +DEPENDS += "${PYTHON_PN}-grpcio" + +SRC_URI += "file://0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch" +SRC_URI[sha256sum] = "be37f458ea510c9a8f1caabbc2b258d12e55d189a567f5edcace90f27dc0efbf" + +RDEPENDS:${PN} = "${PYTHON_PN}-grpcio" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch b/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch index 373669461b..febe6c4c87 100644 --- a/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch +++ b/meta-python/recipes-devtools/python/python3-grpcio/0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch @@ -28,11 +28,9 @@ Signed-off-by: Hongxu Jia src/python/grpcio/commands.py | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) -diff --git a/setup.py b/setup.py -index 4b8c9d4..271b7b1 100644 --- a/setup.py +++ b/setup.py -@@ -172,8 +172,11 @@ def check_linker_need_libatomic(): +@@ -199,8 +199,11 @@ def check_linker_need_libatomic(): """Test if linker on system needs libatomic.""" code_test = (b'#include \n' + b'int main() { return std::atomic{}; }') @@ -46,20 +44,18 @@ index 4b8c9d4..271b7b1 100644 stdin=PIPE, stdout=PIPE, stderr=PIPE) -@@ -183,7 +186,7 @@ def check_linker_need_libatomic(): +@@ -210,7 +213,7 @@ def check_linker_need_libatomic(): # Double-check to see if -latomic actually can solve the problem. # https://github.com/grpc/grpc/issues/22491 cpp_test = subprocess.Popen( -- [cxx, '-x', 'c++', '-std=c++11', '-latomic', '-'], -+ [cxx, cxx_args, '-x', 'c++', '-std=c++11', '-latomic', '-'], +- [cxx, '-x', 'c++', '-std=c++11', '-', '-latomic'], ++ [cxx, cxx_args, '-x', 'c++', '-std=c++11', '-', '-latomic'], stdin=PIPE, stdout=PIPE, stderr=PIPE) -diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py -index a8b2ff5..b928201 100644 --- a/src/python/grpcio/commands.py +++ b/src/python/grpcio/commands.py -@@ -219,7 +219,10 @@ class BuildExt(build_ext.build_ext): +@@ -228,7 +228,10 @@ class BuildExt(build_ext.build_ext): """ try: # TODO(lidiz) Remove the generated a.out for success tests. @@ -71,6 +67,3 @@ index a8b2ff5..b928201 100644 stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) --- -2.30.1 - diff --git a/meta-python/recipes-devtools/python/python3-grpcio/abseil-ppc-fixes.patch b/meta-python/recipes-devtools/python/python3-grpcio/abseil-ppc-fixes.patch new file mode 100644 index 0000000000..e8048fe940 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-grpcio/abseil-ppc-fixes.patch @@ -0,0 +1,79 @@ +An all-in-one patch that fixes several issues: + +1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled on musl) +2) powerpc stacktrace implementation only works on glibc (disabled on musl) +3) powerpc stacktrace implementation has ppc64 assumptions (fixed) +4) examine_stack.cpp makes glibc assumptions on powerpc (fixed) + +Sourced from void linux + +Signed-off-by: Khem Raj + +--- a/absl/base/internal/unscaledcycleclock.cc ++++ b/absl/base/internal/unscaledcycleclock.cc +@@ -20,7 +20,7 @@ + #include + #endif + +-#if defined(__powerpc__) || defined(__ppc__) ++#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__) + #ifdef __GLIBC__ + #include + #elif defined(__FreeBSD__) +@@ -59,7 +59,7 @@ double UnscaledCycleClock::Frequency() { + return base_internal::NominalCPUFrequency(); + } + +-#elif defined(__powerpc__) || defined(__ppc__) ++#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__) + + int64_t UnscaledCycleClock::Now() { + #ifdef __GLIBC__ +--- a/absl/base/internal/unscaledcycleclock.h ++++ b/absl/base/internal/unscaledcycleclock.h +@@ -46,7 +46,8 @@ + + // The following platforms have an implementation of a hardware counter. + #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \ +- defined(__powerpc__) || defined(__ppc__) || defined(__riscv) || \ ++ ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \ ++ defined(__riscv) || \ + defined(_M_IX86) || defined(_M_X64) + #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1 + #else +--- a/absl/debugging/internal/examine_stack.cc ++++ b/absl/debugging/internal/examine_stack.cc +@@ -27,6 +27,10 @@ + #include + #include + ++#if defined(__powerpc__) ++#include ++#endif ++ + #include "absl/base/attributes.h" + #include "absl/base/internal/raw_logging.h" + #include "absl/base/macros.h" +@@ -63,8 +67,10 @@ void* GetProgramCounter(void* vuc) { + return reinterpret_cast(context->uc_mcontext.pc); + #elif defined(__powerpc64__) + return reinterpret_cast(context->uc_mcontext.gp_regs[32]); +-#elif defined(__powerpc__) ++#elif defined(__powerpc__) && defined(__GLIBC__) + return reinterpret_cast(context->uc_mcontext.uc_regs->gregs[32]); ++#elif defined(__powerpc__) ++ return reinterpret_cast(((struct pt_regs *)context->uc_regs)->gregs[32]); + #elif defined(__riscv) + return reinterpret_cast(context->uc_mcontext.__gregs[REG_PC]); + #elif defined(__s390__) && !defined(__s390x__) +--- a/absl/debugging/internal/stacktrace_config.h ++++ b/absl/debugging/internal/stacktrace_config.h +@@ -59,7 +59,7 @@ + #elif defined(__i386__) || defined(__x86_64__) + #define ABSL_STACKTRACE_INL_HEADER \ + "absl/debugging/internal/stacktrace_x86-inl.inc" +-#elif defined(__ppc__) || defined(__PPC__) ++#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__) + #define ABSL_STACKTRACE_INL_HEADER \ + "absl/debugging/internal/stacktrace_powerpc-inl.inc" + #elif defined(__aarch64__) diff --git a/meta-python/recipes-devtools/python/python3-grpcio_1.43.0.bb b/meta-python/recipes-devtools/python/python3-grpcio_1.43.0.bb deleted file mode 100644 index 6d76967bee..0000000000 --- a/meta-python/recipes-devtools/python/python3-grpcio_1.43.0.bb +++ /dev/null @@ -1,48 +0,0 @@ -DESCRIPTION = "Google gRPC" -HOMEPAGE = "http://www.grpc.io/" -SECTION = "devel/python" -LICENSE = "Apache-2.0 & BSD-3-Clause" -LIC_FILES_CHKSUM = "file://LICENSE;md5=6e4cf218112648d22420a84281b68b88" - -DEPENDS += "${PYTHON_PN}-protobuf" - -SRC_URI += "file://0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch" -SRC_URI:append:class-target = " file://ppc-boringssl-support.patch \ - file://boring_ssl.patch \ - file://mips_bigendian.patch \ - file://0001-absl-always-use-asm-sgidefs.h.patch \ -" -SRC_URI[sha256sum] = "735d9a437c262ab039d02defddcb9f8f545d7009ae61c0114e19dda3843febe5" - -RDEPENDS:${PN} = "${PYTHON_PN}-protobuf \ - ${PYTHON_PN}-setuptools \ - ${PYTHON_PN}-six \ -" - -inherit setuptools3 -inherit pypi - -export GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY = "1" - -BORING_SSL_PLATFORM:arm = "linux-arm" -BORING_SSL_PLATFORM:x86-64 = "linux-x86_64" -BORING_SSL_PLATFORM ?= "unsupported" -export GRPC_BORING_SSL_PLATFORM = "${BORING_SSL_PLATFORM}" - -BORING_SSL:x86-64 = "1" -BORING_SSL:arm = "1" -BORING_SSL ?= "0" -export GRPC_BUILD_WITH_BORING_SSL_ASM = "${BORING_SSL}" - -GRPC_CFLAGS ?= "" -GRPC_CFLAGS:append:toolchain-clang = " -fvisibility=hidden -fno-wrapv -fno-exceptions" -export GRPC_PYTHON_CFLAGS = "${GRPC_CFLAGS}" - -CLEANBROKEN = "1" - -BBCLASSEXTEND = "native nativesdk" - -CCACHE_DISABLE = "1" - -# needs vdso support -COMPATIBLE_HOST:libc-musl:powerpc64le = "null" diff --git a/meta-python/recipes-devtools/python/python3-grpcio_1.44.0.bb b/meta-python/recipes-devtools/python/python3-grpcio_1.44.0.bb new file mode 100644 index 0000000000..ffa009d7b7 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-grpcio_1.44.0.bb @@ -0,0 +1,46 @@ +DESCRIPTION = "Google gRPC" +HOMEPAGE = "http://www.grpc.io/" +SECTION = "devel/python" +LICENSE = "Apache-2.0 & BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=6e4cf218112648d22420a84281b68b88" + +DEPENDS += "${PYTHON_PN}-protobuf" + +SRC_URI += "file://0001-setup.py-Do-not-mix-C-and-C-compiler-options.patch" +SRC_URI:append:class-target = " file://ppc-boringssl-support.patch \ + file://boring_ssl.patch \ + file://mips_bigendian.patch \ + file://0001-absl-always-use-asm-sgidefs.h.patch \ + file://abseil-ppc-fixes.patch;patchdir=third_party/abseil-cpp \ +" +SRC_URI[sha256sum] = "4bae1c99896045d3062ab95478411c8d5a52cb84b91a1517312629fa6cfeb50e" + +RDEPENDS:${PN} = "${PYTHON_PN}-protobuf \ + ${PYTHON_PN}-setuptools \ + ${PYTHON_PN}-six \ +" + +inherit setuptools3 +inherit pypi + +export GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY = "1" + +BORING_SSL_PLATFORM:arm = "linux-arm" +BORING_SSL_PLATFORM:x86-64 = "linux-x86_64" +BORING_SSL_PLATFORM ?= "unsupported" +export GRPC_BORING_SSL_PLATFORM = "${BORING_SSL_PLATFORM}" + +BORING_SSL:x86-64 = "1" +BORING_SSL:arm = "1" +BORING_SSL ?= "0" +export GRPC_BUILD_WITH_BORING_SSL_ASM = "${BORING_SSL}" + +GRPC_CFLAGS ?= "" +GRPC_CFLAGS:append:toolchain-clang = " -fvisibility=hidden -fno-wrapv -fno-exceptions" +export GRPC_PYTHON_CFLAGS = "${GRPC_CFLAGS}" + +CLEANBROKEN = "1" + +BBCLASSEXTEND = "native nativesdk" + +CCACHE_DISABLE = "1" -- cgit v1.2.3-54-g00ecf