Handling updates to CMake files

Maciej Poleski d82ks8djf82msd83hf8sc02lqb5gh5 at gmail.com
Sun Jun 7 21:25:55 UTC 2015

Dnia niedziela, 7 czerwca 2015 18:32:09 Milian Wolff pisze:
> Hey all, esp. Aleix.
> In KF5, we are currently really bad at handling updates to CMakeLists.txt 
> files:
> - configure is not rerun (do we want that on every change to CMakeLists.txt?)
> - this way, no compile_commands.json file is updated

With regard to refactorings i have some thoughts.
Up-to-date compile_commands.json may be necessary even to populate menu with applicable refactorings "here". I we forget about this for a moment, then performing refactoring action with out-of-date compile_commands is likely to break source code - by simply missing parts of the project(s). (if tool "behave" to "succeed" at all)
But fulfilling this requirement on "refactorings side" seems be quite easy:
 1 information if configure needs re-run
 2 if so - rerun and and pass rest of the operation as continuation (callback, ...)
Remembering about possible race between 1 and 2.

As a result of regenerating compile_commands the whole ClangTool (with its internal cache) needs rebuilding - finished configure on CMake project should trigger this rebuild (and it is slightly more complicated for non CMake projects as there may be Bear within this chain).

As a result there may be noticeable delay after change in project structure before refactorings come back to functional state. The question which i'm asking myself for some time is "is it possible to populate already opened context-menu?" It might be better for user experience to do this "slow" part in background - without blocking GUI if right mouse button was clicked, but ClangTool is not ready yet.

Best Regards
Maciej Poleski

More information about the KDevelop-devel mailing list