-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Qt plugin paths handling in nixpkgs causes problems, software picking wrong plugins #86369
Comments
Qt plugins are used for themes, input methods, image formats, integration between applications, and probably other things I'm forgetting at the moment. The reason that Qt applications are allowed to discover plugins that don't belong to their dependencies is: that is what plugins are used for in practice, and it's the behavior that Qt upstream and Qt application developers expect. The other options I am aware of are: 1. break all those things in subtle ways, or 2. require the user to rebuild all Qt packages on their system whenever they install a new Qt package. Both choices are unacceptable. Note that item 2 above would also prevent using
There are two issues here that I want to discuss separately. First is managing the size of In the past, we have discussed controlling the size of
We cannot simply set the Nix store path as If you want to work on this, there is relevant prior art in #44047 and #85103. The second issue is having the wrappers manage paths for global plugins. It seems to me that this will, in practice, amount to adding Note that Qt plugins in Nixpkgs are slightly broken by |
I marked this as stale due to inactivity. → More info |
Still interested |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/announcing-nomia-a-general-resource-manager-inspired-by-nix/12591/26 |
I marked this as stale due to inactivity. → More info |
Still an issue |
This also breaks |
This breaks |
pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0009-qtbase-qtpluginpath.patch
by commit ec9e7e4 , merged in pull request Qt 5.12.4 #69086 by @ttuegel , but I don't see any explanation about the need for this in the commit msg nor PR text nor in source comments. Why at all allow Qt apps to discover plugins which don't belong to its deps? If it's because of theme engines I think this should be handled separately.Maybe not an issue, butI see that wrappers created for qt binaries build enormous QT_PLUGIN_PATH vars, causing a lot of directory scanning on each plugin loading. Why don't we just collect for each Qt app package symlinks to all plugins of its qt deps in its /nix/store/${out-path}/lib/qt-${ver}/plugins?Another example: I can't run pcmanfm-qt from user's outdated profile within KDE/Plasma session unless I unset QT_PLUGIN_PATH because otherwise pcmanfm-qt picks plugins both from paths derived from PATH (in qt-5.12/ subdirs, set at buildtime, as it was built against qt-5.12) and paths of Qt deps of parent KDE/Plasma process added to env by its wrapper (in qt-5.12.7/ subdirs) and crashes with
Cannot mix incompatible Qt library (version 0x50c07) with this library (version 0x50c00)
error. I had also seen whole KDE/Plasma breaking for user before, though I didn't know what to check at that time unfortunately, now I'm almost sure it was because of its processes similarly picking some plugins from user's outdated profile dir.My current idea is that for every Qt app we should collect all plugins of its dep closure in lib/ subdir of its nix store dir so that it can use it as QTDIR, as described in https://doc.qt.io/qt-5/deployment-plugins.html . Paths to global plugins like styles and input methods may be managed by wrappers which can both add and remove QT_PLUGIN_PATH components, but should print warnings about these changes.
The text was updated successfully, but these errors were encountered: