Skip to content

fix(build): install only the Qt runtime the app needs - #118

Merged
juliusknorr merged 1 commit into
mainfrom
reduce-qt6-payload
Nov 14, 2026
Merged

juliusknorr merged 1 commit into
mainfrom
reduce-qt6-payload

Conversation

@rikled

@rikled rikled commented Nov 6, 2026

Copy link
Copy Markdown
Member

The install step copied the whole aqt Qt SDK into the package: all of lib/ and plugins/ on Linux, and every Qt6*.dll plus all plugins on Windows, including the debug *d.dll copies.

This PR installs only:

  • the Qt modules the app links, plus the Qt libraries they depend on
  • the plugins a desktop Widgets app loads: platform, image formats, icon engines, multimedia, styles, and on Linux xcb, Wayland, themes, input methods and print support
  • FFmpeg, and on Linux the ICU build that Qt Core needs

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

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>
@rikled rikled added the no-tests-needed feat/fix PR that needs no tests label Nov 6, 2026
@rikled
rikled requested a review from juliusknorr November 6, 2026 20:36

@juliusknorr juliusknorr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread win-linux/CMakeLists.txt
# 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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.

Comment thread win-linux/CMakeLists.txt
else()
file(GLOB _plugins "${QT_ROOT}/plugins/${_d}/*.so")
endif()
if(_plugins)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()

@bargib

bargib commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

9.3.8 (Windows x64) still installs 69 Qt6*d.dll (208 MB) plus debug plugins such as qsvgd.dll, so this didn't make it into the release. If there's a Windows build from this branch, I'm happy to install it and check that the editors, video playback (FFmpeg) and SVG icons still work.

AI: Used Claude Opus 5.5 to help in the process.

@juliusknorr
juliusknorr merged commit 55f99a9 into main Nov 14, 2026
3 of 4 checks passed
@juliusknorr juliusknorr mentioned this pull request Nov 16, 2026
42 of 55 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-tests-needed feat/fix PR that needs no tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants