Is there a way to build a private .deb release for ROS 2 project? Like calling $ colcon build but instead of generates a build directories, it generates a .deb package.
I’ve already search and found about bloom, buildfarm, jenkins etc. but i still have no idea on how to use those tools or whether those are the right tools to be used.
Thanks all for the answer, i’m already be able to build the Debian package using the ROS answers that provided by @flynneva. I haven’t tried using CPack for ROS 2 project though, but as in this thread, i think it’s not recommended to used it in ROS 2 project.
Anyway in case you are wondering how to create a Debian package for ROS 2 project, i did it as follows:
That’s a nice guide, haven’t seen one too in the ROS documentation. Actually i’m already planned to write it later, but i have been busy doing something else and don’t have time to write that yet.
Love where this is headed, and great work on the documentation.
We build debians for our ROS packages for installation on field units (using a private apt server), and I’ve done it 3 ways:
using the bloom-generate rosdebian tool
manually creating the debian folder and appropriate files (using tools debuild and others)
using cpack
Each has pros/cons. cpack is pretty easy but not straightforward. Here’s an example of a library from a vendor we simply forked and added the cpack installation to create a debian.
Using the bloom as a template and then modifying is super useful, as it adds all the ROS niceities, but we ended up wanting to use more of the power of debian (installing other files, postinst setup, configuration, having an actual changelog, etc.) so we opted for setting up and checking in our own debian folder.
The downside is that you’ve got duplication of the dependencies in package.xml and debian/control. Here’s an example of a fork of the realsense-ros lib that has a debian control file for ros1 melodic package creation:
Our circleci uses this to build a debian and install it on our package server(s).
I would love to assist further in helping with the debian-ization in ROS. I’m torn between just using stock debian setup, and the bloom tooling. If I was a good true OSS zealot, I’d insist we just use stock debian tools, if I was a true ROS developer, I’d insist we keep improving bloom. I’m somewhere in between.
From a jazzy-desktop Docker container I built ROS 2 from source with the intention of generating the rclcpp Debian package.
I followed the steps from @threeal
It appears rclcpp is rebuilt again and this time I hit the following error
– Found rosidl_adapter: 4.6.4 (/opt/ros/jazzy/share/rosidl_adapter/cmake)
CMake Error at test/CMakeLists.txt:3 (find_package):
By not providing “Findtest_msgs.cmake” in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
“test_msgs”, but CMake did not find one.
Could not find a package configuration file provided by “test_msgs” with
any of the following names:
test_msgsConfig.cmake
test_msgs-config.cmake
Add the installation prefix of “test_msgs” to CMAKE_PREFIX_PATH or set
“test_msgs_DIR” to a directory containing one of the above files. If
“test_msgs” provides a separate development package or SDK, be sure it has
been installed.
Then I started to go down a dependency rabbit hole.
Is there an update to this recipe?
We’re also doing a similar thing, and running into the same issue with duplication of dependencies. In our case we use a .yaml file as a template for the debian, which includes a build_depends and run_depends section.
It’d be nice to automate this, although I’ve found it difficult to do via parsing the packages.xml. Specifically, determining which are ros and which are non-ros, as the former are usually of the form ros-<version>-<package> and the latter of the form lib<package>-dev.
Being able to tag each dependency with a type (e.g. “ros”, “non-ros”) would be really helpful in this regard, though I’m unsure how useful it’d be for other tools which use the package.xml
colcon-ros-buildfarm - WIP: Extensions for colcon to utilize ros_buildfarm to build system packages in containers. It was presented at ROSCon 2024 (video).
colcon-in-container - Colcon extension to build a colcon workspace in a container (see the release command). It was presented at ROSCon 2023 (video).