git: 1236852dbf99 - 2026Q1 - databases/mongodb70: fix build with clang 21
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 24 Feb 2026 09:34:05 UTC
The branch 2026Q1 has been updated by ronald:
URL: https://cgit.FreeBSD.org/ports/commit/?id=1236852dbf99c4c5a69db112117d71e8ff2a09d8
commit 1236852dbf99c4c5a69db112117d71e8ff2a09d8
Author: Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2026-02-20 13:00:22 +0000
Commit: Ronald Klop <ronald@FreeBSD.org>
CommitDate: 2026-02-24 09:33:14 +0000
databases/mongodb70: fix build with clang 21
With clang 21 databases/mongodb70 fails to build, with errors similar to:
In file included from src/third_party/boost/libs/log/src/default_sink.cpp:20:
In file included from src/third_party/boost/boost/thread/locks.hpp:10:
In file included from src/third_party/boost/boost/thread/lock_algorithms.hpp:11:
In file included from src/third_party/boost/boost/thread/lock_types.hpp:18:
In file included from src/third_party/boost/boost/thread/thread_time.hpp:11:
In file included from src/third_party/boost/boost/date_time/posix_time/posix_time_types.hpp:16:
In file included from src/third_party/boost/boost/date_time/posix_time/posix_time_duration.hpp:15:
In file included from src/third_party/boost/boost/numeric/conversion/cast.hpp:33:
In file included from src/third_party/boost/boost/numeric/conversion/converter.hpp:13:
In file included from src/third_party/boost/boost/numeric/conversion/conversion_traits.hpp:13:
In file included from src/third_party/boost/boost/numeric/conversion/detail/conversion_traits.hpp:18:
In file included from src/third_party/boost/boost/numeric/conversion/detail/int_float_mixture.hpp:19:
In file included from src/third_party/boost/boost/mpl/integral_c.hpp:32:
src/third_party/boost/boost/mpl/aux_/integral_wrapper.hpp:62:51: error: in-class initializer for static data member is not a constant expression
62 | BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/third_party/boost/boost/config/detail/suffix.hpp:394:72: note: expanded from macro 'BOOST_STATIC_CONSTANT'
394 | # define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment
| ^~~~~~~~~~
src/third_party/boost/boost/log/utility/strictest_lock.hpp:70:53: note: in instantiation of template class 'mpl_::integral_c<boost::log::lock_access_mode, boost::log::unlocked_access>' requested here
70 | struct thread_access_mode_of< no_lock< MutexT > > : mpl::integral_c< lock_access_mode, unlocked_access >
| ^
src/third_party/boost/boost/mpl/aux_/integral_wrapper.hpp:62:65: note: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'lock_access_mode'
62 | BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));
| ^
src/third_party/boost/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
24 | # define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
| ^
There are two of these cases in the vendored copy of boost in mongodb70,
which have been fixed in boost upstream:
* https://github.com/boostorg/numeric_conversion/commit/50a1eae
* https://github.com/boostorg/log/commit/77f1e20
To fix the errors, port these patches back to the vendored boost.
PR: 293230
MFH: 2026Q1
(cherry picked from commit ab1af9dff06a3eab6e485a27a6eceb7d13d2c50e)
---
...rty_boost_boost_log_utility_strictest__lock.hpp | 70 ++++++++++++++++++++++
...meric_conversion_detail_int__float__mixture.hpp | 23 +++++++
...ost_numeric_conversion_detail_sign__mixture.hpp | 23 +++++++
...ric_conversion_detail_udt__builtin__mixture.hpp | 23 +++++++
4 files changed, 139 insertions(+)
diff --git a/databases/mongodb70/files/patch-src_third__party_boost_boost_log_utility_strictest__lock.hpp b/databases/mongodb70/files/patch-src_third__party_boost_boost_log_utility_strictest__lock.hpp
new file mode 100644
index 000000000000..1b6d245a824b
--- /dev/null
+++ b/databases/mongodb70/files/patch-src_third__party_boost_boost_log_utility_strictest__lock.hpp
@@ -0,0 +1,70 @@
+--- src/third_party/boost/boost/log/utility/strictest_lock.hpp.orig 2026-02-10 20:02:45 UTC
++++ src/third_party/boost/boost/log/utility/strictest_lock.hpp
+@@ -16,7 +16,7 @@
+ #ifndef BOOST_LOG_UTILITY_STRICTEST_LOCK_HPP_INCLUDED_
+ #define BOOST_LOG_UTILITY_STRICTEST_LOCK_HPP_INCLUDED_
+
+-#include <boost/mpl/integral_c.hpp>
++#include <boost/type_traits/integral_constant.hpp>
+ #include <boost/log/detail/config.hpp>
+ #include <boost/log/detail/locks.hpp>
+ #if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+@@ -67,49 +67,49 @@ template< typename MutexT >
+ struct thread_access_mode_of;
+
+ template< typename MutexT >
+-struct thread_access_mode_of< no_lock< MutexT > > : mpl::integral_c< lock_access_mode, unlocked_access >
++struct thread_access_mode_of< no_lock< MutexT > > : boost::integral_constant< lock_access_mode, unlocked_access >
+ {
+ };
+
+ #if !defined(BOOST_LOG_NO_THREADS)
+
+ template< typename MutexT >
+-struct thread_access_mode_of< lock_guard< MutexT > > : mpl::integral_c< lock_access_mode, exclusive_access >
++struct thread_access_mode_of< lock_guard< MutexT > > : boost::integral_constant< lock_access_mode, exclusive_access >
+ {
+ };
+
+ template< typename MutexT >
+-struct thread_access_mode_of< shared_lock_guard< MutexT > > : mpl::integral_c< lock_access_mode, shared_access >
++struct thread_access_mode_of< shared_lock_guard< MutexT > > : boost::integral_constant< lock_access_mode, shared_access >
+ {
+ };
+
+ template< typename MutexT >
+-struct thread_access_mode_of< unique_lock< MutexT > > : mpl::integral_c< lock_access_mode, exclusive_access >
++struct thread_access_mode_of< unique_lock< MutexT > > : boost::integral_constant< lock_access_mode, exclusive_access >
+ {
+ };
+
+ template< typename MutexT >
+-struct thread_access_mode_of< shared_lock< MutexT > > : mpl::integral_c< lock_access_mode, shared_access >
++struct thread_access_mode_of< shared_lock< MutexT > > : boost::integral_constant< lock_access_mode, shared_access >
+ {
+ };
+
+ template< typename MutexT >
+-struct thread_access_mode_of< upgrade_lock< MutexT > > : mpl::integral_c< lock_access_mode, shared_access >
++struct thread_access_mode_of< upgrade_lock< MutexT > > : boost::integral_constant< lock_access_mode, shared_access >
+ {
+ };
+
+ template< typename MutexT >
+-struct thread_access_mode_of< boost::log::aux::exclusive_lock_guard< MutexT > > : mpl::integral_c< lock_access_mode, exclusive_access >
++struct thread_access_mode_of< boost::log::aux::exclusive_lock_guard< MutexT > > : boost::integral_constant< lock_access_mode, exclusive_access >
+ {
+ };
+
+ template< typename MutexT >
+-struct thread_access_mode_of< boost::log::aux::shared_lock_guard< MutexT > > : mpl::integral_c< lock_access_mode, shared_access >
++struct thread_access_mode_of< boost::log::aux::shared_lock_guard< MutexT > > : boost::integral_constant< lock_access_mode, shared_access >
+ {
+ };
+
+ template< typename MutexT1, typename MutexT2 >
+-struct thread_access_mode_of< boost::log::aux::multiple_unique_lock2< MutexT1, MutexT2 > > : mpl::integral_c< lock_access_mode, exclusive_access >
++struct thread_access_mode_of< boost::log::aux::multiple_unique_lock2< MutexT1, MutexT2 > > : boost::integral_constant< lock_access_mode, exclusive_access >
+ {
+ };
+
diff --git a/databases/mongodb70/files/patch-src_third__party_boost_boost_numeric_conversion_detail_int__float__mixture.hpp b/databases/mongodb70/files/patch-src_third__party_boost_boost_numeric_conversion_detail_int__float__mixture.hpp
new file mode 100644
index 000000000000..45f9e5cc2bae
--- /dev/null
+++ b/databases/mongodb70/files/patch-src_third__party_boost_boost_numeric_conversion_detail_int__float__mixture.hpp
@@ -0,0 +1,23 @@
+--- src/third_party/boost/boost/numeric/conversion/detail/int_float_mixture.hpp.orig 2026-02-10 20:02:45 UTC
++++ src/third_party/boost/boost/numeric/conversion/detail/int_float_mixture.hpp
+@@ -16,15 +16,15 @@
+ #include "boost/numeric/conversion/int_float_mixture_enum.hpp"
+ #include "boost/numeric/conversion/detail/meta.hpp"
+
+-#include "boost/mpl/integral_c.hpp"
++#include "boost/type_traits/integral_constant.hpp"
+
+ namespace boost { namespace numeric { namespace convdetail
+ {
+ // Integral Constants for 'IntFloatMixture'
+- typedef mpl::integral_c<int_float_mixture_enum, integral_to_integral> int2int_c ;
+- typedef mpl::integral_c<int_float_mixture_enum, integral_to_float> int2float_c ;
+- typedef mpl::integral_c<int_float_mixture_enum, float_to_integral> float2int_c ;
+- typedef mpl::integral_c<int_float_mixture_enum, float_to_float> float2float_c ;
++ typedef boost::integral_constant<int_float_mixture_enum, integral_to_integral> int2int_c ;
++ typedef boost::integral_constant<int_float_mixture_enum, integral_to_float> int2float_c ;
++ typedef boost::integral_constant<int_float_mixture_enum, float_to_integral> float2int_c ;
++ typedef boost::integral_constant<int_float_mixture_enum, float_to_float> float2float_c ;
+
+ // Metafunction:
+ //
diff --git a/databases/mongodb70/files/patch-src_third__party_boost_boost_numeric_conversion_detail_sign__mixture.hpp b/databases/mongodb70/files/patch-src_third__party_boost_boost_numeric_conversion_detail_sign__mixture.hpp
new file mode 100644
index 000000000000..50ae9c4c98ca
--- /dev/null
+++ b/databases/mongodb70/files/patch-src_third__party_boost_boost_numeric_conversion_detail_sign__mixture.hpp
@@ -0,0 +1,23 @@
+--- src/third_party/boost/boost/numeric/conversion/detail/sign_mixture.hpp.orig 2026-02-10 20:02:45 UTC
++++ src/third_party/boost/boost/numeric/conversion/detail/sign_mixture.hpp
+@@ -16,15 +16,15 @@
+ #include "boost/numeric/conversion/sign_mixture_enum.hpp"
+ #include "boost/numeric/conversion/detail/meta.hpp"
+
+-#include "boost/mpl/integral_c.hpp"
++#include "boost/type_traits/integral_constant.hpp"
+
+ namespace boost { namespace numeric { namespace convdetail
+ {
+ // Integral Constants for 'SignMixture'
+- typedef mpl::integral_c<sign_mixture_enum, unsigned_to_unsigned> unsig2unsig_c ;
+- typedef mpl::integral_c<sign_mixture_enum, signed_to_signed> sig2sig_c ;
+- typedef mpl::integral_c<sign_mixture_enum, signed_to_unsigned> sig2unsig_c ;
+- typedef mpl::integral_c<sign_mixture_enum, unsigned_to_signed> unsig2sig_c ;
++ typedef boost::integral_constant<sign_mixture_enum, unsigned_to_unsigned> unsig2unsig_c ;
++ typedef boost::integral_constant<sign_mixture_enum, signed_to_signed> sig2sig_c ;
++ typedef boost::integral_constant<sign_mixture_enum, signed_to_unsigned> sig2unsig_c ;
++ typedef boost::integral_constant<sign_mixture_enum, unsigned_to_signed> unsig2sig_c ;
+
+ // Metafunction:
+ //
diff --git a/databases/mongodb70/files/patch-src_third__party_boost_boost_numeric_conversion_detail_udt__builtin__mixture.hpp b/databases/mongodb70/files/patch-src_third__party_boost_boost_numeric_conversion_detail_udt__builtin__mixture.hpp
new file mode 100644
index 000000000000..9af692a1f48e
--- /dev/null
+++ b/databases/mongodb70/files/patch-src_third__party_boost_boost_numeric_conversion_detail_udt__builtin__mixture.hpp
@@ -0,0 +1,23 @@
+--- src/third_party/boost/boost/numeric/conversion/detail/udt_builtin_mixture.hpp.orig 2026-02-10 20:02:45 UTC
++++ src/third_party/boost/boost/numeric/conversion/detail/udt_builtin_mixture.hpp
+@@ -15,15 +15,15 @@
+ #include "boost/numeric/conversion/udt_builtin_mixture_enum.hpp"
+ #include "boost/numeric/conversion/detail/meta.hpp"
+
+-#include "boost/mpl/integral_c.hpp"
++#include "boost/type_traits/integral_constant.hpp"
+
+ namespace boost { namespace numeric { namespace convdetail
+ {
+ // Integral Constants for 'UdtMixture'
+- typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_builtin> builtin2builtin_c ;
+- typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_udt> builtin2udt_c ;
+- typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_builtin> udt2builtin_c ;
+- typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_udt> udt2udt_c ;
++ typedef boost::integral_constant<udt_builtin_mixture_enum, builtin_to_builtin> builtin2builtin_c ;
++ typedef boost::integral_constant<udt_builtin_mixture_enum, builtin_to_udt> builtin2udt_c ;
++ typedef boost::integral_constant<udt_builtin_mixture_enum, udt_to_builtin> udt2builtin_c ;
++ typedef boost::integral_constant<udt_builtin_mixture_enum, udt_to_udt> udt2udt_c ;
+
+ // Metafunction:
+ //