-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qt6 compatibility #495
Qt6 compatibility #495
Conversation
Hi @tobtoht, Thank you for your PR, Qt 6 compatibility is something a lot of us need. I tried your changes and some of them prevent linuxdeployqt to build with Qt 5.x. This is due to When running the linuxdeployqt built with Qt 6, I get the following error : |
Thanks @RICCIARDI-Adrien, I've added your fix. |
As I understand it, this patch might make it possible to compile linuxdeployqt using Qt 6. |
Oh I misunderstood then
The usecase would be to deploy Qt6 applications. If I remember correctly your tool does only make assumptions about the glibc version, but none about how old the Qt version is since it bundles Qt libraries anyway. |
I think that at least Qt 6 plugins support must be added before merging this pull request, otherwise it won't deploy any plugin. See linuxdeployqt/tools/linuxdeployqt/shared.cpp Line 1213 in aeafcd2
|
Since this PR doesn't break building linuxdeployqt with Qt 5, I think it can be merged; however it will not result in the possibility to deploy Qt 6 applications unless someone updates the code to (also) do that. And even then, the resulting AppImages will not be all that useful yet because they won't be able to run on all still-supported LTS Linux distributions if I am not mistaken. |
In #532 it was apparently possible to get Qt6 running on Ubuntu 14.04, so the official claim of the Qt company is not true (it claims Ubuntu 20.04 is necessary) |
That's good news then. So, if someone would like to send a PR to add deployment of the Qt6 plugins similar to the Qt5 ones (details: #532), this would be a welcome addition. |
Let's give a try... @probonopd, do you know some test case applications that use a lot of Qt plugins ? |
I can't remember I had specific test case apps. Maybe use one (or two) from the examples in the README? Ah no, its not known whether they can be compiled with Qt 6. So best look for some app that is known to work with Qt 6. |
Thank you, I will try with some README examples (hoping they can build with Qt 6). I have 2 more questions for you :
|
Looking at the code they seem only used to determine which Qt modules are used and need a translation file, so the bit values might be assigned "randomly" for Qt 6 modules. Thank you for your quick reply ! |
@RICCIARDI-Adrien These are just random and this code is copied from windeployqt for how they deal with translations. You may check that code as to how Qt6 is handled |
@ribtoks Thank you, this is a good idea ! |
Here is a proof of concept with an initial support of Qt 6 : https://github.com/RICCIARDI-Adrien/linuxdeployqt/tree/add_qt6_support. I tested this on the following applications, they were the only ones I could find that were able to build with Qt 6 :
Each application could successfully run after deployment (however I did not do exhaustive tests). Application executable was successfully modified to use the deployed libraries. All needed files (like In all cases, I added the parameter Here are the commands I used : Build linuxdeployqt
Deploy Time Logger
Deploy PacketSender
Deploy linuxdeployqt itself
There were some errors when trying to deploy linudeployqt, however the program executable runs fine.
It would be great if people try these changes with their own setups to find as much as bugs and corner cases as possible. |
It seems to end up in an infinite loop for me when using it with https://github.com/vimpostor/quickcurver Instructions used: # in the root of my repo
cmake -B build
cmake --build build
cd build
/path/to/linuxdeployqt/bin/linuxdeployqt quickcurver -bundle-non-qt-libs -unsupported-allow-new-glibc Backtrace of infinite loop: #0 0x00007ffff730604f in ppoll () from /usr/lib/libc.so.6
#1 0x00007ffff7cd171b in qt_safe_poll(pollfd*, unsigned long, timespec const*) () from /usr/lib/libQt5Core.so.5
#2 0x00007ffff7c198db in QProcess::waitForFinished(int) () from /usr/lib/libQt5Core.so.5
#3 0x0000555555568794 in findDependencyInfo(QString const&) ()
#4 0x000055555556b27b in getQtLibraries(QString const&, QString const&, QSet<QString> const&) ()
#5 0x000055555556e79f in deployQtLibraries(QList<LibraryInfo>, QString const&, QStringList const&, bool) ()
#6 0x0000555555578a0a in deployPlugins(AppDirInfo const&, QString const&, QString, DeploymentInfo) ()
#7 0x000055555557a589 in deployPlugins(QString const&, DeploymentInfo) ()
#8 0x0000555555563d65 in main () |
Thanks for testing and reporting @vimpostor ! What's your Linux distro (as you are using |
Thanks for testing and reporting @vimpostor ! What's your Linux distro
(as you are using `-unsupported-allow-new-glibc`) ?
It's on Arch Linux, but I don't think the distro matters. I can try
reproducing it on Ubuntu LTS if you want.
|
You need to find a build of Qt 6 that runs on all still-supported versions of Ubuntu, and use that, without |
@vimpostor, could you build your game on Ubuntu 18.04 with Qt 6.3, and deploy it without |
Hi @RICCIARDI-Adrien, |
Hi @a12e, |
@a12e Sorry for the dump question, I forgot that this PR was merged ! |
I tried your
So, with your branch and those tweaks, I seem to be able to deploy my Qt 6 app (QML, Qt 3D, Qt Multimedia) successfully. |
Great, let's add the fix for |
@a12e, could you also test the |
@RICCIARDI-Adrien your fix for I use Qt 6.3.1 built with GCC 11 under Ubuntu 18.04 LTS. Yes, Qt Multimedia was added back, but its plugin architecture has been removed. Instead, everything lies directly in This is the ldd before linuxdeplyqt:
This is the commands I used to deploy my app :
I needed to bundle a more recent version of the libstdc++ because of GCC 11 and modern C++, but there is no issue with glibc or other core libs. I tested my app under a brand new Ubuntu 18.04 VM, everything works smoothly for now. |
Thank you for the information and the tests. Is any of the Qt libraries missing or are they all deployed correctly ?
I attempted a fix for the Qt 3D renderers deployment, but I can't test it. Could you test it https://github.com/RICCIARDI-Adrien/linuxdeployqt/tree/add_qt6_support_test ? |
I added the support for almost all Qt 6 plugins, but I can't test on complex applications. Could some of the people participating to this thread test with their own applications ? RICCIARDI-Adrien@66ff3cc Thanks in advance for your help ! |
This patch allows for builds with Qt 6 with qmake.