Bug 417202 - CMake: switch from server mode to file-api
Summary: CMake: switch from server mode to file-api
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Build tools: CMake (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-05 18:34 UTC by Ben Boeckel
Modified: 2020-02-20 12:36 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Boeckel 2020-02-05 18:34:55 UTC
SUMMARY

It appears as though KDevelop is still relying on CMake's server mode.  The server mode was superseded in CMake 3.14 by the file-api.  Furthermore, the server mode was deprecated in CMake 3.15 and will soon be removed.  KDevelop should be updated to use the file-api instead.  Doing so may also address some of the other CMake-related issues that are open.

Release note announcing the change: https://cmake.org/cmake/help/latest/release/3.14.html#file-based-api
Blog post: https://blog.kitware.com/cmake-3-14-0-available-for-download/
file api docs: https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html
Comment 1 Milian Wolff 2020-02-06 16:15:15 UTC
sigh yes very true... thanks for reminding us.
Comment 2 Milian Wolff 2020-02-08 16:39:58 UTC
I've started working on this now over at https://invent.kde.org/mwolff/kdevelop/commits/cmake-file-api
Comment 3 Milian Wolff 2020-02-09 21:13:57 UTC
OK, the branch is now ready for testing. There are some things left to be done, most notably support for runtimes (docker etc). I'll also have to test it on a real world project outside the unit tests now.
Comment 4 Milian Wolff 2020-02-20 12:36:59 UTC
Git commit d38ae65bc3b5304e13fd641b4971939e67f70d09 by Milian Wolff.
Committed on 14/02/2020 at 09:23.
Pushed by mwolff into branch 'master'.

Start implementation of cmake-file-api support

Before long, upstream cmake will remove the server support. Instead,
the new cmake-file-api is supposed to be used. This patch adds the
first baby steps towards that goal. We now write a query file to
the required location before running the cmake configure job. Then
we can look for the latest available index reply file that belongs
to our client request.

See:
https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html

M  +1    -0    plugins/cmake/CMakeLists.txt
A  +97   -0    plugins/cmake/cmakefileapi.cpp     [License: LGPL (v2+)]
A  +50   -0    plugins/cmake/cmakefileapi.h     [License: LGPL (v2+)]
M  +1    -0    plugins/cmake/tests/CMakeLists.txt
A  +89   -0    plugins/cmake/tests/test_cmakefileapi.cpp     [License: LGPL (v2+)]
M  +3    -1    plugins/cmakebuilder/cmakejob.cpp

https://invent.kde.org/kde/kdevelop/commit/d38ae65bc3b5304e13fd641b4971939e67f70d09
Comment 5 Milian Wolff 2020-02-20 12:36:59 UTC
Git commit 958bc087cc1804a054be553f1c81a325590afb12 by Milian Wolff.
Committed on 14/02/2020 at 09:23.
Pushed by mwolff into branch 'master'.

Actually parse the cmake-file-api response files

For now, this is only done in the unit test. We are also lacking
support for runtimes, as I first want to clarify how this is
supposed to be done and tested.

M  +158  -2    plugins/cmake/cmakefileapi.cpp
M  +16   -0    plugins/cmake/cmakefileapi.h
M  +27   -1    plugins/cmake/tests/test_cmakefileapi.cpp

https://invent.kde.org/kde/kdevelop/commit/958bc087cc1804a054be553f1c81a325590afb12
Comment 6 Milian Wolff 2020-02-20 12:36:59 UTC
Git commit 76ddc001950321190def89d2894cf452dd825870 by Milian Wolff.
Committed on 14/02/2020 at 09:23.
Pushed by mwolff into branch 'master'.

Actually use the cmake-file-api for project import, if possible

M  +1    -0    plugins/cmake/CMakeLists.txt
M  +1    -1    plugins/cmake/cmakefileapi.cpp
A  +72   -0    plugins/cmake/cmakefileapiimportjob.cpp     [License: LGPL (v2+)]
A  +52   -0    plugins/cmake/cmakefileapiimportjob.h     [License: LGPL (v2+)]
M  +24   -3    plugins/cmake/cmakemanager.cpp

https://invent.kde.org/kde/kdevelop/commit/76ddc001950321190def89d2894cf452dd825870