Akonadi build failures

Daniel Vrátil dvratil at kde.org
Tue Dec 4 19:21:32 GMT 2018


Hi Ade,

On Tuesday, 4 December 2018 15:48:53 CET Adriaan de Groot wrote:
> 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

Sorry about the breakage. There's wan error in the #if logic in the file which 
as caused issues on Windows as well.

> ==
> [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. 

Indeed.

> Wouldn't something like
> 
> template<typename T> AkonadiOptional : std::experimental::optional<T> {};
> 
> be more appropriate?

Good idea, I'll update the code.


Cheers,
Dan

> 
> [ade]


-- 
Daniel Vrátil
www.dvratil.cz | dvratil at kde.org
IRC: dvratil on Freenode (#kde, #kontact, #akonadi, #fedora-kde)

GPG Key: 0x4D69557AECB13683
Fingerprint: 0ABD FA55 A4E6 BEA9 9A83 EA97 4D69 557A ECB1 3683
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20181204/195316a8/attachment.sig>


More information about the kde-pim mailing list