Akonadi build failures

Adriaan de Groot groot at kde.org
Tue Dec 4 14:48:53 GMT 2018


Akonadi fails to build on KDE CI right now. On FreeBSD, the log is at 

https://build.kde.org/job/Applications/job/akonadi/job/kf5-qt5%20FreeBSDQt5.11/51/console

and the actual error is

In file included from /usr/home/jenkins/workspace/Applications/akonadi/kf5-qt5 
FreeBSDQt5.11/src/server/storage/datastore.cpp:38:
14:05:46 /usr/home/jenkins/workspace/Applications/akonadi/kf5-qt5 
FreeBSDQt5.11/src/server/storage/querycache.h:41:6: error: no template named 
'optional' in namespace 'std'
14:05:46 std::optional<QSqlQuery> query(const QString &queryStatement);

This build failure makes sense: akonadi is built (on Linux, BSD) as C++14, 
which has no std::optional, but it does have std::experimental::optional. The 
header akoptional.h tries to fix that, but

==
[C++11: 17.6.4.2.1/1]: The behavior of a C++ program is undefined if it adds 
declarations or definitions to namespace std or to a namespace within namespace 
std unless otherwise specified. A program may add a template specialization for 
any standard library template to namespace std only if the declaration depends 
on a user-defined type and the specialization meets the standard library 
requirements for the original template and is not explicitly prohibited.
==

makes the solution

==
        #include <experimental/optional>
        namespace std { using namespace experimental; }
==

rather dubious. Wouldn't something like

template<typename T> AkonadiOptional : std::experimental::optional<T> {};

be more appropriate? 

[ade]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20181204/d7a1aefa/attachment.sig>


More information about the kde-pim mailing list