probonopd / linuxdeployqt

Makes Linux applications self-contained by copying in the libraries and plugins that the application uses, and optionally generates an AppImage. Can be used for Qt and other applications
Other
2.22k stars 414 forks source link

Build from source breaks after upgrade from Qt 6.4.3 to 6.5.0 #584

Open petrmanek opened 1 year ago

petrmanek commented 1 year ago

I discovered that upgrading Qt from version 6.4.3 to 6.5.0 (or later) breaks the build from source. The main symptom are the following qmake messages:

$ qmake6
/tmp/linuxdeployqt/.qmake.conf:1: Cannot find feature qt_build_config
/tmp/linuxdeployqt/.qmake.conf:1: Cannot find feature qt_build_config
Info: creating stash file /tmp/linuxdeployqt/.qmake.stash
/tmp/linuxdeployqt/linuxdeployqt.pro:1: Cannot find feature qt_parts

Curiously these only appear as "warnings" because qmake still terminates with exit code 0. In my CI, this led to a failing attempt to invoke GNU make, which had the following predictable output since no objects for executable targets were registered:

$ make
g++ -Wl,-O1 -Wl,-rpath,/usr/lib -Wl,-rpath-link,/usr/lib -o linuxdeployqt     /usr/lib/libQt6Gui.so /usr/lib/libGLX.so /usr/lib/libOpenGL.so /usr/lib/libQt6Core.so -lpthread -lGLX -lOpenGL
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib/Scrt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [Makefile:68: linuxdeployqt] Error 1

I suspect that the cause may have something to do with the way makespecs are organized in Qt 6.4 and 6.5. However, I do not really understand qmake internals all that well.

For now I am mitigating this by sticking with Qt 6.4.3 but it would be nice to be able to use version 6.5 at some point since it is a LTS release, which brings many features that are not present in 6.4.

probonopd commented 1 year ago

Are you building linuxdeployqt from source? What happens if you use the linuxdeployqt AppImage (continuous build) provided on GitHub Releases?

petrmanek commented 1 year ago

Are you building linuxdeployqt from source?

Yes, I am building linuxdeployqt from source using clang++ 10 with Qt 6.5 under dockerized Ubuntu Focal inside my CI.

What happens if you use the linuxdeployqt AppImage (continuous build) provided on GitHub Releases?

The published AppImage works without any issues. The drawback is that it is only provided for the x86_64 (amd64) CPU architecture. The reason I was building linuxdeployqt from source in the first place is to support other architectures such as aarch64 (arm64) and armv7 (arm32) in my CI. That being said, the symptoms described in this bug report are present for all CPU architectures with Qt 6.5. I can even reproduce it on my x86_64 laptop with Qt 6.5.2.

probonopd commented 1 year ago

This probably is because linuxdeployqt has never really been ported to Qt6. It is a Qt5 application and has only ever been tested to be compiled with Qt5.

petrmanek commented 1 year ago

This probably is because linuxdeployqt has never really been ported to Qt6. It is a Qt5 application and has only ever been tested to be compiled with Qt5.

While that is certainly possible, I suspect that this is merely caused by change of qmake's configuration language. Out of curiosity, I tried running it in project generation mode using qmake6 -project, and got somewhat sane .pro file out of it. The only drawback was that I had to manually cherry-pick files that belong to tests and examples. You may want to consider it in a future release/PR.