roscatkin

catkin build ignoring local changes?


I'm wondering if anybody else has seen the following issue with catkin build. It's rare, but every now and then when I rebuild my workspace (literally just calling catkin build again after changing a .cpp file) it seems like changes to certain files are not reflected (i.e. new print statements don't show up, even though I can see the change on git).

Has anybody else seen something like this? I suspect what's happening is that catkin build is (for whatever reason) not registering that the file in question has been modified, and as such does not rebuild that unit. Cleaning and rebuilding the workspace completely of course seems to fix the issue, but I'm wondering if others have encountered this and if there's a specific reason this happens.

FWIW I have two Ubutnu 18.04 machines each running ROS Melodic and I've observed this behavior on each one (albeit only a few times). I'm also using VS Studio Code on each machine (in the unlikely case that this matters).

As always, TYSM for the help!


Solution

  • This is a known issue(at least to me) and I’ve observed the behavior in Kinetic, Melodic, and Noetic. As of right now there isn’t a specific reason that has been singled out inside of cstkin_make as to what causes it. However I do suspect it’s a caching issue.

    As you stated it can easily be solved by cleaning the build space and forcing a new build; which is probably good practice in most circumstances regardless.