Skip to contentSkip to conversation

mongodb: backport fixes to wrynose from master

PATCH New Awais Belal 1 participant 8 messages Nov 18

lore
Share & tools
lore
#0 lore raw

cover mongodb: backport fixes to wrynose from master

From: Awais B <[email protected]>

These commits are backported from master to allow building mongodb on wrynose cleanly.

Awais Belal (2):
mongodb: fix build with python 3.12
mongodb: update to 4.4.29

Gyorgy Sarvari (2):
mongodb: upgrade 4.4.29 -> 4.4.30
mongodb: ignore CVE-2025-14911

Khem Raj (3):
mongodb: Fix build with current python, SCons, clang and OpenSSL
mongodb: Backport fix for SERVER-49099
mongodb: Keep build paths out of buildInfo

 ...stead-of-pkg_resources-for-version-p.patch |  51 +++++
 ...001-free_mon-Include-missing-cstdint.patch |  28 ---
 ...econfig.py-python-3.12-compatibility.patch |  57 ++++++
 ...call-to-CheckLibWithHeader-as-a-keyw.patch |  56 ++++++
 .../0003-boost-Fix-build-with-clang-23.patch  | 176 ++++++++++++++++++
 .../0004-ssl-Fix-build-with-OpenSSL-4.patch   | 117 ++++++++++++
 ...ove-the-Node-swap-function-in-Biggie.patch |  58 ++++++
 .../mongodb/mongodb/oe-buildinfo.vars         |  11 ++
 .../recipes-dbs/mongodb/mongodb_git.bb        |  20 +-
 9 files changed, 539 insertions(+), 35 deletions(-)
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Use-packaging-instead-of-pkg_resources-for-version-p.patch
 delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-free_mon-Include-missing-cstdint.patch
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-moduleconfig.py-python-3.12-compatibility.patch
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0002-SConstruct-Pass-call-to-CheckLibWithHeader-as-a-keyw.patch
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0003-boost-Fix-build-with-clang-23.patch
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0004-ssl-Fix-build-with-OpenSSL-4.patch
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0005-SERVER-49099-Remove-the-Node-swap-function-in-Biggie.patch
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/oe-buildinfo.vars
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/7 mongodb: fix build with python 3.12

The moduleconfig.py build script uses the 'imp' module which is deprecated in favor of 'importlib' in python 3.12. This fixes the build issue by replacing the affected portion of the code and the package now builds fine on hosts with python 3.12.

(cherry picked from commit b14547d10254c50f729cc3f7c844c6f31f10ba68)
---
 ...econfig.py-python-3.12-compatibility.patch | 57 +++++++++++++++++++
 .../recipes-dbs/mongodb/mongodb_git.bb        |  3 +-
 2 files changed, 58 insertions(+), 2 deletions(-)
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-moduleconfig.py-python-3.12-compatibility.patch
meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-moduleconfig.py-python-3.12-compatibility.patch new file +57 -0
new file mode 100644
index 0000000000..51926b9d2e
@@ -0,0 +1,57 @@
+From 37580777bc5294d606584f3731d9f5f5425bb587 Mon Sep 17 00:00:00 2001
+From: Awais B <[email protected]>
+Date: Tue, 4 Mar 2025 11:27:10 +0000
+Subject: [PATCH] moduleconfig.py: python 3.12 compatibility
+
+The imp module was deprecated in python 3.4 and is dropped
+with python 3.12. We now need to use importlib for the
+purpose of manipulating/loading modules.
+
+Upstream-Status: Pending
+Signed-off-by: Awais B <[email protected]>
+---
+ buildscripts/moduleconfig.py | 21 ++++++++++++++-------
+ 1 file changed, 14 insertions(+), 7 deletions(-)
+
+diff --git a/buildscripts/moduleconfig.py b/buildscripts/moduleconfig.py
+index b4d0bba0490..69dd91ab30d 100644
+--- a/buildscripts/moduleconfig.py
++++ b/buildscripts/moduleconfig.py
+@@ -27,7 +27,8 @@ MongoDB SConscript files do.
+ __all__ = ('discover_modules', 'discover_module_directories', 'configure_modules',
+            'register_module_test')  # pylint: disable=undefined-all-variable
+ 
+-import imp
++import importlib
++import sys
+ import inspect
+ import os
+ 
+@@ -71,12 +72,18 @@ def discover_modules(module_root, allowed_modules):
+             print("adding module: %s" % (name))
+             fp = open(build_py, "r")
+             try:
+-                module = imp.load_module("module_" + name, fp, build_py,
+-                                         (".py", "r", imp.PY_SOURCE))
+-                if getattr(module, "name", None) is None:
+-                    module.name = name
+-                found_modules.append(module)
+-                found_module_names.append(name)
++                module_name = "module_" + name
++                module_spec = importlib.util.spec_from_file_location(module_name, build_py)
++
++                if module_spec is not None:
++                    module = importlib.util.module_from_spec(module_spec)
++                    sys.modules[module_name] = module
++                    module_spec.loader.exec_module(module)
++
++                    if not hasattr(module, "name"):
++                        module.name = name
++                    found_modules.append(module)
++                    found_module_names.append(name)
+             finally:
+                 fp.close()
+         except (FileNotFoundError, IOError):
+-- 
+2.34.1
+
meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb +1 -2
index 23515d9fa8..0f4a5c4423 100644
@@ -36,6 +36,7 @@ SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4;protocol=https \
            file://0001-apply-msvc-workaround-for-clang-16.patch \
            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 \
            "
 SRC_URI:append:libc-musl = "\
            file://0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch \
@@ -140,5 +141,3 @@ SYSTEMD_SERVICE:${PN} = "mongod.service"
 FILES:${PN} += "${nonarch_libdir}/tmpfiles.d"
 
 RDEPENDS:${PN} += "tzdata-core"
-
-SKIP_RECIPE[mongodb] ?= "Needs porting to python 3.12"
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/7 mongodb: update to 4.4.29

In reply to Awais Belal

Move on to 4.4.29 and drop a patch that is not applicable anymore.

(cherry picked from commit 245b2dceb256932c62e762839adb57c0dec32edf)
---
 ...001-free_mon-Include-missing-cstdint.patch | 28 -------------------
 .../recipes-dbs/mongodb/mongodb_git.bb        |  7 ++---
 2 files changed, 3 insertions(+), 32 deletions(-)
 delete mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-free_mon-Include-missing-cstdint.patch
meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-free_mon-Include-missing-cstdint.patch deleted +0 -28
deleted file mode 100644
index 8cee14889f..0000000000
@@ -1,28 +0,0 @@
-From 5d8218b8a1b5bc71e2a0cf543a000e194daba599 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Sun, 29 Jan 2023 17:15:30 -0800
-Subject: [PATCH] free_mon: Include missing <cstdint>
-
-gcc 13 moved some includes around and as a result <cstdint> is no
-longer transitively included [1]. Explicitly include it
-for uintXX_t.
-
-[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
-
-Signed-off-by: Khem Raj <[email protected]>
-
-Upstream-Status: Pending
----
- src/mongo/db/free_mon/free_mon_options.h | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/src/mongo/db/free_mon/free_mon_options.h
-+++ b/src/mongo/db/free_mon/free_mon_options.h
-@@ -29,6 +29,7 @@
- 
- #pragma once
- 
-+#include <cstdint>
- #include <string>
- #include <vector>
- 
meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb +3 -4
index 0f4a5c4423..339bb38a2b 100644
@@ -11,9 +11,9 @@ DEPENDS = "openssl libpcap zlib boost curl python3 \
 
 inherit scons dos2unix siteinfo python3native systemd useradd
 
-PV = "4.4.24"
-#v4.4.24
-SRCREV = "0b86b9b7b42ad9970c5f818c527dd86c0634243a"
+PV = "4.4.29"
+#v4.4.29
+SRCREV = "89d6ffe6fc67b36fd47aff6425087003966588e3"
 SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4;protocol=https \
            file://0001-Tell-scons-to-use-build-settings-from-environment-va.patch \
            file://0001-Use-long-long-instead-of-int64_t.patch \
@@ -32,7 +32,6 @@ SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4;protocol=https \
            file://0001-add-explict-static_cast-size_t-to-maxMemoryUsageByte.patch \
            file://0001-server-Adjust-the-cache-alignment-assumptions.patch \
            file://0001-The-std-lib-unary-binary_function-base-classes-are-d.patch \
-           file://0001-free_mon-Include-missing-cstdint.patch \
            file://0001-apply-msvc-workaround-for-clang-16.patch \
            file://0001-Fix-type-mismatch-on-32bit-arches.patch \
            file://0001-Fix-build-on-32bit.patch \
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/7 mongodb: upgrade 4.4.29 -> 4.4.30

In reply to Awais Belal

From: Gyorgy Sarvari <[email protected]>

This is a security release to fix CVE-2025-14847:
https://nvd.nist.gov/vuln/detail/CVE-2025-14847

(cherry picked from commit 08c49b447b5a615aaaeb89802f503ec6d1722b74)
---
 .../meta-python/recipes-dbs/mongodb/mongodb_git.bb          | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb +3 -3
index 339bb38a2b..720ddef416 100644
@@ -11,9 +11,9 @@ DEPENDS = "openssl libpcap zlib boost curl python3 \
 
 inherit scons dos2unix siteinfo python3native systemd useradd
 
-PV = "4.4.29"
-#v4.4.29
-SRCREV = "89d6ffe6fc67b36fd47aff6425087003966588e3"
+PV = "4.4.30"
+#v4.4.30
+SRCREV = "1ae4c9990dbc5711f3500748f0c3f8b5d375d8c0"
 SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4;protocol=https \
            file://0001-Tell-scons-to-use-build-settings-from-environment-va.patch \
            file://0001-Use-long-long-instead-of-int64_t.patch \
Signature · 1 line
2.34.1
#4 lore raw

PATCH 4/7 mongodb: ignore CVE-2025-14911

In reply to Awais Belal

From: Gyorgy Sarvari <[email protected]>

Details: https://nvd.nist.gov/vuln/detail/CVE-2025-14911

The CVE is currently tracked without valid CPE. The vulnerability affects mongo-c-driver component, not mongodb. They are also stored in different repositories.

Due to this, ignore this CVE.

(cherry picked from commit 272e975c34e5bd8863e72477c461755839932d88)
---
 .../meta-python/recipes-dbs/mongodb/mongodb_git.bb               | 1 +
 1 file changed, 1 insertion(+)
meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb +1 -0
index 720ddef416..b7f2c3aaac 100644
@@ -51,6 +51,7 @@ SRC_URI:append:toolchain-clang = "\
 
 CVE_STATUS[CVE-2014-8180] = "not-applicable-config: Not affecting our configuration so it can be safely ignored."
 CVE_STATUS[CVE-2017-2665] = "not-applicable-config: Not affecting our configuration so it can be safely ignored."
+CVE_STATUS[CVE-2025-14911] = "cpe-incorrect: The vulnerability is about mongo-c-driver application, not mongodb"
 
 COMPATIBLE_HOST ?= '(x86_64|i.86|powerpc64|arm|aarch64).*-linux'
 
Signature · 1 line
2.34.1
#5 lore raw

PATCH 5/7 mongodb: Fix build with current python, SCons, clang and OpenSSL

In reply to Awais Belal

From: Khem Raj <[email protected]>

mongodb was re-enabled after having been skipped, and no longer builds with the current toolchain and dependencies:

- setuptools 84 does not provide pkg_resources anymore; use packaging.version to parse versions
- SCons 4.11 added an extra_libs parameter ahead of call in CheckLibWithHeader(), so the positional call snippet was split into bogus -l options and the OpenSSL check failed; pass call as a keyword
- clang 23 rejects out of range enum values in the bundled Boost 1.70 mpl::integral_c uses and a typo in Boost.Thread; backport the fixes from newer Boost
- OpenSSL 4 makes ASN1_STRING opaque and removes ASN1_STRING_data() and ERR_remove_state(); use the accessors available since OpenSSL 1.1

AI-Generated: Uses Claude Code

(cherry picked from commit 2903830b48e5a304ad62aa65e5c2b44c2fe67f67)
---
 ...stead-of-pkg_resources-for-version-p.patch |  51 +++++
 ...call-to-CheckLibWithHeader-as-a-keyw.patch |  56 ++++++
 .../0003-boost-Fix-build-with-clang-23.patch  | 176 ++++++++++++++++++
 .../0004-ssl-Fix-build-with-OpenSSL-4.patch   | 117 ++++++++++++
 .../recipes-dbs/mongodb/mongodb_git.bb        |   6 +-
 5 files changed, 405 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Use-packaging-instead-of-pkg_resources-for-version-p.patch
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0002-SConstruct-Pass-call-to-CheckLibWithHeader-as-a-keyw.patch
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0003-boost-Fix-build-with-clang-23.patch
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0004-ssl-Fix-build-with-OpenSSL-4.patch
meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0001-Use-packaging-instead-of-pkg_resources-for-version-p.patch new file +51 -0
new file mode 100644
index 0000000000..d45b9f8021
@@ -0,0 +1,51 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+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 <[email protected]>
+---
+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
+ 
meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0002-SConstruct-Pass-call-to-CheckLibWithHeader-as-a-keyw.patch new file +56 -0

56 lines not on this page · raw message

meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0003-boost-Fix-build-with-clang-23.patch new file +176 -0

176 lines not on this page · raw message

meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0004-ssl-Fix-build-with-OpenSSL-4.patch new file +117 -0

117 lines not on this page · raw message

meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb +5 -1
index b7f2c3aaac..c8095b0292 100644
@@ -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 \
Signature · 1 line
2.34.1
#6 lore raw

PATCH 6/7 mongodb: Backport fix for SERVER-49099

In reply to Awais Belal

From: Khem Raj <[email protected]>

The Node and Head swap() friends and the copy-and-swap assignment operators in Biggie store.h are unused and refer to members that do not exist. Backport the upstream removal.

AI-Generated: Uses Claude Code

(cherry picked from commit cc2835067bc19f55632483bba26b67aa6174197d)
---
 ...ove-the-Node-swap-function-in-Biggie.patch | 58 +++++++++++++++++++
 .../recipes-dbs/mongodb/mongodb_git.bb        |  1 +
 2 files changed, 59 insertions(+)
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0005-SERVER-49099-Remove-the-Node-swap-function-in-Biggie.patch
meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/0005-SERVER-49099-Remove-the-Node-swap-function-in-Biggie.patch new file +58 -0
new file mode 100644
index 0000000000..b2d1d92f30
@@ -0,0 +1,58 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Yuhong Zhang <[email protected]>
+Date: Thu, 9 Jul 2020 15:43:33 +0000
+Subject: [PATCH] SERVER-49099 Remove the Node::swap() function in Biggie
+
+The Node and Head swap() friends and the copy-and-swap assignment
+operators built on them are unused and do not compile: Node::swap()
+does not exist and Node has no trieKey, depth, data or children
+members (they are _-prefixed). This went unnoticed because they are
+in a class template that never instantiates them.
+
+Upstream-Status: Backport [https://github.com/mongodb/mongo/commit/77ffbcb4f5673b154fe64872cba9f34ce97bc55d]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/mongo/db/storage/biggie/store.h | 21 ---------------------
+ 1 file changed, 21 deletions(-)
+
+diff --git a/src/mongo/db/storage/biggie/store.h b/src/mongo/db/storage/biggie/store.h
+index a09b5b4..aeaa337 100644
+--- a/src/mongo/db/storage/biggie/store.h
++++ b/src/mongo/db/storage/biggie/store.h
+@@ -809,18 +809,6 @@ private:
+ 
+         virtual ~Node() = default;
+ 
+-        friend void swap(Node& first, Node& second) {
+-            std::swap(first.trieKey, second.trieKey);
+-            std::swap(first.depth, second.depth);
+-            std::swap(first.data, second.data);
+-            std::swap(first.children, second.children);
+-        }
+-
+-        Node& operator=(const Node other) {
+-            swap(*this, other);
+-            return *this;
+-        }
+-
+         bool isLeaf() const {
+             for (auto child : _children) {
+                 if (child != nullptr)
+@@ -855,17 +843,8 @@ private:
+                 _nextVersion->_hasPreviousVersion = false;
+         }
+ 
+-        friend void swap(Head& first, Head& second) {
+-            Node::swap(first, second);
+-        }
+-
+         Head(Head&& other) : Node(std::move(other)) {}
+ 
+-        Head& operator=(const Head other) {
+-            swap(*this, other);
+-            return *this;
+-        }
+-
+         bool hasPreviousVersion() const {
+             return _hasPreviousVersion;
+         }
meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb +1 -0
index c8095b0292..0cd1dd9def 100644
@@ -40,6 +40,7 @@ SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4;protocol=https \
            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 \
+           file://0005-SERVER-49099-Remove-the-Node-swap-function-in-Biggie.patch \
            "
 SRC_URI:append:libc-musl = "\
            file://0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch \
Signature · 1 line
2.34.1
#7 lore raw

PATCH 7/7 mongodb: Keep build paths out of buildInfo

In reply to Awais Belal

From: Khem Raj <[email protected]>

By default buildInfo embeds the compiler version string and CCFLAGS, CXXFLAGS and LINKFLAGS, which carry --sysroot and -ffile-prefix-map paths into mongod and mongos and trigger buildpaths QA warnings. Pass a variables file that drops those entries from MONGO_BUILDINFO_ENVIRONMENT_DATA.

(cherry picked from commit 17fb07cf799cc98205c63c2d2cc956fc8d12b533)
---
 .../recipes-dbs/mongodb/mongodb/oe-buildinfo.vars     | 11 +++++++++++
 .../meta-python/recipes-dbs/mongodb/mongodb_git.bb    |  2 ++
 2 files changed, 13 insertions(+)
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/oe-buildinfo.vars
meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb/oe-buildinfo.vars new file +11 -0
new file mode 100644
index 0000000000..950dc4baa2
@@ -0,0 +1,11 @@
+# Keep the compiler and its flags, which carry build paths, out of
+# the buildInfo command and --version output
+from mongo.generators import default_buildinfo_environment_data
+
+MONGO_BUILDINFO_ENVIRONMENT_DATA = {
+    k: v for k, v in default_buildinfo_environment_data().items()
+    if k not in ('cc', 'ccflags', 'cxx', 'cxxflags', 'linkflags')
+}
+
+# SConstruct rejects unknown names left in a variables file
+del default_buildinfo_environment_data
meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb +2 -0
index 0cd1dd9def..76a3acfda4 100644
@@ -41,6 +41,7 @@ SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4;protocol=https \
            file://0003-boost-Fix-build-with-clang-23.patch \
            file://0004-ssl-Fix-build-with-OpenSSL-4.patch \
            file://0005-SERVER-49099-Remove-the-Node-swap-function-in-Biggie.patch \
+           file://oe-buildinfo.vars \
            "
 SRC_URI:append:libc-musl = "\
            file://0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch \
@@ -87,6 +88,7 @@ EXTRA_OESCONS = "PREFIX=${prefix} \
                  TARGET_ARCH=${MONGO_ARCH} \
                  MONGO_VERSION=${PV} \
                  OBJCOPY=${OBJCOPY} \
+                 --variables-files=${UNPACKDIR}/oe-buildinfo.vars \
                  --ssl \
                  --disable-warnings-as-errors \
                  --use-system-zlib \
Signature · 1 line
2.34.1