Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 725868

Summary: kde-frameworks/kio-5.67.0-r1, kde-frameworks/kxmlgui-5.67.0, kde-frameworks/kirigami-5.67.1-r1: Fail to compile when used with dev-qt/qtnetwork-5.15.0
Product: Gentoo Linux Reporter: matthias.grobarek
Component: Current packagesAssignee: Gentoo KDE team <kde>
Status: RESOLVED OBSOLETE    
Severity: normal CC: johnnybit, jstein
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=724346
Whiteboard: fixed in KDE Frameworks 5.70
Package list:
Runtime testing required: ---
Attachments: emerge --info qtnetwork kio kirigami kxmlgui (after installing the fixed versions)
Build log of kio-5.67.0-r1
Build log of kirigami-5.67.1-r1
Build log of kxmlgui-5.67.0
Patch file for kio-5.67.0-r1
Modified ebuild for kio-5.67.0-r1 that includes the patch file
Patch file for kirigami-5.67.1-r1
Modified ebuild for kirigami-5.67.1-r1 that includes the patch file
Patch file for kxmlgui-5.67.0
Modified ebuild for kxmlgui-5.67.0 that includes the patch file

Description matthias.grobarek 2020-05-28 11:21:41 UTC
Created attachment 642330 [details]
emerge --info qtnetwork kio kirigami kxmlgui (after installing the fixed versions)

== SYMPTOMS ==

After I updated dev-qt/qtnetwork to 5.15.0 on my system (which is not yet stabilized), the subsequent rebuilds of kde-frameworks/kio-5.67.0-r1, kde-frameworks/kxmlgui-5.67.0 and kde-frameworks/kirigami-5.67.1-r1 failed.


== ANALYSIS ==

The reason is that the source code of these three packages use a Qt version switch in several places, e. g.:

#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
    if (reply->error() != QNetworkReply::NoError) {
#else
    if (reply->networkError() != QNetworkReply::NoError) {
#endif

…or:

#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
    const auto socketError = socket->error();
#else
    const auto socketError = socket->socketError();
#endif


So the authors assume that prior to Qt 5.15.0 the methods are called error() and error() while in Qt 5.15.0 and later they are called networkError() and socketError().

But this assumption is wrong, as can be seen in the API documentation of Qt 5.15:
• The class QAbstractSocket keeps using error() instead of socketError(): https://doc.qt.io/qt-5/qabstractsocket.html (compare with the Qt 5.14 doc: https://doc.qt.io/qt-5.14/qabstractsocket.html)
• The class QNetworkReply keeps using error() instead of networkError(): https://doc.qt.io/qt-5/qnetworkreply.html (compare with the Qt 5.14 doc: https://doc.qt.io/qt-5.14/qnetworkreply.html)


== FIX ==

I created patch files for the affected source code files that remove the Qt version switch for said method calls, and added them in the ebuild files accordingly. This enabled me to successfully build the three packages.
Comment 1 matthias.grobarek 2020-05-28 11:26:12 UTC
Created attachment 642332 [details]
Build log of kio-5.67.0-r1
Comment 2 matthias.grobarek 2020-05-28 11:26:39 UTC
Created attachment 642334 [details]
Build log of kirigami-5.67.1-r1
Comment 3 matthias.grobarek 2020-05-28 11:27:25 UTC
Created attachment 642348 [details]
Build log of kxmlgui-5.67.0
Comment 4 matthias.grobarek 2020-05-28 11:28:31 UTC
Created attachment 642350 [details, diff]
Patch file for kio-5.67.0-r1
Comment 5 matthias.grobarek 2020-05-28 11:29:18 UTC
Created attachment 642352 [details]
Modified ebuild for kio-5.67.0-r1 that includes the patch file
Comment 6 matthias.grobarek 2020-05-28 11:29:53 UTC
Created attachment 642354 [details, diff]
Patch file for kirigami-5.67.1-r1
Comment 7 matthias.grobarek 2020-05-28 11:30:23 UTC
Created attachment 642356 [details]
Modified ebuild for kirigami-5.67.1-r1 that includes the patch file
Comment 8 matthias.grobarek 2020-05-28 11:31:08 UTC
Created attachment 642358 [details, diff]
Patch file for kxmlgui-5.67.0
Comment 9 matthias.grobarek 2020-05-28 11:31:32 UTC
Created attachment 642360 [details]
Modified ebuild for kxmlgui-5.67.0 that includes the patch file
Comment 10 Andreas Sturmlechner gentoo-dev 2020-05-28 15:59:31 UTC
Please update your mixed arch/~arch system to KDE Frameworks 5.70.
Comment 11 Andreas Sturmlechner gentoo-dev 2020-05-29 07:52:20 UTC
There won't be any more changes to 5.67.

Please just update to 5.70.
Comment 12 Andreas Sturmlechner gentoo-dev 2020-05-29 07:57:10 UTC
You can use our autogenerated files for that:

https://gitweb.gentoo.org/proj/kde.git/tree/Documentation/package.accept_keywords/kde-frameworks-5.70.keywords
Comment 13 matthias.grobarek 2020-05-29 18:38:10 UTC
Thank you, 5.70 builds fine.
The only thing I had to do on top of that upgrade was to update kde-apps/konsole from stable 19.12.3-r1 to unstable 20.04.1 (or 20.04.1-r2 as of today) because it wouldn’t compile with the 5.70 components anymore.
Comment 14 Andreas Sturmlechner gentoo-dev 2020-05-30 07:54:59 UTC
konsole-19.12.3 and potentially other stable kde-apps/* packages is also a victim of Qt 5.15.0, not related to the KDE Frameworks upgrade.
Comment 15 Andreas Sturmlechner gentoo-dev 2020-05-30 11:28:44 UTC
Stabilisation was initiated in bug 724346.