moving a catkin ws requires recompile because of absolute paths?
Hi all,
I am looking to offload compilation of our catkin ws to a CI server (recompile takes over an hour on our ARM boards). Most of the building blocks are in place now. I only just found out about an inconvenient issue.
What I want to do:
- build the ws on our CI server (e.g. on a nighly basis)
- tar the build and devel folders
- on a local development machine, download the tarred build / devel folders from CI server
- remove local build / devel folders and extract the CI tar folders in place.
- build the catkin ws. Only the diffs since the CI job need to be build on the local machine.
Currently I am more or less at the 5th step. When I build it, it complains that the folders of ws, build, source, and devel space do not match:
Error: Attempting to build a catkin workspace using build space: "/home/koenlek/catkin_ws/build" but that build space's most recent configuration differs from the commanded one in ways which will cause problems. Fix the following options or use `catkin clean -b` to remove the build space:
- install_space: /builds/k.lekkerkerker/catkin_ws/install (stored) is not /home/koenlek/catkin_ws/install (commanded)
- source_space: /builds/k.lekkerkerker/catkin_ws/src (stored) is not /home/koenlek/catkin_ws/src (commanded)
- workspace: /builds/k.lekkerkerker/catkin_ws (stored) is not /home/koenlek/catkin_ws (commanded)
- devel_space: /builds/k.lekkerkerker/catkin_ws/devel (stored) is not /home/koenlek/catkin_ws/devel (commanded)
If I search for the hardcoded CI path /builds/k.lekkerkerker/catkin_ws
in the build and devel folders I get thousands of matches. And from these commands I find that there are also matches on binary level:
grep -HIrn "/builds/k.lekkerkerker/catkin_ws" > /tmp/file1
grep -Hrn "/builds/k.lekkerkerker/catkin_ws" > /tmp/file2
diff /tmp/file1 /tmp/file2
If I remove the build folder as suggested in the error, I factually need to do a clean build, so I don't gain any time. As there are changes on the binary level, I doubt whether a search and replace will work... So I am pretty much stuck here.
Is there a way to force catkin to work with relative paths? Or can I tell it that it has moved? Or can you cleverly search & replace stuff (I don't know how to solve that on the binary level). Or should I maybe get creative with chroot (with which I have no experience).
A solution would be to make the CI server build in the same folder as where we will use the ws on the local computers, but I don't really like that approach. We could also get creative with symlinks to fake some stuff, but I don't like that either.
I use ROS Indigo on Ubuntu 14.04, with catkin tools (instead of catkin_make) 0.3.1. A quick check with catkin_make shows the same absolute path issue.
I'm not sure what you're trying to do is a supported use case (transferring build dirs is often a hairy operation, whatever the build system). You might be interested in catkin_tools#240 and 251.
Is generating
debs
an option here?