Error when packaging a binary .deb file with bloom: file changed as we read it
I am packaging a ROS node with bloom, following the following answer and am receiving a 'file changed as we read it' error at the final step. If I re-run the command everything works fine (as far as I can tell) and the deb package is produced in /src. Any ideas on why this is being produced?
Environment: Ubuntu Xenial, ROS Kinect, bloom 0.7.2-1, debhelper 9.20160115ubuntu3, fakeroot 1.20.2-1ubuntu1
bloom-generate rosdebian --os-name ubuntu --os-version xenial --ros-distro kinetic
fakeroot debian/rules binary
Errors out the first time:
dpkg-deb --build debian/ros-kinetic-test-node ..
dpkg-deb: building package 'ros-kinetic-test-node' in '../ros-kinetic-test-node0.7.0-0xenialamd64.deb'. tar: .: file changed as we read it
dpkg-deb: error: subprocess tar -cf returned error exit status 1
dh_builddeb: dpkg-deb --build debian/ros-kinetic-test-node .. returned exit code 2
debian/rules:22: recipe for target 'binary' failed
make: *** [binary] Error 1
Running fakeroot debian/rules binary
again right after, seems to package the .deb fine:
dh binary -v --buildsystem=cmake
dhbuilddeb -O-v -O--buildsystem=cmake
dpkg-deb --build debian/ros-kinetic-test-node ..
dpkg-deb: building package 'ros-kinetic-test-node' in '../ros-kinetic-test-node0.7.0-0xenial_amd64.deb'.
Asked by sgloutnikov on 2019-03-09 18:46:51 UTC
Answers
Following the same instructions under a Ubuntu Bionic with ROS Melodic environment produced no errors. If you need to build a ROS package under Xenial and Kinetic, and are seeing the same error, just run the fakeroot debian/rules binary
command again--the deb file produced worked fine for me.
Asked by sgloutnikov on 2019-03-18 17:12:37 UTC
Comments
In general it's probably a good idea to build packages on the same platform which they are targeting. It's possible to do so inside of a container, chroot, or virtual machine if your development host is different.
Asked by nuclearsandwich on 2019-03-19 07:59:59 UTC
Comments
It's been a while since I've encountered that tar error myself, and I haven't built a standalone ROS package. When I've seen the tar error it's usually because I'm trying to archive a directory that I'm creating the archive file in. You might try running
fakeroot debian/rules -n binary
to "just print" the actions taken by the debian/rules makefile. That might tell you what the tar command is so you can investigate further.Asked by nuclearsandwich on 2019-03-15 07:40:22 UTC
The output of
fakeroot debian/rules -n binary
is just this:dh binary -v --buildsystem=cmake
Since I posted this I tried another environment and if I run the exact same steps on Ubuntu Bionic with ROS Melodic, I see no errors and packages from the first try.
Asked by sgloutnikov on 2019-03-18 13:22:40 UTC
@sgloutnikov since that sounds like the solution you went with, I'd recommend posting an answer to your own question (rather than just a comment) to help others who may encounter similar issues.
Asked by nuclearsandwich on 2019-03-18 15:17:15 UTC