From 592370d1e9a35b932110222e2737a43384ea32f7 Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Tue, 28 Nov 2023 09:29:49 +0100 Subject: [PATCH] Patch to pybind11 to avoid issue with concat --- resources/include_pybind11.cmake | 1 + resources/pybind11_2.10.0.patch | 22 ++++++++++++++++++++++ resources/pybind11_2.11.1.patch | 22 ++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 resources/pybind11_2.10.0.patch create mode 100644 resources/pybind11_2.11.1.patch diff --git a/resources/include_pybind11.cmake b/resources/include_pybind11.cmake index e080d6e3f..bdbd839f6 100644 --- a/resources/include_pybind11.cmake +++ b/resources/include_pybind11.cmake @@ -9,6 +9,7 @@ else() pybind11 GIT_REPOSITORY https://github.com/pybind/pybind11 GIT_TAG "v${PYBIND_VERSION}" + PATCH_COMMAND git apply ${CMAKE_CURRENT_SOURCE_DIR}/resources/pybind11_${PYBIND_VERSION}.patch || git apply ${CMAKE_CURRENT_SOURCE_DIR}/resources/pybind11_${PYBIND_VERSION}.patch --reverse --check ) FetchContent_MakeAvailable(pybind11) diff --git a/resources/pybind11_2.10.0.patch b/resources/pybind11_2.10.0.patch new file mode 100644 index 000000000..547aad6f8 --- /dev/null +++ b/resources/pybind11_2.10.0.patch @@ -0,0 +1,22 @@ +diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h +index a0e32281..f132d096 100644 +--- a/include/pybind11/cast.h ++++ b/include/pybind11/cast.h +@@ -657,7 +657,7 @@ public: + } + + static constexpr auto name +- = const_name("Tuple[") + concat(make_caster::name...) + const_name("]"); ++ = const_name("Tuple[") + pybind11::detail::concat(make_caster::name...) + const_name("]"); + + template + using cast_op_type = type; +@@ -1399,7 +1399,7 @@ public: + static_assert(args_pos == -1 || args_pos == constexpr_first(), + "py::args cannot be specified more than once"); + +- static constexpr auto arg_names = concat(type_descr(make_caster::name)...); ++ static constexpr auto arg_names = pybind11::detail::concat(type_descr(make_caster::name)...); + + bool load_args(function_call &call) { return load_impl_sequence(call, indices{}); } + diff --git a/resources/pybind11_2.11.1.patch b/resources/pybind11_2.11.1.patch new file mode 100644 index 000000000..a7f01313e --- /dev/null +++ b/resources/pybind11_2.11.1.patch @@ -0,0 +1,22 @@ +diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h +index db393411..117680a1 100644 +--- a/include/pybind11/cast.h ++++ b/include/pybind11/cast.h +@@ -661,7 +661,7 @@ public: + } + + static constexpr auto name +- = const_name("Tuple[") + concat(make_caster::name...) + const_name("]"); ++ = const_name("Tuple[") + pybind11::detail::concat(make_caster::name...) + const_name("]"); + + template + using cast_op_type = type; +@@ -1438,7 +1438,7 @@ public: + static_assert(args_pos == -1 || args_pos == constexpr_first(), + "py::args cannot be specified more than once"); + +- static constexpr auto arg_names = concat(type_descr(make_caster::name)...); ++ static constexpr auto arg_names = pybind11::detail::concat(type_descr(make_caster::name)...); + + bool load_args(function_call &call) { return load_impl_sequence(call, indices{}); } +