[SERVER-26651] error: chosen constructor is explicit in copy-initialization Created: 15/Oct/16  Updated: 28/Oct/16  Resolved: 28/Oct/16

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: 3.2.10
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Ryan Schmidt Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Sprint: Platforms 2016-10-31
Participants:

 Description   

Hello,

mongodb 3.2.10 does not build with the version of clang included with the latest version of Xcode compatible with OS X versions 10.7, 10.8 or 10.9:

src/mongo/dbtests/index_access_method_test.cpp:42:16: error: chosen constructor is explicit in copy-initialization
    BSONObjSet left = {};
               ^      ~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/set:428:14: note: constructor declared here
    explicit set(const value_compare& __comp = value_compare())
             ^
src/mongo/dbtests/index_access_method_test.cpp:43:16: error: chosen constructor is explicit in copy-initialization
    BSONObjSet right = {};
               ^       ~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/set:428:14: note: constructor declared here
    explicit set(const value_compare& __comp = value_compare())
             ^
src/mongo/dbtests/index_access_method_test.cpp:50:16: error: chosen constructor is explicit in copy-initialization
    BSONObjSet left = {};
               ^      ~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/set:428:14: note: constructor declared here
    explicit set(const value_compare& __comp = value_compare())
             ^
src/mongo/dbtests/index_access_method_test.cpp:59:16: error: chosen constructor is explicit in copy-initialization
    BSONObjSet right = {};
               ^       ~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/set:428:14: note: constructor declared here
    explicit set(const value_compare& __comp = value_compare())
             ^

This problem was reported to MacPorts here: https://trac.macports.org/ticket/52611

mongodb 3.2.9 did not have this problem.

mongodb 3.2.10 builds fine on OS X 10.10 and later.



 Comments   
Comment by Andrew Morrow (Inactive) [ 28/Oct/16 ]

ryandesign - I've marked SERVER-23974 to request backport to the 3.2 branch. Assuming this backport is approved, an upcoming version of 3.2 should contain the fix. In the meantime, I think MacPorts can go ahead with patching in the necessary changes until that lands.

Please feel free to re-open the ticket if you have further questions.

Comment by Andrew Morrow (Inactive) [ 25/Oct/16 ]

ryandesign - Were you able to confirm the above fixes for 3.2?

Comment by Andrew Morrow (Inactive) [ 19/Oct/16 ]

ryandesign - In particular, this is the fix from SERVER-23974 of interest (only relevant parts here are changes to src/mongo/dbtests/index_access_method_test.cpp): https://github.com/mongodb/mongo/commit/2f708de73326bfa6aef14169888c23ccdd3345d1. Could you try cherry-picking it in on your v3.2 branch and confirming that it fixes the issue for you? If so it would be fairly easy for us to do the same on our side.

Comment by Andrew Morrow (Inactive) [ 19/Oct/16 ]

ryandesign - I believe this is a bug in the system libc++ on older versions of OS X. As you note, it compiles fine on 10.10 with XCode 8, and the code appears correct to me. Could you try changing the offending instances to read:

BSONObjSet xxx{};

And see if this fixes it for you? If so, I think we could probably just backport the work done in SERVER-23974, where we explicitly added support for much older clang, to the v3.2 branch.

Also, I note that all of the offending instances are within a test. Is it MacPorts policy to build and run tests as part of packaging a project? Perhaps you could just not build the dbtests when doing the build? What SCons target does the MacPorts MongoDB 3.2 recipe build when it invokes SCons?

Comment by Ramon Fernandez Marina [ 15/Oct/16 ]

Thanks for reporting this ryandesign, we'll take a look.

Generated at Thu Feb 08 04:12:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.