[MacPorts] #38334: mongodb @2.2.3 unable to link with libmongoclient.a
#38334: mongodb @2.2.3 unable to link with libmongoclient.a --------------------+-------------------------------- Reporter: ralf@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Keywords: | Port: mongodb --------------------+-------------------------------- After updating to the current version of mongodb I'm unable to link my application with libmongodb.a To make it reproducible I tried to compile the attached micro example (see x.cpp): {{{ clang++ -I /opt/local/include/ -L /opt/local/lib -lboost_system-mt -l boost_filesystem-mt -lboost_thread-mt -lmongoclient x.cpp Undefined symbols for architecture x86_64: "boost::filesystem2::detail::status_api(std::string const&, boost::system::error_code&)", referenced from: ... }}} When I compile the mongodb package I can see it compiles against an own version of boost - that is not compatible with the installed boost provided by macports. I copied this version and linked my example against this version - this worked but it is plain stupid. I read the comments about the incompatibility between mongodb and boost. So yes - I know there is a problem. Anyway: Is there a supposed/supported way to actually use libmongoclient.a or is this file a mere placeholder currently? I could live with using an older version of boost for my application, I could even live with an older version of libmongodb - but a broken binary is way too hard to deal with. -- Ticket URL: <https://trac.macports.org/ticket/38334> MacPorts <http://www.macports.org/> Ports system for OS X
#38334: mongodb @2.2.3 unable to link with libmongoclient.a ----------------------+-------------------------------- Reporter: ralf@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: mongodb | ----------------------+-------------------------------- Comment (by ralf@…): all occurrences of "libmongodb.a" above are meant to be "libmongoclient.a" ;) -- Ticket URL: <https://trac.macports.org/ticket/38334#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#38334: mongodb @2.2.3 unable to link with libmongoclient.a ----------------------+-------------------------- Reporter: ralf@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: mongodb | ----------------------+-------------------------- Changes (by macsforever2000@…): * owner: macports-tickets@… => ryandesign@… Comment: In the future, please Cc the port maintainer(s). -- Ticket URL: <https://trac.macports.org/ticket/38334#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#38334: mongodb @2.2.3 unable to link with libmongoclient.a ----------------------+-------------------------- Reporter: ralf@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: mongodb | ----------------------+-------------------------- Comment (by ralf@…): Replying to [comment:2 macsforever2000@…]:
In the future, please Cc the port maintainer(s).
Sorry for that. -- Ticket URL: <https://trac.macports.org/ticket/38334#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#38334: mongodb @2.2.3 unable to link with libmongoclient.a ----------------------+-------------------------- Reporter: ralf@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: mongodb | ----------------------+-------------------------- Comment (by ryandesign@…): Apologies for this. I must admit I was unaware of the existence of libmongoclient.a or that using it required a copy of the same version of boost as was used to build mongodb. Boost is one of those libraries that changes in major ways from version to version, and often in ways that break other software that uses it. So it seems common for developers to bundle a version of boost that works for them and to use that. In MacPorts we usually try not to use bundled libraries since usually it's a waste of time and disk space to build them when we already have working ports for those libraries, but boost seems to be an exception to the rule. I used to have the mongodb port using the MacPorts boost, but when boost was upgraded to version 1.50.0, mongodb no longer compiled, and I fixed it by using the bundled boost instead; see #35118 for more about that. In this specific case, the way that the boost upgrade broke mongodb is that mongodb uses the boost filesystem API version 2, and in version 1.50.0, after having been deprecated for several versions, filesystem v2 was finally removed, leaving only filesystem v3. [https://jira.mongodb.org/browse/SERVER-4314 Mongodb ticket 4314] tracks the need for the mongodb developers to port their code to boost filesystem v3. That ticket says it was [https://github.com/mongodb/mongo/commit/b3b1949de30b5dc1bde3d91aa197a8587d17... fixed in October 2012] and will be included in mongodb 2.3.0. So you could downgrade to boost 1.49.0 or older, or try a development version of mongodb, or encourage the developers to release version 2.3.0. Or we could see whether we can port that change back to mongodb 2.2.3 and include it in our port. -- Ticket URL: <https://trac.macports.org/ticket/38334#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#38334: mongodb @2.2.3 unable to link with libmongoclient.a ----------------------+-------------------------- Reporter: ralf@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: mongodb | ----------------------+-------------------------- Comment (by ralf@…): I currently try to downgrade to boost 1.49.0 - this takes a minute as my internet connection currently is a bit bad. Thank you very much for the explanation. -- Ticket URL: <https://trac.macports.org/ticket/38334#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#38334: mongodb @2.2.3 unable to link with libmongoclient.a ----------------------+-------------------------- Reporter: ralf@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: mongodb | ----------------------+-------------------------- Comment (by ryandesign@…): mongodb 2.4.0 was released, so updating the port to that version (#38445) should resolve this issue. -- Ticket URL: <https://trac.macports.org/ticket/38334#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#38334: mongodb @2.2.3 unable to link with libmongoclient.a ----------------------+-------------------------- Reporter: ralf@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: mongodb | ----------------------+-------------------------- Comment (by ryandesign@…): Updated to 2.4.0 in r104216 but still using the bundled boost, which still seems to be version 1.49.0. Does it now work for you? It doesn't for me; your reproduction recipe above still fails for me, with the errors now referencing missing filesystem v3 symbols instead of missing filesystem v2 symbols. We could try to switch mongodb back to using MacPorts boost, now that mongodb is supposed to be compatible with boost filesystem v3. Presumably that would also speed up the mongodb build since it wouldn't have to build its own copy of boost. -- Ticket URL: <https://trac.macports.org/ticket/38334#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#38334: mongodb @2.2.3 unable to link with libmongoclient.a ----------------------+-------------------------- Reporter: ralf@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: haspatch Port: mongodb | ----------------------+-------------------------- Changes (by ryandesign@…): * cc: alexander.afanasyev@… (added) * keywords: => haspatch Comment: Replying to [comment:7 ryandesign@…]:
We could try to switch mongodb back to using MacPorts boost, now that mongodb is supposed to be compatible with boost filesystem v3.
Duplicate #38900 has a [attachment:ticket:38900:mongodb-Portfile.patch patch] to do this. -- Ticket URL: <https://trac.macports.org/ticket/38334#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
#38334: mongodb @2.2.3 unable to link with libmongoclient.a ----------------------+-------------------------- Reporter: ralf@… | Owner: ryandesign@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: haspatch Port: mongodb | ----------------------+-------------------------- Comment (by alexander.afanasyev@…): I see. I agree that it is possible that compilation can break again in the future (but hopefully API is getting more stable over time). At the same time, when mongodb is using internal boost libraries, there no point of installing the library, since it cannot be used. At least, I'm not sure how to make it work unless I manually get the source of mongodb, then extract the specific version of boost, then use this version to compile my custom code... -- Ticket URL: <https://trac.macports.org/ticket/38334#comment:9> MacPorts <http://www.macports.org/> Ports system for OS X
#38334: mongodb @2.2.3 unable to link with libmongoclient.a ----------------------+-------------------------- Reporter: ralf@… | Owner: ryandesign@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: fixed | Keywords: haspatch Port: mongodb | ----------------------+-------------------------- Changes (by ryandesign@…): * status: new => closed * resolution: => fixed Comment: Right, as I mentioned [comment:4 above], for your own code, you would have to use the same version of boost that mongodb uses, which was 1.49.0. However, I have now made the change in r105531 along with updating mongodb to 2.4.3, so mongodb is now again using MacPorts boost and you should be able to use libmongoclient.a in your code using MacPorts boost. I tested the attached [attachment:x.cpp x.cpp] and it now compiles. -- Ticket URL: <https://trac.macports.org/ticket/38334#comment:10> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts