Open Levi-Armstrong opened 7 years ago
Hey Levi!
Not sure what you mean exactly? I don't think there is any use of cmake server mode in catkin tools yet, and I'm not sure what catkin_tools itself would do with the info the server mode can provide, since it "just" builds the projects.
To be honest, I'm not 100% firm on how cmake server mode is supposed to be used, but as far as I understood is that you invoke it on a cmake build space or a CMakeLists.txt and it parses that and provides all sorts of info via RPC, e.g. for consumption by your favorite IDE. Does that require that you only ever run cmake for that project via that server instance? Otherwise, I could imagine that catkin_tools continues to build as it does, and qtcreator has cmake server mode instances running to parse the info from the resulting build spaces.
If that is not the way things need to work, an option to invoke cmake in a different manner than is done currently could probably be integrated.
Docs here: https://cmake.org/cmake/help/v3.7/manual/cmake-server.7.html
My main concern with it is that catkin_tools is heavily dependent on being able to not just build but also configure multiple packages in parallel— that's kind of the point of it. Based on the discussion in there around the "progress" messages, it definitely looks like the long-running CMake server process is intended to be used for only one thing at a time, so I don't know how that would work, short of maintaining a pool of N CMake server instances, but I feel like that would mess up the intended IDE integration.
Turning things around, how does QT Creator handle working on multiple CMake projects at once?
Currently the way the ros plugin works is it passes a cmake generator flag for creating a code blocks file when calling catkin tools which then gets parsed after the project is finished being built. For building multiple cmake projects at once it currently relies on catkin tools for this. Though Qt Creator does support cmake projects natively but as far as I can tell the user specifies which project to build. I do think you are correct that it may need to maintain a pool of cmake servers but I don't think that would be an issue for the IDE mainly because I can control how it manages the cmake servers. Do you know if the cmake server is also responsible for building or does it just monitor the build directory and parse the directory for information?
It looks like from what I can tell it is not responsible for building so I may be able to handle this within the IDE where I create a CMake server for each package and manage the pool internally not requiring any changes to catkin tools. I will do testing and provide feedback.
I think you'd still need something within catkin_tools that lets you map package names to cmake server sockets/ports/pids/whatever. Kind of along the lines of #465, it would be great if we could figure out a plugin hook to expose with catkin_tools that would enable this functionality to be supplied by a plugin, rather than needing to be natively supported.
One of the tricky bits is going to be that it seems the interface to the persistent server is a complete departure from the the conventional cmake CLI, with no obvious mapping between them. So it's really an all or nothing affair— it's not just a matter of plopping an extra flag on your cmake
invocation to make it pass through to the server instead of its conventional behaviour.
Do catkin tools support building using the cmake server mode?
I currently maintain the ROS Qt Creator Plug-in and the server mode makes it a lot easier for getting specific information about a given project for building the code model.