ros2 / rclpy

rclpy (ROS Client Library for Python)
Apache License 2.0
268 stars 221 forks source link

debian12 humble source build: invalid use of incomplete type ‘PyFrameObject’ #1210

Open christophfroehlich opened 5 months ago

christophfroehlich commented 5 months ago

Bug report

I know that debian12 is not officially supported for humble, but maybe there is an easy fix?

Required Info:

Steps to reproduce issue

Source build on debian 12 via ros2.repos.

Expected behavior

it compiles

Actual behavior

#19 1329.4 Starting >>> rclpy
#19 1337.7 --- stderr: rclpy
#19 1337.7 In file included from /opt/ros2_ws/install/pybind11_vendor/include/pybind11_vendor/pybind11/cast.h:16,
#19 1337.7                  from /opt/ros2_ws/install/pybind11_vendor/include/pybind11_vendor/pybind11/attr.h:13,
#19 1337.7                  from /opt/ros2_ws/install/pybind11_vendor/include/pybind11_vendor/pybind11/pybind11.h:13,
#19 1337.7                  from /opt/ros2_ws/src/ros2/rclpy/rclpy/src/rclpy/_rclpy_logging.cpp:15:
#19 1337.7 /opt/ros2_ws/install/pybind11_vendor/include/pybind11_vendor/pybind11/detail/type_caster_base.h: In function ‘std::string pybind11::detail::error_string()’:
#19 1337.7 /opt/ros2_ws/install/pybind11_vendor/include/pybind11_vendor/pybind11/detail/type_caster_base.h:482:26: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
#19 1337.7   482 |             frame = frame->f_back;
#19 1337.7       |                          ^~
#19 1337.7 In file included from /usr/include/python3.11/Python.h:42,
#19 1337.7                  from /opt/ros2_ws/install/pybind11_vendor/include/pybind11_vendor/pybind11/detail/common.h:215,
#19 1337.7                  from /opt/ros2_ws/install/pybind11_vendor/include/pybind11_vendor/pybind11/pytypes.h:12,
#19 1337.7                  from /opt/ros2_ws/install/pybind11_vendor/include/pybind11_vendor/pybind11/cast.h:13:
#19 1337.7 /usr/include/python3.11/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
#19 1337.7    22 | typedef struct _frame PyFrameObject;
#19 1337.7       |                ^~~~~~
#19 1337.7 gmake[2]: *** [CMakeFiles/_rclpy_pybind11.dir/build.make:76: CMakeFiles/_rclpy_pybind11.dir/src/rclpy/_rclpy_logging.cpp.o] Error 1
#19 1337.7 gmake[1]: *** [CMakeFiles/Makefile2:192: CMakeFiles/_rclpy_pybind11.dir/all] Error 2
#19 1337.7 gmake: *** [Makefile:146: all] Error 2
#19 1337.7 ---
#19 1337.7 Failed   <<< rclpy [8.26s, exited with code 2]