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-node_0.7.0-0xenial_amd64.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
dh_builddeb -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-node_0.7.0-0xenial_amd64.deb'.
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.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.
@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.