Compile ROS2 foxy binaries for other linux distro
I am currently working on a robot project where we are using Debian Buster for an industrial application. Debian is simply more reliable and future-proof than Ubuntu, that is the simple reason we are using Debian.
Since ROS2 Foxy is mainly supported on Ubuntu, I am having a hard time compiling binaries (.deb) for Debian. Building binaries for Ubuntu works fine with bloom-generate
and dpkg-buildpackage
, but this is not possible for the Debian distro because no Debian apt repositority for ROS2 Foxy exists.
Therefore I want to compile ROS2 Foxy myself for Debian Buster, but I am struggling really hard with it. Everything is dependend on each other, some things won't build, some things don't really work when installed, the ros/opt/foxy/setup.sh is not installed by any binary. In short, horrible experience trying it, but still trying. I don't know how I should tackle this.
I made a script my self which finds every folder with package.xml
and than goes to that folder and executes bloom-generate
and dpkg-buildpackage
and than installing the package after. This works well, but after a while of repeatedly doing this, you start to bump into python packages not being sourced, because the lack of setup.sh
. (I think)
I'm wondering if some kind of build script exist, which I can use for building ROS2 Foxy for Debian Buster, which also makes the ros-foxy-desktop
or ros-foxy-ros-base
package.
Out of the problems you've faced, are you also getting
rosdep
unresolved dependency errors? For that specific issue, you can probably create arosdep
config file listing the dependencies (even custom packages) for the packages you're building.https://gist.github.com/awesomebytes/...
@aprotyas I have passed that station a while ago... :)
Oops - best of luck regardless!
Perhaps you could take a look at meta-ros. Doing this yourself without the help of some system which takes care of build-ordering and dependency checking for you seems like it shouldn't be necessary.
Note: this is not "some kind of build script" which builds
.deb
s for you. It's a different approach. But in an industrial context, building a complete rootfs may actually be a more viable approach.@gvdhoorn, correct me if I'm wrong, but I think this repository is more focused on cross-compiling on Yocto (mostly arm64/aarch64), rather than focusing on compiling for another Linux distro. Also, I do actually need the ROS2 Foxy for Buster
.deb
s for compiling my own ROS2 packages for Debian Buster, otherwisedpkg-buildpackage
can't find the dependencies.Yocto can certainly be used to build images for non-
amd64
architectures, but it's also used for regular Intel/AMD/other-x86 platforms. There's nothing in there specific for cross-compilation.As I wrote, this is an entirely different approach.
dpkg-buildpackage
is not involved (or at least not in the way you're using it now).@gvdhoorn, thanks for informing me. I will take a look at it and see if it's useful! Still needs the
.deb
s though... For now, I will just build manually, which can be a pain, but I will get there. A big reason for the.deb
s is also to deploy it in a docker container for releasing my packages, which can just be easily updated and made with existing binaries.