Bug 1540311 - mongodb FTBFS in rawhide with boost-1.66.0
Summary: mongodb FTBFS in rawhide with boost-1.66.0
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: mongodb
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Marek Skalický
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1540650 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-30 18:20 UTC by Jonathan Wakely
Modified: 2018-02-16 10:32 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-16 10:32:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jonathan Wakely 2018-01-30 18:20:07 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:


src/mongo/db/repl/oplog_fetcher.cpp: In function 'mongo::StatusWith<boost::optional<mongo::rpc::OplogQueryMetadata> > mongo::repl::{anonymous}::parseOplogQueryMetadata(mongo::Fetcher::QueryResponse)':
src/mongo/db/repl/oplog_fetcher.cpp:248:93: error: no matching function for call to 'make_optional<mongo::rpc::OplogQueryMetadata>(mongo::rpc::OplogQueryMetadata&)'
         oqMetadata = boost::make_optional<rpc::OplogQueryMetadata>(metadataResult.getValue());
                                                                                             ^
In file included from /usr/include/boost/optional.hpp:15:0,
                 from src/mongo/base/status_with.h:30,
                 from src/mongo/db/repl/oplog_fetcher.h:34,
                 from src/mongo/db/repl/oplog_fetcher.cpp:33:
/usr/include/boost/optional/optional.hpp:1367:56: note: candidate: template<class T> boost::optional<typename boost::decay<T>::type> boost::make_optional(T&&)
 optional<BOOST_DEDUCED_TYPENAME boost::decay<T>::type> make_optional ( T && v  )
                                                        ^~~~~~~~~~~~~
/usr/include/boost/optional/optional.hpp:1367:56: note:   template argument deduction/substitution failed:
The error is:

src/mongo/db/repl/oplog_fetcher.cpp:248:91: note:   cannot convert 'metadataResult.mongo::StatusWith<mongo::rpc::OplogQueryMetadata>::getValue()' (type 'mongo::rpc::OplogQueryMetadata') to type 'mongo::rpc::OplogQueryMetadata&&'
         oqMetadata = boost::make_optional<rpc::OplogQueryMetadata>(metadataResult.getValue());
                                                                    ~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from /usr/include/boost/optional.hpp:15:0,
                 from src/mongo/base/status_with.h:30,
                 from src/mongo/db/repl/oplog_fetcher.h:34,
                 from src/mongo/db/repl/oplog_fetcher.cpp:33:
/usr/include/boost/optional/optional.hpp:1375:56: note: candidate: template<class T> boost::optional<typename boost::decay<T>::type> boost::make_optional(bool, T&&)
 optional<BOOST_DEDUCED_TYPENAME boost::decay<T>::type> make_optional ( bool cond, T && v )
                                                        ^~~~~~~~~~~~~
/usr/include/boost/optional/optional.hpp:1375:56: note:   template argument deduction/substitution failed:
src/mongo/db/repl/oplog_fetcher.cpp:248:93: note:   candidate expects 2 arguments, 1 provided
         oqMetadata = boost::make_optional<rpc::OplogQueryMetadata>(metadataResult.getValue());
                                                                                             ^

This code is dumb, the point of make_optional(x) is to deduce the type from 'x', so saying make_optional<T>(x) to override it makes no sense, and doesn't even compile with the latest version of boost (because boost::optional now follows the same design as std::optional).


The upstream bug is https://jira.mongodb.org/browse/SERVER-32516

The fix is:

--- mongo-r3.6.2/src/mongo/db/repl/oplog_fetcher.cpp~   2018-01-30 18:19:15.398613407 +0000
+++ mongo-r3.6.2/src/mongo/db/repl/oplog_fetcher.cpp    2018-01-30 18:19:43.245561408 +0000
@@ -245,7 +245,7 @@
         if (!metadataResult.isOK()) {
             return metadataResult.getStatus();
         }
-        oqMetadata = boost::make_optional<rpc::OplogQueryMetadata>(metadataResult.getValue());
+        oqMetadata = boost::make_optional(metadataResult.getValue());
     }
     return oqMetadata;
 }

Comment 1 Jonathan Wakely 2018-01-30 18:26:20 UTC
Failed to scratch build:
https://koji.fedoraproject.org/koji/taskinfo?taskID=24513377

Comment 2 Jonathan Wakely 2018-01-31 17:02:43 UTC
Fixed upstream by:
https://github.com/mongodb/mongo/commit/3c34eda8d8a38b982a1659b919e9f4b5971ba512

Comment 3 Vít Ondruch 2018-02-01 08:31:19 UTC
*** Bug 1540650 has been marked as a duplicate of this bug. ***

Comment 4 Marek Skalický 2018-02-02 13:31:17 UTC
Thanks for reporting upstream fix for boost 1.66.

Unfortunately there is another problem caused probably by gcc8 which fails mongodb builds.
- https://github.com/chriskohlhoff/asio/issues/276


Note You need to log in before you can comment on or make changes to this bug.