[SERVER-85779] Build failure with C++20 due to use of unary_function in boost Created: 26/Jan/24 Updated: 30/Jan/24 |
|
| Status: | Needs Scheduling |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 7.0.5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ryan Schmidt | Assignee: | Thomas Langston |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Assigned Teams: |
Build
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Building mongodb 7.0.5 on macOS 14.2.1 with Xcode 15.2 fails because you appear to be using C++20 mode and your bundled boost uses
which was removed from the language as of C++17. See https://github.com/boostorg/functional/pull/21 |
| Comments |
| Comment by Daniel Moody [ 30/Jan/24 ] | |
|
boost officially added this define to there configuration in boost >= 1.80.0, so we should add this as always defined in our build and/or upgrade boost: https://github.com/boostorg/config/commit/a7cfad38eae88cf72da8bffadd6098980f427ff7 | |
| Comment by Ryan Schmidt [ 27/Jan/24 ] | |
|
Thank you, that suggestion does work around the bug. Can you make your build system apply that automatically so users don't have to specify it manually? I may be wrong about it affecting all macOS versions. What I meant is it is not dependent on the OS version; it's dependent on the compiler. The compilers in some versions of Xcode might not have this issue, but for example a user on macOS 13 could experience the problem if they upgrade to Xcode 15 (and recall that Apple loves pushing out updates to App Store apps automatically) or a user on any OS could experience the problem if they use a newer clang that they've installed separately. | |
| Comment by Ryan Schmidt [ 26/Jan/24 ] | |
|
Thanks, I will try your suggestion. The issue affects all macOS versions. | |
| Comment by Daniel Moody [ 26/Jan/24 ] | |
|
ryandesign Also note that macos 14 is not "supported" platform for mongodb 7.0, but it may still work, we just don't have test coverage for it yet | |
| Comment by Daniel Moody [ 26/Jan/24 ] | |
|
ryandesign to workaround this issue, you can add the argument on the scons command line:
This will cause boost to not try to use that function. |