-
Notifications
You must be signed in to change notification settings - Fork 38
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
How to ignore a specific driver for QtSql? #153
How to ignore a specific driver for QtSql? #153
Comments
There is no such feature as of yet. I have not investigated this driver. Is it really part of a standard Qt distribution? Where do you get your Qt from? In any case, I'm not sure your approach is appropriate. We may want to exclude that driver by default if needed, i.e., make it opt-in. |
I install Qt in my CI environment using aqt install-qt linux desktop 6.6.1 gcc_64 -O "/opt/qt" -m \
qt3d qtcharts qtimageformats qtlocation \
qtmultimedia qtpositioning qtquick3dphysics \
qtserialport qtspeech qtwebchannel qtwebengine \
qtwebsockets qtwebview qt5compat qtquick3d qtshadertools |
It does show Mimer as one of the supported drivers here: I guess it ultimately depends on if you configure the Qt build to build that driver or not, and the default appears to be |
The exact binary distribution that is pulled by aqt is hosted on an official Qt mirror site (Constant, in my case), as per:
Looking in here, I can confirm that the mimer driver is included. |
Could you post a (sanitized) log of a failed attempt so I can get an idea of the problem, please? |
Sure, given Qt installed via aqt via: aqt install-qt linux desktop 6.6.1 gcc_64 -O "/opt/mr/qt" -m \
qt3d qtcharts qtimageformats qtlocation \
qtmultimedia qtpositioning qtquick3dphysics \
qtserialport qtspeech qtwebchannel qtwebengine \
qtwebsockets qtwebview qt5compat qtquick3d qtshadertools And given a linuxdeploy invocation of: /opt/mr/linuxdeploy/linuxdeploy-x86_64.AppImage \
--appdir "${BUILD_DIR}/AppDir" \
--plugin qt \
--output appimage \
--executable "${BUILD_DIR}/AppDir/usr/bin/myapp" \
--exclude-library="libqsqlmimer.so" \ # Tried this for fun... didn't work.
--custom-apprun="${SRC_DIR}/app/myapp/appimage/AppRun" this is the relevant log output/error message:
|
To me, this smells like a bug in Qt. How can they ship an incomplete distribution? I'm not decided on a strategy yet. I'll check their bug tracker. |
Well, I think that is a weird thing about Qt in general (just seems to be more egregious in their Sql plugin). There are definitely a bunch of assumptions made around what files exist in a user's environment: ldd /opt/mr/qt/6.6.1/gcc_64/plugins/sqldrivers/libqsqlmysql.so
linux-vdso.so.1 (0x00007ffc3a737000)
libmysqlclient.so.21 => /lib/x86_64-linux-gnu/libmysqlclient.so.21 (0x00007f9beec03000)
... Like there's really no reason it should be expected that I have I've never been able to pinpoint any documentation that specifies exactly what you need within a given Linux distribution Qt to be fully functional, I just keep apt-installing (or conan-installing) packages until everything works... Interested to learn what they respond with on their tracker! |
In a quick search I could not find related bug reports. Feel free to post some links. I guess the main issue is that most of the time, users of this software use distribution provided (or otherwise well packaged) Qt distributions rather than the upstream Qt. Those usually ensure the installation of all dependencies. |
If it wasn't the case, So this isn't a bug in Qt. Instead, linuxdeploy-plugin-qt should provide a way to exclude plugins (since it can be useful to not ship unused plugins in general) and possibly, a missing dependency of a plugin should not be a fatal error like this:
Maybe it could just be a warning instead. |
the issue is not only with mimersql. We use SQLite only in our project, but all SQL plugins are being deployed: 113K libqsqlmimer.so 332K .AppDir/usr/lib/libpq.so.5 not mentioning dependencies of libpq and others. it makes our AppImage >10MB too big. Is there any option to fix that other than removing files in Qt installation? |
You can remove the |
@TheAssassin cheers for the tip, it works |
@TheAssassin just FYI this happens with the upstream Qt packages, aqtinstall uses that, sqlmimer and mysqlclient libraries are not bundled into the distributed binaries as the user is expected to have them if they want to use it (plus obvious legal issues and increased distribution size), this is not a problem outside linuxdeploy Qt plugin because only this tool will do an "ldd" scan to see if plugins have deps met, so yes, |
@TheAssassin so I started adding Adding this option to the But adding the option on the plugin by my understanding of the code, will not receive the needed args by default, it seems to me that each AppDir option should be stored into LINUXDEPLOY_ env vars that get's automatically read by AppDir plugins instances. Do you think that's a good approach? I don't want to spend time coding in the wrong direction... |
It would be useful to have the standalone version also able to exclude-libraries, this helps with issues: linuxdeploy#153 linuxdeploy#150 linuxdeploy#110 linuxdeploy#108
It would be useful to have the standalone version also able to exclude-libraries, this helps with issues: linuxdeploy#153 linuxdeploy#150 linuxdeploy#110 linuxdeploy#108
I remember I had the same issue, but I fixed it somehow. Now I got the same issue again (and even previous commits have this issue). @spiderkeys, how did you solve this in your CI? |
@nuttyartist we build and deploy Qt using conan now, so this is no longer a problem for us. EDIT: Disregard the below as it wouldn't solve the problem - I was misremembering how we solved a different issue.
I think the only way we got around this issue in the past was deleting the offending shared libs before running linuxdeploy |
@nuttyartist you can also use my linuxdeploy appimages fork where the issue is fixed, hopefully @TheAssassin will merge my fixes soon... |
It would be useful to have the standalone version also able to exclude-libraries, this helps with issues: linuxdeploy#153 linuxdeploy#150 linuxdeploy#110 linuxdeploy#108
It would be useful to have the standalone version also able to exclude-libraries, this helps with issues: linuxdeploy#153 linuxdeploy#150 linuxdeploy#110 linuxdeploy#108
Is there any timeline on addressing this with an official solution? |
It would be useful to have the standalone version also able to exclude-libraries, this helps with issues: linuxdeploy#153 linuxdeploy#150 linuxdeploy#110 linuxdeploy#108
When I try to package my app (which does depend on QtSql),
ldd
will be run on each of the libraries within the${QT_PATH}/plugins/sqldrivers/
directory, as you might expect to happen. However, now in Qt 6.6.1 (and not in 6.5.2), there is a new SQL driver called libqsqlmimer.so for the Mimer SQL library (https://www.mimer.com/mimer-sql-joins-qt-6-6-enhancing-database-connectivity/).ldd
fails to findlibmimerapi.so
, and the appimage build fails as a result.From what I can tell, the two obvious paths to resolve this are:
Well, I have no need for Mimer (and you can't even trivially install it on Ubuntu anyway, because it is a paid product - likely Qt automotive related shenanigans), so I'm currently working around the issue by just outright deleting the driver.
That said, it would be nice if there was a way to tell linuxdeploy/plugin-qt to ignore specific drivers which aren't needed. In this case, I only use the sqlite driver in my app, so there is no need to deploy the others either.
I tried to find such a method, but didn't come across anything.
The text was updated successfully, but these errors were encountered: