Bug 234022 - deskutils/kmail build failure in latest CURRENT
Summary: deskutils/kmail build failure in latest CURRENT
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Tobias C. Berner
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2018-12-14 21:01 UTC by oleg.nauman
Modified: 2019-01-01 18:02 UTC (History)
6 users (show)

See Also:
tcberner: maintainer-feedback+
koobs: merge-quarterly?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description oleg.nauman 2018-12-14 21:01:40 UTC
deskutils/kmail fails to build in latest CURRENT amd64 r342058 :


FAILED: agents/unifiedmailboxagent/CMakeFiles/akonadi_unifiedmailbox_agent.dir/unifiedmailboxagent.cpp.o 
/usr/bin/c++  -DKCOREADDONS_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_DISABLE_DEPRECATED_BEFORE=0x060000 -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_SIGNALS_SLOTS_KEYWORDS -DQT_NO_URL_CAST_FROM_STRING -DQT_USE_QSTRINGBUILDER -DQT_WIDGETS_LIB -DQT_XML_LIB -DTRANSLATION_DOMAIN=\"akonadi_unifiedmailbox_agent\" -D_LARGEFILE64_SOURCE -Iagents/unifiedmailboxagent -I/usr/obj/usr/ports/deskutils/kmail/work/kmail-18.12.0/agents/unifiedmailboxagent -Iagents/unifiedmailboxagent/akonadi_unifiedmailbox_agent_autogen/include -I/usr/obj/usr/ports/deskutils/kmail/work/kmail-18.12.0 -I. -isystem /usr/local/include/KF5/AkonadiAgentBase -isystem /usr/local/include -isystem /usr/local/include/KF5 -isystem /usr/local/include/qt5 -isystem /usr/local/include/qt5/QtDBus -isystem /usr/local/include/qt5/QtCore -isystem /usr/local/lib/qt5/mkspecs/freebsd-clang -isystem /usr/local/include/qt5/QtWidgets -isystem /usr/local/include/qt5/QtGui -isystem /usr/local/include/KF5/AkonadiCore -isystem /usr/local/include/KF5/KCoreAddons -isystem /usr/local/include/KF5/KItemModels -isystem /usr/local/include/KF5/KConfigCore -isystem /usr/local/include/KF5/KConfigGui -isystem /usr/local/include/qt5/QtXml -isystem /usr/local/include/KF5/Akonadi/KMime -isystem /usr/local/include/KF5/akonadi/kmime -isystem /usr/local/include/KF5/AkonadiWidgets -isystem /usr/local/include/KF5/KConfigWidgets -isystem /usr/local/include/KF5/KCodecs -isystem /usr/local/include/KF5/KWidgetsAddons -isystem /usr/local/include/KF5/KAuth -isystem /usr/local/include/KF5/KMime -isystem /usr/local/include/KF5/KI18n -isystem /usr/local/include/KF5/KIdentityManagement -isystem /usr/local/include/KF5/KIdentityManagement/kidentitymanagement -isystem /usr/local/include/KF5/KPIMTextEdit -isystem /usr/local/include/KF5/KIconThemes -isystem /usr/local/include/KF5/MailCommon -isystem /usr/local/include/KF5/mailcommon -isystem /usr/local/include/KF5/MessageComposer -isystem /usr/local/include/KF5/messagecomposer -isystem /usr/local/include/KF5/MessageCore -isystem /usr/local/include/KF5/messagecore -isystem /usr/local/include/KF5/PimCommon -isystem /usr/local/include/KF5/pimcommon -isystem /usr/local/include/qt5/QtNetwork -isystem /usr/local/include/KF5/KIOCore -isystem /usr/local/include/KF5/KService -isystem /usr/local/include/qt5/QtConcurrent -isystem /usr/local/include/KF5/Libkleo -isystem /usr/local/include/KF5/libkleo -isystem /usr/local/include/qgpgme -isystem /usr/local/include/gpgme++ -isystem /usr/local/include/KF5/MessageViewer -isystem /usr/local/include/KF5/messageviewer -isystem /usr/local/include/KF5/KContacts -isystem /usr/local/include/KF5/MimeTreeParser -isystem /usr/local/include/KF5/mimetreeparser -isystem /usr/local/include/KF5/PimCommonAkonadi -isystem /usr/local/include/KF5/pimcommonakonadi -isystem /usr/local/include/KF5/KIMAP -isystem /usr/local/include/KF5/Akonadi/Contact -isystem /usr/local/include/KF5/akonadi/contact -isystem /usr/local/include/KF5/KCompletion -isystem /usr/local/include/KF5/KDBusAddons -O2 -pipe -march=nehalem -fstack-protector -fno-strict-aliasing -std=c++0x -fno-operator-names -fno-exceptions -Wno-gnu-zero-variadic-macro-arguments -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Wvla -Wdate-time -fdiagnostics-color=always -pedantic -Wzero-as-null-pointer-constant -O2 -pipe -march=nehalem -fstack-protector -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden   -fPIC -fexceptions -std=gnu++14 -MD -MT agents/unifiedmailboxagent/CMakeFiles/akonadi_unifiedmailbox_agent.dir/unifiedmailboxagent.cpp.o -MF agents/unifiedmailboxagent/CMakeFiles/akonadi_unifiedmailbox_agent.dir/unifiedmailboxagent.cpp.o.d -o agents/unifiedmailboxagent/CMakeFiles/akonadi_unifiedmailbox_agent.dir/unifiedmailboxagent.cpp.o -c /usr/obj/usr/ports/deskutils/kmail/work/kmail-18.12.0/agents/unifiedmailboxagent/unifiedmailboxagent.cpp
In file included from /usr/obj/usr/ports/deskutils/kmail/work/kmail-18.12.0/agents/unifiedmailboxagent/unifiedmailboxagent.cpp:20:
In file included from /usr/obj/usr/ports/deskutils/kmail/work/kmail-18.12.0/agents/unifiedmailboxagent/unifiedmailboxagent.h:26:
In file included from /usr/obj/usr/ports/deskutils/kmail/work/kmail-18.12.0/agents/unifiedmailboxagent/unifiedmailboxmanager.h:23:
In file included from /usr/obj/usr/ports/deskutils/kmail/work/kmail-18.12.0/agents/unifiedmailboxagent/utils.h:27:
/usr/include/c++/v1/experimental/optional:11:2: error: "<experimental/optional> has been removed. Use <optional> instead."
#error "<experimental/optional> has been removed. Use <optional> instead."
 ^
In file included from /usr/obj/usr/ports/deskutils/kmail/work/kmail-18.12.0/agents/unifiedmailboxagent/unifiedmailboxagent.cpp:20:
In file included from /usr/obj/usr/ports/deskutils/kmail/work/kmail-18.12.0/agents/unifiedmailboxagent/unifiedmailboxagent.h:26:
In file included from /usr/obj/usr/ports/deskutils/kmail/work/kmail-18.12.0/agents/unifiedmailboxagent/unifiedmailboxmanager.h:23:
/usr/obj/usr/ports/deskutils/kmail/work/kmail-18.12.0/agents/unifiedmailboxagent/utils.h:31:22: error: expected namespace name
using namespace std::experimental;
                ~~~~~^
In file included from /usr/obj/usr/ports/deskutils/kmail/work/kmail-18.12.0/agents/unifiedmailboxagent/unifiedmailboxagent.cpp:21:
/usr/obj/usr/ports/deskutils/kmail/work/kmail-18.12.0/agents/unifiedmailboxagent/unifiedmailbox.h:51:11: error: no template named 'optional' in namespace 'stdx'
    stdx::optional<qint64> collectionId() const;
    ~~~~~~^
/usr/obj/usr/ports/deskutils/kmail/work/kmail-18.12.0/agents/unifiedmailboxagent/unifiedmailbox.h:71:11: error: no template named 'optional' in namespace 'stdx'
    stdx::optional<qint64> mCollectionId;
    ~~~~~~^
4 errors generated.
Comment 1 Tobias C. Berner freebsd_committer freebsd_triage 2018-12-15 08:27:52 UTC
Moin moin

Interesting. My Current was too old to catch this. I will reproduce / fix it later.

mfg Tobias
Comment 2 Tobias C. Berner freebsd_committer freebsd_triage 2018-12-15 08:32:28 UTC
It seems that was changed in src r341825
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2018-12-15 15:02:11 UTC
Not sure how kde uses <experimental/optional>, but as the error message indicates, this should now be changed to just <optional>, taking care that the interface is still working as expected.
Comment 4 Tobias C. Berner freebsd_committer freebsd_triage 2018-12-15 22:08:06 UTC
It seems the fix is a bit messier than hoped for. 
Pushing for std=c++17 will mean hitting removed auto_ptr in kf5-akonadi.

dim:
https://github.com/KDE/kmail/blob/master/agents/unifiedmailboxagent/utils.h#L27
Comment 5 Alexander Kabaev freebsd_committer freebsd_triage 2018-12-26 18:51:52 UTC
(In reply to Tobias C. Berner from comment #4)
I suspect libc++ is wrong here, as it single-handedly removed experimental/optional from all C++ clients, even ones that are _not_ c++17 compatible.
Comment 6 Tobias C. Berner freebsd_committer freebsd_triage 2018-12-27 06:09:24 UTC
(In reply to Alexander Kabaev from comment #5)
Would be great if it were fixed in libc++, because at the moment I cannot see a clean way to do it.
We can either 
* also patch dependent software like akonadi to be c++17 compatible, and who knows how many others, 
* or including a separate implementation of optional in the port, 
* or port the whole thing away from optional.

Neither of them sounds ideal.
Comment 7 Dimitry Andric freebsd_committer freebsd_triage 2018-12-27 10:28:19 UTC
(In reply to Alexander Kabaev from comment #5)
> (In reply to Tobias C. Berner from comment #4)
> I suspect libc++ is wrong here, as it single-handedly removed
> experimental/optional from all C++ clients, even ones that are _not_ c++17
> compatible.

I disagree.  Those headers, and their implementations were explicitly marked as "experimental", which clearly means that you *cannot* count on 1) those headers to keep on existing, and 2) their functionality staying the same.

If software is taking the risk of relying on experimental headers, then maybe it is better to not import them into FreeBSD's base system at all?  That would force people to wait until the standards have been finalized.
Comment 8 Dimitry Andric freebsd_committer freebsd_triage 2018-12-27 10:29:01 UTC
(In reply to Tobias C. Berner from comment #4)
> It seems the fix is a bit messier than hoped for. 
> Pushing for std=c++17 will mean hitting removed auto_ptr in kf5-akonadi.
> 
> dim:
> https://github.com/KDE/kmail/blob/master/agents/unifiedmailboxagent/utils.
> h#L27

Hm, I don't see why that header needs <optional> at all?  It does not use std::optional anywhere, so maybe just remove the (seemingly) unnecessary include?
Comment 9 Tobias C. Berner freebsd_committer freebsd_triage 2018-12-27 10:52:14 UTC
(In reply to Dimitry Andric from comment #8)
* It includes <experimental/optional> which errors out on current
* we can switch it to use <optional> on current
* but <optional> can only be included with c++ > 14
* if c++17 is set auto_ptr is invalid => other issues
Comment 10 commit-hook freebsd_committer freebsd_triage 2018-12-29 23:07:54 UTC
A commit references this bug:

Author: tcberner
Date: Sat Dec 29 23:07:17 UTC 2018
New revision: 488694
URL: https://svnweb.freebsd.org/changeset/ports/488694

Log:
  deskutils/kmail: include optional.h from boost to fix build on recent CURRENT

  On FreeBSD Current optional is no longer in experimental/optional.
  Further, switching  to c++17 to use it, would require changes to
  databases/akonadi to no longer use auto_ptr.

  As this all would be a hassle, follow what upstream has done for a
  similar problem with akonadi on Windows [1]: Import a 3rdparty optional.h
  and use that.

  [1] https://github.com/KDE/akonadi/commit/482315f4cbc79d3725738fa1e62c8e0ce053bdea

  PR:             234022

Changes:
  head/deskutils/kmail/files/
  head/deskutils/kmail/files/patch-agents_unifiedmailboxagent_boost__optional.h
  head/deskutils/kmail/files/patch-agents_unifiedmailboxagent_utils.h