Repository navigation
fix(build): install only the Qt runtime the app needs - #118
Conversation
The install step copied the whole aqt Qt package: every library and plugin on Linux, and every Qt6*.dll plus all plugins on Windows, including the debug *d.dll twins of each. List the Qt modules the app links plus their transitive Qt dependencies, and the plugin directories a Widgets desktop app loads, and install only those. Windows debug DLLs are dropped; Linux skips the unversioned development symlinks and the empty lib/cmake directories. With Qt 6.10.1 this takes the Qt payload from 156 MB / 324 files to 109 MB / 60 files on Linux and from 350 MB / 223 files to 52 MB / 25 files on Windows. A missing module now fails the configure step instead of producing a broken package. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Hendrik Leidinger <hendrik.leidinger@nextcloud.com>
juliusknorr
left a comment
There was a problem hiding this comment.
Thanks, nice cleanup, and failing configure on a missing module is a good change 👍 Code-wise this looks fine, and I checked the dependency closure against the 6.10.1 aqt packages. Two small comments inside.
Before merging I'd like to see one launched package per platform, since nothing in desktop-apps CI builds or starts it. Could you build DesktopEditors once with this commit and check on Linux (X11 and Wayland) and on Windows that the app starts, a video in a presentation plays (FFmpeg plugin) and the print dialog opens (cups printsupport on Linux)? The smoke tests in DesktopEditors#226 would cover the X11 start once merged.
| # The aqt Qt package is a full SDK (Quick, Qml, Designer, Sql, Test, ..., | ||
| # plus debug DLLs on Windows), so only install what the app needs: the modules | ||
| # it links, their transitive Qt dependencies and the plugins a desktop Widgets | ||
| # app loads. Check with ldd/dumpbin after bumping Qt or linking a new module. |
There was a problem hiding this comment.
"Check with ldd/dumpbin after bumping Qt" is easy to forget. The next Qt bump could add a plugin dependency, and we'd only notice at runtime. You already checked that every dependency resolves for the PR. Could we turn that check into a small script that runs after cmake --install in the DesktopEditors build and fails if a libQt6*/Qt6*.dll dependency of an installed binary or plugin is missing? That would also be the test for this change, instead of the no-tests-needed label.
| else() | ||
| file(GLOB _plugins "${QT_ROOT}/plugins/${_d}/*.so") | ||
| endif() | ||
| if(_plugins) |
There was a problem hiding this comment.
If a plugin directory comes back empty, we skip it silently. If multimedia or imageformats ever ends up empty, we'd ship a package without playback or image loading and not notice. Should we treat it as a FATAL_ERROR, the same as the modules? Have not tested, but something like:
if(NOT _plugins)
message(FATAL_ERROR "Qt runtime: no plugins in ${QT_ROOT}/plugins/${_d}")
endif()|
9.3.8 (Windows x64) still installs 69 AI: Used Claude Opus 5.5 to help in the process. |
The install step copied the whole aqt Qt SDK into the package: all of
lib/andplugins/on Linux, and everyQt6*.dllplus all plugins on Windows, including the debug*d.dllcopies.This PR installs only:
With Qt 6.10.1, the Qt files shrink on Linux from 156 MB (324 files) to 109 MB (60 files), and on Windows from 350 MB (223 files) to 52 MB (25 files). If a listed module is missing, configure now fails.
I tested the install against the aqt Linux and Windows packages, and every dependency resolves. The app hasn't been launched from a package built with this change yet.
🤖 Generated with Claude Code