Ask Your Question
1

moving a catkin ws requires recompile because of absolute paths?

asked 2015-12-31 04:50:05 -0500

koenlek gravatar image

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:

  1. build the ws on our CI server (e.g. on a nighly basis)
  2. tar the build and devel folders
  3. on a local development machine, download the tarred build / devel folders from CI server
  4. remove local build / devel folders and extract the CI tar folders in place.
  5. 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.

edit retag flag offensive close merge delete

Comments

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.

gvdhoorn gravatar image gvdhoorn  ( 2015-12-31 08:08:16 -0500 )edit

Is generating debs an option here?

Mani gravatar image Mani  ( 2015-12-31 13:44:58 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-12-31 10:32:23 -0500

Dirk Thomas gravatar image

I don't think that CMake supports moving the build (or source) folder to a different location. Since catkin is based on CMake the same "limitation" applies.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2015-12-31 04:50:05 -0500

Seen: 374 times

Last updated: Dec 31 '15