NotepadNext icon indicating copy to clipboard operation
NotepadNext copied to clipboard

AppImage build on Linux can fail when linuxdeploy-plugin-qt picks a Qt 5 qmake instead of Qt 6

Open saberoueslati opened this issue 7 months ago • 0 comments

Operating System and Version

Ubuntu/Debian-based Linux

Distribution

Source build with CMake + Ninja, APP_DISTRIBUTION=AppImage

Description

The current Linux AppImage packaging step can fail on systems where linuxdeploy-plugin-qt auto-detects a Qt 5 qmake binary even though NotepadNext is built against Qt 6.

This repo is now a Qt 6 project, and doc/Building.md currently instructs Linux users to install Qt 6 packages and then run:

cmake -S . -B build \
    -G Ninja \
    -DCMAKE_BUILD_TYPE=Release \
    -DAPP_DISTRIBUTION=$DISTRIBUTION
cmake --build build --target appimage --parallel

When it failed, I got the following message :


[qt/stdout] Using qmake: /usr/bin/qmake 

[qt/stderr] linuxdeploy-plugin-qt version 1-alpha (git commit ID 511d51d), GitHub actions build 237 built on 2026-03-07 19:21:17 UTC

[qt/stdout] 

[qt/stdout] Using Qt version:  5.15.13  ( 5 ) 

[qt/stdout]   libEGL.so.1  libGLX.so.0  libGLdispatch.so.0  libOpenGL.so.0  libQt6Core.so.6  libQt6Core5Compat.so.6  libQt6DBus.so.6  libQt6Gui.so.6  libQt6Network.so.6  libQt6PrintSupport.so.6  libQt6Widgets.so.6  libX11.so.6  libXau.so.6  libXdmcp.so.6  libb2.so.1  libblkid.so.1  libbrotlicommon.so.1  libbrotlidec.so.1  libbsd.so.0  libbz2.so.1.0  libc.so.6  libcap.so.2  libcom_err.so.2  libcrypto.so.3  libcurl-gnutls.so.4  libdbus-1.so.3  libdouble-conversion.so.3  libduktape.so.207  libexpat.so.1  libffi.so.8  libfontconfig.so.1  libfreetype.so.6  libgcc_s.so.1  libgcrypt.so.20  libgio-2.0.so.0  libglib-2.0.so.0  libgmodule-2.0.so.0  libgmp.so.10  libgnutls.so.30  libgobject-2.0.so.0  libgomp.so.1  libgpg-error.so.0  libgraphite2.so.3  libgssapi_krb5.so.2  libharfbuzz.so.0  libhogweed.so.6  libicudata.so.74  libicui18n.so.74  libicuuc.so.74  libidn2.so.0  libk5crypto.so.3  libkeyutils.so.1  libkrb5.so.3  libkrb5support.so.0  liblber.so.2  libldap.so.2  liblz4.so.1  liblzma.so.5  libm.so.6  libmd.so.0  libmd4c.so.0  libmount.so.1  libnettle.so.8  libnghttp2.so.14  libp11-kit.so.0  libpcre2-16.so.0  libpcre2-8.so.0  libpng16.so.16  libproxy.so.1  libpsl.so.5  libpxbackend-1.0.so  libresolv.so.2  librtmp.so.1  libsasl2.so.2  libselinux.so.1  libssh.so.4  libstdc++.so.6  libsystemd.so.0  libtasn1.so.6  libunistring.so.5  libxcb.so.1  libxkbcommon.so.0  libz.so.1  libzstd.so.1

[qt/stdout] Found Qt modules:  

[qt/stdout] Extra Qt modules:  

[qt/stdout] ERROR: Could not find Qt modules to deploy 
ERROR: Failed to run plugin: qt (exit code: 1) 
ninja: build stopped: subcommand failed.

This seems worth fixing in the build scripts because the current documented Linux/AppImage build path can fail on systems that have both Qt 5 and Qt 6 tooling installed.

Steps to Reproduce

  1. Install the Linux dependencies from doc/Building.md
  2. Have both Qt 5 and Qt 6 qmake binaries available, with /usr/bin/qmake resolving to Qt 5
  3. Run
cmake -S . -B build \
    -G Ninja \
    -DCMAKE_BUILD_TYPE=Release \
    -DAPP_DISTRIBUTION=$DISTRIBUTION
cmake --build build --target appimage --parallel
  1. Observe that linuxdeploy-plugin-qt reports Using qmake: /usr/bin/qmake
  2. Observe that it detects Qt 5 and then fails with Could not find Qt modules to deploy

Debug Information

On my system, the relevant part was:

[qt/stdout] Using qmake: /usr/bin/qmake
[qt/stdout] Using Qt version:  5.15.13  ( 5 )

while the NotepadNext build itself was linking against Qt 6 libraries.

Additional Details

I already made a fix for this. I'm gonna make a PR next

saberoueslati avatar May 01 '26 21:05 saberoueslati