snapcraft plugin cannot find header files of catkin packages

asked 2017-10-27 01:08:54 -0500

I'm using catkin build to build a workspace which it does successfully

I've followed the tutorial on making ros snap packages and found some discrepancies when working with the snapcraft catkin plugin.

  1. the catkin_packages list doesn't just build the packages in the list. All packages are built.
  2. where a package shares headers and libraries using the catkin_package'macro, the headers are not found during the build by other packages that have dependencies on those files.

I found that these header files could be accessed if they were specified for installation, making me think that the snapcraft catkin plugin doesn't implement a devel space (note I only have a relatively vague knowledge of the details of the configuration of the catkin tool.)

So is there something I should be doing to get my building workspace to build successfully using snapcraft.

edit retag flag offensive close merge delete

Comments

I don't know how snapcraft works exactly, but if it's anything like how regular Debian pkgs are built, then yes, all artefacts that you want to have appear in your snap would have to be install()ed.

It's good practice to always have install() targets in your CMakeLists.txt anyway.

gvdhoorn gravatar image gvdhoorn  ( 2017-10-27 02:03:52 -0500 )edit

So that is the case. Our workspace installs are correct for proper runtime use. But it seems that snapcraft requires artefacts required for the build to be installed as well.

PeterMilani gravatar image PeterMilani  ( 2017-10-27 17:51:38 -0500 )edit

Our workspace installs are correct for proper runtime use. But it seems that snapcraft requires artefacts required for the build to be installed as well.

There is no distinction between these two ('runtime' vs 'install'). catkin just does some tricks to make things work when you ..

gvdhoorn gravatar image gvdhoorn  ( 2017-10-28 07:10:18 -0500 )edit

.. don't have install() statements, but it's really that, tricks.

Installing your files is the only proper way.

gvdhoorn gravatar image gvdhoorn  ( 2017-10-28 07:10:48 -0500 )edit

Indeed, you've got to have proper install rules for snapcraft to work. The tutorial says this as well, and walks you through adding them for the talker/listener tutorial.

kyrofa gravatar image kyrofa  ( 2020-04-09 12:26:37 -0500 )edit