From bd54f6885e527f60e2a06ccd53c161c06eaff447 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 14 May 2023 00:04:37 +1100 Subject: [PATCH 01/12] bump to 4.22.3; rebase patches --- recipe/meta.yaml | 12 +- ...-do-not-link-msvc-runtime-statically.patch | 9 +- ...ix-paths-for-include-lib-directories.patch | 13 +- ...t-to-name-of-protobuf-lib-on-windows.patch | 27 ++-- .../0004-fix-build-with-python-311.patch | 128 ------------------ 5 files changed, 26 insertions(+), 163 deletions(-) delete mode 100644 recipe/patches/0004-fix-build-with-python-311.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 5389f6a..c2c65a9 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,9 +1,10 @@ # keep this without major version to let the bot pick it up -{% set version = "21.12" %} -# protobuf doesn't add the major version in the tag... +{% set version = "22.5" %} +# protobuf doesn't add the major version in the tag, it's defined per language in +# https://github.com/protocolbuffers/protobuf/blob/main/version.json {% set major = "4" %} -# libprotobuf now has a different major version than protobuf -{% set lib_major = "3" %} +# libprotobuf can have a different major version than protobuf +{% set lib_major = "4" %} package: name: protobuf @@ -11,12 +12,11 @@ package: source: url: https://github.com/protocolbuffers/protobuf/archive/v{{ version }}/protobuf-v{{ version }}.tar.gz - sha256: 22fdaf641b31655d4b2297f9981fa5203b2866f8332d3c6333f6b0107bb320de + sha256: 4b98c800b352e7582bc92ed398999030ce4ebb49c7858dcb070850ec476b72f2 patches: - patches/0001-do-not-link-msvc-runtime-statically.patch - patches/0002-fix-paths-for-include-lib-directories.patch - patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch - - patches/0004-fix-build-with-python-311.patch build: number: 0 diff --git a/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch b/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch index 4369911..06cd4cb 100644 --- a/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch +++ b/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch @@ -1,4 +1,4 @@ -From 45deeecca8a38de9e3f8a31a55dc2d161f1081be Mon Sep 17 00:00:00 2001 +From fb3b6e0a27173920fe69ba76512f431062677158 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 4 Sep 2022 18:14:41 +0200 Subject: [PATCH 1/3] do not link msvc runtime statically @@ -8,10 +8,10 @@ Subject: [PATCH 1/3] do not link msvc runtime statically 1 file changed, 4 deletions(-) diff --git a/python/setup.py b/python/setup.py -index cbb9a5906..39988effd 100755 +index e65631013..b6de92d1d 100755 --- a/python/setup.py +++ b/python/setup.py -@@ -285,10 +285,6 @@ if __name__ == '__main__': +@@ -396,10 +396,6 @@ if __name__ == '__main__': if sys.platform == 'win32' and '64 bit' in sys.version: extra_compile_args.append('-DMS_WIN64') @@ -22,6 +22,3 @@ index cbb9a5906..39988effd 100755 if 'clang' in os.popen('$CC --version 2> /dev/null').read(): extra_compile_args.append('-Wno-shorten-64-to-32') --- -2.37.0.windows.1 - diff --git a/recipe/patches/0002-fix-paths-for-include-lib-directories.patch b/recipe/patches/0002-fix-paths-for-include-lib-directories.patch index 09ca8b1..cd6d299 100644 --- a/recipe/patches/0002-fix-paths-for-include-lib-directories.patch +++ b/recipe/patches/0002-fix-paths-for-include-lib-directories.patch @@ -1,4 +1,4 @@ -From f3f67634ac60d6df42f119b1478f6a84bfb2db48 Mon Sep 17 00:00:00 2001 +From ecd4d1dfe12ed1466ed1a94c0a560eca9127c960 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 4 Sep 2022 18:42:34 +0200 Subject: [PATCH 2/3] fix paths for include & lib directories @@ -8,10 +8,10 @@ Subject: [PATCH 2/3] fix paths for include & lib directories 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python/setup.py b/python/setup.py -index 39988effd..2b907cf9f 100755 +index b6de92d1d..193685733 100755 --- a/python/setup.py +++ b/python/setup.py -@@ -292,6 +292,14 @@ if __name__ == '__main__': +@@ -403,6 +403,14 @@ if __name__ == '__main__': extra_compile_args.append('-Werror') sys.argv.remove(warnings_as_errors) @@ -26,15 +26,12 @@ index 39988effd..2b907cf9f 100755 # C++ implementation extension ext_module_list.extend([ Extension( -@@ -301,7 +309,7 @@ if __name__ == '__main__': +@@ -412,7 +420,7 @@ if __name__ == '__main__': libraries=libraries, extra_objects=extra_objects, extra_link_args=message_extra_link_args, -- library_dirs=['../src/.libs'], +- library_dirs=library_dirs, + library_dirs=[lib_dir], extra_compile_args=extra_compile_args, ), Extension( --- -2.37.0.windows.1 - diff --git a/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch b/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch index 60e6d20..6029530 100644 --- a/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch +++ b/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch @@ -1,4 +1,4 @@ -From c19e949337634e068597c3a3dcd9fd218d03da63 Mon Sep 17 00:00:00 2001 +From e37e53770669b8e2d63d79fc89978de31168814b Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 4 Sep 2022 19:42:16 +0200 Subject: [PATCH 3/3] adapt to name of protobuf lib on windows @@ -8,19 +8,16 @@ Subject: [PATCH 3/3] adapt to name of protobuf lib on windows 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/setup.py b/python/setup.py -index 2b907cf9f..9127f05d2 100755 +index 193685733..88bd80a33 100755 --- a/python/setup.py +++ b/python/setup.py -@@ -228,7 +228,8 @@ if __name__ == '__main__': - # extension. Note that those libraries have to be compiled with - # -fPIC for this to work. - compile_static_ext = GetOptionFromArgv('--compile_static_extension') -- libraries = ['protobuf'] -+ # our windows builds don't follow standard windows naming (i.e. have a lib prefix) -+ libraries = ['protobuf'] if sys.platform != 'win32' else ['libprotobuf-static'] - extra_objects = None - if compile_static_ext: - libraries = None --- -2.37.0.windows.1 - +@@ -336,7 +336,8 @@ if __name__ == '__main__': + extra_objects += list( + glob.iglob('../third_party/abseil-cpp/absl/**/*.a')) + else: +- libraries = ['protobuf'] ++ # our windows builds don't follow standard windows naming (i.e. have a lib prefix) ++ libraries = ['protobuf'] if sys.platform != 'win32' else ['libprotobuf'] + if HasLibraryDirsOpt(): + library_dirs = None + elif os.path.exists('../bazel-bin/src/google/protobuf/libprotobuf.a'): diff --git a/recipe/patches/0004-fix-build-with-python-311.patch b/recipe/patches/0004-fix-build-with-python-311.patch deleted file mode 100644 index c307557..0000000 --- a/recipe/patches/0004-fix-build-with-python-311.patch +++ /dev/null @@ -1,128 +0,0 @@ -diff -ruN protobuf-21.8/python/google/protobuf/pyext/descriptor.cc protobuf-21.8-patch/python/google/protobuf/pyext/descriptor.cc ---- protobuf-21.8/python/google/protobuf/pyext/descriptor.cc 2022-10-18 17:45:18.000000000 +0200 -+++ protobuf-21.8-patch/python/google/protobuf/pyext/descriptor.cc 2022-10-26 21:57:26.217437077 +0200 -@@ -58,6 +58,37 @@ - : 0) \ - : PyBytes_AsStringAndSize(ob, (charpp), (sizep))) - -+#if PY_VERSION_HEX < 0x030900B1 && !defined(PYPY_VERSION) -+static PyCodeObject* PyFrame_GetCode(PyFrameObject *frame) -+{ -+ Py_INCREF(frame->f_code); -+ return frame->f_code; -+} -+ -+static PyFrameObject* PyFrame_GetBack(PyFrameObject *frame) -+{ -+ Py_XINCREF(frame->f_back); -+ return frame->f_back; -+} -+#endif -+ -+#if PY_VERSION_HEX < 0x030B00A7 && !defined(PYPY_VERSION) -+static PyObject* PyFrame_GetLocals(PyFrameObject *frame) -+{ -+ if (PyFrame_FastToLocalsWithError(frame) < 0) { -+ return NULL; -+ } -+ Py_INCREF(frame->f_locals); -+ return frame->f_locals; -+} -+ -+static PyObject* PyFrame_GetGlobals(PyFrameObject *frame) -+{ -+ Py_INCREF(frame->f_globals); -+ return frame->f_globals; -+} -+#endif -+ - namespace google { - namespace protobuf { - namespace python { -@@ -92,52 +123,72 @@ - // TODO(amauryfa): Change the proto2 compiler to remove the assignments, and - // remove this hack. - bool _CalledFromGeneratedFile(int stacklevel) { --#ifndef PYPY_VERSION -+#ifdef PYPY_VERSION -+ return true; -+#else -+ bool result = false; - // This check is not critical and is somewhat difficult to implement correctly - // in PyPy. - PyFrameObject* frame = PyEval_GetFrame(); -+ PyCodeObject* frame_code = nullptr; -+ PyObject* frame_globals = nullptr; -+ PyObject* frame_locals = nullptr; -+ - if (frame == nullptr) { -- return false; -+ goto exit; - } -+ Py_INCREF(frame); - while (stacklevel-- > 0) { -- frame = frame->f_back; -+ PyFrameObject* next_frame = PyFrame_GetBack(frame); -+ Py_DECREF(frame); -+ frame = next_frame; - if (frame == nullptr) { -- return false; -+ goto exit; - } - } - -- if (frame->f_code->co_filename == nullptr) { -- return false; -+ frame_code = PyFrame_GetCode(frame); -+ if (frame_code->co_filename == nullptr) { -+ goto exit; - } - char* filename; - Py_ssize_t filename_size; -- if (PyString_AsStringAndSize(frame->f_code->co_filename, -+ if (PyString_AsStringAndSize(frame_code->co_filename, - &filename, &filename_size) < 0) { - // filename is not a string. - PyErr_Clear(); -- return false; -+ goto exit; - } - if ((filename_size < 3) || - (strcmp(&filename[filename_size - 3], ".py") != 0)) { - // Cython's stack does not have .py file name and is not at global module - // scope. -- return true; -+ result = true; -+ goto exit; - } - if (filename_size < 7) { - // filename is too short. -- return false; -+ goto exit; - } - if (strcmp(&filename[filename_size - 7], "_pb2.py") != 0) { - // Filename is not ending with _pb2. -- return false; -+ goto exit; - } - -- if (frame->f_globals != frame->f_locals) { -+ frame_globals = PyFrame_GetGlobals(frame); -+ frame_locals = PyFrame_GetLocals(frame); -+ if (frame_globals != frame_locals) { - // Not at global module scope -- return false; -+ goto exit; - } -+ result = true; -+exit: -+ Py_XDECREF(frame_globals); -+ Py_XDECREF(frame_locals); -+ Py_XDECREF(frame_code); -+ Py_XDECREF(frame); -+ return result; - #endif -- return true; - } - - // If the calling code is not a _pb2.py file, raise AttributeError. From 63b0795183c6186b4ec45dbb5e966c46d3e9ba7f Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 14 May 2023 00:05:02 +1100 Subject: [PATCH 02/12] use more discoverable url pattern --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index c2c65a9..85cd66e 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -11,7 +11,7 @@ package: version: {{ major + "." + version }} source: - url: https://github.com/protocolbuffers/protobuf/archive/v{{ version }}/protobuf-v{{ version }}.tar.gz + url: https://github.com/protocolbuffers/protobuf/archive/refs/tags/v{{ version }}.tar.gz sha256: 4b98c800b352e7582bc92ed398999030ce4ebb49c7858dcb070850ec476b72f2 patches: - patches/0001-do-not-link-msvc-runtime-statically.patch From 1cd340d97fb44c00537114062a60ae9d1dcc11f3 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 14 May 2023 00:05:42 +1100 Subject: [PATCH 03/12] use more robust string concatenation syntax in jinja --- recipe/meta.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 85cd66e..4c071f4 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -8,7 +8,7 @@ package: name: protobuf - version: {{ major + "." + version }} + version: {{ major ~ "." ~ version }} source: url: https://github.com/protocolbuffers/protobuf/archive/refs/tags/v{{ version }}.tar.gz @@ -28,18 +28,18 @@ requirements: build: - python # [build_platform != target_platform] - cross-python_{{ target_platform }} # [build_platform != target_platform] - - libprotobuf {{ lib_major + "." + version }} # [build_platform != target_platform] + - libprotobuf {{ lib_major ~ "." ~ version }} # [build_platform != target_platform] - {{ compiler('c') }} - {{ compiler('cxx') }} host: - python - pip - - libprotobuf {{ lib_major + "." + version }} # [unix] - - libprotobuf-static {{ lib_major + "." + version }} # [win] + - libprotobuf {{ lib_major ~ "." ~ version }} # [unix] + - libprotobuf-static {{ lib_major ~ "." ~ version }} # [win] run: - python - setuptools - - libprotobuf {{ lib_major + "." + version }} + - libprotobuf {{ lib_major ~ "." ~ version }} test: commands: From 014f32fb068721dafecf910527bfae501a5f63d6 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 14 May 2023 00:39:40 +1100 Subject: [PATCH 04/12] MNT: Re-rendered with conda-build 3.24.0, conda-smithy 3.23.1, and conda-forge-pinning 2023.05.12.17.26.46 --- .azure-pipelines/azure-pipelines-win.yml | 4 ++-- ...linux_64_python3.10.____cpythonpython_implcpython.yaml | 4 ++-- ...linux_64_python3.11.____cpythonpython_implcpython.yaml | 4 ++-- .../linux_64_python3.8.____73_pypypython_implpypy.yaml | 4 ++-- .../linux_64_python3.8.____cpythonpython_implcpython.yaml | 4 ++-- .../linux_64_python3.9.____73_pypypython_implpypy.yaml | 4 ++-- .../linux_64_python3.9.____cpythonpython_implcpython.yaml | 4 ++-- ..._aarch64_python3.10.____cpythonpython_implcpython.yaml | 4 ++-- ..._aarch64_python3.11.____cpythonpython_implcpython.yaml | 4 ++-- ...inux_aarch64_python3.8.____73_pypypython_implpypy.yaml | 4 ++-- ...x_aarch64_python3.8.____cpythonpython_implcpython.yaml | 4 ++-- ...inux_aarch64_python3.9.____73_pypypython_implpypy.yaml | 4 ++-- ...x_aarch64_python3.9.____cpythonpython_implcpython.yaml | 4 ++-- ..._ppc64le_python3.10.____cpythonpython_implcpython.yaml | 4 ++-- ..._ppc64le_python3.11.____cpythonpython_implcpython.yaml | 4 ++-- ...inux_ppc64le_python3.8.____73_pypypython_implpypy.yaml | 4 ++-- ...x_ppc64le_python3.8.____cpythonpython_implcpython.yaml | 4 ++-- ...inux_ppc64le_python3.9.____73_pypypython_implpypy.yaml | 4 ++-- ...x_ppc64le_python3.9.____cpythonpython_implcpython.yaml | 4 ++-- .../osx_64_python3.10.____cpythonpython_implcpython.yaml | 4 ++-- .../osx_64_python3.11.____cpythonpython_implcpython.yaml | 4 ++-- .../osx_64_python3.8.____73_pypypython_implpypy.yaml | 4 ++-- .../osx_64_python3.8.____cpythonpython_implcpython.yaml | 4 ++-- .../osx_64_python3.9.____73_pypypython_implpypy.yaml | 4 ++-- .../osx_64_python3.9.____cpythonpython_implcpython.yaml | 4 ++-- .ci_support/osx_arm64_python3.10.____cpython.yaml | 4 ++-- .ci_support/osx_arm64_python3.11.____cpython.yaml | 4 ++-- .ci_support/osx_arm64_python3.8.____cpython.yaml | 4 ++-- .ci_support/osx_arm64_python3.9.____cpython.yaml | 4 ++-- .scripts/build_steps.sh | 4 ++-- .scripts/run_osx_build.sh | 4 ++-- README.md | 8 ++++---- 32 files changed, 66 insertions(+), 66 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index d7f3aa0..0253afc 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -5,7 +5,7 @@ jobs: - job: win pool: - vmImage: windows-2019 + vmImage: windows-2022 strategy: matrix: win_64_python3.10.____cpythonpython_implcpython: @@ -51,7 +51,7 @@ jobs: - script: | call activate base - mamba.exe install "python=3.9" conda-build conda pip boa conda-forge-ci-setup=3 "py-lief<0.12" -c conda-forge --strict-channel-priority --yes + mamba.exe install "python=3.10" conda-build conda pip boa conda-forge-ci-setup=3 -c conda-forge --strict-channel-priority --yes displayName: Install conda-build - script: set PYTHONUNBUFFERED=1 diff --git a/.ci_support/linux_64_python3.10.____cpythonpython_implcpython.yaml b/.ci_support/linux_64_python3.10.____cpythonpython_implcpython.yaml index 5af4428..01daac2 100644 --- a/.ci_support/linux_64_python3.10.____cpythonpython_implcpython.yaml +++ b/.ci_support/linux_64_python3.10.____cpythonpython_implcpython.yaml @@ -1,7 +1,7 @@ c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_name: - cos6 channel_sources: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_64_python3.11.____cpythonpython_implcpython.yaml b/.ci_support/linux_64_python3.11.____cpythonpython_implcpython.yaml index 8abd22d..d0fce72 100644 --- a/.ci_support/linux_64_python3.11.____cpythonpython_implcpython.yaml +++ b/.ci_support/linux_64_python3.11.____cpythonpython_implcpython.yaml @@ -1,7 +1,7 @@ c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_name: - cos6 channel_sources: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_64_python3.8.____73_pypypython_implpypy.yaml b/.ci_support/linux_64_python3.8.____73_pypypython_implpypy.yaml index 3bc3096..88baebb 100644 --- a/.ci_support/linux_64_python3.8.____73_pypypython_implpypy.yaml +++ b/.ci_support/linux_64_python3.8.____73_pypypython_implpypy.yaml @@ -1,7 +1,7 @@ c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_name: - cos6 channel_sources: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_64_python3.8.____cpythonpython_implcpython.yaml b/.ci_support/linux_64_python3.8.____cpythonpython_implcpython.yaml index c54f404..163e30b 100644 --- a/.ci_support/linux_64_python3.8.____cpythonpython_implcpython.yaml +++ b/.ci_support/linux_64_python3.8.____cpythonpython_implcpython.yaml @@ -1,7 +1,7 @@ c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_name: - cos6 channel_sources: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_64_python3.9.____73_pypypython_implpypy.yaml b/.ci_support/linux_64_python3.9.____73_pypypython_implpypy.yaml index b850f75..d9e0d04 100644 --- a/.ci_support/linux_64_python3.9.____73_pypypython_implpypy.yaml +++ b/.ci_support/linux_64_python3.9.____73_pypypython_implpypy.yaml @@ -1,7 +1,7 @@ c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_name: - cos6 channel_sources: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_64_python3.9.____cpythonpython_implcpython.yaml b/.ci_support/linux_64_python3.9.____cpythonpython_implcpython.yaml index 95cdb9b..a33af34 100644 --- a/.ci_support/linux_64_python3.9.____cpythonpython_implcpython.yaml +++ b/.ci_support/linux_64_python3.9.____cpythonpython_implcpython.yaml @@ -1,7 +1,7 @@ c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_name: - cos6 channel_sources: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_aarch64_python3.10.____cpythonpython_implcpython.yaml b/.ci_support/linux_aarch64_python3.10.____cpythonpython_implcpython.yaml index 7365b08..abac9c5 100644 --- a/.ci_support/linux_aarch64_python3.10.____cpythonpython_implcpython.yaml +++ b/.ci_support/linux_aarch64_python3.10.____cpythonpython_implcpython.yaml @@ -3,7 +3,7 @@ BUILD: c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_arch: - aarch64 cdt_name: @@ -15,7 +15,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_aarch64_python3.11.____cpythonpython_implcpython.yaml b/.ci_support/linux_aarch64_python3.11.____cpythonpython_implcpython.yaml index a06eac4..f8918a4 100644 --- a/.ci_support/linux_aarch64_python3.11.____cpythonpython_implcpython.yaml +++ b/.ci_support/linux_aarch64_python3.11.____cpythonpython_implcpython.yaml @@ -3,7 +3,7 @@ BUILD: c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_arch: - aarch64 cdt_name: @@ -15,7 +15,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_aarch64_python3.8.____73_pypypython_implpypy.yaml b/.ci_support/linux_aarch64_python3.8.____73_pypypython_implpypy.yaml index 7a2affa..f3f4ff8 100644 --- a/.ci_support/linux_aarch64_python3.8.____73_pypypython_implpypy.yaml +++ b/.ci_support/linux_aarch64_python3.8.____73_pypypython_implpypy.yaml @@ -3,7 +3,7 @@ BUILD: c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_arch: - aarch64 cdt_name: @@ -15,7 +15,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_aarch64_python3.8.____cpythonpython_implcpython.yaml b/.ci_support/linux_aarch64_python3.8.____cpythonpython_implcpython.yaml index 4b203f4..6a0dc2c 100644 --- a/.ci_support/linux_aarch64_python3.8.____cpythonpython_implcpython.yaml +++ b/.ci_support/linux_aarch64_python3.8.____cpythonpython_implcpython.yaml @@ -3,7 +3,7 @@ BUILD: c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_arch: - aarch64 cdt_name: @@ -15,7 +15,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_aarch64_python3.9.____73_pypypython_implpypy.yaml b/.ci_support/linux_aarch64_python3.9.____73_pypypython_implpypy.yaml index 6950f45..e64344a 100644 --- a/.ci_support/linux_aarch64_python3.9.____73_pypypython_implpypy.yaml +++ b/.ci_support/linux_aarch64_python3.9.____73_pypypython_implpypy.yaml @@ -3,7 +3,7 @@ BUILD: c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_arch: - aarch64 cdt_name: @@ -15,7 +15,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_aarch64_python3.9.____cpythonpython_implcpython.yaml b/.ci_support/linux_aarch64_python3.9.____cpythonpython_implcpython.yaml index 25f2a96..fcbc2f2 100644 --- a/.ci_support/linux_aarch64_python3.9.____cpythonpython_implcpython.yaml +++ b/.ci_support/linux_aarch64_python3.9.____cpythonpython_implcpython.yaml @@ -3,7 +3,7 @@ BUILD: c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_arch: - aarch64 cdt_name: @@ -15,7 +15,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_ppc64le_python3.10.____cpythonpython_implcpython.yaml b/.ci_support/linux_ppc64le_python3.10.____cpythonpython_implcpython.yaml index d5ccd03..0250296 100644 --- a/.ci_support/linux_ppc64le_python3.10.____cpythonpython_implcpython.yaml +++ b/.ci_support/linux_ppc64le_python3.10.____cpythonpython_implcpython.yaml @@ -1,7 +1,7 @@ c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_name: - cos7 channel_sources: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_ppc64le_python3.11.____cpythonpython_implcpython.yaml b/.ci_support/linux_ppc64le_python3.11.____cpythonpython_implcpython.yaml index 73508db..48b3805 100644 --- a/.ci_support/linux_ppc64le_python3.11.____cpythonpython_implcpython.yaml +++ b/.ci_support/linux_ppc64le_python3.11.____cpythonpython_implcpython.yaml @@ -1,7 +1,7 @@ c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_name: - cos7 channel_sources: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_ppc64le_python3.8.____73_pypypython_implpypy.yaml b/.ci_support/linux_ppc64le_python3.8.____73_pypypython_implpypy.yaml index e16245a..e390e17 100644 --- a/.ci_support/linux_ppc64le_python3.8.____73_pypypython_implpypy.yaml +++ b/.ci_support/linux_ppc64le_python3.8.____73_pypypython_implpypy.yaml @@ -1,7 +1,7 @@ c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_name: - cos7 channel_sources: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_ppc64le_python3.8.____cpythonpython_implcpython.yaml b/.ci_support/linux_ppc64le_python3.8.____cpythonpython_implcpython.yaml index caaabfb..38b95aa 100644 --- a/.ci_support/linux_ppc64le_python3.8.____cpythonpython_implcpython.yaml +++ b/.ci_support/linux_ppc64le_python3.8.____cpythonpython_implcpython.yaml @@ -1,7 +1,7 @@ c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_name: - cos7 channel_sources: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_ppc64le_python3.9.____73_pypypython_implpypy.yaml b/.ci_support/linux_ppc64le_python3.9.____73_pypypython_implpypy.yaml index ee3579b..7431d2d 100644 --- a/.ci_support/linux_ppc64le_python3.9.____73_pypypython_implpypy.yaml +++ b/.ci_support/linux_ppc64le_python3.9.____73_pypypython_implpypy.yaml @@ -1,7 +1,7 @@ c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_name: - cos7 channel_sources: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/linux_ppc64le_python3.9.____cpythonpython_implcpython.yaml b/.ci_support/linux_ppc64le_python3.9.____cpythonpython_implcpython.yaml index 2e337d3..e6dcc9b 100644 --- a/.ci_support/linux_ppc64le_python3.9.____cpythonpython_implcpython.yaml +++ b/.ci_support/linux_ppc64le_python3.9.____cpythonpython_implcpython.yaml @@ -1,7 +1,7 @@ c_compiler: - gcc c_compiler_version: -- '11' +- '12' cdt_name: - cos7 channel_sources: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '11' +- '12' docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: diff --git a/.ci_support/osx_64_python3.10.____cpythonpython_implcpython.yaml b/.ci_support/osx_64_python3.10.____cpythonpython_implcpython.yaml index c2fcbfd..fd55828 100644 --- a/.ci_support/osx_64_python3.10.____cpythonpython_implcpython.yaml +++ b/.ci_support/osx_64_python3.10.____cpythonpython_implcpython.yaml @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET: c_compiler: - clang c_compiler_version: -- '14' +- '15' channel_sources: - conda-forge channel_targets: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '14' +- '15' macos_machine: - x86_64-apple-darwin13.4.0 pin_run_as_build: diff --git a/.ci_support/osx_64_python3.11.____cpythonpython_implcpython.yaml b/.ci_support/osx_64_python3.11.____cpythonpython_implcpython.yaml index e238b13..a2c40f9 100644 --- a/.ci_support/osx_64_python3.11.____cpythonpython_implcpython.yaml +++ b/.ci_support/osx_64_python3.11.____cpythonpython_implcpython.yaml @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET: c_compiler: - clang c_compiler_version: -- '14' +- '15' channel_sources: - conda-forge channel_targets: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '14' +- '15' macos_machine: - x86_64-apple-darwin13.4.0 pin_run_as_build: diff --git a/.ci_support/osx_64_python3.8.____73_pypypython_implpypy.yaml b/.ci_support/osx_64_python3.8.____73_pypypython_implpypy.yaml index cb635a6..6eb5071 100644 --- a/.ci_support/osx_64_python3.8.____73_pypypython_implpypy.yaml +++ b/.ci_support/osx_64_python3.8.____73_pypypython_implpypy.yaml @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET: c_compiler: - clang c_compiler_version: -- '14' +- '15' channel_sources: - conda-forge channel_targets: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '14' +- '15' macos_machine: - x86_64-apple-darwin13.4.0 pin_run_as_build: diff --git a/.ci_support/osx_64_python3.8.____cpythonpython_implcpython.yaml b/.ci_support/osx_64_python3.8.____cpythonpython_implcpython.yaml index 681a68a..fc767da 100644 --- a/.ci_support/osx_64_python3.8.____cpythonpython_implcpython.yaml +++ b/.ci_support/osx_64_python3.8.____cpythonpython_implcpython.yaml @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET: c_compiler: - clang c_compiler_version: -- '14' +- '15' channel_sources: - conda-forge channel_targets: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '14' +- '15' macos_machine: - x86_64-apple-darwin13.4.0 pin_run_as_build: diff --git a/.ci_support/osx_64_python3.9.____73_pypypython_implpypy.yaml b/.ci_support/osx_64_python3.9.____73_pypypython_implpypy.yaml index 9915151..7f7bdd7 100644 --- a/.ci_support/osx_64_python3.9.____73_pypypython_implpypy.yaml +++ b/.ci_support/osx_64_python3.9.____73_pypypython_implpypy.yaml @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET: c_compiler: - clang c_compiler_version: -- '14' +- '15' channel_sources: - conda-forge channel_targets: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '14' +- '15' macos_machine: - x86_64-apple-darwin13.4.0 pin_run_as_build: diff --git a/.ci_support/osx_64_python3.9.____cpythonpython_implcpython.yaml b/.ci_support/osx_64_python3.9.____cpythonpython_implcpython.yaml index 95bc57b..8c795eb 100644 --- a/.ci_support/osx_64_python3.9.____cpythonpython_implcpython.yaml +++ b/.ci_support/osx_64_python3.9.____cpythonpython_implcpython.yaml @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET: c_compiler: - clang c_compiler_version: -- '14' +- '15' channel_sources: - conda-forge channel_targets: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '14' +- '15' macos_machine: - x86_64-apple-darwin13.4.0 pin_run_as_build: diff --git a/.ci_support/osx_arm64_python3.10.____cpython.yaml b/.ci_support/osx_arm64_python3.10.____cpython.yaml index 6e07431..8644e41 100644 --- a/.ci_support/osx_arm64_python3.10.____cpython.yaml +++ b/.ci_support/osx_arm64_python3.10.____cpython.yaml @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET: c_compiler: - clang c_compiler_version: -- '14' +- '15' channel_sources: - conda-forge channel_targets: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '14' +- '15' macos_machine: - arm64-apple-darwin20.0.0 pin_run_as_build: diff --git a/.ci_support/osx_arm64_python3.11.____cpython.yaml b/.ci_support/osx_arm64_python3.11.____cpython.yaml index 7613b07..bc269e9 100644 --- a/.ci_support/osx_arm64_python3.11.____cpython.yaml +++ b/.ci_support/osx_arm64_python3.11.____cpython.yaml @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET: c_compiler: - clang c_compiler_version: -- '14' +- '15' channel_sources: - conda-forge channel_targets: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '14' +- '15' macos_machine: - arm64-apple-darwin20.0.0 pin_run_as_build: diff --git a/.ci_support/osx_arm64_python3.8.____cpython.yaml b/.ci_support/osx_arm64_python3.8.____cpython.yaml index 82343d8..46228d2 100644 --- a/.ci_support/osx_arm64_python3.8.____cpython.yaml +++ b/.ci_support/osx_arm64_python3.8.____cpython.yaml @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET: c_compiler: - clang c_compiler_version: -- '14' +- '15' channel_sources: - conda-forge channel_targets: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '14' +- '15' macos_machine: - arm64-apple-darwin20.0.0 pin_run_as_build: diff --git a/.ci_support/osx_arm64_python3.9.____cpython.yaml b/.ci_support/osx_arm64_python3.9.____cpython.yaml index 7814405..d29b9ce 100644 --- a/.ci_support/osx_arm64_python3.9.____cpython.yaml +++ b/.ci_support/osx_arm64_python3.9.____cpython.yaml @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET: c_compiler: - clang c_compiler_version: -- '14' +- '15' channel_sources: - conda-forge channel_targets: @@ -11,7 +11,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '14' +- '15' macos_machine: - arm64-apple-darwin20.0.0 pin_run_as_build: diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index 84431a6..a6b09f6 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -33,9 +33,9 @@ CONDARC mamba install --update-specs --yes --quiet --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" + conda-build pip boa conda-forge-ci-setup=3 mamba update --update-specs --yes --quiet --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" + conda-build pip boa conda-forge-ci-setup=3 # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index b3abaeb..bb00584 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -24,9 +24,9 @@ source ${MINIFORGE_HOME}/etc/profile.d/conda.sh conda activate base mamba install --update-specs --quiet --yes --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" + conda-build pip boa conda-forge-ci-setup=3 mamba update --update-specs --yes --quiet --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" + conda-build pip boa conda-forge-ci-setup=3 diff --git a/README.md b/README.md index 91da22a..8c2040b 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -About protobuf -============== +About protobuf-feedstock +======================== + +Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/protobuf-feedstock/blob/main/LICENSE.txt) Home: https://developers.google.com/protocol-buffers/ Package license: BSD-3-Clause -Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/protobuf-feedstock/blob/main/LICENSE.txt) - Summary: Protocol Buffers - Google's data interchange format. Development: https://github.com/protocolbuffers/protobuf From 1a8402c015f83c91d3b1adda59f38512a5c74cb2 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 14 May 2023 01:30:14 +1100 Subject: [PATCH 05/12] add dependence on libabseil --- recipe/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 4c071f4..e9569ef 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -34,6 +34,7 @@ requirements: host: - python - pip + - libabseil - libprotobuf {{ lib_major ~ "." ~ version }} # [unix] - libprotobuf-static {{ lib_major ~ "." ~ version }} # [win] run: From 1f5c8c92ef5f4ac182aa172c9f17fc928fec18b5 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 18 May 2023 17:27:32 +1100 Subject: [PATCH 06/12] use C++17, point to our abseil headers --- recipe/meta.yaml | 1 + ...-do-not-link-msvc-runtime-statically.patch | 4 +-- ...ix-paths-for-include-lib-directories.patch | 34 +++++++++++++------ ...t-to-name-of-protobuf-lib-on-windows.patch | 8 ++--- recipe/patches/0004-use-C-17-everywhere.patch | 24 +++++++++++++ 5 files changed, 54 insertions(+), 17 deletions(-) create mode 100644 recipe/patches/0004-use-C-17-everywhere.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index e9569ef..1b15d24 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -17,6 +17,7 @@ source: - patches/0001-do-not-link-msvc-runtime-statically.patch - patches/0002-fix-paths-for-include-lib-directories.patch - patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch + - patches/0004-use-C-17-everywhere.patch build: number: 0 diff --git a/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch b/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch index 06cd4cb..adf490a 100644 --- a/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch +++ b/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch @@ -1,7 +1,7 @@ -From fb3b6e0a27173920fe69ba76512f431062677158 Mon Sep 17 00:00:00 2001 +From cbe7b53095c6acf29abb65aee4b825f3235babf9 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 4 Sep 2022 18:14:41 +0200 -Subject: [PATCH 1/3] do not link msvc runtime statically +Subject: [PATCH 1/4] do not link msvc runtime statically --- python/setup.py | 4 ---- diff --git a/recipe/patches/0002-fix-paths-for-include-lib-directories.patch b/recipe/patches/0002-fix-paths-for-include-lib-directories.patch index cd6d299..9ba1eb6 100644 --- a/recipe/patches/0002-fix-paths-for-include-lib-directories.patch +++ b/recipe/patches/0002-fix-paths-for-include-lib-directories.patch @@ -1,37 +1,49 @@ -From ecd4d1dfe12ed1466ed1a94c0a560eca9127c960 Mon Sep 17 00:00:00 2001 +From db8c830280ee0cf0a853d24a2e634728e224813b Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 4 Sep 2022 18:42:34 +0200 -Subject: [PATCH 2/3] fix paths for include & lib directories +Subject: [PATCH 2/4] fix paths for include & lib directories --- - python/setup.py | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) + python/setup.py | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/python/setup.py b/python/setup.py -index b6de92d1d..193685733 100755 +index b6de92d1d..ccdfc5f78 100755 --- a/python/setup.py +++ b/python/setup.py -@@ -403,6 +403,14 @@ if __name__ == '__main__': +@@ -37,6 +37,7 @@ from distutils import util + import fnmatch + import glob + import os ++import pathlib + import pkg_resources + import re + import subprocess +@@ -403,16 +404,25 @@ if __name__ == '__main__': extra_compile_args.append('-Werror') sys.argv.remove(warnings_as_errors) + # correct lib dir for usage in conda builds; -+ # cannot point include dir because libprotobuf ++ # cannot point to include dir for libprotobuf because it + # does not contain some headers, e.g. in google/protobuf/pyext + if sys.platform == 'win32': -+ lib_dir = os.environ["LIBRARY_LIB"] ++ prefix = pathlib.Path(os.environ["LIBRARY_PREFIX"]) + else: -+ lib_dir = os.path.join(os.environ["PREFIX"], "lib") ++ prefix = pathlib.Path(os.environ["PREFIX"]) ++ lib_dir = prefix / "lib" + # C++ implementation extension ext_module_list.extend([ Extension( -@@ -412,7 +420,7 @@ if __name__ == '__main__': + 'google.protobuf.pyext._message', + glob.glob('google/protobuf/pyext/*.cc'), +- include_dirs=['.', '../src', '../third_party/abseil-cpp'], ++ include_dirs=['.', '../src', str(prefix / 'include/abseil-cpp')], libraries=libraries, extra_objects=extra_objects, extra_link_args=message_extra_link_args, - library_dirs=library_dirs, -+ library_dirs=[lib_dir], ++ library_dirs=[str(lib_dir)], extra_compile_args=extra_compile_args, ), Extension( diff --git a/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch b/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch index 6029530..8a7e123 100644 --- a/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch +++ b/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch @@ -1,17 +1,17 @@ -From e37e53770669b8e2d63d79fc89978de31168814b Mon Sep 17 00:00:00 2001 +From e893d9d92207989b1cc917564518545dd5615143 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 4 Sep 2022 19:42:16 +0200 -Subject: [PATCH 3/3] adapt to name of protobuf lib on windows +Subject: [PATCH 3/4] adapt to name of protobuf lib on windows --- python/setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/setup.py b/python/setup.py -index 193685733..88bd80a33 100755 +index ccdfc5f78..0063ac0e3 100755 --- a/python/setup.py +++ b/python/setup.py -@@ -336,7 +336,8 @@ if __name__ == '__main__': +@@ -337,7 +337,8 @@ if __name__ == '__main__': extra_objects += list( glob.iglob('../third_party/abseil-cpp/absl/**/*.a')) else: diff --git a/recipe/patches/0004-use-C-17-everywhere.patch b/recipe/patches/0004-use-C-17-everywhere.patch new file mode 100644 index 0000000..1fa8eb9 --- /dev/null +++ b/recipe/patches/0004-use-C-17-everywhere.patch @@ -0,0 +1,24 @@ +From f5c19b6bcb953106ffa3852f930f9906d9577490 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Thu, 18 May 2023 17:14:37 +1100 +Subject: [PATCH 4/4] use C++17 everywhere + +--- + python/setup.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/python/setup.py b/python/setup.py +index 0063ac0e3..91c4e9b36 100755 +--- a/python/setup.py ++++ b/python/setup.py +@@ -372,7 +372,9 @@ if __name__ == '__main__': + extra_compile_args.append('-Wno-invalid-offsetof') + extra_compile_args.append('-Wno-sign-compare') + extra_compile_args.append('-Wno-unused-variable') +- extra_compile_args.append('-std=c++14') ++ extra_compile_args.append('-std=c++17') ++ else: ++ extra_compile_args.append('/std:c++17') + + if sys.platform == 'darwin': + extra_compile_args.append('-Wno-shorten-64-to-32') From 805a945f673c75d23ca0278eb7dc3782e11ff4a0 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 18 May 2023 17:27:41 +1100 Subject: [PATCH 07/12] ensure we point to the right protoc --- recipe/meta.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 1b15d24..99848c7 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -23,6 +23,9 @@ build: number: 0 script: - cd python + - export PROTOC=$PREFIX/bin/protoc # [unix and (build_platform == target_platform)] + - export PROTOC=$BUILD_PREFIX/bin/protoc # [unix and (build_platform != target_platform)] + - set PROTOC=%LIBRARY_BIN%\protoc # [win] - {{ PYTHON }} -m pip install . -vv --install-option="--cpp_implementation" requirements: From 16284626ca5cc1929e90079e12fa428d44ca60f1 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 14 May 2023 01:19:19 +1100 Subject: [PATCH 08/12] add setuptools --- recipe/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 99848c7..8814306 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -38,6 +38,7 @@ requirements: host: - python - pip + - setuptools - libabseil - libprotobuf {{ lib_major ~ "." ~ version }} # [unix] - libprotobuf-static {{ lib_major ~ "." ~ version }} # [win] From 5db99a17f68a5f71eb905d5ae793a78e9110277f Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 14 May 2023 01:24:54 +1100 Subject: [PATCH 09/12] limit pip version for now --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 8814306..1f820eb 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -37,7 +37,7 @@ requirements: - {{ compiler('cxx') }} host: - python - - pip + - pip <23.1 - setuptools - libabseil - libprotobuf {{ lib_major ~ "." ~ version }} # [unix] From 4a5156c24b1158ed15d3cc729b989d2d9126ed3f Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 18 May 2023 18:09:14 +1100 Subject: [PATCH 10/12] use dynamic libprotobuf also on windows --- recipe/meta.yaml | 5 ++-- ...-do-not-link-msvc-runtime-statically.patch | 2 +- ...ix-paths-for-include-lib-directories.patch | 2 +- ...t-to-name-of-protobuf-lib-on-windows.patch | 2 +- recipe/patches/0004-use-C-17-everywhere.patch | 2 +- ...E_DLLS-clean-up-other-symbols-on-win.patch | 27 +++++++++++++++++++ 6 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 recipe/patches/0005-set-PROTOBUF_USE_DLLS-clean-up-other-symbols-on-win.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 1f820eb..800f1a3 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -18,6 +18,7 @@ source: - patches/0002-fix-paths-for-include-lib-directories.patch - patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch - patches/0004-use-C-17-everywhere.patch + - patches/0005-set-PROTOBUF_USE_DLLS-clean-up-other-symbols-on-win.patch build: number: 0 @@ -40,12 +41,10 @@ requirements: - pip <23.1 - setuptools - libabseil - - libprotobuf {{ lib_major ~ "." ~ version }} # [unix] - - libprotobuf-static {{ lib_major ~ "." ~ version }} # [win] + - libprotobuf {{ lib_major ~ "." ~ version }} run: - python - setuptools - - libprotobuf {{ lib_major ~ "." ~ version }} test: commands: diff --git a/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch b/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch index adf490a..44bb9cd 100644 --- a/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch +++ b/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch @@ -1,7 +1,7 @@ From cbe7b53095c6acf29abb65aee4b825f3235babf9 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 4 Sep 2022 18:14:41 +0200 -Subject: [PATCH 1/4] do not link msvc runtime statically +Subject: [PATCH 1/5] do not link msvc runtime statically --- python/setup.py | 4 ---- diff --git a/recipe/patches/0002-fix-paths-for-include-lib-directories.patch b/recipe/patches/0002-fix-paths-for-include-lib-directories.patch index 9ba1eb6..2224518 100644 --- a/recipe/patches/0002-fix-paths-for-include-lib-directories.patch +++ b/recipe/patches/0002-fix-paths-for-include-lib-directories.patch @@ -1,7 +1,7 @@ From db8c830280ee0cf0a853d24a2e634728e224813b Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 4 Sep 2022 18:42:34 +0200 -Subject: [PATCH 2/4] fix paths for include & lib directories +Subject: [PATCH 2/5] fix paths for include & lib directories --- python/setup.py | 14 ++++++++++++-- diff --git a/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch b/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch index 8a7e123..4678aa0 100644 --- a/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch +++ b/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch @@ -1,7 +1,7 @@ From e893d9d92207989b1cc917564518545dd5615143 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 4 Sep 2022 19:42:16 +0200 -Subject: [PATCH 3/4] adapt to name of protobuf lib on windows +Subject: [PATCH 3/5] adapt to name of protobuf lib on windows --- python/setup.py | 3 ++- diff --git a/recipe/patches/0004-use-C-17-everywhere.patch b/recipe/patches/0004-use-C-17-everywhere.patch index 1fa8eb9..94d6f70 100644 --- a/recipe/patches/0004-use-C-17-everywhere.patch +++ b/recipe/patches/0004-use-C-17-everywhere.patch @@ -1,7 +1,7 @@ From f5c19b6bcb953106ffa3852f930f9906d9577490 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 18 May 2023 17:14:37 +1100 -Subject: [PATCH 4/4] use C++17 everywhere +Subject: [PATCH 4/5] use C++17 everywhere --- python/setup.py | 4 +++- diff --git a/recipe/patches/0005-set-PROTOBUF_USE_DLLS-clean-up-other-symbols-on-win.patch b/recipe/patches/0005-set-PROTOBUF_USE_DLLS-clean-up-other-symbols-on-win.patch new file mode 100644 index 0000000..15fccd7 --- /dev/null +++ b/recipe/patches/0005-set-PROTOBUF_USE_DLLS-clean-up-other-symbols-on-win.patch @@ -0,0 +1,27 @@ +From 1d7c0d7885178f0cfd9caab881559cfbdd2013e0 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Thu, 18 May 2023 18:49:27 +1100 +Subject: [PATCH 5/5] set PROTOBUF_USE_DLLS; clean up other symbols on win + +--- + python/setup.py | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/python/setup.py b/python/setup.py +index 91c4e9b36..897191d7b 100755 +--- a/python/setup.py ++++ b/python/setup.py +@@ -394,11 +394,8 @@ if __name__ == '__main__': + + # https://github.com/Theano/Theano/issues/4926 + if sys.platform == 'win32': +- extra_compile_args.append('-D_hypot=hypot') +- +- # https://github.com/tpaviot/pythonocc-core/issues/48 +- if sys.platform == 'win32' and '64 bit' in sys.version: +- extra_compile_args.append('-DMS_WIN64') ++ extra_compile_args.append('/D_hypot=hypot') ++ extra_compile_args.append('/DPROTOBUF_USE_DLLS') + + if 'clang' in os.popen('$CC --version 2> /dev/null').read(): + extra_compile_args.append('-Wno-shorten-64-to-32') From b93afbd2cb3904afd4fbf7c2f33690649a318087 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 18 May 2023 19:22:06 +1100 Subject: [PATCH 11/12] also link to abseil on win --- recipe/meta.yaml | 1 + ...-do-not-link-msvc-runtime-statically.patch | 2 +- ...ix-paths-for-include-lib-directories.patch | 2 +- ...t-to-name-of-protobuf-lib-on-windows.patch | 2 +- recipe/patches/0004-use-C-17-everywhere.patch | 2 +- ...E_DLLS-clean-up-other-symbols-on-win.patch | 2 +- ...icitly-link-to-abseil_dll-on-windows.patch | 22 +++++++++++++++++++ 7 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 recipe/patches/0006-explicitly-link-to-abseil_dll-on-windows.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 800f1a3..f3b804b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -19,6 +19,7 @@ source: - patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch - patches/0004-use-C-17-everywhere.patch - patches/0005-set-PROTOBUF_USE_DLLS-clean-up-other-symbols-on-win.patch + - patches/0006-explicitly-link-to-abseil_dll-on-windows.patch build: number: 0 diff --git a/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch b/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch index 44bb9cd..fe00905 100644 --- a/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch +++ b/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch @@ -1,7 +1,7 @@ From cbe7b53095c6acf29abb65aee4b825f3235babf9 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 4 Sep 2022 18:14:41 +0200 -Subject: [PATCH 1/5] do not link msvc runtime statically +Subject: [PATCH 1/6] do not link msvc runtime statically --- python/setup.py | 4 ---- diff --git a/recipe/patches/0002-fix-paths-for-include-lib-directories.patch b/recipe/patches/0002-fix-paths-for-include-lib-directories.patch index 2224518..1e847e3 100644 --- a/recipe/patches/0002-fix-paths-for-include-lib-directories.patch +++ b/recipe/patches/0002-fix-paths-for-include-lib-directories.patch @@ -1,7 +1,7 @@ From db8c830280ee0cf0a853d24a2e634728e224813b Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 4 Sep 2022 18:42:34 +0200 -Subject: [PATCH 2/5] fix paths for include & lib directories +Subject: [PATCH 2/6] fix paths for include & lib directories --- python/setup.py | 14 ++++++++++++-- diff --git a/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch b/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch index 4678aa0..4e889f8 100644 --- a/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch +++ b/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch @@ -1,7 +1,7 @@ From e893d9d92207989b1cc917564518545dd5615143 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 4 Sep 2022 19:42:16 +0200 -Subject: [PATCH 3/5] adapt to name of protobuf lib on windows +Subject: [PATCH 3/6] adapt to name of protobuf lib on windows --- python/setup.py | 3 ++- diff --git a/recipe/patches/0004-use-C-17-everywhere.patch b/recipe/patches/0004-use-C-17-everywhere.patch index 94d6f70..7c98589 100644 --- a/recipe/patches/0004-use-C-17-everywhere.patch +++ b/recipe/patches/0004-use-C-17-everywhere.patch @@ -1,7 +1,7 @@ From f5c19b6bcb953106ffa3852f930f9906d9577490 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 18 May 2023 17:14:37 +1100 -Subject: [PATCH 4/5] use C++17 everywhere +Subject: [PATCH 4/6] use C++17 everywhere --- python/setup.py | 4 +++- diff --git a/recipe/patches/0005-set-PROTOBUF_USE_DLLS-clean-up-other-symbols-on-win.patch b/recipe/patches/0005-set-PROTOBUF_USE_DLLS-clean-up-other-symbols-on-win.patch index 15fccd7..f7b9235 100644 --- a/recipe/patches/0005-set-PROTOBUF_USE_DLLS-clean-up-other-symbols-on-win.patch +++ b/recipe/patches/0005-set-PROTOBUF_USE_DLLS-clean-up-other-symbols-on-win.patch @@ -1,7 +1,7 @@ From 1d7c0d7885178f0cfd9caab881559cfbdd2013e0 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 18 May 2023 18:49:27 +1100 -Subject: [PATCH 5/5] set PROTOBUF_USE_DLLS; clean up other symbols on win +Subject: [PATCH 5/6] set PROTOBUF_USE_DLLS; clean up other symbols on win --- python/setup.py | 7 ++----- diff --git a/recipe/patches/0006-explicitly-link-to-abseil_dll-on-windows.patch b/recipe/patches/0006-explicitly-link-to-abseil_dll-on-windows.patch new file mode 100644 index 0000000..f57d560 --- /dev/null +++ b/recipe/patches/0006-explicitly-link-to-abseil_dll-on-windows.patch @@ -0,0 +1,22 @@ +From 6261ee512478a6ba826243b368dd7d35527f5b14 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Thu, 18 May 2023 19:20:35 +1100 +Subject: [PATCH 6/6] explicitly link to abseil_dll on windows + +--- + python/setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/python/setup.py b/python/setup.py +index 897191d7b..bdd67a457 100755 +--- a/python/setup.py ++++ b/python/setup.py +@@ -338,7 +338,7 @@ if __name__ == '__main__': + glob.iglob('../third_party/abseil-cpp/absl/**/*.a')) + else: + # our windows builds don't follow standard windows naming (i.e. have a lib prefix) +- libraries = ['protobuf'] if sys.platform != 'win32' else ['libprotobuf'] ++ libraries = ['protobuf'] if sys.platform != 'win32' else ['libprotobuf', 'abseil_dll'] + if HasLibraryDirsOpt(): + library_dirs = None + elif os.path.exists('../bazel-bin/src/google/protobuf/libprotobuf.a'): From 900e22993b12aea1848082311936cd90ec6e628e Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 18 May 2023 19:47:44 +1100 Subject: [PATCH 12/12] backport patch to fix PyPy --- recipe/meta.yaml | 2 + ...-do-not-link-msvc-runtime-statically.patch | 2 +- ...ix-paths-for-include-lib-directories.patch | 2 +- ...t-to-name-of-protobuf-lib-on-windows.patch | 2 +- recipe/patches/0004-use-C-17-everywhere.patch | 2 +- ...E_DLLS-clean-up-other-symbols-on-win.patch | 2 +- ...icitly-link-to-abseil_dll-on-windows.patch | 2 +- ...port-broken-when-adding-3.11-support.patch | 48 +++++++++++++++++++ 8 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 recipe/patches/0007-restore-pypy-support-broken-when-adding-3.11-support.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index f3b804b..89d5a58 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -20,6 +20,8 @@ source: - patches/0004-use-C-17-everywhere.patch - patches/0005-set-PROTOBUF_USE_DLLS-clean-up-other-symbols-on-win.patch - patches/0006-explicitly-link-to-abseil_dll-on-windows.patch + # backport 69a4876d69eeee37aab121f6f4908bec7b35b271 to fix PyPy support + - patches/0007-restore-pypy-support-broken-when-adding-3.11-support.patch build: number: 0 diff --git a/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch b/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch index fe00905..5c2c92e 100644 --- a/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch +++ b/recipe/patches/0001-do-not-link-msvc-runtime-statically.patch @@ -1,7 +1,7 @@ From cbe7b53095c6acf29abb65aee4b825f3235babf9 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 4 Sep 2022 18:14:41 +0200 -Subject: [PATCH 1/6] do not link msvc runtime statically +Subject: [PATCH 1/7] do not link msvc runtime statically --- python/setup.py | 4 ---- diff --git a/recipe/patches/0002-fix-paths-for-include-lib-directories.patch b/recipe/patches/0002-fix-paths-for-include-lib-directories.patch index 1e847e3..8d715a8 100644 --- a/recipe/patches/0002-fix-paths-for-include-lib-directories.patch +++ b/recipe/patches/0002-fix-paths-for-include-lib-directories.patch @@ -1,7 +1,7 @@ From db8c830280ee0cf0a853d24a2e634728e224813b Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 4 Sep 2022 18:42:34 +0200 -Subject: [PATCH 2/6] fix paths for include & lib directories +Subject: [PATCH 2/7] fix paths for include & lib directories --- python/setup.py | 14 ++++++++++++-- diff --git a/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch b/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch index 4e889f8..f2c8fb0 100644 --- a/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch +++ b/recipe/patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch @@ -1,7 +1,7 @@ From e893d9d92207989b1cc917564518545dd5615143 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 4 Sep 2022 19:42:16 +0200 -Subject: [PATCH 3/6] adapt to name of protobuf lib on windows +Subject: [PATCH 3/7] adapt to name of protobuf lib on windows --- python/setup.py | 3 ++- diff --git a/recipe/patches/0004-use-C-17-everywhere.patch b/recipe/patches/0004-use-C-17-everywhere.patch index 7c98589..5a84de4 100644 --- a/recipe/patches/0004-use-C-17-everywhere.patch +++ b/recipe/patches/0004-use-C-17-everywhere.patch @@ -1,7 +1,7 @@ From f5c19b6bcb953106ffa3852f930f9906d9577490 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 18 May 2023 17:14:37 +1100 -Subject: [PATCH 4/6] use C++17 everywhere +Subject: [PATCH 4/7] use C++17 everywhere --- python/setup.py | 4 +++- diff --git a/recipe/patches/0005-set-PROTOBUF_USE_DLLS-clean-up-other-symbols-on-win.patch b/recipe/patches/0005-set-PROTOBUF_USE_DLLS-clean-up-other-symbols-on-win.patch index f7b9235..a26a348 100644 --- a/recipe/patches/0005-set-PROTOBUF_USE_DLLS-clean-up-other-symbols-on-win.patch +++ b/recipe/patches/0005-set-PROTOBUF_USE_DLLS-clean-up-other-symbols-on-win.patch @@ -1,7 +1,7 @@ From 1d7c0d7885178f0cfd9caab881559cfbdd2013e0 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 18 May 2023 18:49:27 +1100 -Subject: [PATCH 5/6] set PROTOBUF_USE_DLLS; clean up other symbols on win +Subject: [PATCH 5/7] set PROTOBUF_USE_DLLS; clean up other symbols on win --- python/setup.py | 7 ++----- diff --git a/recipe/patches/0006-explicitly-link-to-abseil_dll-on-windows.patch b/recipe/patches/0006-explicitly-link-to-abseil_dll-on-windows.patch index f57d560..9ab9a1f 100644 --- a/recipe/patches/0006-explicitly-link-to-abseil_dll-on-windows.patch +++ b/recipe/patches/0006-explicitly-link-to-abseil_dll-on-windows.patch @@ -1,7 +1,7 @@ From 6261ee512478a6ba826243b368dd7d35527f5b14 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 18 May 2023 19:20:35 +1100 -Subject: [PATCH 6/6] explicitly link to abseil_dll on windows +Subject: [PATCH 6/7] explicitly link to abseil_dll on windows --- python/setup.py | 2 +- diff --git a/recipe/patches/0007-restore-pypy-support-broken-when-adding-3.11-support.patch b/recipe/patches/0007-restore-pypy-support-broken-when-adding-3.11-support.patch new file mode 100644 index 0000000..457cea7 --- /dev/null +++ b/recipe/patches/0007-restore-pypy-support-broken-when-adding-3.11-support.patch @@ -0,0 +1,48 @@ +From d448c644c0bd8986819fb8e7b86bd5a223e0aae2 Mon Sep 17 00:00:00 2001 +From: Eric Salo +Date: Thu, 13 Apr 2023 10:38:15 -0700 +Subject: [PATCH 7/7] restore pypy support broken when adding 3.11 support + (from GH) + +This is a copy of https://github.com/protocolbuffers/protobuf/pull/12431 +but with the ifdef logic reversed. The original PR could not kick off our +CI tests because it wasn't branched directly from repo main. + +Thanks to Tom Gillespie for the original PR. + +PiperOrigin-RevId: 524041105 +--- + python/google/protobuf/pyext/descriptor.cc | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/python/google/protobuf/pyext/descriptor.cc b/python/google/protobuf/pyext/descriptor.cc +index de9a24807..d09c218b6 100644 +--- a/python/google/protobuf/pyext/descriptor.cc ++++ b/python/google/protobuf/pyext/descriptor.cc +@@ -125,7 +125,9 @@ PyObject* PyString_FromCppString(const std::string& str) { + // TODO(amauryfa): Change the proto2 compiler to remove the assignments, and + // remove this hack. + bool _CalledFromGeneratedFile(int stacklevel) { +-#ifndef PYPY_VERSION ++#ifdef PYPY_VERSION ++ return true; ++#else + // This check is not critical and is somewhat difficult to implement correctly + // in PyPy. + PyFrameObject* frame = PyEval_GetFrame(); +@@ -181,7 +183,6 @@ bool _CalledFromGeneratedFile(int stacklevel) { + // Not at global module scope + goto exit; + } +-#endif + result = true; + exit: + Py_XDECREF(frame_globals); +@@ -189,6 +190,7 @@ exit: + Py_XDECREF(frame_code); + Py_XDECREF(frame); + return result; ++#endif + } + + // If the calling code is not a _pb2.py file, raise AttributeError.