[SERVER-58746] Build failure on macOS 10.12; mongodb 5.0.0 requires macOS 10.13+? Created: 22/Jul/21  Updated: 29/Oct/23  Resolved: 26/Jul/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 5.0.0
Fix Version/s: 5.0.2, 5.1.0-rc0

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

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Sprint: Dev Platform 2021-07-26
Participants:

 Description   

SConstruct currently enforces a requirement of macOS 10.12 or later:

https://github.com/mongodb/mongo/blob/master/SConstruct#L2853-L2881

In fact, mongodb 5.0.0 appears to require macOS 10.13 or later; trying to compile on macOS 10.12 fails. There are many errors, beginning with:

src/mongo/logv2/plain_formatter.cpp:127:21: error: 'any_cast<const std::__1::basic_string<char> &>' is unavailable: introduced in macOS 10.13
 return std::any_cast<const T&>(_storage.emplace_back(std::forward<T>(val)));
 ^
src/mongo/logv2/plain_formatter.cpp:122:31: note: in instantiation of function template specialization 'mongo::logv2::(anonymous namespace)::TextValueExtractor::_store<std::__1::basic_string<char> >' requested here
 _add(name, StringData{_store(std::move(val))});
 ^
/opt/local/libexec/llvm-9.0/bin/../include/c++/v1/any:596:12: note: 'any_cast<const std::__1::basic_string<char> &>' has been explicitly marked unavailable here
_ValueType any_cast(any & __v)
 ^

Here is the full build log:

https://build.macports.org/builders/ports-10.12_x86_64-builder/builds/153834/steps/install-port/logs/stdio

If you can continue to support macOS 10.12 that would be great. If not, you could update SConstruct to error out on macOS 10.12.



 Comments   
Comment by Andrew Morrow (Inactive) [ 09/Nov/21 ]

ryandesign - Yes, I think that is a decent plan for now. I wasn't very closely involved with this reformulation of our release strategy, so I'm checking in with some people who were with the aim of putting together some additional public details on how external packagers should approach it. For instance, it may make sense to package it as a development or unstable release, if the ecosystem in question supports that.

Comment by Ryan Schmidt [ 09/Nov/21 ]

Thanks! So if we want to stick with stable supported releases, we should now only package versions of mongodb where the second number in the version number is 0?

Comment by Andrew Morrow (Inactive) [ 09/Nov/21 ]

ryandesign - Also, you will probably encounter SERVER-61304 if you decide you do want to package 5.1, so you might want to wait on a fix for that as well.

Comment by Andrew Morrow (Inactive) [ 09/Nov/21 ]

ryandesign - Yes, that's not surprising that eventually a real dependency arrived, since there was nothing to prevent it.

Meanwhile, you should consider whether packaging 5.1 is appropriate given the new release strategy. It isn't really intended for use outside Atlas, our DBaaS: https://www.mongodb.com/blog/post/new-quarterly-releases-starting-with-mongodb-5-0.

Comment by Ryan Schmidt [ 09/Nov/21 ]

And just to close this out, mongodb 5.1.0 now does require macOS 10.14 or newer to build. On 10.13 it says:

In file included from src/mongo/db/s/resharding/resharding_metrics.cpp:32:
In file included from /opt/local/libexec/llvm-9.0/bin/../include/c++/v1/algorithm:643:
/opt/local/libexec/llvm-9.0/bin/../include/c++/v1/memory:2338:5: error: aligned deallocation function of type 'void (void *, std::size_t, std::align_val_t) noexcept' is only available on macOS 10.14 or newer
 delete __ptr;
 ^

Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 28/Jul/21 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-58746 Set minimum OSX build requirement to 10.14

(cherry picked from commit a6f432b4970ab1d80a418f3f1ccf53cf0e0c9fc4)
Branch: v5.0
https://github.com/mongodb/mongo/commit/d6705c78975ecab7ade89a7676a75fa6277949fd

Comment by Ryan Egesdahl (Inactive) [ 26/Jul/21 ]

ryandesign I've merged the change acm described above. Unfortunately, it won't be effective in released source code packages until the next v5.0 release goes out, which is likely to be a while. The commit should be listed for you in the ticket above if you need a patch.

Comment by Githook User [ 26/Jul/21 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-58746 Set minimum OSX build requirement to 10.14
Branch: master
https://github.com/mongodb/mongo/commit/a6f432b4970ab1d80a418f3f1ccf53cf0e0c9fc4

Comment by Andrew Morrow (Inactive) [ 23/Jul/21 ]

ryandesign - Yes, the v5.0 branch probably (currently) does build fine on 10.13. The decision to set the minimum to 10.14 is more of a product driven decision than a technical one, in that we have a sliding window of prior releases of macOS we declare support for, and that gets updated on every major release. So 10.13 has slipped out of that window for 5.0, and since we aren't necessarily testing against it in CI, we don't want to declare support only to have it regress, as it could if a fix were backported to v5.0 that broke compatibility. I realize that this probably isn't the most satisfying answer from a packaging perspective, since I would expect that you quite reasonably would like to support as many platforms as possible on purely technical merits. However, our understanding is that more than 80% of macOS deployments are running 10.14 or newer, and that number will only continue to grow. So my recommendation would just be to only release 5.0 for 10.14+.

Comment by Ryan Schmidt [ 22/Jul/21 ]

It builds fine on 10.13 FYI.

Comment by Andrew Morrow (Inactive) [ 22/Jul/21 ]

ryandesign - Thank you for letting us know, this is definitely an oversight on our part. The intended minimum macOS version for MongoDB 5.0 is actually 10.14. That requirement is correctly enforced in the pre-built binaries we ship, but the SConstruct was not updated to enforce it for source builds. We will get that corrected.

Generated at Thu Feb 08 05:45:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.