Bug 408970 - flatpak apps using Qt plug-ins get "FATAL: Cannot mix incompatible Qt library" error after KDE runtime update
Summary: flatpak apps using Qt plug-ins get "FATAL: Cannot mix incompatible Qt library...
Status: REPORTED
Alias: None
Product: Qt/KDE Flatpak Runtime
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Flatpak Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on: 409026
Blocks:
  Show dependency treegraph
 
Reported: 2019-06-21 01:48 UTC by skierpage
Modified: 2022-05-24 02:04 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description skierpage 2019-06-21 01:48:52 UTC
SUMMARY
After a recent update of the KDE runtime flatpak (org.kde.Platform on flathub), I can't run skrooge either from flathub or the master version from kdeapps. The former exits with
  ##FATAL: Cannot mix incompatible Qt library (version 0x50c02) with this library (version 0x50c04)
the latter exits with the same error message except the first version is 0x50c03.

I think the problem is the skrooge flatpaks were compiled against Qt 5.12.2 or 5.12.3 but the new KDE runtime is 5.12.4 (confirmed by running
  $ flatpak run --command=bash org.kde.skrooge/x86_64/stable
  [📦 org.kde.skrooge finance]$ kdeinit5 --version
).

I think https://binary-factory.kde.org/job/Skrooge_flatpak/lastBuild/ is the build log for the flatpak on kdeapps, and it's three days ago, so the problem may be that KDE apps must be rebuilt when the KDE runtime flatpak is updated. It seems a bug that building a revised runtime with a different Qt library doesn't trigger a rebuild of Qt and KDE app flatpaks. The third version number after 5.12 is the patch version and according to semver it should not introduce backwards-incompatible changes. Yet it seems to for this KDE app.

STEPS TO REPRODUCE
1. Install skrooge and org.kde.Platform from flathub
2. Try to run skrooge flatpak

OBSERVED RESULT
  ##FATAL: Cannot mix incompatible Qt library (version 0x50c02) with this library (version 0x50c04)

EXPECTED RESULT
No failures.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 
(from kdeinit5 --version within the flatpak)
KDE Plasma Version: ??
KDE Frameworks Version: 5.59.0
Qt Version: 5.12.4 , though note the error suggests a Qt mismatch.

ADDITIONAL INFORMATION
I think manually rebuilding the flathub and kdeapps apps against the same newer Qt would fix the problem until it happens again.

I tried to reproduce the problem with another KDE app (elisa) and it didn't have this problem. Maybe it was rebuilt recently, I don't know how to determine the date of the build of a KDE app. 

Unfortunately there doesn't seem to be any workaround for users.  Bug 172163 mentions a Trolltech.conf file but I don't have that in $HOME/.var/app/org.kde.skrooge . I tried removing the whole directory and it didn't help. I tried removing and reinstalling org.kde.skrooge/xk6_64/stable and reinstalling from flathub and it didn't help.
Comment 1 skierpage 2019-06-22 10:22:20 UTC
(In reply to skierpage from comment #0)
> I tried to reproduce the problem with another KDE app (elisa) and it didn't
> have this problem.
People in #flatpak IRC suggested that because Skrooge uses Qt plug-ins it must be rebuilt against the exact same libraries as in the KDE runtime whenever the latter's Qt library version changes. I don't know if this rebuild dependency on its runtime can be automated.

> I don't know how to determine the date of the build of a KDE app. 
  flatpak info org.kde.skrooge
shows the date and commit message of the revision that was built, but you have to view build logs to figure out the timestamp of the build.

> Unfortunately there doesn't seem to be any workaround for users.
You have to find some helpful person (thanks TingPing) to kick off a rebuild of the flatpak.

Note the skrooge flatpak on flathub has the same problem, https://github.com/flathub/org.kde.skrooge/issues/7
Comment 2 skierpage 2021-04-14 05:43:14 UTC
This happened again, I think because Flathub updating org.kde.Platform to 5.15.3. I created a Flathub issue and a KDE sysadmin phabricator ticket to rebuild Skrooge.

If it happens to you, one workaround while waiting for the rebuild is to downgrade the KDE+Qt runtime. From https://unix.stackexchange.com/questions/552688/is-it-possible-to-roll-back-a-flatpak-update :
  $ flatpak remote-info --log flathub org.kde.Platform//5.NNN
(e.g. ... org.kde.Platform//5.15)
and then rollback to a working Qt, e.g.
  $ sudo flatpak update --commit=3522f785effad84e56b127dc800e2982ae4eeca621d7b12a1a26136039d452ae org.kde.Platform//5.15
Comment 3 skierpage 2022-05-24 02:04:13 UTC
It happened again, now
> ##FATAL: Cannot mix incompatible Qt library (5.15.3) with this library (5.15.4)
I filed https://github.com/flathub/org.kde.skrooge/issues/27 for org.kde.skrooge//stable and and a KDE sysadmin phabricator ticket for org.kde.skrooge//master to trigger rebuilds.