-
Notifications
You must be signed in to change notification settings - Fork 43
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
Compile and deploy only the required binaries #106
Comments
I need suggestions on what would be the best way to provide this feature. |
Beware, I think this assertion is untrue/imprecise. On the one hand, CMake will let you build only what is needed to build another target: you don't need to "make all", just "make my_test", and the minimal subset will be built. On the other hand, the CMake install rules seem to rely on the fact that "make all" is called beforehand. (that is what I recall from the last time I looked into it, and talked about it with Dimitri).
So, one would only need to call qibuild configure
I think it is cool :
By the way, I think this is what catkin does. That being said, before digging into qibuild work, I think it is important to see what raw cmake enables these days (especially regarding export targets). |
Also when you update toolchains (with added / removed projects), or change a config. But you are right that we are stuck at the installation level (unless we make new tricks with CMake), since CMake export looks interesting to distinguish "staging" from "installing", but in practice it does not help having select targets in However I see that there is a notion of components in cmake that can be installed with alternative commands (from http://stackoverflow.com/questions/9190098/for-cmakes-install-command-what-can-the-component-argument-do): As a result, joint with a single CMake file regrouping the projects, you could install "only what's necessary" to your project. What do you think of that? |
Note that qiBuild already uses CMake components: for buildtime/runtime/testtime notions This issue lies deep within qibuild's design: when you depend on a qibuild project you can only choose between these 3 types of dependencies (with the qiproject syntax). There isn't any finer-grain control, the purpose of qiprojects dependencies is to abstract the CMake layer (projects can be other languages not built by CMake) I remember we tried the possibility of a common top CMakeLists (Dimitri probably had a way of generating it)
edit: Yes, you wouldn't need qibuild anymore, only CMake but that would bring another set of drawbacks: You may need sometimes to work on CMake/debug CMake code, and then having a really heavy configure time could be painful. Whereas with a small qiproject, even if the install is longer because of useless targets in the dependencies, you're guaranteed to have a quick incremental re-configure and re-install. Just my 2 cents |
I suspect it would enable us to drop lots of qibuild-specific code and make qibuild compatible with raw-cmake upstream targets.
This is my understanding too.
Yes. This is how qibuild distinguishes what it needs to install for runtime vs test vs devel.
There will be tricks.
Maybe this is going too far from the original intended use of cmake component. I think the use case they had in mind was to work with package managers (like dpkg) but not to replace them. A debian source package produces several debian binary packages. I think components were intended to pick in which (single) binary package a file would land. Dependencies would then be installed by the package manager as their own package. So to summarize, even if possible, my gut feeling is that having a file listed in several component may lead to troubles. I also think we should reduce the scope of qibuild, not enlarge it. Having a single cmake projects goes in that direction. Adding smartness to qi_stage_lib, not that much. |
I see that it's not easily feasible, nor so compatible with current design of qibuild, thanks guys. Also, looking at what Catkin shows in the logs, I wonder whether they are able to do it, with their different design. Do you know that? |
@victor, it's not really an answer to your question but you might be interested in reading those articles http://design.ros2.org/articles/ament.html |
sorry, what question? |
Ament is indeed interesting! But it sure they are able to do the trick catkin did. Anyway, it is worth trying for new projects. |
Hello,
QiBuild relies on the qiproject.xml files to know what are the dependencies between projects, and the CMake API helps using them in practice for C++.
This is good, but when compiling projects implies compiling fully every other dependency, whereas only a some parts are actually required in the CMake. This is too bad since CMake actually lets you build only what is needed for your target.
As a consequence, a qibuild make, install, deploy and package will take uselessly more time, and bring unused binaries in the result. Let's fix this!
The text was updated successfully, but these errors were encountered: