diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Use-packaging-instead-of-pkg_resources-for-version-p.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Use-packaging-instead-of-pkg_resources-for-version-p.patch new file mode 100644 index 0000000000..d45b9f8021 --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Use-packaging-instead-of-pkg_resources-for-version-p.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 9 Nov 2026 07:45:00 -0800 +Subject: [PATCH] Use packaging instead of pkg_resources for version parsing + +pkg_resources has been removed from setuptools, so SConstruct fails to +load with: + + ModuleNotFoundError: No module named 'pkg_resources' + +Use parse() from the packaging module instead. + +Upstream-Status: Inappropriate [v4.4 branch is EOL] +Signed-off-by: Khem Raj +--- +diff --git a/SConstruct b/SConstruct +--- a/SConstruct ++++ b/SConstruct +@@ -16,7 +16,7 @@ + import uuid + from glob import glob + +-from pkg_resources import parse_version ++from packaging.version import parse as parse_version + + import SCons + +diff --git a/site_scons/site_tools/ccache.py b/site_scons/site_tools/ccache.py +--- a/site_scons/site_tools/ccache.py ++++ b/site_scons/site_tools/ccache.py +@@ -26,7 +26,7 @@ + import subprocess + + import SCons +-from pkg_resources import parse_version ++from packaging.version import parse as parse_version + + # This is the oldest version of ccache that offers support for -gsplit-dwarf + _ccache_version_min = parse_version("3.2.3") +diff --git a/site_scons/site_tools/icecream.py b/site_scons/site_tools/icecream.py +--- a/site_scons/site_tools/icecream.py ++++ b/site_scons/site_tools/icecream.py +@@ -25,7 +25,7 @@ + import subprocess + import urllib + +-from pkg_resources import parse_version ++from packaging.version import parse as parse_version + + import SCons + diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0002-SConstruct-Pass-call-to-CheckLibWithHeader-as-a-keyw.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0002-SConstruct-Pass-call-to-CheckLibWithHeader-as-a-keyw.patch new file mode 100644 index 0000000000..d4b5586a97 --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0002-SConstruct-Pass-call-to-CheckLibWithHeader-as-a-keyw.patch @@ -0,0 +1,56 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 9 Nov 2026 08:10:00 -0800 +Subject: [PATCH] SConstruct: Pass call to CheckLibWithHeader as a keyword + +Newer SCons added an extra_libs parameter to CheckLibWithHeader() ahead +of call, so the call snippet passed positionally is treated as a list of +extra libraries and each character becomes a -l option: + + ... -lcrypto -lS -lS -lL -le -la -ly ... -l( -l0 -l) -l; + Couldn't find OpenSSL crypto.h header and library + +Pass it as a keyword argument, which works with old and new SCons. + +Upstream-Status: Inappropriate [v4.4 branch is EOL] +Signed-off-by: Khem Raj +--- +diff --git a/SConstruct b/SConstruct +--- a/SConstruct ++++ b/SConstruct +@@ -3499,7 +3499,7 @@ + cryptoLibName, + ["openssl/crypto.h"], + "C", +- "SSLeay_version(0);", ++ call="SSLeay_version(0);", + autoadd=True): + maybeIssueDarwinSSLAdvice(conf.env) + conf.env.ConfError("Couldn't find OpenSSL crypto.h header and library") +@@ -3656,7 +3656,7 @@ + if conf.CheckLibWithHeader( + "curl", + ["curl/curl.h"], "C", +- "curl_global_init(0);", ++ call="curl_global_init(0);", + autoadd=False): + return True + +@@ -3782,7 +3782,7 @@ + "sasl2", + ["stddef.h","sasl/sasl.h"], + "C", +- "sasl_version_info(0, 0, 0, 0, 0, 0);", ++ call="sasl_version_info(0, 0, 0, 0, 0, 0);", + autoadd=False ): + myenv.ConfError("Couldn't find SASL header/libraries") + +@@ -3947,7 +3947,7 @@ + ["mongoc-1.0"], + ["mongoc/mongoc.h"], + "C", +- "mongoc_get_major_version();", ++ call="mongoc_get_major_version();", + autoadd=False ): + conf.env['MONGO_HAVE_LIBMONGOC'] = "library" + if not conf.env['MONGO_HAVE_LIBMONGOC'] and env.TargetOSIs('darwin') and conf.CheckMongoCFramework(): diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0003-boost-Fix-build-with-clang-23.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0003-boost-Fix-build-with-clang-23.patch new file mode 100644 index 0000000000..3a188033f6 --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0003-boost-Fix-build-with-clang-23.patch @@ -0,0 +1,176 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 9 Nov 2026 09:00:00 -0800 +Subject: [PATCH] boost: Fix build with clang 23 + +Backport fixes from newer Boost to the bundled Boost 1.70: + +- numeric_conversion and log: use boost::integral_constant instead of + mpl::integral_c for enum constants. mpl::integral_c computes the + next/prior values, which are outside the range of the enum, and clang + now rejects that: + + error: in-class initializer for static data member is not a constant expression + note: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'lock_access_mode' + +- thread: fix a typo in run_it's move assignment operator, which clang + now diagnoses in uninstantiated templates: + + error: no member named 'that' in 'boost::detail::run_it' + +Upstream-Status: Backport [https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a https://github.com/boostorg/log/commit/77f1e20bd69c2e7a9e25e6a9818ae6105f7d070c https://github.com/boostorg/thread/commit/49ccf9c30a0ca556873dbf64b12b0d741d1b3e66] +Signed-off-by: Khem Raj +--- +diff --git a/src/third_party/boost-1.70.0/boost/log/utility/strictest_lock.hpp b/src/third_party/boost-1.70.0/boost/log/utility/strictest_lock.hpp +index 5dd48b4f..05c7a037 100644 +--- a/src/third_party/boost-1.70.0/boost/log/utility/strictest_lock.hpp ++++ b/src/third_party/boost-1.70.0/boost/log/utility/strictest_lock.hpp +@@ -17,6 +17,7 @@ + #define BOOST_LOG_UTILITY_STRICTEST_LOCK_HPP_INCLUDED_ + + #include ++#include + #include + #include + #if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) +@@ -67,44 +68,44 @@ template< typename LockT > + 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 > + { + }; + +diff --git a/src/third_party/boost-1.70.0/boost/numeric/conversion/detail/int_float_mixture.hpp b/src/third_party/boost-1.70.0/boost/numeric/conversion/detail/int_float_mixture.hpp +index 464e5275..7690d07a 100644 +--- a/src/third_party/boost-1.70.0/boost/numeric/conversion/detail/int_float_mixture.hpp ++++ b/src/third_party/boost-1.70.0/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 int2int_c ; +- typedef mpl::integral_c int2float_c ; +- typedef mpl::integral_c float2int_c ; +- typedef mpl::integral_c float2float_c ; ++ typedef boost::integral_constant int2int_c ; ++ typedef boost::integral_constant int2float_c ; ++ typedef boost::integral_constant float2int_c ; ++ typedef boost::integral_constant float2float_c ; + + // Metafunction: + // +diff --git a/src/third_party/boost-1.70.0/boost/numeric/conversion/detail/sign_mixture.hpp b/src/third_party/boost-1.70.0/boost/numeric/conversion/detail/sign_mixture.hpp +index c7f9e42a..fde15840 100644 +--- a/src/third_party/boost-1.70.0/boost/numeric/conversion/detail/sign_mixture.hpp ++++ b/src/third_party/boost-1.70.0/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 unsig2unsig_c ; +- typedef mpl::integral_c sig2sig_c ; +- typedef mpl::integral_c sig2unsig_c ; +- typedef mpl::integral_c unsig2sig_c ; ++ typedef boost::integral_constant unsig2unsig_c ; ++ typedef boost::integral_constant sig2sig_c ; ++ typedef boost::integral_constant sig2unsig_c ; ++ typedef boost::integral_constant unsig2sig_c ; + + // Metafunction: + // +diff --git a/src/third_party/boost-1.70.0/boost/numeric/conversion/detail/udt_builtin_mixture.hpp b/src/third_party/boost-1.70.0/boost/numeric/conversion/detail/udt_builtin_mixture.hpp +index 36dbc491..a39d29fd 100644 +--- a/src/third_party/boost-1.70.0/boost/numeric/conversion/detail/udt_builtin_mixture.hpp ++++ b/src/third_party/boost-1.70.0/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 builtin2builtin_c ; +- typedef mpl::integral_c builtin2udt_c ; +- typedef mpl::integral_c udt2builtin_c ; +- typedef mpl::integral_c udt2udt_c ; ++ typedef boost::integral_constant builtin2builtin_c ; ++ typedef boost::integral_constant builtin2udt_c ; ++ typedef boost::integral_constant udt2builtin_c ; ++ typedef boost::integral_constant udt2udt_c ; + + // Metafunction: + // +diff --git a/src/third_party/boost-1.70.0/boost/thread/future.hpp b/src/third_party/boost-1.70.0/boost/thread/future.hpp +index 3d1b29d4..2862fc0a 100644 +--- a/src/third_party/boost-1.70.0/boost/thread/future.hpp ++++ b/src/third_party/boost-1.70.0/boost/thread/future.hpp +@@ -4669,7 +4669,7 @@ namespace detail + } + run_it& operator=(BOOST_THREAD_RV_REF(run_it) x) BOOST_NOEXCEPT { + if (this != &x) { +- that_=x.that; ++ that_=x.that_; + x.that_.reset(); + } + return *this; diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0004-ssl-Fix-build-with-OpenSSL-4.patch b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0004-ssl-Fix-build-with-OpenSSL-4.patch new file mode 100644 index 0000000000..fdf6852119 --- /dev/null +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0004-ssl-Fix-build-with-OpenSSL-4.patch @@ -0,0 +1,117 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 9 Nov 2026 09:00:00 -0800 +Subject: [PATCH] ssl: Fix build with OpenSSL 4 + +OpenSSL 4 makes ASN1_STRING opaque, removes ASN1_STRING_data() and +ERR_remove_state(), and returns const pointers from +X509_EXTENSION_get_object() and X509_EXTENSION_get_data(). + +Use the ASN1_STRING accessors, which are available since OpenSSL 1.1, +make the extension pointers const, and only call ERR_remove_state() with +OpenSSL older than 1.1, where it is not a no-op. + +Upstream-Status: Inappropriate [v4.4 branch is EOL] +Signed-off-by: Khem Raj +--- +diff --git a/src/mongo/util/net/openssl_init.cpp b/src/mongo/util/net/openssl_init.cpp +index c4980bb0..93b6e4fc 100644 +--- a/src/mongo/util/net/openssl_init.cpp ++++ b/src/mongo/util/net/openssl_init.cpp +@@ -77,7 +77,9 @@ public: + + // The `guard` callback will cause an invocation of `getID`, so it must be destroyed first. + static thread_local ManagedId managedId; ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + static thread_local auto guard = makeGuard([] { ERR_remove_state(0); }); ++#endif + + return managedId.id; + } +diff --git a/src/mongo/util/net/ssl_manager_openssl.cpp b/src/mongo/util/net/ssl_manager_openssl.cpp +index 60cde955..fa55bb7d 100644 +--- a/src/mongo/util/net/ssl_manager_openssl.cpp ++++ b/src/mongo/util/net/ssl_manager_openssl.cpp +@@ -1433,7 +1433,10 @@ SSLX509Name getCertificateSubjectX509Name(X509* cert) { + + const auto* str = X509_NAME_ENTRY_get_data(entry); + rdn.emplace_back( +- buffer, str->type, std::string(reinterpret_cast(str->data), str->length)); ++ buffer, ++ ASN1_STRING_type(str), ++ std::string(reinterpret_cast(ASN1_STRING_get0_data(str)), ++ ASN1_STRING_length(str))); + } + if (!rdn.empty()) { + entries.push_back(std::move(rdn)); +@@ -2904,7 +2907,7 @@ Future SSLManagerOpenSSL::parseAndValidatePeerCertificate( + const GENERAL_NAME* currentName = sk_GENERAL_NAME_value(sanNames, i); + if (currentName && currentName->type == GEN_DNS) { + std::string dnsName( +- reinterpret_cast(ASN1_STRING_data(currentName->d.dNSName))); ++ reinterpret_cast(ASN1_STRING_get0_data(currentName->d.dNSName))); + auto swCIDRDNSName = CIDR::parse(dnsName); + if (swCIDRDNSName.isOK()) { + LOGV2_WARNING(23237, +@@ -2925,14 +2928,16 @@ Future SSLManagerOpenSSL::parseAndValidatePeerCertificate( + auto ipAddrStruct = currentName->d.iPAddress; + struct sockaddr_storage ss; + memset(&ss, 0, sizeof(ss)); +- if (ipAddrStruct->length == 4) { ++ const int ipAddrLength = ASN1_STRING_length(ipAddrStruct); ++ const unsigned char* ipAddrData = ASN1_STRING_get0_data(ipAddrStruct); ++ if (ipAddrLength == 4) { + struct sockaddr_in* sa = reinterpret_cast(&ss); + sa->sin_family = AF_INET; +- memcpy(&(sa->sin_addr), ipAddrStruct->data, ipAddrStruct->length); +- } else if (ipAddrStruct->length == 16) { ++ memcpy(&(sa->sin_addr), ipAddrData, ipAddrLength); ++ } else if (ipAddrLength == 16) { + struct sockaddr_in6* sa = reinterpret_cast(&ss); + sa->sin6_family = AF_INET6; +- memcpy(&(sa->sin6_addr), ipAddrStruct->data, ipAddrStruct->length); ++ memcpy(&(sa->sin6_addr), ipAddrData, ipAddrLength); + } + auto ipAddress = + SockAddr(reinterpret_cast(&ss), sizeof(ss)).getAddr(); +@@ -3026,15 +3031,16 @@ StatusWith> SSLManagerOpenSSL::_parsePeerRoles(X50 + stdx::unordered_set roles; + for (int i = 0; i < extCount; i++) { + X509_EXTENSION* ex = sk_X509_EXTENSION_value(exts, i); +- ASN1_OBJECT* obj = X509_EXTENSION_get_object(ex); ++ const ASN1_OBJECT* obj = X509_EXTENSION_get_object(ex); + + if (!OBJ_cmp(obj, rolesObj)) { + // We've found an extension which has our roles OID +- ASN1_OCTET_STRING* data = X509_EXTENSION_get_data(ex); ++ const ASN1_OCTET_STRING* data = X509_EXTENSION_get_data(ex); + + return parsePeerRoles( +- ConstDataRange(reinterpret_cast(data->data), +- reinterpret_cast(data->data) + data->length)); ++ ConstDataRange(reinterpret_cast(ASN1_STRING_get0_data(data)), ++ reinterpret_cast(ASN1_STRING_get0_data(data)) + ++ ASN1_STRING_length(data))); + } + } + +@@ -3054,14 +3060,15 @@ StatusWith>> SSLManagerOpenSSL::_parseTL + ASN1_OBJECT* featuresObj = OBJ_nid2obj(NID_tlsfeature); + for (int i = 0; i < extCount; i++) { + X509_EXTENSION* ex = sk_X509_EXTENSION_value(exts, i); +- ASN1_OBJECT* obj = X509_EXTENSION_get_object(ex); ++ const ASN1_OBJECT* obj = X509_EXTENSION_get_object(ex); + + if (!OBJ_cmp(obj, featuresObj)) { + // We've found an extension which has the features OID +- ASN1_OCTET_STRING* data = X509_EXTENSION_get_data(ex); ++ const ASN1_OCTET_STRING* data = X509_EXTENSION_get_data(ex); + return parseTLSFeature( +- ConstDataRange(reinterpret_cast(data->data), +- reinterpret_cast(data->data) + data->length)); ++ ConstDataRange(reinterpret_cast(ASN1_STRING_get0_data(data)), ++ reinterpret_cast(ASN1_STRING_get0_data(data)) + ++ ASN1_STRING_length(data))); + } + } + return boost::none; diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb index e7a4d1e34b..e1016681e4 100644 --- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb @@ -4,7 +4,7 @@ LIC_FILES_CHKSUM = "file://LICENSE-Community.txt;md5=3a865f27f11f43ecbe542d9ea38 file://APACHE-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57" DEPENDS = "openssl libpcap zlib boost curl python3 \ - python3-setuptools-native \ + python3-packaging-native python3-setuptools-native \ python3-pyyaml-native python3-cheetah-native \ python3-psutil-native python3-regex-native \ " @@ -36,6 +36,10 @@ SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4;protocol=https \ file://0001-Fix-type-mismatch-on-32bit-arches.patch \ file://0001-Fix-build-on-32bit.patch \ file://0001-moduleconfig.py-python-3.12-compatibility.patch \ + file://0001-Use-packaging-instead-of-pkg_resources-for-version-p.patch \ + file://0002-SConstruct-Pass-call-to-CheckLibWithHeader-as-a-keyw.patch \ + file://0003-boost-Fix-build-with-clang-23.patch \ + file://0004-ssl-Fix-build-with-OpenSSL-4.patch \ " SRC_URI:append:libc-musl = "\ file://0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch \