Skip to content

[build] mongodb on SmartOS: g++ version #73

Description

@hww3

Hi,

I spent some time trying to figure out why mongodb packages aren't available on SmartOS. The solution is fairly simple yet likely would result in upheaval... I'd love for the change to be made but will settle for it being documented here.

It seems that mongodb requires g++ version 5.3 or higher, however all of its dependencies have no such requirement, so they use the default g++ version (4.9 iirc). This results in name mangling incompatibilities which prevents the mongo binaries from linking.

I was able to get it to build by changing the system minimum gcc version (GCC_REQD) to 5.3 and recompiling the C++ dependencies.

Is there any chance of (or plans to) increasing the minimum g++ (c libraries obviously don't have this sort of version incompatibility for the most part) version in future joyent build releases?

There are other possible solutions, as referenced in this developer list email, but they all seem pretty brittle and/or don't make the situation any better on smartos:

https://groups.google.com/forum/#!topic/mongodb-dev/NVDytnnOUhg

Bill

Activity

  1. jperkin commented on Jan 24, 2018

    @jperkin
    Collaborator

    It's something we will probably have to do at some point, but obviously it is a huge change so needs to be tested thoroughly. At present MongoDB is the only software that I'm aware of that requires a newer compiler than our current default of GCC 4.9.

    I switched our daily bulk builds over to GCC 6 a while back so that we can start to look at what the state of play is, and there is quite a lot of fallout from the default compilation environment changing from C89 to C11:

    http://us-east.manta.joyent.com/pkgsrc/public/reports/upstream-trunk64/20180124.0210/meta/report.html

    I've been working on fixing issues as they come up when time permits but the builds with GCC 6 are still quite far behind those done with GCC 4.9. At the same time I've recently been looking at what's involved in switching to Clang to see if that might be a better option if we're going to have to do a bunch of work either way.

    So, for now, we're still in a preparation and exploration phase. With only one piece of software requiring the upgrade we're not going to rush quickly into something that may cause regressions.

    Hope that helps explain the situation.

  2. hww3 commented on Jan 24, 2018

    @hww3
    Author

    That makes complete sense to me... switching compilers is not a change undertaken lightly. I'm not at all surprised I found the one package that has a problem!

    I was able to get packages built that will solve the problem for me in the short term, so I was mainly attempting to get the problem and resolution on record in case anyone else runs into the problem.

    I may go back through and see if it will build using 4.9. GCC 4.9 claims C++11 compliance which is what mongodb is supposedly tracking.

  3. mamash commented on Jan 24, 2018

    @mamash

    One other workaround would be to make sure all the MongoDB dependencies are built embedded. That's hardly a sanctioned approach in pkgsrc, but may be better than nothing. IIRC the MongoDB source tarball used to come with vendored sources for all (most?) deps and it was the default behavior.

    The other thing is that upstream has dropped all SunOS support recently and we might see ugly portability issues coming our way.

  4. hww3 commented on Jan 24, 2018

    @hww3
    Author

    I did attempt to build using the embedded dependencies and it didn't solve the problem (though the problem did move). I did not take the time to see if that was something that was easily fixable.

    Getting on my soapbox, it's a shame that they're no longer supporting SunOS, but that seems to be an unfortunate trend. I have run into a number of projects that pretend that no other OS exist aside from Linux; that Darwin even exists is a major thorn, let alone SunOS.

  5. added a commit that references this issue on Jan 28, 2018
  6. added a commit that references this issue on Mar 15, 2018
    2c86273
  7. added a commit that references this issue on Apr 5, 2018
  8. added 2 commits that reference this issue on Aug 16, 2018
  9. added a commit that references this issue on Sep 20, 2018
  10. added a commit that references this issue on Feb 2, 2019
  11. added a commit that references this issue on Jun 10, 2019
  12. 161 remaining items

  13. added a commit that references this issue on Jul 30, 2026
  14. added a commit that references this issue on Aug 25, 2026
  15. added a commit that references this issue on Sep 9, 2026
    96399e0
  16. added a commit that references this issue on Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions