ros / meta-ros

OpenEmbedded Layers for ROS 1 and ROS 2
MIT License
373 stars 246 forks source link

catkin not found in mickledore #1041

Closed johannesschrimpf closed 1 year ago

johannesschrimpf commented 1 year ago

Not strictly relevant (yet) as mickledore is not supported yet in meta-ros, but I hope the insights here will help other people who try to compile the newest versions.

When compiling ros packages in mickledore, the do_configure step fails as follows:

| -- The C compiler identification is GNU 12.2.0
| -- The CXX compiler identification is GNU 12.2.0
| -- Detecting C compiler ABI info
| -- Detecting C compiler ABI info - done
| -- Check for working C compiler: /data/yocto-mickledore/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/ros-environment/1.3.2-1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc - skipped
| -- Detecting C compile features
| -- Detecting C compile features - done
| -- Detecting CXX compiler ABI info
| -- Detecting CXX compiler ABI info - done
| -- Check for working CXX compiler: /data/yocto-mickledore/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/ros-environment/1.3.2-1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ - skipped
| -- Detecting CXX compile features
| -- Detecting CXX compile features - done
| -- Using CATKIN_DEVEL_PREFIX: /data/yocto-mickledore/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/ros-environment/1.3.2-1-r0/devel
| -- Using CMAKE_PREFIX_PATH: /data/yocto-mickledore/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/ros-environment/1.3.2-1-r0/recipe-sysroot/opt/ros/noetic;/data/yocto-mickledore/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/ros-environment/1.3.2-1-r0/recipe-sysroot/usr
| -- Found PythonInterp: /data/yocto-mickledore/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/ros-environment/1.3.2-1-r0/recipe-sysroot-native/usr/bin/python3-native/python3 (found suitable version "3.11.2", minimum required is "3")
| -- Using PYTHON_EXECUTABLE: /data/yocto-mickledore/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/ros-environment/1.3.2-1-r0/recipe-sysroot-native/usr/bin/python3-native/python3
| -- Using default Python package layout
| -- Found PY_em: /data/yocto-mickledore/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/ros-environment/1.3.2-1-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/em.py
| -- Using empy: /data/yocto-mickledore/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/ros-environment/1.3.2-1-r0/recipe-sysroot-native/usr/lib/python3.11/site-packages/em.py
| -- Using CATKIN_ENABLE_TESTING: 0
| -- catkin 0.8.10
| -- BUILD_SHARED_LIBS is on
| Traceback (most recent call last):
|   File "/data/yocto-mickledore/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/ros-environment/1.3.2-1-r0/build/catkin_generated/generate_cached_setup.py", line 16, in <module>
|     from catkin.environment_cache import generate_environment_script
| ModuleNotFoundError: No module named 'catkin'

This is due to a change in openembedded/poky in those commits: https://github.com/openembedded/openembedded-core/commit/c9617c03bceee54dc540318cada392799b137bd5 https://github.com/yoctoproject/poky/commit/af4284d39d8922ef1fcd884fe099aff52c7999f2

I created a bug report in the yocto bugzilla to track this bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=15108

Depending on whether this will be fixed in those layers, and if so, how fast, we might need to think about a workaround in meta-ros.

My fix in poky:

diff --git a/meta/classes-recipe/python3targetconfig.bbclass b/meta/classes-recipe/python3targetconfig.bbclass
index 22305fe176..08bc619398 100644
--- a/meta/classes-recipe/python3targetconfig.bbclass
+++ b/meta/classes-recipe/python3targetconfig.bbclass
@@ -12,7 +12,7 @@ DEPENDS:append = " ${EXTRA_PYTHON_DEPENDS}"

 setup_target_config() {
         export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata"
-        export PYTHONPATH=${STAGING_LIBDIR}/python-sysconfigdata
+        export PYTHONPATH=${STAGING_LIBDIR}/python-sysconfigdata:$PYTHONPATH
         export PATH=${STAGING_EXECPREFIXDIR}/python-target-config/:$PATH
 }
johannesschrimpf commented 1 year ago

This is now fixed in the poky and openembedded-core mickledore branch.