Open jdiez17 opened 3 weeks ago
I found that adding inherit python3targetconfig
(as mentioned in openembedded/meta-openembedded#718) to rmw-dds-common
fixes the compilation step for that package, but as expected many other packages failed in the same way.
In the end I replaced python3native
for python3targetconfig
in ros_ament_cmake.bbclass:
diff --git a/meta-ros2/classes/ros_ament_cmake.bbclass b/meta-ros2/classes/ros_ament_cmake.bbclass
index d1705a8b4..a559fab5e 100644
--- a/meta-ros2/classes/ros_ament_cmake.bbclass
+++ b/meta-ros2/classes/ros_ament_cmake.bbclass
@@ -23,7 +23,7 @@ EXTRA_OECMAKE:append:class-target = " -DPYTHON_SOABI=${PYTHON_SOABI}"
#
export AMENT_PREFIX_PATH="${STAGING_DIR_HOST}${prefix}:${STAGING_DIR_NATIVE}${prefix}:${STAGING_DIR_HOST}${ros_prefix}:${STAGING_DIR_NATIVE}${ros_prefix}"
-inherit cmake python3native
+inherit cmake python3targetconfig
FILES:${PN}:prepend = " \
${datadir}/ament_index \
This let me successfully build ros-core
for the rpi0-wifi. I haven't built it into an image and tried it on the target yet.
However, this leads to the question "how did building for 32-bit targets on 64-bit hosts ever work?"
Looking at the history of ros_ament_cmake.bbclass
, this python3native
inherited class was there from the beginning, i.e. it didn't change recently.
I know at least one colleague that has built ROS2 using meta-ros for an ATSAMA5D27 (32-bit).
So the mystery remains. I'm not sure if the proposed patch is appropriate or a hack.
I think the change helps. In scarthgap, python3targetconfig.bbclass inherit python3native and add some configurations for target.
Describe the bug
rmw-dds-common
(and possibly other packages) fail to compile when building for a 32 bit target on a 64 bit machine.To Reproduce
Error message:
This appears to happen because the code generated by rosidl includes, which is installed in the sysroot as python-native is a dependency of some of the build tools (see recipe and bbappend).
Instead of using the python.h configured for the target, we end up using the host's config. I tried adding
python3
toROS_BUILD_DEPENDS
with the same result. I suspect this issue may affect many other packages.