0

I'm using the catkin plugin for snapcraft. I'm using it in a ros workspace of multiple packages as required. This workspace builds with catkin tools.

However when using snapcraft, the build fails to find a header file that is supposed to be shared between local packages using the catkin_package() declaration in CMakeLists.txt

are there any known reasons why this would fail. As this has occurred for a number of header files referenced between packages using catkin

rocklegend
  • 81
  • 11
  • Note that the Catkin plugin uses Catkin, not Catkin Tools (although a Catkin Tools plugin was just completed and will be in a forthcoming release). Can you verify that this workspace builds with Catkin? – kyrofa Oct 27 '17 at 05:06
  • I must not understand the difference between catkin and catkin tools. I use '$ catkin build' to build the workspace. is this not catkin? – rocklegend Oct 27 '17 at 05:43
  • I've added the unfound header to install and now other packages can find it. It seems that the snapcraft catkin package doesn't build a devel space the same way that other catkin invocations do? – rocklegend Oct 27 '17 at 05:55
  • No, [catkin tools](https://catkin-tools.readthedocs.io/en/latest/) is a beta tool meant to improve upon Catkin, which is the normal ROS1 build system. Doesn't sound like that was your problem though-- I've tried to explain more in my answer. – kyrofa Oct 27 '17 at 14:12

1 Answers1

0

This is mentioned in both the ROS docs on snapcraft.io as well as the snap tutorial on wiki.ros.org, although I've proposed the following clarification to the former:

Most ROS developers run out of the devel space. As a result, it's easy to forget the importance of good install rules, i.e. rules for installing every component of the package necessary to run, or every component necessary to use a given library. The Catkin packages you're building must have good install rules, or Snapcraft won't know which components to place into the snap. Make sure you install binaries, libraries, header files, launch files, etc.

The same goes for any packaging method. You must have good install rules.

kyrofa
  • 1,759
  • 1
  • 14
  • 19
  • we use the installed packages to run our machine, so everything required for runtime is there. However build dependencies typically use the devel space in the instances I mentioned. The by-product of not using the devel space to build the packages is that they wont build, and the snapcraft build will be a painful process, despite what is in install is all that is needed for runtime use. – rocklegend Oct 27 '17 at 22:49
  • Sorry, in general catkin packages have build and runtime dependencies. sometimes, these dependencies are being built at the same time. In normal usage if a package depends upon a header in another package for build. Then may not depend on it during runtime and may just link to a shared library. These dependencies are handled in the devel workspace during build. However, now I want to deploy my stack to customers via snap, and I have to include with the runtime, artefacts (these headers that build dependencies) that are only required during the build. There is a significant cost to this. – rocklegend Oct 28 '17 at 02:02
  • I disagree that this is how ros works. I copy my install directory onto my robot and it works. So there is nothing wrong with my install specification. I dont see why catkin plugin cant build like a normal catkin workspace. would adding the --merge to catkin_make_isolated solve this? – rocklegend Oct 28 '17 at 02:22
  • I'm afraid we can't chat in the comments, we should move to IRC if you want to continue. – kyrofa Oct 28 '17 at 02:24