Problem running dpkg-buildpackage
I have two packages;
- msgsrv_pkg - holds the custom messages and services
- motordriverpkg - a driver package that interfaces with the drives in the robot
I'm trying to generate debian for both the packages. motordriverpkg depends on msgsrvpkg.
I ran bloom-generate rosdebian
which generated the debian folders for both the packages. Then I executed dpkg-buildpackage -b -us
on msgsrvpkg which generated debian for the package without any issue. I followed this question. I created a rosdep file and added to /etc/ros/rosdep/source.list.d/50-my-packages.list and ran rosdep update got the following output.
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/magazino/pylon_camera/indigo-devel/rosdep/pylon_sdk.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Hit file:///home/user/my-ros-pkgs.yaml
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
Skip end-of-life distro "ardent"
Add distro "bouncy"
Add distro "crystal"
Skip end-of-life distro "groovy"
Skip end-of-life distro "hydro"
Add distro "indigo"
Skip end-of-life distro "jade"
Add distro "kinetic"
Add distro "lunar"
Add distro "melodic"
updated cache in /home/user/.ros/rosdep/sources.cache
Then I executed the dpkg-buildpackage -b -us
on the motordriverpkg. It fails because the package is not installed in /opt/ros/melodic/
Also, I tried the two things to overcome this problem.
1) Researching more about the dpkg-build package help, I executed the following command in dpkg-buildpackage; dpkg-buildpackage -b -d -us
and it failed.
2) Another option was to create an environment variable and add it with a sudo apt install -y $TEST_INSTALL
where TEST_INSTALL
looks like the following,
TEST_INSTALL=$(dpkg-checkbuilddeps 2>&1 | sed "s/dpkg-checkbuilddeps:\serror:\sUnmet build dependencies: //g" | sed "s/[\(][^)]*[\)] //g")
Should I use a docker container to do these builds just for the sake of generating a debian and tear it down ? Any help on this will be greatly appreciated.
Thanks !
Asked by venkisagunner on 2019-02-07 10:53:53 UTC
Answers
If you're building the downstream package, you have to install all the dependencies on the system that you're building on. That includes the messages package that you just built. If you don't want to do this on your host machine. The standard way to do this is either in a chroot or a docker container. All of the production builds are done in chroots or docker for better reproducibility.
Asked by tfoote on 2019-02-08 16:49:00 UTC
Comments