Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting CMakeCache.txt from build space results in incorrect passing of --cmake-args #1190

Open
peci1 opened this issue Sep 28, 2023 · 0 comments

Comments

@peci1
Copy link
Contributor

peci1 commented Sep 28, 2023

If I call e.g.

catkin_make --cmake-args -DCATKIN_DEVEL_PREFIX=devel_n

the first build succeeds. Sometimes I want to reset CMake cache by deleting build/CMakeCache.txt and rebuild the workspace. But when I do that, the custom --cmake-args are all lost, even if they're again passed on the command line (so in this case, the devel space used will be build/devel, which I find even weirder).

After some debugging, I know why is that: catkin_make checks whether it needs to run full cmake again, and does that by looking at Makefile and catkin_make.cache files in build space. CMakeLists.txt is not included. So catkin_make decides full re-run is not needed, and instead of calling the top-level CMakeLists.txt, it only runs make cmake_check_build_system. But this call loses all the custom --cmake-args passed to catkin_make. CMake thus runs again, but without the custom arguments. And its results are cached, so all subsequent calls also use this wrong environment.

The workaround is clear. Always also delete either Makefile or catkin_make.cache (or both) if you're deleting CMakeCache.txt.

The question is whether the invalidation logic should not also look at CMakeCache.txt and run the full train if it's missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant