Bug 269024 - databases/mongodb50 Does not compile wth boost-libs 1.81.0
Summary: databases/mongodb50 Does not compile wth boost-libs 1.81.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ronald Klop
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-18 08:50 UTC by Borja Marcos
Modified: 2023-01-20 14:11 UTC (History)
4 users (show)

See Also:
ronald: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Borja Marcos 2023-01-18 08:50:57 UTC
Compilation aborts with an error. It works with boost 1.80.0



6 errors generated.
scons: *** [build/59f4f0dd/mongo/db/matcher/expression_geo.o] Error 1
In file included from src/third_party/mozjs-60/platform/x86_64/freebsd/build/Unified_cpp_js_src32.cpp:11:
In file included from src/third_party/mozjs-60/extract/js/src/vm/Debugger.cpp:7:
In file included from src/third_party/mozjs-60/extract/js/src/vm/Debugger-inl.h:10:
In file included from src/third_party/mozjs-60/extract/js/src/vm/Debugger.h:20:
In file included from src/third_party/mozjs-60/extract/js/src/gc/WeakMap.h:18:
In file included from src/third_party/mozjs-60/extract/js/src/vm/JSCompartment.h:24:
In file included from src/third_party/mozjs-60/extract/js/src/vm/GlobalObject.h:17:
In file included from src/third_party/mozjs-60/extract/js/src/vm/ErrorObject.h:13:
In file included from src/third_party/mozjs-60/extract/js/src/vm/SavedStacks.h:11:
src/third_party/mozjs-60/include/mozilla/FastBernoulliTrial.h:368:21: warning: implicit conversion from 'unsigned long' to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Wimplicit-const-int-float-conversion]
    if (skipCount < SIZE_MAX)
                  ~ ^~~~~~~~
/usr/include/x86/_stdint.h:178:18: note: expanded from macro 'SIZE_MAX'
#define SIZE_MAX        UINT64_MAX
                        ^~~~~~~~~~
/usr/include/x86/_stdint.h:91:20: note: expanded from macro 'UINT64_MAX'
#define UINT64_MAX      0xffffffffffffffff
                        ^~~~~~~~~~~~~~~~~~
1 warning generated.
1 warning generated.
1 warning generated.
scons: building terminated because of errors.
build/59f4f0dd/mongo/db/matcher/expression_geo.o failed: Error 1
*** Error code 2

Stop.
make[1]: stopped in /usr/ports/databases/mongodb50
*** Error code 1

Stop.
make: stopped in /usr/ports/databases/mongodb50
Comment 1 Ronald Klop freebsd_committer freebsd_triage 2023-01-18 15:55:23 UTC
I've seen the issue. A little lack of time these days so patches are welcome. Otherwise I might switch the port to the embedded boost in the mongodb sources.
Comment 2 Einar Bjarni Halldórsson 2023-01-18 22:57:32 UTC
Just decided to upgrade mongodb42 -> 50 today so started building and got hit by this bug.
Comment 3 peter.sopko+freebsd.org 2023-01-19 10:04:54 UTC
I end up with some other errors, so I fear there may be multiple issues :/ 

In file included from src/mongo/db/matcher/expression_geo.cpp:32:
In file included from src/mongo/db/matcher/expression_geo.h:36:
In file included from src/mongo/db/matcher/expression.h:42:
In file included from src/mongo/db/matcher/matchable.h:34:
In file included from src/mongo/db/field_ref.h:32:
In file included from /usr/local/include/boost/container/small_vector.hpp:26:
/usr/local/include/boost/container/container_fwd.hpp:196:7: error: cannot define or redeclare 'unordered_set' here because namespace 'container' does not enclose namespace 'std'
class hash_set;
      ^~~~~~~~
src/third_party/s2/hash.h:8:23: note: expanded from macro 'hash_set'
#define hash_set std::unordered_set
                 ~~~~~^
In file included from src/mongo/db/matcher/expression_geo.cpp:32:
In file included from src/mongo/db/matcher/expression_geo.h:36:
In file included from src/mongo/db/matcher/expression.h:42:
In file included from src/mongo/db/matcher/matchable.h:34:
In file included from src/mongo/db/field_ref.h:32:
In file included from /usr/local/include/boost/container/small_vector.hpp:26:
/usr/local/include/boost/container/container_fwd.hpp:190:1: error: too many template parameters in template redeclaration
template <class Key
^~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/unordered_set:409:1: note: previous template declaration is here
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/mongo/db/matcher/expression_geo.cpp:32:
In file included from src/mongo/db/matcher/expression_geo.h:36:
In file included from src/mongo/db/matcher/expression.h:42:
In file included from src/mongo/db/matcher/matchable.h:34:
In file included from src/mongo/db/field_ref.h:32:
In file included from /usr/local/include/boost/container/small_vector.hpp:26:
/usr/local/include/boost/container/container_fwd.hpp:209:7: error: cannot define or redeclare 'unordered_map' here because namespace 'container' does not enclose namespace 'std'
class hash_map;
      ^~~~~~~~
src/third_party/s2/hash.h:5:23: note: expanded from macro 'hash_map'
#define hash_map std::unordered_map
                 ~~~~~^
In file included from src/mongo/db/matcher/expression_geo.cpp:32:
In file included from src/mongo/db/matcher/expression_geo.h:36:
In file included from src/mongo/db/matcher/expression.h:42:
In file included from src/mongo/db/matcher/matchable.h:34:
In file included from src/mongo/db/field_ref.h:32:
In file included from /usr/local/include/boost/container/small_vector.hpp:26:
/usr/local/include/boost/container/container_fwd.hpp:206:28: error: template parameter redefines default argument
         ,class Compare  = std::less<Key>
                           ^
/usr/include/c++/v1/unordered_map:918:48: note: previous default template argument defined here
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
                                               ^
In file included from src/mongo/db/matcher/expression_geo.cpp:32:
In file included from src/mongo/db/matcher/expression_geo.h:36:
In file included from src/mongo/db/matcher/expression.h:42:
In file included from src/mongo/db/matcher/matchable.h:34:
In file included from src/mongo/db/field_ref.h:32:
In file included from /usr/local/include/boost/container/small_vector.hpp:26:
/usr/local/include/boost/container/container_fwd.hpp:207:29: error: template parameter redefines default argument
         ,class Allocator = void
                            ^
/usr/include/c++/v1/unordered_map:918:74: note: previous default template argument defined here
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
                                                                         ^
In file included from src/mongo/db/matcher/expression_geo.cpp:32:
In file included from src/mongo/db/matcher/expression_geo.h:36:
In file included from src/mongo/db/matcher/expression.h:42:
In file included from src/mongo/db/matcher/matchable.h:34:
In file included from src/mongo/db/field_ref.h:32:
In file included from /usr/local/include/boost/container/small_vector.hpp:26:
/usr/local/include/boost/container/container_fwd.hpp:208:27: error: template parameter redefines default argument
         ,class Options = void >
                          ^
/usr/include/c++/v1/unordered_map:919:26: note: previous default template argument defined here
          class _Alloc = allocator<pair<const _Key, _Tp> > >
Comment 4 Ronald Klop freebsd_committer freebsd_triage 2023-01-19 12:22:34 UTC
Mongodb has a 5.0.15-rc0. Trying a build now to check if that helps this issue.
Comment 5 Ronald Klop freebsd_committer freebsd_triage 2023-01-20 10:06:23 UTC
Made a patch in review D38134.
Comment 6 commit-hook freebsd_committer freebsd_triage 2023-01-20 14:08:14 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d04cd83954fab0573cd898dfcde840219e34aef2

commit d04cd83954fab0573cd898dfcde840219e34aef2
Author:     Ronald Klop <ronald@FreeBSD.org>
AuthorDate: 2023-01-20 10:02:11 +0000
Commit:     Ronald Klop <ronald@FreeBSD.org>
CommitDate: 2023-01-20 13:15:01 +0000

    databases/mongodb50: use in-source boost

    Does not compile with new boost 1.81.0 from ports.

    PR:     269024
    Approved by: rene (mentor)
    Differential Revision: https://reviews.freebsd.org/D38134

 databases/mongodb50/Makefile                       |  7 +--
 .../mongodb50/files/patch-boost-179-compat (gone)  | 70 ----------------------
 .../files/patch-boost-179-link-fix (gone)          | 21 -------
 3 files changed, 2 insertions(+), 96 deletions(-)
Comment 7 Ronald Klop freebsd_committer freebsd_triage 2023-01-20 14:11:04 UTC
Thanks for your input.