Lately I am constantly getting this error when running some Qt software.
Cannot mix incompatible Qt library (5.15.7) with this library (5.15.9)
There are several issues on github about it but they’ve been closed:
opened 08:29PM - 18 Oct 17 UTC
closed 11:58PM - 14 Mar 19 UTC
6.topic: qt/kde
## Issue description
In certain (mixed 17.09/unstable) setups, when both qt-… 5.9.2 and qt-5.9.1 are present, tools like VirtualBox or wpa_gui can't start and fail with this error:
```
Qt FATAL: Cannot mix incompatible Qt library (version 0x50902) with this library (version 0x50901)
```
This might be related to the fact that the recent update to 5.9.2 that still keeps qtwebkit at 5.9.1 (since qtwebkit-5.9.2 is not available):
https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/qt-5/5.9/srcs.nix#L285-L300
### Steps to reproduce
On 17.09, install dropbox from the unstable channel. wpa_gui and VirtualBox from stable will exhibit the error.
## Technical details
* System: 17.09.1756.c99239bca0 (Hummingbird)
* Nix version: nix-env (Nix) 1.11.15
* Nixpkgs version: "17.09.1756.c99239bca0"
* Sandboxing enabled: false
cc/ht @woffs
opened 01:36PM - 26 Mar 18 UTC
closed 09:14PM - 29 Jul 19 UTC
6.topic: qt/kde
## Issue description
IMHO this is the most notable and irritating bug in Nix/… NixOS. Basically, if there are multiple versions of the same QT plugin in /nix/store, _all_ QT applications which use that plugin will fail with "QT library version mismatch" error. I am wondering if there is a solution which doesn't require deleting older generations and lets you update the system regularly.
### Steps to reproduce
Install multiple versions of QT;
Launch some QT-based applications.
opened 06:14AM - 30 Sep 18 UTC
closed 08:40PM - 02 Jun 20 UTC
0.kind: bug
6.topic: qt/kde
0.kind: regression
2.status: stale
First of all: ♥ nixos and the ability to create a self-contained configuration o… f a system which one can easily use to see a full system failure.
* * *
### What is this all about?
Users may face issues when upgrading their system, if a Qt dependency was installed in their profile. Their user profile may be at a stale revision, which has a previous Qt version, and the system a newer, but at the same major version.
If the user uses `plasma` as their desktop, it could cause serious headaches, where their session decisively doesn't want to work anymore.
### But why?
This is because of how Qt loads its plugins. See #44047 where there is details about how Qt loads plugins.
### Reproducing
See [this gist](https://gist.github.com/samueldr/fae3aa2116c0380877d12287e7184412) which has a script (`./build.sh`) which can be used to build the VM represented in `configuration.nix`.
1. Start the vm (`./build.sh`)
1. Login as alice, password is `foobar`.
1. Open `konsole` (type it in the app menu if you can't find it).
1. Try starting `heimdall-frontend`. It should fail with: `qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.`
1. Use the `break-env` script to install it "properly" (`nix-env -iA`)
1. The script will tell you that `heimdall-frontend` should work, test it.
1. Logout, (`loginctl terminate-user alice`)
1. Try logging back in.
If the environment was broken as expected, it will restart sddm on login.
### What to do?
Ideally, fix this. See #44047 for an attempt at reviewing how nixpkgs-built Qt apps load their plugins.
Additionally, and for the current release, note in the release notes why plasma could be failing on upgrade, and how to resolve (update user environment OR uninstall Qt apps from there).
### What's left to check
Whether 17.09 -> 18.03 faced the same issue or if this is a regression. (Where a stale older minor version of Qt-latest would break plasma.)
### Related
* An IRC user [faced the issue](https://logs.nix.samueldr.com/nixos/2018-09-29#1608324;).
* if #44047 doesn't fix this, care should be taken so it does.
* #47168 is a user facing a similar issue (but with less dire consequences.)
opened 12:35PM - 18 Feb 19 UTC
closed 11:57PM - 14 Mar 19 UTC
After commit af6b20c0fa14c3907ecf9836cef4d53e07baf515 KDE desktop won't run and … journalctl says:
`org.kde.ActivityManager: Cannot mix incompatible Qt library (version 0x50b01) with this library (0x50b03)`
### Steps to reproduce
nix rebuild with nixpkgs pointed to commit af6b20c0fa14c3907ecf9836cef4d53e07baf515
There is also a topic here that has no replies:
Here is my simple flake.nix
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "nixpkgs/nixos-21.11";
};
outputs = inputs@{ self, nixpkgs, ... }:
let
pkgs = import nixpkgs {
system = "x86_64-linux";
config = { allowUnfree = true; };
};
in
{
packages.x86_64-linux.mathpix = pkgs.mathpix-snipping-tool;
defaultPackage.x86_64-linux = self.packages.x86_64-linux.mathpix;
};
}
When I run nix run, the following error happens.
Cannot mix…
The solutions generally involve finding old packages and removing them. This makes me question everything I thought I knew about nix. I thought one of the main features of nix packages was that you could run multiple versions of the same package. I generally don’t even “install” packages but run them using “nix run”. I’ve ran the garbage collector even though I shouldn’t have to and that still doesn’t fix this problem. I don’t have this problem with anything else other than Qt packages. It seems weird and very wrong that adding something to my nix store could break something else that was working fine before. It seems like that these types of packages should be flagged or something. Can someone please help me understand why this happens and if there is a workaround other than going on a wild goose chase trying to find packages to remove? Thanks.
pbek
September 13, 2023, 1:42pm
2
Cannot mix incompatible Qt library (5.15.10) with this library (5.15.9)
I’m also getting this with the current “unstable” packages. I haven’t found any way around it yet…
I was running Qt Creator and Clion in a nix-shell with the Qt dev packages.