Qt-dependent dependencies pull in all Qt components #28237
Closed
rainbowgoblin
started this conversation in
Maintenance
Replies: 1 comment
-
I'm going to make this into an issue instead. Closing. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I work on a project that uses Qt as well as a handful of additional dependencies that require Qt themselves (e.g., qca, qntp), for which we've written our own recipes from scratch. We build quite a lot of Qt modules, some of which aren't used by some of our builds. E.g., we have a setup like this:
Subproject A: depends on many Qt modules, including QtWebEngine, as well as qca and qntp
Subproject B: depends on a small number of Qt modules, not QtWebEngine, as well as qca and qntp
Subproject C: depends on a small number of Qt modules, no additional Qt-based dependencies
We noticed since switching to Conan 2 that our builds for Subprojects A and B were linking far more Qt libraries than necessary, every single Qt module that we build from the conan package, e.g., Subproject B now gets linked to QtWebEngine. Subproject C is fine, though. And notably, qca and qntp are not themselves linked to QtWebEngine. The fix for this was to specify which Qt components to propagate in the qca and qntp recipes in
package_info
:This works, but I'm wondering if there's a better approach. The Conan documentation describes
cpp_info.requires
as experimental, for one thing, so I'm somewhat concerned something will change at some point. It also doesn't seem very well-documented... it took a lot of hunting and CMake debugging to figure out that this was the problem.Is there a better way? Is there an option to make conan recipes propagate only specified components from dependencies by default (rather than propagating every single Qt component, irrespective of whether they're used by either the package or downstream consumer)?
If I'm doing this right, I feel that the Qt recipe deserves a warning somewhere. There are LOTS of modules that can optionally be built. Our deployed "Subproject B" size went up by a factor of 6 when we switched to Conan 2 (from under 100 MB to almost 600 MB) before I fixed the qca and qntp recipes.
Beta Was this translation helpful? Give feedback.
All reactions