Bug 400934 - kdepim-runtime does not compile with qt 5.11 (because QString::QString(const char*), QChar::QChar(char) and QString::QString(const QByteArray&) are private)
Summary: kdepim-runtime does not compile with qt 5.11 (because QString::QString(const ...
Status: RESOLVED LATER
Alias: None
Product: kdepim
Classification: Applications
Component: libkdepim (show other bugs)
Version: GIT (master)
Platform: Gentoo Packages Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-11 14:32 UTC by Benjamin Traut
Modified: 2018-11-12 19:12 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Output of emerge --info (6.97 KB, text/plain)
2018-11-11 15:16 UTC, Benjamin Traut
Details
Compressed versuin of the build-environment (41.38 KB, application/gzip)
2018-11-11 15:17 UTC, Benjamin Traut
Details
Compressed build-log (49.39 KB, application/gzip)
2018-11-11 15:18 UTC, Benjamin Traut
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Traut 2018-11-11 14:32:50 UTC
SUMMARY

See Bug #400916, fixed today. Package fails to compile now at several other files.

Qt 5.11.x seems to have deprecated some constructors.

I:

/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/tomboynotes/o2/o0baseauth.cpp: In member function ‘void O0BaseAuth::setExtraTokens(const QVariantMap&)’:
/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/tomboynotes/o2/o0baseauth.cpp:126:43: error: ‘QString::QString(const QByteArray&)’ is private within this context
     store_->setValue(key, bytes.toBase64());
                                           ^
In file included from /usr/include/qt5/QtCore/qobject.h:47:0,
                 from /usr/include/qt5/QtCore/qiodevice.h:45,
                 from /usr/include/qt5/QtCore/qdatastream.h:44,
                 from /usr/include/qt5/QtCore/QDataStream:1,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/tomboynotes/o2/o0baseauth.cpp:1:
/usr/include/qt5/QtCore/qstring.h:830:5: note: declared private here
     QString(const QByteArray &a);
     ^~~~~~~
/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/tomboynotes/o2/o0baseauth.cpp: In static member function ‘static QByteArray O0BaseAuth::createQueryParameters(const QList<O0RequestParameter>&)’:
/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/tomboynotes/o2/o0baseauth.cpp:140:50: error: ‘QString::QString(const QByteArray&)’ is private within this context
         ret.append(QUrl::toPercentEncoding(h.name) + "=" + QUrl::toPercentEncoding(h.value));
                                                  ^
In file included from /usr/include/qt5/QtCore/qobject.h:47:0,
                 from /usr/include/qt5/QtCore/qiodevice.h:45,
                 from /usr/include/qt5/QtCore/qdatastream.h:44,
                 from /usr/include/qt5/QtCore/QDataStream:1,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/tomboynotes/o2/o0baseauth.cpp:1:
/usr/include/qt5/QtCore/qstring.h:830:5: note: declared private here
     QString(const QByteArray &a);
     ^~~~~~~
/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/tomboynotes/o2/o0baseauth.cpp:140:91: error: ‘QString::QString(const QByteArray&)’ is private within this context
         ret.append(QUrl::toPercentEncoding(h.name) + "=" + QUrl::toPercentEncoding(h.value));
                                                                                           ^
In file included from /usr/include/qt5/QtCore/qobject.h:47:0,
                 from /usr/include/qt5/QtCore/qiodevice.h:45,
                 from /usr/include/qt5/QtCore/qdatastream.h:44,
                 from /usr/include/qt5/QtCore/QDataStream:1,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/tomboynotes/o2/o0baseauth.cpp:1:
/usr/include/qt5/QtCore/qstring.h:830:5: note: declared private here
     QString(const QByteArray &a);
     ^~~~~~~
make[2]: *** [resources/tomboynotes/CMakeFiles/akonadi_tomboynotes_resource.dir/build.make:221: resources/tomboynotes/CMakeFiles/akonadi_tomboynotes_resource.dir/o2/o0baseauth.cpp.o] Error 1
make[2]: Leaving directory '/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999_build'
make[1]: *** [CMakeFiles/Makefile2:2873: resources/tomboynotes/CMakeFiles/akonadi_tomboynotes_resource.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

II:
/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.cpp: In function ‘QMultiMap<QCA::CertificateInfoType, QString> parseCertSubjectInfo(const QString&)’:
/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.cpp:41:68: error: ‘QChar::QChar(char)’ is private within this context
     for (const auto token : info.split(',', QString::SkipEmptyParts)) {
                                                                    ^
In file included from /usr/include/qt5/QtCore/qstring.h:48:0,
                 from /usr/include/qt5/QtCore/qobject.h:47,
                 from /usr/include/qt5/QtCore/QObject:1,
                 from /usr/include/KF5/KCoreAddons/kjob.h:26,
                 from /usr/include/KF5/KCoreAddons/kcompositejob.h:24,
                 from /usr/include/KF5/KCoreAddons/KCompositeJob:1,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/ewsjob.h:23,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.h:23,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.cpp:20:
/usr/include/qt5/QtCore/qchar.h:589:5: note: declared private here
     QChar(char c) Q_DECL_NOTHROW;
     ^~~~~
/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.cpp:42:54: error: ‘QChar::QChar(char)’ is private within this context
         const auto keyval = token.trimmed().split('=');
                                                      ^
In file included from /usr/include/qt5/QtCore/qstring.h:48:0,
                 from /usr/include/qt5/QtCore/qobject.h:47,
                 from /usr/include/qt5/QtCore/QObject:1,
                 from /usr/include/KF5/KCoreAddons/kjob.h:26,
                 from /usr/include/KF5/KCoreAddons/kcompositejob.h:24,
                 from /usr/include/KF5/KCoreAddons/KCompositeJob:1,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/ewsjob.h:23,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.h:23,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.cpp:20:
/usr/include/qt5/QtCore/qchar.h:589:5: note: declared private here
     QChar(char c) Q_DECL_NOTHROW;
     ^~~~~
/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.cpp: In function ‘QString escapeSlashes(const QString&)’:
/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.cpp:56:53: error: ‘QChar::QChar(char)’ is private within this context
     return result.replace('/', QStringLiteral("\\/"));
                                                     ^
In file included from /usr/include/qt5/QtCore/qstring.h:48:0,
                 from /usr/include/qt5/QtCore/qobject.h:47,
                 from /usr/include/qt5/QtCore/QObject:1,
                 from /usr/include/KF5/KCoreAddons/kjob.h:26,
                 from /usr/include/KF5/KCoreAddons/kcompositejob.h:24,
                 from /usr/include/KF5/KCoreAddons/KCompositeJob:1,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/ewsjob.h:23,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.h:23,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.cpp:20:
/usr/include/qt5/QtCore/qchar.h:589:5: note: declared private here
     QChar(char c) Q_DECL_NOTHROW;
     ^~~~~
/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.cpp: In member function ‘virtual void EwsPKeyAuthJob::start()’:
/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.cpp:72:35: error: variable ‘const QUrlQuery query’ has initializer but incomplete type
     const QUrlQuery query(mPKeyUri);
                                   ^
/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.cpp: In member function ‘void EwsPKeyAuthJob::sendAuthRequest(const QByteArray&, const QUrl&, const QString&)’:
/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.cpp:102:106: error: ‘QString::QString(const QByteArray&)’ is private within this context
         QStringLiteral("PKeyAuth AuthToken=\"%1\",Context=\"%2\",Version=\"1.0\"").arg(respToken, context).toAscii());
                                                                                                          ^
In file included from /usr/include/qt5/QtCore/qobject.h:47:0,
                 from /usr/include/qt5/QtCore/QObject:1,
                 from /usr/include/KF5/KCoreAddons/kjob.h:26,
                 from /usr/include/KF5/KCoreAddons/kcompositejob.h:24,
                 from /usr/include/KF5/KCoreAddons/KCompositeJob:1,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/ewsjob.h:23,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.h:23,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.cpp:20:
/usr/include/qt5/QtCore/qstring.h:830:5: note: declared private here
     QString(const QByteArray &a);
     ^~~~~~~
/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.cpp:102:108: error: ‘class QString’ has no member named ‘toAscii’
         QStringLiteral("PKeyAuth AuthToken=\"%1\",Context=\"%2\",Version=\"1.0\"").arg(respToken, context).toAscii());
                                                                                                            ^~~~~~~
/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.cpp: In member function ‘QByteArray EwsPKeyAuthJob::buildAuthResponse(const QMap<QString, QString>&)’:
/var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.cpp:165:66: error: ‘QString::QString(const QByteArray&)’ is private within this context
     const QString certStr = escapeSlashes(cert.toDER().toBase64());
                                                                  ^
In file included from /usr/include/qt5/QtCore/qobject.h:47:0,
                 from /usr/include/qt5/QtCore/QObject:1,
                 from /usr/include/KF5/KCoreAddons/kjob.h:26,
                 from /usr/include/KF5/KCoreAddons/kcompositejob.h:24,
                 from /usr/include/KF5/KCoreAddons/KCompositeJob:1,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/ewsjob.h:23,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.h:23,
                 from /var/tmp/portage/kde-apps/kdepim-runtime-9999/work/kdepim-runtime-9999/resources/ews/ewsclient/auth/ewspkeyauthjob.cpp:20:
/usr/include/qt5/QtCore/qstring.h:830:5: note: declared private here
     QString(const QByteArray &a);
     ^~~~~~~



STEPS TO REPRODUCE
1. compile Qt5-5.11 from sources (gentoo qt-overlay)
2. compile kdepim-live-package-set (if you haven't before).
3. or compile directly the kde-apps/kdepim-runtime-9999.ebuild

OBSERVED RESULT
Package does not compile (see above error message)

EXPECTED RESULT
Package does compile and install

SOFTWARE/OS VERSIONS
Windows: -
MacOS: -
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.14.18 (live)
KDE Frameworks Version: 5.52.0 (live)
Qt Version: 5.11.2 (live)
Comment 1 Laurent Montel 2018-11-11 14:59:48 UTC
I don't know why you have this problem.
What do you use as build specific argument ?
Comment 2 Laurent Montel 2018-11-11 15:09:21 UTC
https://build.kde.org/view/Failing/job/Applications/job/kdepim-runtime/job/kf5-qt5%20FreeBSDQt5.11/
as you can see all compile fine.
So I don"t know why gentoo creates this problem
(same here)
Comment 3 Benjamin Traut 2018-11-11 15:16:55 UTC
Created attachment 116247 [details]
Output of emerge --info
Comment 4 Benjamin Traut 2018-11-11 15:17:30 UTC
Created attachment 116248 [details]
Compressed versuin of the build-environment
Comment 5 Benjamin Traut 2018-11-11 15:18:55 UTC
Created attachment 116249 [details]
Compressed build-log
Comment 6 Benjamin Traut 2018-11-11 15:20:37 UTC
I have attached three files.
If you need additional information, please say so.
Comment 7 Benjamin Traut 2018-11-11 15:42:00 UTC
Looking at /usr/include/qt5/QtCore/qstring.h at line ~826:

private:
#if defined(QT_NO_CAST_FROM_ASCII)
    QString &operator+=(const char *s);
    QString &operator+=(const QByteArray &s);
    QString(const char *ch);
    QString(const QByteArray &a);
    QString &operator=(const char  *ch);
    QString &operator=(const QByteArray &a);
#endif

so I guess, that gentoos qt5-packages are setting the QT_NO_CAST_FROM_ASCII-flags where they should'nt currently do?
Comment 8 Benjamin Traut 2018-11-11 15:42:58 UTC
...or the packages to be installed are setting this...?
Comment 9 Benjamin Traut 2018-11-11 15:44:58 UTC
and the commandline from the build-output (see attachment) states

-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII
Comment 10 Laurent Montel 2018-11-11 17:46:28 UTC
you force some flags as there are removed by kdelibs4support.

So by default it builds without it.
So you need to remove theses flags for kdepim-runtime.

We will fix it later but for normal build it's ok.
Comment 11 Benjamin Traut 2018-11-11 20:05:54 UTC
I filed a report on bugs.gentoo.org:

https://bugs.gentoo.org/670958
Comment 12 Benjamin Traut 2018-11-11 21:04:12 UTC
I had no intention of marking it as fixed instead of later. Sorry.
Comment 13 Andreas Sturmlechner 2018-11-11 23:59:38 UTC
For the record, Gentoo does not mess with those flags.

Benjamin, if you are working with live sources, make sure you use `smart-live-rebuild` to catch any new upstream commits in dependencies that may fix your issue.
Comment 14 Manuel Nickschas 2018-11-12 10:54:26 UTC
The compiler flags -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII are enforced by extra-cmake-modules in KDEFrameworkCompilerSettings.cmake; so those are not added by Gentoo.

In addition, resources/ews/ewsclient/auth/ewspkeyauthjob.cpp misses an #include <QUrlQuery>; also in that file, QString::toAscii() is used twice, which is deprecated since Qt 5.0 (and I guess something in KDE's build chain disables those methods, although I could not find the actual place).

Removing the flags from KDEFrameworkCompilerSettings.cmake, adding the missing include and changing toAscii() to toLatin1() fixes the kdepim-runtime build for me, but obviously these are hacks that should be fixed properly.

I'm reopening the bug, because these seem to be upstream issues rather than Gentoo issues. If you disagree, feel free to close again.
Comment 15 Laurent Montel 2018-11-12 16:54:55 UTC
(In reply to Manuel Nickschas from comment #14)
> The compiler flags -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY
> -DQT_NO_CAST_TO_ASCII are enforced by extra-cmake-modules in
> KDEFrameworkCompilerSettings.cmake; so those are not added by Gentoo.

indeed it's in KDEFrameworkCompilerSettings.cmake I know as I added it in kdepim-runtime.
but we use kdelibs4support which has remove_definition(....)
but as gentoo force it to build it will override remove_definition.
I tested in local it yesterday

> 
> In addition, resources/ews/ewsclient/auth/ewspkeyauthjob.cpp misses an
> #include <QUrlQuery>; also in that file, QString::toAscii() is used twice,
> which is deprecated since Qt 5.0 (and I guess something in KDE's build chain
> disables those methods, although I could not find the actual place).
> 
> Removing the flags from KDEFrameworkCompilerSettings.cmake, adding the
> missing include and changing toAscii() to toLatin1() fixes the
> kdepim-runtime build for me, but obviously these are hacks that should be
> fixed properly.

For sure they need to be fix. It's for that I close as 'later' as it compiles fine for the moment

> 
> I'm reopening the bug, because these seem to be upstream issues rather than
> Gentoo issues. If you disagree, feel free to close again.

I disagreee => I close it
Comment 16 Andreas Sturmlechner 2018-11-12 17:26:03 UTC
Oh, I see now. Our ebuild has the following:

> # We don't build kolab, so we can disable this
> punt_bogus_dep KF5 KDELibs4Support

That's why the the build issues are unmasked.
Comment 17 Manuel Nickschas 2018-11-12 18:04:43 UTC
I can confirm that removing this from the ebuild makes kdepim-runtime compile on Gentoo, so you guys were right. That was one venue I didn't look into when trying to debug :)
Comment 18 Benjamin Traut 2018-11-12 19:12:19 UTC
Thank you all.

I commented out the mentioned line in the ebuild and now it compiled.