[dev-db/mongodb] WIP stuff, builds for the most part

This commit is contained in:
2026-01-15 09:19:12 +01:00
parent 914a07cdda
commit a0c6d0bb75
37 changed files with 440 additions and 1607 deletions

View File

@@ -1,3 +1,6 @@
DIST mongodb-5.0.30-patches.tar.xz 9652 BLAKE2B d0780026c4b2dd4e0968e3699eeeed4c4db14bce93bf6bce8141f9d6a3b3b4579b4496494b2e0ebdb00ac1e316a55723625b64bac9ebf032d4ae6dc7e1691fd7 SHA512 8d1032b99f1cf0087f1562c53fbed33815a2becd8641ab9373c8a474e23f1bb148b712cbebac1da4038ec9e4e3a5249fb9bdfe864ca626d4b9fc221bd91b7dd6
DIST mongodb-5.0.32.gh.tar.gz 57336354 BLAKE2B 400f4485561e284eb8caaa1bb6f65c2cb8418a98e99b0381b2828a8448ad37e253023237de39952fca45522a14d308bb93b9191ee2847633b593f88fbb7d978b SHA512 d9a47524ea9aa9554bb7ebc272598b26e3317a5d8ecc6f159ed9cc9ef3c6e19e752cda3a1bcfc4315a38b1cf3843948e6d1f3519437cfd9b1e654a1b7eea5f77
DIST mongodb-6.0.22-patches.tar.xz 8820 BLAKE2B 973e58d0a09d8fb160beefd46b425b0f5dd7ad531f9ccec433fd201517035613c171cddaf5d3cf2883f57d4728438572062cc5c8b9166e15d8e5701efcd8b84c SHA512 fa8f18d259e829df07ec26ab570de9b3968b9b02ed195b47d7a2bfc832f2b7e74a5aaf58e54cfe6d01ea7e3d76efdad2e1efca0da4af0b0d3f50944dfd1fd4e0 DIST mongodb-6.0.22-patches.tar.xz 8820 BLAKE2B 973e58d0a09d8fb160beefd46b425b0f5dd7ad531f9ccec433fd201517035613c171cddaf5d3cf2883f57d4728438572062cc5c8b9166e15d8e5701efcd8b84c SHA512 fa8f18d259e829df07ec26ab570de9b3968b9b02ed195b47d7a2bfc832f2b7e74a5aaf58e54cfe6d01ea7e3d76efdad2e1efca0da4af0b0d3f50944dfd1fd4e0
DIST mongodb-6.0.26.gh.tar.gz 87528255 BLAKE2B 031b4a8f10d948ac8f22a8dded6ce42d19e930ca5ac1b5fa0b3cdd2cd7dcdaf1899dd2110bd9856a6a164c684414e3b2a807a19d74083938ffae975aa42f97be SHA512 fb1e156fc1349a45815ea1fa0eb0927361fbbc7e288ca8c02a0875c2ec6b9dbe41ba45b2831c1d68786a3f477d0602aa4ccfeb50549f2d53414964b3ea8e4193 DIST mongodb-6.0.27.gh.tar.gz 87528963 BLAKE2B b0155e5caaff1f7532291a64d723a6cff4292692045312f0f838862ffa48d4e6f90e2ff476094d4017b02eaf26b8f514a3b28c08c1adfc4cc987ee504b83a121 SHA512 920b3f5c2347b43cdb533da417267ba62106508d129ec42083b29e8f0f2625dc2eb9c69724a1906ef2d12f55f70403d7e774dd6a1a6abf52e406aea4baf96e4d
DIST mongodb-7.0.18.gh.tar.gz 87225100 BLAKE2B 7ede32f4c6b6968ee8d797ce71457133020a3e4a039cd0db914e344e5042a0b871deb5741f86098b2e82b9ff619a511a754a06a29dcbb9527a3b7a7edf52b3ac SHA512 599767db66e95d8dd0bd0e6d51fd70129ea6df1e18a0cdaa52bc6cbe301c982684ff5aab446c50cb825573051e372d8f791aeab7df58e2a4d855e6073f2b46d5 DIST mongodb-7.0.18-patches.tar.xz 9036 BLAKE2B d52032a7bd82a5bffd3536a14d346750b9c093387dd5cb2cf618e32410ccc22e3c5e89a4947d948c16dc8fa4c34388b7ffcc3321723dfa2b2730db763acc2f69 SHA512 5e6e5b29a2c500e6be7fb3e9b83a5f88fde0182e070af15e4d04dede82a6cea8957e1fc0ea329f0cd8a51565de9e51c7ae1d0e7f2ca021e5391cabb337752d40
DIST mongodb-7.0.28.gh.tar.gz 90762731 BLAKE2B d60babc4c5b823b9b55b086b34cc2ced41187c08c3a591265307ffde6bb5bf56ede6ca1b273b9fa0baa5da475820b837db1d43bf0fd1be46e5ad07a8d9b91f21 SHA512 1e8e782ea1f89bc2e3e0b5d15b6f5c9479cda35c8e64fb5d91a3750880eb10274b15ab3f04118dfceb15a18cbedd3c4026826ea2f38f1864d5d26626ac177339

View File

@@ -1,21 +0,0 @@
--- a/SConstruct
+++ b/SConstruct
@@ -3511,17 +3511,11 @@ def doConfigure(myenv):
"BOOST_LOG_NO_SHORTHAND_NAMES",
"BOOST_LOG_USE_NATIVE_SYSLOG",
"BOOST_LOG_WITHOUT_THREAD_ATTR",
+ "BOOST_LOG_DYN_LINK",
"ABSL_FORCE_ALIGNED_ACCESS",
]
)
- if link_model.startswith("dynamic") and not link_model == 'dynamic-sdk':
- conf.env.AppendUnique(
- CPPDEFINES=[
- "BOOST_LOG_DYN_LINK",
- ]
- )
-
if use_system_version_of_library("boost"):
if not conf.CheckCXXHeader( "boost/filesystem/operations.hpp" ):
myenv.ConfError("can't find boost headers")

View File

@@ -1,317 +0,0 @@
https://bugs.gentoo.org/887037
Workaround https://github.com/boostorg/container/commit/99091420ae553b27345e04279fd19fe24fb684c1
in Boost 1.81.
Upstream s2 (as in real upstream, not MongoDB) has deviated substantially
from the version vendored.
--- a/src/third_party/s2/base/stl_decl_msvc.h
+++ b/src/third_party/s2/base/stl_decl_msvc.h
@@ -118,8 +118,8 @@ namespace msvchash {
class hash_multimap;
} // end namespace msvchash
-using msvchash::hash_set;
-using msvchash::hash_map;
+using msvchash::hash_set = my_hash_set;
+using msvchash::hash_map = my_hash_map;
using msvchash::hash;
using msvchash::hash_multimap;
using msvchash::hash_multiset;
--- a/src/third_party/s2/base/stl_decl_osx.h
+++ b/src/third_party/s2/base/stl_decl_osx.h
@@ -68,8 +68,8 @@ using std::string;
using namespace std;
using __gnu_cxx::hash;
-using __gnu_cxx::hash_set;
-using __gnu_cxx::hash_map;
+using __gnu_cxx::hash_set = my_hash_set;
+using __gnu_cxx::hash_map = my_hash_map;
using __gnu_cxx::select1st;
/* On Linux (and gdrive on OSX), this comes from places like
--- a/src/third_party/s2/hash.h
+++ b/src/third_party/s2/hash.h
@@ -2,10 +2,10 @@
#define THIRD_PARTY_S2_HASH_H_
#include <unordered_map>
-#define hash_map std::unordered_map
+#define my_hash_map std::unordered_map
#include <unordered_set>
-#define hash_set std::unordered_set
+#define my_hash_set std::unordered_set
#define HASH_NAMESPACE_START namespace std {
#define HASH_NAMESPACE_END }
--- a/src/third_party/s2/s2_test.cc
+++ b/src/third_party/s2/s2_test.cc
@@ -10,7 +10,7 @@ using std::reverse;
#include <hash_set>
#include <hash_map>
-using __gnu_cxx::hash_set;
+using __gnu_cxx::hash_set = my_hash_map;
#include "s2.h"
#include "base/logging.h"
@@ -709,8 +709,8 @@ TEST(S2, Frames) {
#if 0
TEST(S2, S2PointHashSpreads) {
int kTestPoints = 1 << 16;
- hash_set<size_t> set;
- hash_set<S2Point> points;
+ my_hash_set<size_t> set;
+ my_hash_set<S2Point> points;
hash<S2Point> hasher;
S2Point base = S2Point(1, 1, 1);
for (int i = 0; i < kTestPoints; ++i) {
@@ -733,7 +733,7 @@ TEST(S2, S2PointHashCollapsesZero) {
double minus_zero = -zero;
EXPECT_NE(*reinterpret_cast<uint64 const*>(&zero),
*reinterpret_cast<uint64 const*>(&minus_zero));
- hash_map<S2Point, int> map;
+ my_hash_map<S2Point, int> map;
S2Point zero_pt(zero, zero, zero);
S2Point minus_zero_pt(minus_zero, minus_zero, minus_zero);
--- a/src/third_party/s2/s2cellid_test.cc
+++ b/src/third_party/s2/s2cellid_test.cc
@@ -10,7 +10,7 @@ using std::reverse;
#include <cstdio>
#include <hash_map>
-using __gnu_cxx::hash_map;
+using __gnu_cxx::hash_map = my_hash_map;
#include <sstream>
#include <vector>
@@ -170,7 +170,7 @@ TEST(S2CellId, Tokens) {
static const int kMaxExpandLevel = 3;
static void ExpandCell(S2CellId const& parent, vector<S2CellId>* cells,
- hash_map<S2CellId, S2CellId>* parent_map) {
+ my_hash_map<S2CellId, S2CellId>* parent_map) {
cells->push_back(parent);
if (parent.level() == kMaxExpandLevel) return;
int i, j, orientation;
@@ -194,7 +194,7 @@ static void ExpandCell(S2CellId const& parent, vector<S2CellId>* cells,
TEST(S2CellId, Containment) {
// Test contains() and intersects().
- hash_map<S2CellId, S2CellId> parent_map;
+ my_hash_map<S2CellId, S2CellId> parent_map;
vector<S2CellId> cells;
for (int face = 0; face < 6; ++face) {
ExpandCell(S2CellId::FromFacePosLevel(face, 0, 0), &cells, &parent_map);
--- a/src/third_party/s2/s2loop.cc
+++ b/src/third_party/s2/s2loop.cc
@@ -120,7 +120,7 @@ bool S2Loop::IsValid(string* err) const {
}
}
// Loops are not allowed to have any duplicate vertices.
- hash_map<S2Point, int> vmap;
+ my_hash_map<S2Point, int> vmap;
for (int i = 0; i < num_vertices(); ++i) {
if (!vmap.insert(make_pair(vertex(i), i)).second) {
VLOG(2) << "Duplicate vertices: " << vmap[vertex(i)] << " and " << i;
--- a/src/third_party/s2/s2polygon.cc
+++ b/src/third_party/s2/s2polygon.cc
@@ -117,7 +117,7 @@ HASH_NAMESPACE_END
bool S2Polygon::IsValid(const vector<S2Loop*>& loops, string* err) {
// If a loop contains an edge AB, then no other loop may contain AB or BA.
if (loops.size() > 1) {
- hash_map<S2PointPair, pair<int, int> > edges;
+ my_hash_map<S2PointPair, pair<int, int> > edges;
for (size_t i = 0; i < loops.size(); ++i) {
S2Loop* lp = loops[i];
for (int j = 0; j < lp->num_vertices(); ++j) {
--- a/src/third_party/s2/s2polygonbuilder.cc
+++ b/src/third_party/s2/s2polygonbuilder.cc
@@ -175,7 +175,7 @@ S2Loop* S2PolygonBuilder::AssembleLoop(S2Point const& v0, S2Point const& v1,
// This ensures that only CCW loops are constructed when possible.
vector<S2Point> path; // The path so far.
- hash_map<S2Point, int> index; // Maps a vertex to its index in "path".
+ my_hash_map<S2Point, int> index; // Maps a vertex to its index in "path".
path.push_back(v0);
path.push_back(v1);
index[v1] = 1;
@@ -361,7 +361,7 @@ void S2PolygonBuilder::BuildMergeMap(PointIndex* index, MergeMap* merge_map) {
// First, we build the set of all the distinct vertices in the input.
// We need to include the source and destination of every edge.
- hash_set<S2Point> vertices;
+ my_hash_set<S2Point> vertices;
for (EdgeSet::const_iterator i = edges_->begin(); i != edges_->end(); ++i) {
vertices.insert(i->first);
VertexSet const& vset = i->second;
@@ -370,7 +370,7 @@ void S2PolygonBuilder::BuildMergeMap(PointIndex* index, MergeMap* merge_map) {
}
// Build a spatial index containing all the distinct vertices.
- for (hash_set<S2Point>::const_iterator i = vertices.begin();
+ for (my_hash_set<S2Point>::const_iterator i = vertices.begin();
i != vertices.end(); ++i) {
index->Insert(*i);
}
@@ -378,7 +378,7 @@ void S2PolygonBuilder::BuildMergeMap(PointIndex* index, MergeMap* merge_map) {
// Next, we loop through all the vertices and attempt to grow a maximial
// mergeable group starting from each vertex.
vector<S2Point> frontier, mergeable;
- for (hash_set<S2Point>::const_iterator vstart = vertices.begin();
+ for (my_hash_set<S2Point>::const_iterator vstart = vertices.begin();
vstart != vertices.end(); ++vstart) {
// Skip any vertices that have already been merged with another vertex.
if (merge_map->find(*vstart) != merge_map->end()) continue;
--- a/src/third_party/s2/s2polygonbuilder.h
+++ b/src/third_party/s2/s2polygonbuilder.h
@@ -262,7 +262,7 @@ class S2PolygonBuilder {
// current position to a new position, and also returns a spatial index
// containing all of the vertices that do not need to be moved.
class PointIndex;
- typedef hash_map<S2Point, S2Point> MergeMap;
+ typedef my_hash_map<S2Point, S2Point> MergeMap;
void BuildMergeMap(PointIndex* index, MergeMap* merge_map);
// Moves a set of vertices from old to new positions.
@@ -282,7 +282,7 @@ class S2PolygonBuilder {
// once. We could have also used a multiset<pair<S2Point, S2Point> >,
// but this representation is a bit more convenient.
typedef multiset<S2Point> VertexSet;
- typedef hash_map<S2Point, VertexSet> EdgeSet;
+ typedef my_hash_map<S2Point, VertexSet> EdgeSet;
scoped_ptr<EdgeSet> edges_;
// Unique collection of the starting (first) vertex of all edges,
--- a/src/third_party/s2/s2regioncoverer.cc
+++ b/src/third_party/s2/s2regioncoverer.cc
@@ -321,7 +321,7 @@ void S2RegionCoverer::GetInteriorCellUnion(S2Region const& region,
void S2RegionCoverer::FloodFill(
S2Region const& region, S2CellId const& start, vector<S2CellId>* output) {
- hash_set<S2CellId> all;
+ my_hash_set<S2CellId> all;
vector<S2CellId> frontier;
output->clear();
all.insert(start);
--- a/src/third_party/s2/s2regioncoverer_test.cc
+++ b/src/third_party/s2/s2regioncoverer_test.cc
@@ -11,7 +11,7 @@ using std::swap;
using std::reverse;
#include <hash_map>
-using __gnu_cxx::hash_map;
+using __gnu_cxx::hash_map = my_hash_map;
#include <queue>
using std::priority_queue;
@@ -65,7 +65,7 @@ static void CheckCovering(S2RegionCoverer const& coverer,
vector<S2CellId> const& covering,
bool interior) {
// Keep track of how many cells have the same coverer.min_level() ancestor.
- hash_map<S2CellId, int> min_level_cells;
+ my_hash_map<S2CellId, int> min_level_cells;
for (int i = 0; i < covering.size(); ++i) {
int level = covering[i].level();
EXPECT_GE(level, coverer.min_level());
@@ -76,7 +76,7 @@ static void CheckCovering(S2RegionCoverer const& coverer,
if (covering.size() > coverer.max_cells()) {
// If the covering has more than the requested number of cells, then check
// that the cell count cannot be reduced by using the parent of some cell.
- for (hash_map<S2CellId, int>::const_iterator i = min_level_cells.begin();
+ for (my_hash_map<S2CellId, int>::const_iterator i = min_level_cells.begin();
i != min_level_cells.end(); ++i) {
EXPECT_EQ(i->second, 1);
}
--- a/src/third_party/s2/strings/split.cc
+++ b/src/third_party/s2/strings/split.cc
@@ -156,7 +156,7 @@ struct simple_insert_iterator {
// SplitStringToIterator{Using|AllowEmpty}().
template <typename T>
struct simple_hash_map_iterator {
- typedef hash_map<T, T> hashmap;
+ typedef my_hash_map<T, T> hashmap;
hashmap* t;
bool even;
typename hashmap::iterator curr;
@@ -246,8 +246,8 @@ void SplitStringAllowEmpty(const string& full, const char* delim,
}
void SplitStringToHashsetAllowEmpty(const string& full, const char* delim,
- hash_set<string>* result) {
- simple_insert_iterator<hash_set<string> > it(result);
+ my_hash_set<string>* result) {
+ simple_insert_iterator<my_hash_set<string> > it(result);
SplitStringToIteratorAllowEmpty(full, delim, 0, it);
}
@@ -258,7 +258,7 @@ void SplitStringToSetAllowEmpty(const string& full, const char* delim,
}
void SplitStringToHashmapAllowEmpty(const string& full, const char* delim,
- hash_map<string, string>* result) {
+ my_hash_map<string, string>* result) {
simple_hash_map_iterator<string> it(result);
SplitStringToIteratorAllowEmpty(full, delim, 0, it);
}
@@ -352,8 +352,8 @@ void SplitStringUsing(const string& full,
}
void SplitStringToHashsetUsing(const string& full, const char* delim,
- hash_set<string>* result) {
- simple_insert_iterator<hash_set<string> > it(result);
+ my_hash_set<string>* result) {
+ simple_insert_iterator<my_hash_set<string> > it(result);
SplitStringToIteratorUsing(full, delim, it);
}
@@ -364,7 +364,7 @@ void SplitStringToSetUsing(const string& full, const char* delim,
}
void SplitStringToHashmapUsing(const string& full, const char* delim,
- hash_map<string, string>* result) {
+ my_hash_map<string, string>* result) {
simple_hash_map_iterator<string> it(result);
SplitStringToIteratorUsing(full, delim, it);
}
--- a/src/third_party/s2/strings/split.h
+++ b/src/third_party/s2/strings/split.h
@@ -41,7 +41,7 @@ using namespace std;
void SplitStringAllowEmpty(const string& full, const char* delim,
vector<string>* res);
void SplitStringToHashsetAllowEmpty(const string& full, const char* delim,
- hash_set<string>* res);
+ my_hash_set<string>* res);
void SplitStringToSetAllowEmpty(const string& full, const char* delim,
set<string>* res);
// The even-positioned (0-based) components become the keys for the
@@ -50,7 +50,7 @@ void SplitStringToSetAllowEmpty(const string& full, const char* delim,
// if the key was already present in the hash table, or will be the
// empty string if the key is a newly inserted key.
void SplitStringToHashmapAllowEmpty(const string& full, const char* delim,
- hash_map<string, string>* result);
+ my_hash_map<string, string>* result);
// ----------------------------------------------------------------------
// SplitStringUsing()
@@ -66,7 +66,7 @@ void SplitStringToHashmapAllowEmpty(const string& full, const char* delim,
void SplitStringUsing(const string& full, const char* delim,
vector<string>* res);
void SplitStringToHashsetUsing(const string& full, const char* delim,
- hash_set<string>* res);
+ my_hash_set<string>* res);
void SplitStringToSetUsing(const string& full, const char* delim,
set<string>* res);
// The even-positioned (0-based) components become the keys for the
@@ -75,7 +75,7 @@ void SplitStringToSetUsing(const string& full, const char* delim,
// if the key was already present in the hash table, or will be the
// empty string if the key is a newly inserted key.
void SplitStringToHashmapUsing(const string& full, const char* delim,
- hash_map<string, string>* result);
+ my_hash_map<string, string>* result);
// ----------------------------------------------------------------------
// SplitOneIntToken()

View File

@@ -1,24 +0,0 @@
buildscripts/moduleconfig.py | 3 ---
1 file changed, 3 deletions(-)
diff --git a/buildscripts/moduleconfig.py b/buildscripts/moduleconfig.py
index b4d0bba0490..03541fab940 100644
--- a/buildscripts/moduleconfig.py
+++ b/buildscripts/moduleconfig.py
@@ -27,7 +27,6 @@ MongoDB SConscript files do.
__all__ = ('discover_modules', 'discover_module_directories', 'configure_modules',
'register_module_test') # pylint: disable=undefined-all-variable
-import imp
import inspect
import os
@@ -71,8 +70,6 @@ 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)

View File

@@ -1,16 +0,0 @@
The upstream patch for this is far too big to backport, so for now, just drop
the assert given it's somewhat harmless compared to not being able to build at all.
https://jira.mongodb.org/browse/SERVER-65664
https://bugs.gentoo.org/855128
--- a/src/mongo/db/stats/counters.h
+++ b/src/mongo/db/stats/counters.h
@@ -221,8 +221,6 @@ private:
AtomicWord<long long> requests{0};
};
CacheAligned<Together> _together{};
- static_assert(sizeof(decltype(_together)) <= stdx::hardware_constructive_interference_size,
- "cache line spill");
CacheAligned<AtomicWord<long long>> _logicalBytesOut{0};

View File

@@ -1,71 +0,0 @@
https://bugs.gentoo.org/844235
--- a/src/mongo/db/auth/security_key_test.cpp
+++ b/src/mongo/db/auth/security_key_test.cpp
@@ -30,6 +30,7 @@
#include "mongo/platform/basic.h"
#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
#include "mongo/base/string_data.h"
#include "mongo/db/auth/authorization_manager.h"
--- a/src/mongo/db/storage/storage_repair_observer.cpp
+++ b/src/mongo/db/storage/storage_repair_observer.cpp
@@ -41,6 +41,7 @@
#include <sys/types.h>
#endif
+#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/path.hpp>
#include "mongo/db/dbhelpers.h"
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine_test.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine_test.cpp
@@ -34,6 +34,7 @@
#include "mongo/db/storage/kv/kv_engine_test_harness.h"
#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/path.hpp>
#include <memory>
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp
@@ -36,6 +36,7 @@
#include <limits>
#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/path.hpp>
#include <pcrecpp.h>
--- a/src/mongo/shell/shell_utils_extended.cpp
+++ b/src/mongo/shell/shell_utils_extended.cpp
@@ -37,6 +37,7 @@
#endif
#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
#include <fmt/format.h>
#include <fstream>
--- a/src/mongo/util/stacktrace_threads.cpp
+++ b/src/mongo/util/stacktrace_threads.cpp
@@ -36,6 +36,7 @@
#include <array>
#include <atomic>
#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
#include <cstdint>
#include <cstdlib>
#include <dirent.h>
--- a/src/mongo/util/processinfo_linux.cpp
+++ b/src/mongo/util/processinfo_linux.cpp
@@ -36,6 +36,7 @@
#include <iostream>
#include <malloc.h>
#include <pcrecpp.h>
+#include <fstream>
#include <sched.h>
#include <stdio.h>
#include <sys/mman.h>

View File

@@ -1,32 +0,0 @@
diff --git a/SConstruct b/SConstruct
index 115de78a..613110b7 100644
--- a/SConstruct
+++ b/SConstruct
@@ -2366,7 +2366,6 @@ if env.TargetOSIs('posix'):
# -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used.
env.Append( CCFLAGS=["-fasynchronous-unwind-tables",
- "-ggdb" if not env.TargetOSIs('emscripten') else "-g",
"-Wall",
"-Wsign-compare",
"-Wno-unknown-pragmas",
@@ -2422,6 +2421,8 @@ if env.TargetOSIs('posix'):
# env.Append( " -Wconversion" ) TODO: this doesn't really work yet
env.Append( CXXFLAGS=["-Woverloaded-virtual"] )
+ env.Append( CXXFLAGS=os.environ['CXXFLAGS'] )
+ env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
# On OS X, clang doesn't want the pthread flag at link time, or it
# issues warnings which make it impossible for us to declare link
@@ -2473,8 +2474,8 @@ if env.TargetOSIs('posix'):
],
)
- #make scons colorgcc friendly
- for key in ('HOME', 'TERM'):
+ #make scons colorgcc, distcc, ccache friendly
+ for key in ('HOME', 'PATH', 'TERM'):
try:
env['ENV'][key] = os.environ[key]
except KeyError:

View File

@@ -1,12 +0,0 @@
diff --git a/src/mongo/installer/SConscript b/src/mongo/installer/SConscript
index 5bd89fe9..489e70ac 100644
--- a/src/mongo/installer/SConscript
+++ b/src/mongo/installer/SConscript
@@ -7,7 +7,6 @@ env = env.Clone()
env.SConscript(
dirs=[
- 'compass',
'msi',
],
exports=[

View File

@@ -1,13 +0,0 @@
diff --git a/SConstruct b/SConstruct
index 613110b7..4987e24e 100644
--- a/SConstruct
+++ b/SConstruct
@@ -2958,7 +2958,7 @@ def doConfigure(myenv):
# This warning was added in clang-5 and incorrectly flags our implementation of
# exceptionToStatus(). See https://bugs.llvm.org/show_bug.cgi?id=34804
- AddToCCFLAGSIfSupported(myenv, "-Wno-exceptions")
+ #AddToCCFLAGSIfSupported(myenv, "-Wno-exceptions")
# Enable sized deallocation support.
AddToCXXFLAGSIfSupported(myenv, '-fsized-deallocation')

View File

@@ -1,24 +0,0 @@
diff --git a/buildscripts/scons.py b/buildscripts/scons.py
index 534fca32..c38f64df 100755
--- a/buildscripts/scons.py
+++ b/buildscripts/scons.py
@@ -19,13 +19,13 @@ SITE_TOOLS_DIR = os.path.join(MONGODB_ROOT, 'site_scons')
sys.path = [SCONS_DIR, SITE_TOOLS_DIR] + sys.path
# pylint: disable=C0413
-from mongo.pip_requirements import verify_requirements, MissingRequirements
+#from mongo.pip_requirements import verify_requirements, MissingRequirements
-try:
- verify_requirements('etc/pip/compile-requirements.txt')
-except MissingRequirements as ex:
- print(ex)
- sys.exit(1)
+#try:
+# verify_requirements('etc/pip/compile-requirements.txt')
+#except MissingRequirements as ex:
+# print(ex)
+# sys.exit(1)
try:
import SCons.Script

View File

@@ -1,16 +0,0 @@
https://bugs.gentoo.org/932251
https://github.com/mongodb/mongo/commit/f8e4be7f6da71f978b2aa9991febb4c7ad89c903#diff-010644a9158d28e5745762753c7ce454444c9fb9ab4c684e9f2fdcff50c6f539
https://bugs.gentoo.org/932251#c3
--- a/src/mongo/db/initialize_server_global_state.cpp
+++ b/src/mongo/db/initialize_server_global_state.cpp
@@ -328,7 +328,7 @@
<< "\" should name a file, not a directory.");
}
- if (!serverGlobalParams.logAppend && boost::filesystem::is_regular(absoluteLogpath)) {
+ if (!serverGlobalParams.logAppend && boost::filesystem::is_regular_file(absoluteLogpath)) {
std::string renameTarget = absoluteLogpath + "." + terseCurrentTimeForFilename();
boost::system::error_code ec;
boost::filesystem::rename(absoluteLogpath, renameTarget, ec);

View File

@@ -1,130 +0,0 @@
https://bugs.gentoo.org/932251
https://github.com/mongodb/mongo/commit/f8e4be7f6da71f978b2aa9991febb4c7ad89c903#diff-010644a9158d28e5745762753c7ce454444c9fb9ab4c684e9f2fdcff50c6f539
https://bugs.gentoo.org/932251#c3
--- a/src/mongo/db/initialize_server_global_state.cpp
+++ b/src/mongo/db/initialize_server_global_state.cpp
@@ -34,7 +34,7 @@
#include "mongo/db/initialize_server_global_state.h"
#include "mongo/db/initialize_server_global_state_gen.h"
-#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem.hpp>
#include <fmt/format.h>
#include <iostream>
#include <memory>
--- a/src/mongo/db/startup_warnings_mongod.cpp
+++ b/src/mongo/db/startup_warnings_mongod.cpp
@@ -34,6 +34,7 @@
#include "mongo/db/startup_warnings_mongod.h"
#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/exception.hpp>
#include <fstream>
#ifndef _WIN32
#include <sys/resource.h>
--- a/src/mongo/db/storage/storage_engine_lock_file_posix.cpp
+++ b/src/mongo/db/storage/storage_engine_lock_file_posix.cpp
@@ -55,7 +55,7 @@
// if called without a fully qualified path it asserts; that makes mongoperf fail.
// so make a warning. need a better solution longer term.
// massert(40389, str::stream() << "Couldn't find parent dir for file: " << file.string(),);
- if (!file.has_branch_path()) {
+ if (!file.has_parent_path()) {
LOGV2(22274,
"warning flushMyDirectory couldn't find parent dir for file: {file}",
"flushMyDirectory couldn't find parent dir for file",
@@ -64,7 +64,7 @@
}
- boost::filesystem::path dir = file.branch_path(); // parent_path in new boosts
+ boost::filesystem::path dir = file.parent_path(); // parent_path in new boosts
LOGV2_DEBUG(22275, 1, "flushing directory {dir_string}", "dir_string"_attr = dir.string());
--- a/src/mongo/db/storage/storage_engine_metadata.cpp
+++ b/src/mongo/db/storage/storage_engine_metadata.cpp
@@ -220,7 +220,7 @@
// if called without a fully qualified path it asserts; that makes mongoperf fail.
// so make a warning. need a better solution longer term.
// massert(13652, str::stream() << "Couldn't find parent dir for file: " << file.string(),);
- if (!file.has_branch_path()) {
+ if (!file.has_parent_path()) {
LOGV2(22283,
"warning flushMyDirectory couldn't find parent dir for file: {file}",
"flushMyDirectory couldn't find parent dir for file",
@@ -229,7 +229,7 @@
}
- boost::filesystem::path dir = file.branch_path(); // parent_path in new boosts
+ boost::filesystem::path dir = file.parent_path(); // parent_path in new boosts
LOGV2_DEBUG(22284, 1, "flushing directory {dir_string}", "dir_string"_attr = dir.string());
--- a/src/mongo/scripting/engine.cpp
+++ b/src/mongo/scripting/engine.cpp
@@ -35,6 +35,7 @@
#include <algorithm>
#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/directory.hpp>
#include "mongo/base/string_data.h"
#include "mongo/client/dbclient_base.h"
--- a/src/mongo/shell/shell_utils_launcher.cpp
+++ b/src/mongo/shell/shell_utils_launcher.cpp
@@ -39,6 +39,7 @@
#include <boost/iostreams/stream.hpp>
#include <boost/iostreams/stream_buffer.hpp>
#include <boost/iostreams/tee.hpp>
+#include <boost/filesystem.hpp>
#include <fcntl.h>
#include <fmt/format.h>
#include <iostream>
@@ -947,26 +948,26 @@
boost::filesystem::directory_iterator i(from);
while (i != end) {
boost::filesystem::path p = *i;
- if (p.leaf() == "metrics.interim" || p.leaf() == "metrics.interim.temp") {
+ if (p.filename() == "metrics.interim" || p.filename() == "metrics.interim.temp") {
// Ignore any errors for metrics.interim* files as these may disappear during copy
boost::system::error_code ec;
- boost::filesystem::copy_file(p, to / p.leaf(), ec);
+ boost::filesystem::copy_file(p, to / p.filename(), ec);
if (ec) {
LOGV2_INFO(22814,
"Skipping copying of file from '{from}' to "
"'{to}' due to: {error}",
"Skipping copying of file due to error"
"from"_attr = p.generic_string(),
- "to"_attr = (to / p.leaf()).generic_string(),
+ "to"_attr = (to / p.filename()).generic_string(),
"error"_attr = ec.message());
}
- } else if (p.leaf() != "mongod.lock" && p.leaf() != "WiredTiger.lock") {
+ } else if (p.filename() != "mongod.lock" && p.filename() != "WiredTiger.lock") {
if (boost::filesystem::is_directory(p)) {
- boost::filesystem::path newDir = to / p.leaf();
+ boost::filesystem::path newDir = to / p.filename();
boost::filesystem::create_directory(newDir);
copyDir(p, newDir);
} else {
- boost::filesystem::copy_file(p, to / p.leaf());
+ boost::filesystem::copy_file(p, to / p.filename());
}
}
++i;
--- a/src/mongo/shell/shell_utils_launcher.h
+++ b/src/mongo/shell/shell_utils_launcher.h
@@ -29,7 +29,7 @@
#pragma once
-#include <boost/filesystem/convenience.hpp>
+#include <boost/filesystem/path.hpp>
#include <map>
#include <sstream>
#include <string>

View File

@@ -1,25 +0,0 @@
https://phabricator.services.mozilla.com/D209108
https://github.com/mozilla/gecko-dev/commit/33cdc6655b0de44cb7a431216dcbb0d5a552aec6
clang 19 will report error if w/o this patch:
src/third_party/mozjs-60/extract/js/src/threading/ExclusiveData.h:124:33: error: reference to non-static member function must be called
diff --git a/src/third_party/mozjs-60/extract/js/src/threading/ExclusiveData.h b/src/third_party/mozjs-60/extract/js/src/threading/ExclusiveData.h
index 25b977e..379a509 100644
--- a/src/third_party/mozjs-60/extract/js/src/threading/ExclusiveData.h
+++ b/src/third_party/mozjs-60/extract/js/src/threading/ExclusiveData.h
@@ -120,13 +120,6 @@ class ExclusiveData
release();
}
- ExclusiveData(ExclusiveData&& rhs)
- : lock_(mozilla::Move(rhs.lock))
- {
- MOZ_ASSERT(&rhs != this, "self-move disallowed!");
- new (mozilla::KnownNotNull, value_.addr()) T(mozilla::Move(*rhs.value_.addr()));
- }
-
ExclusiveData& operator=(ExclusiveData&& rhs) {
this->~ExclusiveData();
new (mozilla::KnownNotNull, this) ExclusiveData(mozilla::Move(rhs));

View File

@@ -1,27 +0,0 @@
https://jira.mongodb.org/browse/SERVER-94430 Upstream respond:
> we intentionally do not ingest the environment PATH as this makes build
> reproducibility and hermiticity much harder. Instead, you should set the
> absolute paths to the tools you want to use on the command line, instead of
> relying on the PATH.
Gentoo bug https://bugs.gentoo.org/829340
In Gentoo, we have LLVM slotted and we put clang in /usr/lib/llvm/18/bin (or
whatever), not in /usr/bin, and if upstream strip PATH and construct it
themselves, they surely won't contain this location.
So we add PATH backup for scons.
diff --git a/SConstruct b/SConstruct
index 3d831c9..f07feeb 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1201,7 +1201,7 @@ envDict = dict(BUILD_ROOT=buildDir,
if get_option('build-tools') == 'next':
SCons.Tool.DefaultToolpath.insert(0, os.path.abspath('site_scons/site_tools/next'))
-env = Environment(variables=env_vars, **envDict)
+env = Environment(variables=env_vars, ENV={'PATH': os.environ['PATH']}, **envDict)
del envDict
if get_option('cache-signature-mode') == 'validate':

View File

@@ -1,12 +0,0 @@
https://bugs.gentoo.org/768339
--- a/src/mongo/db/exec/plan_stats.h
+++ b/src/mongo/db/exec/plan_stats.h
@@ -33,6 +33,7 @@
#include <cstdlib>
#include <string>
#include <vector>
+#include <optional>
#include "mongo/db/index/multikey_paths.h"
#include "mongo/db/jsobj.h"

View File

@@ -1,13 +0,0 @@
https://github.com/abseil/abseil-cpp/commit/809e5de7b92950849289236a5a09e9cb4f32c7b9
diff --git a/src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/container_memory.h b/src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/container_memory.h
index e67529ecb6e..d777480d604 100644
--- a/src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/container_memory.h
+++ b/src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/container_memory.h
@@ -17,6 +17,7 @@
#include <cassert>
#include <cstddef>
+#include <cstdint>
#include <memory>
#include <new>
#include <tuple>

View File

@@ -0,0 +1,21 @@
--- mongo-r5.0.32/SConstruct.orig 2025-12-30 22:11:04.054613342 +0100
+++ mongo-r5.0.32/SConstruct 2025-12-30 22:11:44.334813563 +0100
@@ -1177,7 +1177,7 @@
printLocalInfo()
-boostLibs = [ "filesystem", "program_options", "system", "iostreams", "thread", "log" ]
+boostLibs = [ "filesystem", "program_options", "iostreams", "thread", "log" ]
onlyServer = len( COMMAND_LINE_TARGETS ) == 0 or ( len( COMMAND_LINE_TARGETS ) == 1 and str( COMMAND_LINE_TARGETS[0] ) in [ "mongod" , "mongos" , "test" ] )
--- mongo-r5.0.32/src/third_party/SConscript.orig 2025-12-30 22:11:59.084886880 +0100
+++ mongo-r5.0.32/src/third_party/SConscript 2025-12-30 22:13:11.795248298 +0100
@@ -347,7 +347,6 @@
SYSLIBDEPS=[
env['LIBDEPS_BOOST_PROGRAM_OPTIONS_SYSLIBDEP'],
env['LIBDEPS_BOOST_FILESYSTEM_SYSLIBDEP'],
- env['LIBDEPS_BOOST_SYSTEM_SYSLIBDEP'],
env['LIBDEPS_BOOST_IOSTREAMS_SYSLIBDEP'],
env['LIBDEPS_BOOST_THREAD_SYSLIBDEP'],
env['LIBDEPS_BOOST_LOG_SYSLIBDEP'],

View File

@@ -0,0 +1,17 @@
--- mongo-r5.0.32/SConstruct.orig 2025-12-30 22:27:54.729642956 +0100
+++ mongo-r5.0.32/SConstruct 2025-12-30 22:28:46.209899176 +0100
@@ -16,7 +16,13 @@
import uuid
from glob import glob
-from pkg_resources import parse_version
+try:
+ from packaging.version import parse as _parse_version
+except ImportError:
+ from distutils.version import LooseVersion as _LooseVersion
+
+ def _parse_version(version):
+ return _LooseVersion(version)
import SCons

View File

@@ -1,11 +0,0 @@
https://bugs.gentoo.org/889020
--- a/src/mongo/util/boost_assert_shim.cpp
+++ b/src/mongo/util/boost_assert_shim.cpp
@@ -31,6 +31,7 @@
#if defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && !defined(NDEBUG)
+#include <exception>
#include <boost/assert.hpp>
namespace mongo {

View File

@@ -1,49 +0,0 @@
Don't automagically force lld > gold > bfd. Leave it up to the user.
In particular, avoids issues with LTO enabled (via the flag/scons option)
where using GCC as compiler, as lld can't do LTO with GCC.
https://bugs.gentoo.org/769986
--- a/SConstruct
+++ b/SConstruct
@@ -2824,40 +2824,6 @@ def doConfigure(myenv):
def AddToSHLINKFLAGSIfSupported(env, flag):
return AddFlagIfSupported(env, 'C', '.c', flag, True, SHLINKFLAGS=[flag])
- if myenv.ToolchainIs('gcc', 'clang'):
- # This tells clang/gcc to use the gold linker if it is available - we prefer the gold linker
- # because it is much faster. Don't use it if the user has already configured another linker
- # selection manually.
- if any(flag.startswith('-fuse-ld=') for flag in env['LINKFLAGS']):
- myenv.FatalError(f"Use the '--linker' option instead of modifying the LINKFLAGS directly.")
-
- linker_ld = get_option('linker')
- if linker_ld == 'auto':
- # lld has problems with separate debug info on some platforms. See:
- # - https://bugzilla.mozilla.org/show_bug.cgi?id=1485556
- # - https://bugzilla.mozilla.org/show_bug.cgi?id=1485556
- #
- # lld also apparently has problems with symbol resolution
- # in some esoteric configurations that apply for us when
- # using --link-model=dynamic mode, so disable lld there
- # too. See:
- # - https://bugs.llvm.org/show_bug.cgi?id=46676
- #
- # We should revisit all of these issues the next time we upgrade our clang minimum.
- if get_option('separate-debug') == 'off' and get_option('link-model') != 'dynamic':
- if not AddToLINKFLAGSIfSupported(myenv, '-fuse-ld=lld'):
- AddToLINKFLAGSIfSupported(myenv, '-fuse-ld=gold')
- else:
- AddToLINKFLAGSIfSupported(myenv, '-fuse-ld=gold')
- elif link_model.startswith("dynamic") and linker_ld == 'bfd':
- # BFD is not supported due to issues with it causing warnings from some of
- # the third party libraries that mongodb is linked with:
- # https://jira.mongodb.org/browse/SERVER-49465
- myenv.FatalError(f"Linker {linker_ld} is not supported with dynamic link model builds.")
- else:
- if not AddToLINKFLAGSIfSupported(myenv, f'-fuse-ld={linker_ld}'):
- myenv.FatalError(f"Linker {linker_ld} could not be configured.")
-
detectCompiler = Configure(myenv, help=False, custom_tests = {
'CheckForCXXLink': CheckForCXXLink,
})

View File

@@ -1,81 +0,0 @@
https://bugs.gentoo.org/844235
--- a/src/mongo/db/auth/security_key_test.cpp
+++ b/src/mongo/db/auth/security_key_test.cpp
@@ -30,6 +30,7 @@
#include "mongo/platform/basic.h"
#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
#include "mongo/base/string_data.h"
#include "mongo/db/auth/authorization_manager.h"
--- a/src/mongo/db/storage/storage_repair_observer.cpp
+++ b/src/mongo/db/storage/storage_repair_observer.cpp
@@ -41,6 +41,7 @@
#include <sys/types.h>
#endif
+#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/path.hpp>
#include "mongo/db/dbhelpers.h"
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine_test.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine_test.cpp
@@ -34,6 +34,7 @@
#include "mongo/db/storage/kv/kv_engine_test_harness.h"
#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/path.hpp>
#include <memory>
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
@@ -48,6 +48,7 @@
#include "mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h"
#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/system/error_code.hpp>
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp
@@ -36,6 +36,7 @@
#include <limits>
#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/path.hpp>
#include <pcrecpp.h>
--- a/src/mongo/shell/shell_utils_extended.cpp
+++ b/src/mongo/shell/shell_utils_extended.cpp
@@ -37,6 +37,7 @@
#endif
#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
#include <fmt/format.h>
#include <fstream>
--- a/src/mongo/util/stacktrace_threads.cpp
+++ b/src/mongo/util/stacktrace_threads.cpp
@@ -36,6 +36,7 @@
#include <array>
#include <atomic>
#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
#include <cstdint>
#include <cstdlib>
#include <dirent.h>
--- a/src/mongo/util/processinfo_linux.cpp
+++ b/src/mongo/util/processinfo_linux.cpp
@@ -36,6 +36,7 @@
#include <iostream>
#include <malloc.h>
#include <pcrecpp.h>
+#include <fstream>
#include <sched.h>
#include <stdio.h>
#include <sys/mman.h>

View File

@@ -1,15 +0,0 @@
https://bugs.gentoo.org/932251
https://github.com/mongodb/mongo/commit/f8e4be7f6da71f978b2aa9991febb4c7ad89c903#diff-010644a9158d28e5745762753c7ce454444c9fb9ab4c684e9f2fdcff50c6f539
https://bugs.gentoo.org/932251#c3
--- a/src/mongo/db/initialize_server_global_state.cpp
+++ b/src/mongo/db/initialize_server_global_state.cpp
@@ -307,7 +307,7 @@ bool checkAndMoveLogFile(const std::string& absoluteLogpath) {
<< "\" should name a file, not a directory.");
}
- if (!serverGlobalParams.logAppend && boost::filesystem::is_regular(absoluteLogpath)) {
+ if (!serverGlobalParams.logAppend && boost::filesystem::is_regular_file(absoluteLogpath)) {
std::string renameTarget = absoluteLogpath + "." + terseCurrentTimeForFilename();
boost::system::error_code ec;
boost::filesystem::rename(absoluteLogpath, renameTarget, ec);

View File

@@ -1,25 +0,0 @@
From 01c202b65f136450e0bd3f516d7268322e9beafc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Valenduc?= <francoisvalenduc@gmail.com>
Date: Fri, 11 Apr 2025 18:50:10 +0200
Subject: [PATCH] replace change_extension by replace_extension
---
src/mongo/db/storage/backup_block.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mongo/db/storage/backup_block.cpp b/src/mongo/db/storage/backup_block.cpp
index 9b8dc29f209..a8b86398665 100644
--- a/src/mongo/db/storage/backup_block.cpp
+++ b/src/mongo/db/storage/backup_block.cpp
@@ -59,7 +59,7 @@ std::string extractIdentFromPath(const boost::filesystem::path& dbpath,
// Remove the file extension and convert to generic form (i.e. replace "\" with "/"
// on windows, no-op on unix).
- return boost::filesystem::change_extension(identWithExtension, "").generic_string();
+ return boost::filesystem::path(identWithExtension).replace_extension("").generic_string();
}
} // namespace details
--
2.49.0

View File

@@ -1,26 +0,0 @@
From 2605c36cf9a5c3e49d59dcd36ee5b57ab3437922 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Valenduc?= <francoisvalenduc@gmail.com>
Date: Mon, 17 Feb 2025 21:57:45 +0100
Subject: [PATCH] add boost include
---
src/mongo/db/storage/backup_block.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/mongo/db/storage/backup_block.cpp b/src/mongo/db/storage/backup_block.cpp
index 9b8dc29f209..6328a727fbe 100644
--- a/src/mongo/db/storage/backup_block.cpp
+++ b/src/mongo/db/storage/backup_block.cpp
@@ -30,6 +30,9 @@
#include "mongo/db/storage/backup_block.h"
#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
+#include <boost/filesystem/operations.hpp>
+#include <boost/filesystem/path.hpp>
#include <set>
#include "mongo/base/string_data.h"
--
2.45.3

View File

@@ -1,12 +0,0 @@
https://bugs.gentoo.org/768339
--- a/src/mongo/db/exec/plan_stats.h
+++ b/src/mongo/db/exec/plan_stats.h
@@ -33,6 +33,7 @@
#include <cstdlib>
#include <string>
#include <vector>
+#include <optional>
#include "mongo/db/exec/plan_stats_visitor.h"
#include "mongo/db/index/multikey_paths.h"

View File

@@ -1,12 +0,0 @@
diff --git a/src/mongo/db/repl/tenant_file_cloner.h b/src/mongo/db/repl/tenant_file_cloner.h
index def0952..0625e46 100644
--- a/src/mongo/db/repl/tenant_file_cloner.h
+++ b/src/mongo/db/repl/tenant_file_cloner.h
@@ -32,6 +32,7 @@
#include <boost/filesystem.hpp>
#include <memory>
#include <vector>
+#include <fstream>
#include "mongo/db/repl/base_cloner.h"
#include "mongo/db/repl/task_runner.h"

View File

@@ -1,12 +0,0 @@
diff --git a/src/mongo/util/ctype.h b/src/mongo/util/ctype.h
index a3880e2..78ee57e 100644
--- a/src/mongo/util/ctype.h
+++ b/src/mongo/util/ctype.h
@@ -67,6 +67,7 @@
#pragma once
#include <array>
+#include <cstdint>
namespace mongo::ctype {
namespace detail {

View File

@@ -1,93 +0,0 @@
diff --git a/SConstruct b/SConstruct
index 8367691..9061849 100644
--- a/SConstruct
+++ b/SConstruct
@@ -2441,7 +2441,6 @@ if env.TargetOSIs('posix'):
# -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used.
env.Append( CCFLAGS=["-fasynchronous-unwind-tables",
- "-ggdb" if not env.TargetOSIs('emscripten') else "-g",
"-Wall",
"-Wsign-compare",
"-Wno-unknown-pragmas",
@@ -2497,6 +2496,8 @@ if env.TargetOSIs('posix'):
# env.Append( " -Wconversion" ) TODO: this doesn't really work yet
env.Append( CXXFLAGS=["-Woverloaded-virtual"] )
+ env.Append( CXXFLAGS=os.environ['CXXFLAGS'] )
+ env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
# On OS X, clang doesn't want the pthread flag at link time, or it
# issues warnings which make it impossible for us to declare link
@@ -2549,7 +2550,7 @@ if env.TargetOSIs('posix'):
)
#make scons colorgcc friendly
- for key in ('HOME', 'TERM'):
+ for key in ('HOME', 'TERM', 'PATH'):
try:
env['ENV'][key] = os.environ[key]
except KeyError:
@@ -2968,43 +2969,6 @@ def doConfigure(myenv):
myenv.AddMethod(
functools.partial(var_func, var=var, func=CheckFlag), f"Check{var}Supported")
- if myenv.ToolchainIs('gcc', 'clang'):
- # This tells clang/gcc to use the gold linker if it is available - we prefer the gold linker
- # because it is much faster. Don't use it if the user has already configured another linker
- # selection manually.
- if any(flag.startswith('-fuse-ld=') for flag in env['LINKFLAGS']):
- myenv.FatalError(f"Use the '--linker' option instead of modifying the LINKFLAGS directly.")
-
- linker_ld = get_option('linker')
- if linker_ld == 'auto':
- # lld has problems with separate debug info on some platforms. See:
- # - https://bugzilla.mozilla.org/show_bug.cgi?id=1485556
- # - https://bugzilla.mozilla.org/show_bug.cgi?id=1485556
- #
- # lld also apparently has problems with symbol resolution
- # in some esoteric configurations that apply for us when
- # using --link-model=dynamic mode, so disable lld there
- # too. See:
- # - https://bugs.llvm.org/show_bug.cgi?id=46676
- #
- # We should revisit all of these issues the next time we upgrade our clang minimum.
- if get_option('separate-debug') == 'off' and get_option('link-model') != 'dynamic':
- if not myenv.AddToLINKFLAGSIfSupported('-fuse-ld=lld'):
- myenv.AddToLINKFLAGSIfSupported('-fuse-ld=gold')
- else:
- myenv.AddToLINKFLAGSIfSupported('-fuse-ld=gold')
- elif link_model.startswith("dynamic") and linker_ld == 'bfd':
- # BFD is not supported due to issues with it causing warnings from some of
- # the third party libraries that mongodb is linked with:
- # https://jira.mongodb.org/browse/SERVER-49465
- myenv.FatalError(f"Linker {linker_ld} is not supported with dynamic link model builds.")
- else:
- if not myenv.AddToLINKFLAGSIfSupported(f'-fuse-ld={linker_ld}'):
- myenv.FatalError(f"Linker {linker_ld} could not be configured.")
-
- if has_option('gcov') and myenv.AddToCCFLAGSIfSupported('-fprofile-update=single'):
- myenv.AppendUnique(LINKFLAGS=['-fprofile-update=single'])
-
detectCompiler = Configure(myenv, help=False, custom_tests = {
'CheckForCXXLink': CheckForCXXLink,
})
@@ -4344,17 +4308,11 @@ def doConfigure(myenv):
"BOOST_LOG_NO_SHORTHAND_NAMES",
"BOOST_LOG_USE_NATIVE_SYSLOG",
"BOOST_LOG_WITHOUT_THREAD_ATTR",
+ "BOOST_LOG_DYN_LINK",
"ABSL_FORCE_ALIGNED_ACCESS",
]
)
- if link_model.startswith("dynamic") and not link_model == 'dynamic-sdk':
- conf.env.AppendUnique(
- CPPDEFINES=[
- "BOOST_LOG_DYN_LINK",
- ]
- )
-
if use_system_version_of_library("boost"):
if not conf.CheckCXXHeader( "boost/filesystem/operations.hpp" ):
myenv.ConfError("can't find boost headers")

View File

@@ -0,0 +1,110 @@
wrt PATH:
"""
https://jira.mongodb.org/browse/SERVER-94430 Upstream respond:
> we intentionally do not ingest the environment PATH as this makes build
> reproducibility and hermiticity much harder. Instead, you should set the
> absolute paths to the tools you want to use on the command line, instead of
> relying on the PATH.
Gentoo bug https://bugs.gentoo.org/829340
In Gentoo, we have LLVM slotted and we put clang in /usr/lib/llvm/18/bin (or
whatever), not in /usr/bin, and if upstream strip PATH and construct it
themselves, they surely won't contain this location.
So we add PATH backup for scons.
"""
diff --git a/SConstruct b/SConstruct
index 2ebeb0e..44ce93a 100644
--- a/SConstruct
+++ b/SConstruct
@@ -3034,7 +3026,6 @@ if env.TargetOSIs('posix'):
env.Append(
CCFLAGS=[
"-fasynchronous-unwind-tables",
- "-g2" if not env.TargetOSIs('emscripten') else "-g",
"-Wall",
"-Wsign-compare",
"-Wno-unknown-pragmas",
@@ -3101,6 +3092,8 @@ if env.TargetOSIs('posix'):
# env.Append( " -Wconversion" ) TODO: this doesn't really work yet
env.Append(CXXFLAGS=["-Woverloaded-virtual"])
+ env.Append(CXXFLAGS=os.environ['CXXFLAGS'])
+ env.Append(LINKFLAGS=os.environ['LDFLAGS'])
# On OS X, clang doesn't want the pthread flag at link time, or it
# issues warnings which make it impossible for us to declare link
@@ -3151,7 +3144,7 @@ if env.TargetOSIs('posix'):
], )
#make scons colorgcc friendly
- for key in ('HOME', 'TERM'):
+ for key in ('HOME', 'TERM', 'PATH'):
try:
env['ENV'][key] = os.environ[key]
except KeyError:
@@ -3553,33 +3546,6 @@ def doConfigure(myenv):
myenv.AddMethod(
functools.partial(var_func, var=var, func=CheckFlag), f"Check{var}Supported")
- if myenv.ToolchainIs('gcc', 'clang'):
- # This tells clang/gcc to use the gold linker if it is available - we prefer the gold linker
- # because it is much faster. Don't use it if the user has already configured another linker
- # selection manually.
- if any(flag.startswith('-fuse-ld=') for flag in env['LINKFLAGS']):
- myenv.FatalError(
- f"Use the '--linker' option instead of modifying the LINKFLAGS directly.")
-
- linker_ld = get_option('linker')
- if linker_ld == 'auto':
- if not env.TargetOSIs('darwin', 'macOS'):
- if not myenv.AddToLINKFLAGSIfSupported('-fuse-ld=lld'):
- myenv.FatalError(
- f"The recommended linker 'lld' is not supported with the current compiler configuration, you can try the 'gold' linker with '--linker=gold'."
- )
- elif link_model.startswith("dynamic") and linker_ld == 'bfd':
- # BFD is not supported due to issues with it causing warnings from some of
- # the third party libraries that mongodb is linked with:
- # https://jira.mongodb.org/browse/SERVER-49465
- myenv.FatalError(f"Linker {linker_ld} is not supported with dynamic link model builds.")
- else:
- if not myenv.AddToLINKFLAGSIfSupported(f'-fuse-ld={linker_ld}'):
- myenv.FatalError(f"Linker {linker_ld} could not be configured.")
-
- if has_option('gcov') and myenv.AddToCCFLAGSIfSupported('-fprofile-update=single'):
- myenv.AppendUnique(LINKFLAGS=['-fprofile-update=single'])
-
detectCompiler = Configure(
myenv,
help=False,
@@ -5119,17 +5085,13 @@ def doConfigure(myenv):
"BOOST_LOG_NO_SHORTHAND_NAMES",
"BOOST_LOG_USE_NATIVE_SYSLOG",
"BOOST_LOG_WITHOUT_THREAD_ATTR",
+ "BOOST_LOG_DYN_LINK",
"BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS",
"BOOST_SYSTEM_NO_DEPRECATED",
"BOOST_THREAD_USES_DATETIME",
("BOOST_THREAD_VERSION", "5"),
])
- if link_model.startswith("dynamic") and not link_model == 'dynamic-sdk':
- conf.env.AppendUnique(CPPDEFINES=[
- "BOOST_LOG_DYN_LINK",
- ])
-
if use_system_version_of_library("boost"):
if not conf.CheckCXXHeader("boost/filesystem/operations.hpp"):
myenv.ConfError("can't find boost headers")
@@ -5326,6 +5288,9 @@ def doConfigure(myenv):
mongoc_mode = get_option('use-system-mongo-c')
conf.env['MONGO_HAVE_LIBMONGOC'] = False
+ conf.env.ParseConfig('pkg-config libbson-1.0 libmongoc-1.0 --cflags')
+ conf.env['LIBDEPS_LIBBSON_SYSLIBDEP'] = 'bson-1.0'
+
if mongoc_mode != 'off':
if conf.CheckLibWithHeader(
["mongoc-1.0"],

View File

@@ -1,149 +0,0 @@
diff --git a/SConstruct b/SConstruct
index 92d557b..80ee9e8 100644
--- a/SConstruct
+++ b/SConstruct
@@ -23,7 +23,6 @@ from pkg_resources import parse_version
import SCons
import SCons.Script
-from mongo_tooling_metrics.lib.top_level_metrics import SConsToolingMetrics
from site_scons.mongo import build_profiles
# This must be first, even before EnsureSConsVersion, if
@@ -1649,13 +1648,6 @@ env.AddMethod(lambda env, name, **kwargs: add_option(name, **kwargs), 'AddOption
# The placement of this is intentional. Here we setup an atexit method to store tooling metrics.
# We should only register this function after env, env_vars and the parser have been properly initialized.
-SConsToolingMetrics.register_metrics(
- utc_starttime=datetime.utcnow(),
- artifact_dir=env.Dir('$BUILD_DIR').get_abspath(),
- env_vars=env_vars,
- env=env,
- parser=_parser,
-)
if get_option('build-metrics'):
env['BUILD_METRICS_ARTIFACTS_DIR'] = '$BUILD_ROOT/$VARIANT_DIR'
@@ -3026,7 +3018,6 @@ if env.TargetOSIs('posix'):
env.Append(
CCFLAGS=[
"-fasynchronous-unwind-tables",
- "-g2" if not env.TargetOSIs('emscripten') else "-g",
"-Wall",
"-Wsign-compare",
"-Wno-unknown-pragmas",
@@ -3093,6 +3084,8 @@ if env.TargetOSIs('posix'):
# env.Append( " -Wconversion" ) TODO: this doesn't really work yet
env.Append(CXXFLAGS=["-Woverloaded-virtual"])
+ env.Append(CXXFLAGS=os.environ['CXXFLAGS'])
+ env.Append(LINKFLAGS=os.environ['LDFLAGS'])
# On OS X, clang doesn't want the pthread flag at link time, or it
# issues warnings which make it impossible for us to declare link
@@ -3143,7 +3136,7 @@ if env.TargetOSIs('posix'):
], )
#make scons colorgcc friendly
- for key in ('HOME', 'TERM'):
+ for key in ('HOME', 'TERM', 'PATH'):
try:
env['ENV'][key] = os.environ[key]
except KeyError:
@@ -3543,33 +3536,6 @@ def doConfigure(myenv):
myenv.AddMethod(
functools.partial(var_func, var=var, func=CheckFlag), f"Check{var}Supported")
- if myenv.ToolchainIs('gcc', 'clang'):
- # This tells clang/gcc to use the gold linker if it is available - we prefer the gold linker
- # because it is much faster. Don't use it if the user has already configured another linker
- # selection manually.
- if any(flag.startswith('-fuse-ld=') for flag in env['LINKFLAGS']):
- myenv.FatalError(
- f"Use the '--linker' option instead of modifying the LINKFLAGS directly.")
-
- linker_ld = get_option('linker')
- if linker_ld == 'auto':
- if not env.TargetOSIs('darwin', 'macOS'):
- if not myenv.AddToLINKFLAGSIfSupported('-fuse-ld=lld'):
- myenv.FatalError(
- f"The recommended linker 'lld' is not supported with the current compiler configuration, you can try the 'gold' linker with '--linker=gold'."
- )
- elif link_model.startswith("dynamic") and linker_ld == 'bfd':
- # BFD is not supported due to issues with it causing warnings from some of
- # the third party libraries that mongodb is linked with:
- # https://jira.mongodb.org/browse/SERVER-49465
- myenv.FatalError(f"Linker {linker_ld} is not supported with dynamic link model builds.")
- else:
- if not myenv.AddToLINKFLAGSIfSupported(f'-fuse-ld={linker_ld}'):
- myenv.FatalError(f"Linker {linker_ld} could not be configured.")
-
- if has_option('gcov') and myenv.AddToCCFLAGSIfSupported('-fprofile-update=single'):
- myenv.AppendUnique(LINKFLAGS=['-fprofile-update=single'])
-
detectCompiler = Configure(
myenv,
help=False,
@@ -4621,43 +4587,6 @@ def doConfigure(myenv):
if optBuild == "off" and myenv.ToolchainIs('clang') and env.TargetOSIs('darwin'):
myenv.AddToLINKFLAGSIfSupported("-Wl,-no_deduplicate")
- # Apply any link time optimization settings as selected by the 'lto' option.
- if has_option('lto'):
- if myenv.ToolchainIs('msvc'):
- # Note that this is actually more aggressive than LTO, it is whole program
- # optimization due to /GL. However, this is historically what we have done for
- # windows, so we are keeping it.
- #
- # /GL implies /LTCG, so no need to say it in CCFLAGS, but we do need /LTCG on the
- # link flags.
- myenv.Append(CCFLAGS=['/GL'])
- myenv.Append(LINKFLAGS=['/LTCG'])
- myenv.Append(ARFLAGS=['/LTCG'])
- elif myenv.ToolchainIs('gcc', 'clang'):
- # For GCC and clang, the flag is -flto, and we need to pass it both on the compile
- # and link lines.
- if not myenv.AddToCCFLAGSIfSupported('-flto') or \
- not myenv.AddToLINKFLAGSIfSupported('-flto'):
- myenv.ConfError("Link time optimization requested, "
- "but selected compiler does not honor -flto")
-
- if myenv.TargetOSIs('darwin'):
- myenv.AddToLINKFLAGSIfSupported('-Wl,-object_path_lto,${TARGET}.lto')
- else:
- # According to intel benchmarks -fno-plt increases perf
- # See PM-2215
- if linker_ld != "gold":
- myenv.ConfError("lto compilation currently only works with the --linker=gold")
- if link_model != "object":
- myenv.ConfError(
- "lto compilation currently only works with the --link-model=object")
- if not myenv.AddToCCFLAGSIfSupported('-fno-plt') or \
- not myenv.AddToLINKFLAGSIfSupported('-fno-plt'):
- myenv.ConfError("-fno-plt is not supported by the compiler")
-
- else:
- myenv.ConfError("Don't know how to enable --lto on current toolchain")
-
if get_option('runtime-hardening') == "on" and optBuild != "off":
# Older glibc doesn't work well with _FORTIFY_SOURCE=2. Selecting 2.11 as the minimum was an
# emperical decision, as that is the oldest non-broken glibc we seem to require. It is possible
@@ -5120,17 +5049,13 @@ def doConfigure(myenv):
"BOOST_LOG_NO_SHORTHAND_NAMES",
"BOOST_LOG_USE_NATIVE_SYSLOG",
"BOOST_LOG_WITHOUT_THREAD_ATTR",
+ "BOOST_LOG_DYN_LINK",
"BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS",
"BOOST_SYSTEM_NO_DEPRECATED",
"BOOST_THREAD_USES_DATETIME",
("BOOST_THREAD_VERSION", "5"),
])
- if link_model.startswith("dynamic") and not link_model == 'dynamic-sdk':
- conf.env.AppendUnique(CPPDEFINES=[
- "BOOST_LOG_DYN_LINK",
- ])
-
if use_system_version_of_library("boost"):
if not conf.CheckCXXHeader("boost/filesystem/operations.hpp"):
myenv.ConfError("can't find boost headers")

View File

@@ -1,320 +0,0 @@
diff -u -r a/src/mongo/client/sdam/sdam_json_test_runner.cpp b/src/mongo/client/sdam/sdam_json_test_runner.cpp
--- a/src/mongo/client/sdam/sdam_json_test_runner.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/client/sdam/sdam_json_test_runner.cpp 2024-09-08 13:38:28.557633361 +0800
@@ -33,6 +33,7 @@
#include <boost/algorithm/string.hpp>
#include <boost/filesystem.hpp>
+#include <boost/filesystem/directory.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/format.hpp>
#include <boost/optional/optional.hpp>
diff -u -r a/src/mongo/client/sdam/server_selection_json_test_runner.cpp b/src/mongo/client/sdam/server_selection_json_test_runner.cpp
--- a/src/mongo/client/sdam/server_selection_json_test_runner.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/client/sdam/server_selection_json_test_runner.cpp 2024-09-08 13:38:28.557633361 +0800
@@ -33,6 +33,7 @@
#include <boost/algorithm/string.hpp>
#include <boost/filesystem.hpp>
+#include <boost/filesystem/directory.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/format.hpp>
diff -u -r a/src/mongo/db/ftdc/file_manager.cpp b/src/mongo/db/ftdc/file_manager.cpp
--- a/src/mongo/db/ftdc/file_manager.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/db/ftdc/file_manager.cpp 2024-09-08 13:38:28.560966720 +0800
@@ -33,6 +33,7 @@
#include "mongo/db/ftdc/file_manager.h"
#include <boost/filesystem.hpp>
+#include <boost/filesystem/directory.hpp>
#include <memory>
#include <string>
diff -u -r a/src/mongo/db/ftdc/ftdc_test.cpp b/src/mongo/db/ftdc/ftdc_test.cpp
--- a/src/mongo/db/ftdc/ftdc_test.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/db/ftdc/ftdc_test.cpp 2024-09-08 13:38:28.560966720 +0800
@@ -32,6 +32,7 @@
#include "mongo/db/ftdc/ftdc_test.h"
#include <boost/filesystem.hpp>
+#include <boost/filesystem/directory.hpp>
#include <memory>
#include "mongo/base/data_type_validated.h"
diff -u -r a/src/mongo/db/initialize_server_global_state.cpp b/src/mongo/db/initialize_server_global_state.cpp
--- a/src/mongo/db/initialize_server_global_state.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/db/initialize_server_global_state.cpp 2024-09-08 13:44:23.743647036 +0800
@@ -33,6 +33,7 @@
#include "mongo/db/initialize_server_global_state.h"
#include "mongo/db/initialize_server_global_state_gen.h"
+#include <boost/filesystem/exception.hpp>
#include <boost/filesystem/operations.hpp>
#include <fmt/format.h>
#include <iostream>
@@ -310,7 +311,7 @@
<< "\" should name a file, not a directory.");
}
- if (!serverGlobalParams.logAppend && boost::filesystem::is_regular(absoluteLogpath)) {
+ if (!serverGlobalParams.logAppend && boost::filesystem::is_regular_file(absoluteLogpath)) {
std::string renameTarget = absoluteLogpath + "." + terseCurrentTimeForFilename();
boost::system::error_code ec;
boost::filesystem::rename(absoluteLogpath, renameTarget, ec);
diff -u -r a/src/mongo/db/sorter/sorter_test.cpp b/src/mongo/db/sorter/sorter_test.cpp
--- a/src/mongo/db/sorter/sorter_test.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/db/sorter/sorter_test.cpp 2024-09-08 13:38:28.564300078 +0800
@@ -32,6 +32,7 @@
#include "mongo/platform/basic.h"
#include <boost/filesystem.hpp>
+#include <boost/filesystem/directory.hpp>
#include <fstream>
#include <memory>
diff -u -r a/src/mongo/db/startup_recovery.cpp b/src/mongo/db/startup_recovery.cpp
--- a/src/mongo/db/startup_recovery.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/db/startup_recovery.cpp 2024-09-08 13:38:28.567633437 +0800
@@ -29,6 +29,8 @@
#include "mongo/db/startup_recovery.h"
+#include <boost/filesystem/directory.hpp>
+
#include "mongo/db/catalog/collection_write_path.h"
#include "mongo/db/catalog/create_collection.h"
#include "mongo/db/catalog/database_holder.h"
diff -u -r a/src/mongo/db/startup_warnings_mongod.cpp b/src/mongo/db/startup_warnings_mongod.cpp
--- a/src/mongo/db/startup_warnings_mongod.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/db/startup_warnings_mongod.cpp 2024-09-08 13:40:57.852092056 +0800
@@ -32,6 +32,7 @@
#include "mongo/db/startup_warnings_mongod.h"
+#include <boost/filesystem/exception.hpp>
#include <boost/filesystem/operations.hpp>
#include <fstream>
#ifndef _WIN32
diff -u -r a/src/mongo/db/storage/storage_engine_lock_file_posix.cpp b/src/mongo/db/storage/storage_engine_lock_file_posix.cpp
--- a/src/mongo/db/storage/storage_engine_lock_file_posix.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/db/storage/storage_engine_lock_file_posix.cpp 2024-09-08 13:45:35.370855295 +0800
@@ -57,7 +57,7 @@
// if called without a fully qualified path it asserts; that makes mongoperf fail.
// so make a warning. need a better solution longer term.
// massert(40389, str::stream() << "Couldn't find parent dir for file: " << file.string(),);
- if (!file.has_branch_path()) {
+ if (!file.has_parent_path()) {
LOGV2(22274,
"warning flushMyDirectory couldn't find parent dir for file: {file}",
"flushMyDirectory couldn't find parent dir for file",
@@ -66,7 +66,7 @@
}
- boost::filesystem::path dir = file.branch_path(); // parent_path in new boosts
+ boost::filesystem::path dir = file.parent_path(); // parent_path in new boosts
LOGV2_DEBUG(22275, 1, "flushing directory {dir_string}", "dir_string"_attr = dir.string());
diff -u -r a/src/mongo/db/storage/storage_engine_lock_file_test.cpp b/src/mongo/db/storage/storage_engine_lock_file_test.cpp
--- a/src/mongo/db/storage/storage_engine_lock_file_test.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/db/storage/storage_engine_lock_file_test.cpp 2024-09-08 13:38:28.570966795 +0800
@@ -30,6 +30,7 @@
#include "mongo/platform/basic.h"
#include <boost/filesystem.hpp>
+#include <boost/filesystem/directory.hpp>
#include <fstream>
#include <ostream>
diff -u -r a/src/mongo/db/storage/storage_engine_metadata.cpp b/src/mongo/db/storage/storage_engine_metadata.cpp
--- a/src/mongo/db/storage/storage_engine_metadata.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/db/storage/storage_engine_metadata.cpp 2024-09-08 13:46:14.344483426 +0800
@@ -222,7 +222,7 @@
// if called without a fully qualified path it asserts; that makes mongoperf fail.
// so make a warning. need a better solution longer term.
// massert(13652, str::stream() << "Couldn't find parent dir for file: " << file.string(),);
- if (!file.has_branch_path()) {
+ if (!file.has_parent_path()) {
LOGV2(22283,
"warning flushMyDirectory couldn't find parent dir for file: {file}",
"flushMyDirectory couldn't find parent dir for file",
@@ -231,7 +231,7 @@
}
- boost::filesystem::path dir = file.branch_path(); // parent_path in new boosts
+ boost::filesystem::path dir = file.parent_path(); // parent_path in new boosts
LOGV2_DEBUG(22284, 1, "flushing directory {dir_string}", "dir_string"_attr = dir.string());
diff -u -r a/src/mongo/db/storage/wiredtiger/wiredtiger_c_api_test.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_c_api_test.cpp
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_c_api_test.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_c_api_test.cpp 2024-09-08 13:38:28.570966795 +0800
@@ -28,6 +28,7 @@
*/
#include <boost/filesystem.hpp>
+#include <boost/filesystem/directory.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/system/error_code.hpp>
diff -u -r a/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp 2024-09-08 13:38:28.574300153 +0800
@@ -31,6 +31,7 @@
#include "mongo/db/storage/wiredtiger/wiredtiger_util.h"
#include <boost/filesystem.hpp>
+#include <boost/filesystem/directory.hpp>
#include <boost/filesystem/fstream.hpp>
#include "mongo/base/simple_string_data_comparator.h"
diff -u -r a/src/mongo/dbtests/framework_options.cpp b/src/mongo/dbtests/framework_options.cpp
--- a/src/mongo/dbtests/framework_options.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/dbtests/framework_options.cpp 2024-09-08 13:41:53.502512039 +0800
@@ -33,6 +33,8 @@
#include "mongo/dbtests/framework_options.h"
+#include <boost/filesystem/directory.hpp>
+#include <boost/filesystem/exception.hpp>
#include <boost/filesystem/operations.hpp>
#include <iostream>
diff -u -r a/src/mongo/scripting/engine.cpp b/src/mongo/scripting/engine.cpp
--- a/src/mongo/scripting/engine.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/scripting/engine.cpp 2024-09-08 13:38:28.577633512 +0800
@@ -33,6 +33,7 @@
#include "mongo/scripting/engine.h"
#include <algorithm>
+#include <boost/filesystem/directory.hpp>
#include <boost/filesystem/operations.hpp>
#include "mongo/base/string_data.h"
diff -u -r a/src/mongo/scripting/mozjs/module_loader.cpp b/src/mongo/scripting/mozjs/module_loader.cpp
--- a/src/mongo/scripting/mozjs/module_loader.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/scripting/mozjs/module_loader.cpp 2024-09-08 13:38:28.577633512 +0800
@@ -28,6 +28,7 @@
*/
#include <boost/filesystem.hpp>
+#include <boost/filesystem/directory.hpp>
#include "mongo/logv2/log.h"
#include "mongo/scripting/mozjs/implscope.h"
diff -u -r a/src/mongo/shell/shell_utils_extended.cpp b/src/mongo/shell/shell_utils_extended.cpp
--- a/src/mongo/shell/shell_utils_extended.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/shell/shell_utils_extended.cpp 2024-09-08 13:42:27.456101736 +0800
@@ -36,6 +36,8 @@
#endif
#include <boost/filesystem.hpp>
+#include <boost/filesystem/directory.hpp>
+#include <boost/filesystem/exception.hpp>
#include <boost/filesystem/fstream.hpp>
#include <fmt/format.h>
#include <fstream>
diff -u -r a/src/mongo/shell/shell_utils_launcher.cpp b/src/mongo/shell/shell_utils_launcher.cpp
--- a/src/mongo/shell/shell_utils_launcher.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/shell/shell_utils_launcher.cpp 2024-09-08 13:47:56.188587429 +0800
@@ -31,6 +31,8 @@
#include <algorithm>
#include <array>
+#include <boost/filesystem/directory.hpp>
+#include <boost/filesystem/exception.hpp>
#include <boost/iostreams/device/file_descriptor.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/iostreams/stream_buffer.hpp>
@@ -316,26 +318,26 @@
boost::filesystem::directory_iterator i(from);
while (i != end) {
boost::filesystem::path p = *i;
- if (p.leaf() == "metrics.interim" || p.leaf() == "metrics.interim.temp") {
+ if (p.filename() == "metrics.interim" || p.filename() == "metrics.interim.temp") {
// Ignore any errors for metrics.interim* files as these may disappear during copy
boost::system::error_code ec;
- boost::filesystem::copy_file(p, to / p.leaf(), ec);
+ boost::filesystem::copy_file(p, to / p.filename(), ec);
if (ec) {
LOGV2_INFO(22814,
"Skipping copying of file from '{from}' to "
"'{to}' due to: {error}",
"Skipping copying of file due to error"
"from"_attr = p.generic_string(),
- "to"_attr = (to / p.leaf()).generic_string(),
+ "to"_attr = (to / p.filename()).generic_string(),
"error"_attr = ec.message());
}
- } else if (p.leaf() != "mongod.lock" && p.leaf() != "WiredTiger.lock") {
+ } else if (p.filename() != "mongod.lock" && p.filename() != "WiredTiger.lock") {
if (boost::filesystem::is_directory(p)) {
- boost::filesystem::path newDir = to / p.leaf();
+ boost::filesystem::path newDir = to / p.filename();
boost::filesystem::create_directory(newDir);
copyDir(p, newDir);
} else {
- boost::filesystem::copy_file(p, to / p.leaf());
+ boost::filesystem::copy_file(p, to / p.filename());
}
}
++i;
diff -u -r a/src/mongo/shell/shell_utils_launcher.h b/src/mongo/shell/shell_utils_launcher.h
--- a/src/mongo/shell/shell_utils_launcher.h 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/shell/shell_utils_launcher.h 2024-09-08 13:43:55.856769586 +0800
@@ -29,7 +29,6 @@
#pragma once
-#include <boost/filesystem/convenience.hpp>
#include <map>
#include <sstream>
#include <string>
diff -u -r a/src/mongo/unittest/golden_test_base.cpp b/src/mongo/unittest/golden_test_base.cpp
--- a/src/mongo/unittest/golden_test_base.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/unittest/golden_test_base.cpp 2024-09-08 13:48:19.232095193 +0800
@@ -95,7 +95,7 @@
fs::path outputRoot;
if (opts.outputRootPattern) {
fs::path pattern(*opts.outputRootPattern);
- outputRoot = pattern.parent_path() / fs::unique_path(pattern.leaf());
+ outputRoot = pattern.parent_path() / fs::unique_path(pattern.filename());
} else {
outputRoot = fs::temp_directory_path() / fs::unique_path("out-%%%%-%%%%-%%%%-%%%%");
}
diff -u -r a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp
--- a/src/mongo/util/processinfo_linux.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/util/processinfo_linux.cpp 2024-09-08 13:43:30.446577565 +0800
@@ -53,6 +53,7 @@
#endif
#include <boost/filesystem.hpp>
+#include <boost/filesystem/exception.hpp>
#include <boost/none.hpp>
#include <boost/optional.hpp>
#include <fmt/format.h>
diff -u -r a/src/mongo/util/procparser.cpp b/src/mongo/util/procparser.cpp
--- a/src/mongo/util/procparser.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/util/procparser.cpp 2024-09-08 13:38:28.584300228 +0800
@@ -37,6 +37,7 @@
#include <boost/algorithm/string/finder.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/filesystem.hpp>
+#include <boost/filesystem/directory.hpp>
#include <fcntl.h>
#include <string>
#include <sys/stat.h>
diff -u -r a/src/mongo/util/stacktrace_threads.cpp b/src/mongo/util/stacktrace_threads.cpp
--- a/src/mongo/util/stacktrace_threads.cpp 2024-08-15 04:38:09.000000000 +0800
+++ b/src/mongo/util/stacktrace_threads.cpp 2024-09-08 13:38:28.584300228 +0800
@@ -35,6 +35,7 @@
#include <array>
#include <atomic>
#include <boost/filesystem.hpp>
+#include <boost/filesystem/directory.hpp>
#include <boost/filesystem/fstream.hpp>
#include <csignal>
#include <cstdint>

View File

@@ -1,12 +0,0 @@
diff -u -r a/src/mongo/util/pcre.h b/src/mongo/util/pcre.h
--- a/src/mongo/util/pcre.h 2025-03-02 16:46:18.443355487 -0500
+++ b/src/mongo/util/pcre.h 2025-03-02 16:46:59.651708274 -0500
@@ -155,7 +155,7 @@
X(ERROR_ALPHA_ASSERTION_UNKNOWN) \
X(ERROR_SCRIPT_RUN_NOT_AVAILABLE) \
X(ERROR_TOO_MANY_CAPTURES) \
- X(ERROR_CONDITION_ATOMIC_ASSERTION_EXPECTED) \
+ /*X(ERROR_CONDITION_ATOMIC_ASSERTION_EXPECTED)*/ \
X(ERROR_BACKSLASH_K_IN_LOOKAROUND) \
X(ERROR_NOMATCH) \
X(ERROR_PARTIAL) \

View File

@@ -0,0 +1,23 @@
diff '--color=auto' -dupr mongo-r8.0.12.orig/SConstruct mongo-r8.0.12/SConstruct
--- mongo-r8.0.12.orig/SConstruct 2025-12-24 07:40:37.384561186 +0100
+++ mongo-r8.0.12/SConstruct 2025-12-24 07:40:53.107849946 +0100
@@ -1683,7 +1683,7 @@ def printLocalInfo():
printLocalInfo()
-boostLibs = ["filesystem", "program_options", "system", "iostreams", "thread", "log"]
+boostLibs = ["filesystem", "program_options", "iostreams", "thread", "log"]
onlyServer = len(COMMAND_LINE_TARGETS) == 0 or (len(COMMAND_LINE_TARGETS) == 1 and str(
COMMAND_LINE_TARGETS[0]) in ["mongod", "mongos", "test"])
diff '--color=auto' -dupr mongo-r8.0.12.orig/src/third_party/SConscript mongo-r8.0.12/src/third_party/SConscript
--- mongo-r8.0.12.orig/src/third_party/SConscript 2025-12-24 07:40:37.718019419 +0100
+++ mongo-r8.0.12/src/third_party/SConscript 2025-12-24 07:41:15.134959202 +0100
@@ -436,7 +436,6 @@ if use_system_version_of_library("boost"
boostEnv = boostEnv.Clone(SYSLIBDEPS=[
env['LIBDEPS_BOOST_PROGRAM_OPTIONS_SYSLIBDEP'],
env['LIBDEPS_BOOST_FILESYSTEM_SYSLIBDEP'],
- env['LIBDEPS_BOOST_SYSTEM_SYSLIBDEP'],
env['LIBDEPS_BOOST_IOSTREAMS_SYSLIBDEP'],
env['LIBDEPS_BOOST_THREAD_SYSLIBDEP'],
env['LIBDEPS_BOOST_LOG_SYSLIBDEP'],

View File

@@ -0,0 +1,222 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{11..13} )
SCONS_MIN_VERSION="3.3.1"
CHECKREQS_DISK_BUILD="2400M"
CHECKREQS_DISK_USR="512M"
CHECKREQS_MEMORY="1024M"
inherit check-reqs eapi9-ver flag-o-matic multiprocessing pax-utils python-any-r1 scons-utils systemd toolchain-funcs
MY_PV=r${PV/_rc/-rc}
MY_P=mongo-${MY_PV}
DESCRIPTION="A high-performance, open source, schema-free document-oriented database"
HOMEPAGE="https://www.mongodb.com"
SRC_URI="https://github.com/mongodb/mongo/archive/refs/tags/${MY_PV}.tar.gz -> ${P}.gh.tar.gz"
SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-5.0.30-patches.tar.xz"
S="${WORKDIR}/${MY_P}"
LICENSE="Apache-2.0 SSPL-1"
SLOT="0"
KEYWORDS="~amd64 ~arm64 -riscv"
CPU_FLAGS="cpu_flags_x86_avx"
IUSE="debug kerberos mongosh ssl +tools ${CPU_FLAGS}"
# https://github.com/mongodb/mongo/wiki/Test-The-Mongodb-Server
# resmoke needs python packages not yet present in Gentoo
RESTRICT="test"
RDEPEND="acct-group/mongodb
acct-user/mongodb
>=app-arch/snappy-1.1.7:=
app-arch/zstd:=
>=dev-cpp/yaml-cpp-0.6.2:=
dev-libs/boost:=[nls]
>=dev-libs/libpcre-8.42[cxx]
dev-libs/snowball-stemmer:=
net-misc/curl
>=virtual/zlib-1.2.12:=
kerberos? ( dev-libs/cyrus-sasl[kerberos] )
ssl? (
>=dev-libs/openssl-1.0.1g:0=
)"
DEPEND="${RDEPEND}
${PYTHON_DEPS}
sys-libs/ncurses:0=
sys-libs/readline:0=
debug? ( dev-debug/valgrind )"
BDEPEND="
$(python_gen_any_dep '
>=dev-build/scons-3.1.1[${PYTHON_USEDEP}]
dev-python/cheetah3[${PYTHON_USEDEP}]
dev-python/psutil[${PYTHON_USEDEP}]
dev-python/pymongo[${PYTHON_USEDEP}]
dev-python/pyyaml[${PYTHON_USEDEP}]
')
"
PDEPEND="
mongosh? ( app-admin/mongosh-bin )
tools? ( >=app-admin/mongo-tools-100 )
"
PATCHES=(
"${WORKDIR}/mongodb-5.0.30-patches/${PN}-4.4.1-boost.patch"
"${WORKDIR}/mongodb-5.0.30-patches/${PN}-5.0.30-gcc-11.patch"
"${WORKDIR}/mongodb-5.0.30-patches/${PN}-5.0.2-fix-scons.patch"
"${WORKDIR}/mongodb-5.0.30-patches/${PN}-5.0.2-no-compass.patch"
"${WORKDIR}/mongodb-5.0.30-patches/${PN}-5.0.2-skip-no-exceptions.patch"
"${WORKDIR}/mongodb-5.0.30-patches/${PN}-5.0.2-skip-reqs-check.patch"
"${WORKDIR}/mongodb-5.0.30-patches/${PN}-5.0.2-boost-1.79.patch"
"${WORKDIR}/mongodb-5.0.30-patches/${PN}-5.0.5-no-force-lld.patch"
"${WORKDIR}/mongodb-5.0.30-patches/${PN}-4.4.10-boost-1.81.patch"
"${WORKDIR}/mongodb-5.0.30-patches/${PN}-5.0.5-boost-1.81-extra.patch"
"${WORKDIR}/mongodb-5.0.30-patches/${PN}-5.0.16-arm64-assert.patch"
"${WORKDIR}/mongodb-5.0.30-patches/${PN}-4.4.29-no-enterprise.patch"
"${WORKDIR}/mongodb-5.0.30-patches/${PN}-5.0.26-boost-1.85.patch"
"${WORKDIR}/mongodb-5.0.30-patches/${PN}-5.0.26-boost-1.85-extra.patch"
"${WORKDIR}/mongodb-5.0.30-patches/${PN}-5.0.30-gcc-15.patch"
"${WORKDIR}/mongodb-5.0.30-patches/${PN}-5.0.26-scons.patch"
"${WORKDIR}/mongodb-5.0.30-patches/${PN}-5.0.26-mozjs-remove-unused-constructor.patch"
# removed in boost-1.89.0, unnecessary earlier
"${FILESDIR}/${PN}-5.0.32-boost-system.patch"
"${FILESDIR}/${PN}-5.0.32-pkg-resources.patch"
)
python_check_deps() {
python_has_version -b ">=dev-build/scons-3.1.1[${PYTHON_USEDEP}]" &&
python_has_version -b "dev-python/cheetah3[${PYTHON_USEDEP}]" &&
python_has_version -b "dev-python/psutil[${PYTHON_USEDEP}]" &&
python_has_version -b "dev-python/pyyaml[${PYTHON_USEDEP}]" &&
python_has_version -b "dev-python/pymongo[${PYTHON_USEDEP}]"
}
pkg_pretend() {
# Bug 809692 + 890294
if use amd64 && ! use cpu_flags_x86_avx; then
ewarn "MongoDB 5.0 requires use of the AVX instruction set."
ewarn "This ebuild will use --experimental-optimization=-sandybridge which"
ewarn "will result in an experimental build of MongoDB as per upstream."
ewarn "https://docs.mongodb.com/v5.0/administration/production-notes/"
fi
if [[ -n ${REPLACING_VERSIONS} ]]; then
if ver_replacing -lt 4.4; then
ewarn "To upgrade from a version earlier than the 4.4-series, you must"
ewarn "successively upgrade major releases until you have upgraded"
ewarn "to 4.4-series. Then upgrade to 5.0 series."
else
ewarn "Be sure to set featureCompatibilityVersion to 4.4 before upgrading."
fi
fi
}
src_prepare() {
default
# remove bundled libs
rm -r src/third_party/{boost,pcre-*,snappy-*,yaml-cpp,zlib-*} || die
# remove compass
rm -r src/mongo/installer/compass || die
}
src_configure() {
# bug #954813
filter-lto
# https://github.com/mongodb/mongo/blob/v5.0/docs/building.md
# --use-system-icu fails tests
# --use-system-tcmalloc is strongly NOT recommended:
# for MONGO_GIT_HASH use GitOrigin-RevId from the commit of the tag
scons_opts=(
AR="$(tc-getAR)"
CC="$(tc-getCC)"
CXX="$(tc-getCXX)"
CCFLAGS="${CXXFLAGS}"
VERBOSE=1
VARIANT_DIR=gentoo
MONGO_VERSION="${PV}"
MONGO_GIT_HASH="ba92303e18e7ed4701572aa15acd161c97796f2f"
--disable-warnings-as-errors
--force-jobs # Reapply #906897, fix #935274
--jobs="$(makeopts_jobs)"
--use-system-boost
--use-system-pcre
--use-system-snappy
--use-system-stemmer
--use-system-yaml
--use-system-zlib
--use-system-zstd
)
use arm64 && scons_opts+=( --use-hardware-crc32=off ) # Bug 701300
use amd64 && scons_opts+=( --experimental-optimization=-sandybridge ) # Bug 890294
use debug && scons_opts+=( --dbg=on )
use kerberos && scons_opts+=( --use-sasl-client )
scons_opts+=( --ssl=$(usex ssl on off) )
# Needed to avoid forcing FORTIFY_SOURCE
# Gentoo's toolchain applies these anyway
scons_opts+=( --runtime-hardening=off )
# gold is an option here but we don't really do that anymore
if tc-ld-is-lld; then
scons_opts+=( --linker=lld )
else
scons_opts+=( --linker=bfd )
fi
# respect mongoDB upstream's basic recommendations
# see bug #536688 and #526114
if ! use debug; then
filter-flags '-m*'
filter-flags '-O?'
fi
default
}
src_compile() {
PREFIX="${EPREFIX}/usr" ./buildscripts/scons.py "${scons_opts[@]}" install-devcore || die
}
src_install() {
dobin build/install/bin/{mongo,mongod,mongos}
doman debian/mongo*.1
dodoc README docs/building.md
newinitd "${FILESDIR}/${PN}.initd-r3" ${PN}
newconfd "${FILESDIR}/${PN}.confd-r3" ${PN}
newinitd "${FILESDIR}/mongos.initd-r3" mongos
newconfd "${FILESDIR}/mongos.confd-r3" mongos
insinto /etc
newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf
newins "${FILESDIR}/mongos.conf-r2" mongos.conf
systemd_newunit "${FILESDIR}/${PN}.service-r1" "${PN}.service"
insinto /etc/logrotate.d/
newins "${FILESDIR}/${PN}.logrotate" ${PN}
# see bug #526114
pax-mark emr "${ED}"/usr/bin/{mongo,mongod,mongos}
diropts -m0750 -o mongodb -g mongodb
keepdir /var/log/${PN}
}
pkg_postinst() {
ewarn "Make sure to read the release notes and follow the upgrade process:"
ewarn " https://docs.mongodb.com/manual/release-notes/$(ver_cut 1-2)/"
ewarn " https://docs.mongodb.com/manual/release-notes/$(ver_cut 1-2)/#upgrade-procedures"
}

View File

@@ -76,6 +76,9 @@ PATCHES=(
"${WORKDIR}/mongodb-6.0.22-patches/mongodb-6.0.2-sconstruct-changes.patch" "${WORKDIR}/mongodb-6.0.22-patches/mongodb-6.0.2-sconstruct-changes.patch"
"${FILESDIR}/mongodb-6.0.21-mozjs-remove-unused-constructor.patch" "${FILESDIR}/mongodb-6.0.21-mozjs-remove-unused-constructor.patch"
"${FILESDIR}/mongodb-5.0.30-gcc-15.patch" "${FILESDIR}/mongodb-5.0.30-gcc-15.patch"
# removed in boost-1.89.0, unnecessary earlier
"${FILESDIR}/${PN}-5.0.32-boost-system.patch"
"${FILESDIR}/${PN}-5.0.32-pkg-resources.patch"
) )
python_check_deps() { python_check_deps() {
@@ -134,7 +137,7 @@ src_configure() {
VERBOSE=1 VERBOSE=1
VARIANT_DIR=gentoo VARIANT_DIR=gentoo
MONGO_VERSION="${PV}" MONGO_VERSION="${PV}"
MONGO_GIT_HASH="0c4ec4b6005f75582ce208fc800f09f561b6c2e8" MONGO_GIT_HASH="fc88ca137231d7457aed6265d4f32a361ae71716"
--disable-warnings-as-errors --disable-warnings-as-errors
--force-jobs # Reapply #906897, fix #935274 --force-jobs # Reapply #906897, fix #935274

View File

@@ -3,15 +3,15 @@
EAPI=8 EAPI=8
PYTHON_COMPAT=( python3_{10..13} ) PYTHON_COMPAT=( python3_{11..13} )
SCONS_MIN_VERSION="3.3.1" SCONS_MIN_VERSION="4.9.1"
CHECKREQS_DISK_BUILD="2400M" CHECKREQS_DISK_BUILD="2400M"
CHECKREQS_DISK_USR="512M" CHECKREQS_DISK_USR="512M"
CHECKREQS_MEMORY="1024M" CHECKREQS_MEMORY="1024M"
inherit check-reqs eapi9-ver flag-o-matic multiprocessing optfeature pax-utils python-any-r1 \ inherit check-reqs eapi9-ver flag-o-matic multiprocessing pax-utils \
scons-utils systemd tmpfiles toolchain-funcs python-any-r1 scons-utils systemd tmpfiles toolchain-funcs
MY_PV=r${PV/_rc/-rc} MY_PV=r${PV/_rc/-rc}
MY_P=mongo-${MY_PV} MY_P=mongo-${MY_PV}
@@ -19,13 +19,14 @@ MY_P=mongo-${MY_PV}
DESCRIPTION="A high-performance, open source, schema-free document-oriented database" DESCRIPTION="A high-performance, open source, schema-free document-oriented database"
HOMEPAGE="https://www.mongodb.com" HOMEPAGE="https://www.mongodb.com"
SRC_URI="https://github.com/mongodb/mongo/archive/refs/tags/${MY_PV}.tar.gz -> ${P}.gh.tar.gz" SRC_URI="https://github.com/mongodb/mongo/archive/refs/tags/${MY_PV}.tar.gz -> ${P}.gh.tar.gz"
SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-7.0.18-patches.tar.xz"
S="${WORKDIR}/${MY_P}" S="${WORKDIR}/${MY_P}"
LICENSE="Apache-2.0 SSPL-1" LICENSE="Apache-2.0 SSPL-1"
SLOT="0" SLOT="0"
KEYWORDS="~amd64 ~arm64 -riscv" KEYWORDS="~amd64 ~arm64 -riscv"
CPU_FLAGS="cpu_flags_x86_avx" CPU_FLAGS="cpu_flags_x86_avx"
IUSE="debug kerberos ssl ${CPU_FLAGS}" IUSE="debug kerberos mongosh ssl +tools ${CPU_FLAGS}"
# https://github.com/mongodb/mongo/wiki/Test-The-Mongodb-Server # https://github.com/mongodb/mongo/wiki/Test-The-Mongodb-Server
# resmoke needs python packages not yet present in Gentoo # resmoke needs python packages not yet present in Gentoo
@@ -37,10 +38,11 @@ RDEPEND="acct-group/mongodb
app-arch/zstd:= app-arch/zstd:=
>=dev-cpp/yaml-cpp-0.6.2:= >=dev-cpp/yaml-cpp-0.6.2:=
dev-libs/boost:=[nls] dev-libs/boost:=[nls]
>=dev-libs/libpcre2-10.40:=
dev-libs/snowball-stemmer:= dev-libs/snowball-stemmer:=
net-misc/curl net-misc/curl
>=sys-libs/zlib-1.2.12:= dev-libs/libbson
dev-libs/mongo-c-driver:0
>=virtual/zlib-1.2.12:=
kerberos? ( dev-libs/cyrus-sasl[kerberos] ) kerberos? ( dev-libs/cyrus-sasl[kerberos] )
ssl? ( ssl? (
>=dev-libs/openssl-1.0.1g:0= >=dev-libs/openssl-1.0.1g:0=
@@ -52,38 +54,39 @@ DEPEND="${RDEPEND}
debug? ( dev-debug/valgrind )" debug? ( dev-debug/valgrind )"
BDEPEND=" BDEPEND="
$(python_gen_any_dep ' $(python_gen_any_dep '
>=dev-build/scons-3.1.1[${PYTHON_USEDEP}] >=dev-build/scons-4.9.1[${PYTHON_USEDEP}]
dev-python/cheetah3[${PYTHON_USEDEP}] dev-python/cheetah3[${PYTHON_USEDEP}]
dev-python/psutil[${PYTHON_USEDEP}] dev-python/psutil[${PYTHON_USEDEP}]
dev-python/pymongo[${PYTHON_USEDEP}] dev-python/pymongo[${PYTHON_USEDEP}]
dev-python/pyyaml[${PYTHON_USEDEP}] dev-python/pyyaml[${PYTHON_USEDEP}]
dev-python/regex[${PYTHON_USEDEP}]
dev-python/typing-extensions[${PYTHON_USEDEP}]
') ')
" "
PDEPEND="
mongosh? ( app-admin/mongosh-bin )
tools? ( >=app-admin/mongo-tools-100 )
"
PATCHES=( PATCHES=(
"${FILESDIR}/${PN}-5.0.2-no-compass.patch" "${WORKDIR}/mongodb-7.0.18-patches/mongodb-4.4.29-no-enterprise.patch"
"${FILESDIR}/${PN}-5.0.2-skip-reqs-check.patch" "${WORKDIR}/mongodb-7.0.18-patches/${PN}-5.0.2-no-compass.patch"
"${FILESDIR}/${PN}-7.0.15-sconstruct.patch" "${WORKDIR}/mongodb-7.0.18-patches/${PN}-5.0.2-skip-reqs-check.patch"
"${FILESDIR}/${PN}-4.4.29-no-enterprise.patch" "${WORKDIR}/mongodb-7.0.18-patches/${PN}-4.4.10-boost-1.81.patch"
"${FILESDIR}/${PN}-7.0.15-system-boost.patch" "${FILESDIR}/${PN}-7.0.1-sconstruct.patch"
"${FILESDIR}/${PN}-7.0.15-gcc-15.patch" "${WORKDIR}/mongodb-7.0.18-patches/extrapatch-sconstruct.patch"
"${FILESDIR}/${PN}-5.0.26-scons.patch" "${WORKDIR}/mongodb-7.0.18-patches/mongodb-7.0.18-boost-1.85.patch"
"${FILESDIR}/${PN}-6.0.21-mozjs-remove-unused-constructor.patch" "${FILESDIR}/mongodb-7.0.28-gcc-15.patch"
"${FILESDIR}/${PN}-6.0.21-boost-filesystem-1.85.patch" # removed in boost-1.89.0, unnecessary earlier
"${FILESDIR}/${PN}-6.0.21-boost-filesystem-1.85-2.patch" "${FILESDIR}/${PN}-8.0.12-boost-system.patch"
"${FILESDIR}/${PN}-7.0.18-system-pcre.patch" "${FILESDIR}/${PN}-5.0.32-pkg-resources.patch"
) )
python_check_deps() { python_check_deps() {
python_has_version -b ">=dev-build/scons-3.1.1[${PYTHON_USEDEP}]" && python_has_version -b ">=dev-build/scons-4.9.1[${PYTHON_USEDEP}]" &&
python_has_version -b "dev-python/cheetah3[${PYTHON_USEDEP}]" && python_has_version -b "dev-python/cheetah3[${PYTHON_USEDEP}]" &&
python_has_version -b "dev-python/psutil[${PYTHON_USEDEP}]" && python_has_version -b "dev-python/psutil[${PYTHON_USEDEP}]" &&
python_has_version -b "dev-python/pymongo[${PYTHON_USEDEP}]" && python_has_version -b "dev-python/pymongo[${PYTHON_USEDEP}]" &&
python_has_version -b "dev-python/pyyaml[${PYTHON_USEDEP}]" && python_has_version -b "dev-python/pyyaml[${PYTHON_USEDEP}]"
python_has_version -b "dev-python/regex[${PYTHON_USEDEP}]" &&
python_has_version -b "dev-python/typing-extensions[${PYTHON_USEDEP}]"
} }
pkg_pretend() { pkg_pretend() {
@@ -111,13 +114,18 @@ src_prepare() {
default default
# remove bundled libs # remove bundled libs
rm -r src/third_party/{boost,pcre2,snappy-*,yaml-cpp,zlib} || die rm -r src/third_party/{boost,snappy-*,yaml-cpp,zlib} || die
# remove compass # remove compass
rm -r src/mongo/installer/compass || die rm -r src/mongo/installer/compass || die
} }
src_configure() { src_configure() {
# bug #954813
filter-lto
# https://github.com/mongodb/mongo/blob/v7.0/docs/building.md
# --use-system-icu fails tests
# --use-system-tcmalloc is strongly NOT recommended: # --use-system-tcmalloc is strongly NOT recommended:
# for MONGO_GIT_HASH use GitOrigin-RevId from the commit of the tag # for MONGO_GIT_HASH use GitOrigin-RevId from the commit of the tag
scons_opts=( scons_opts=(
@@ -129,13 +137,12 @@ src_configure() {
VERBOSE=1 VERBOSE=1
VARIANT_DIR=gentoo VARIANT_DIR=gentoo
MONGO_VERSION="${PV}" MONGO_VERSION="${PV}"
MONGO_GIT_HASH="1624e181d0dac03edb34ef25b9b58a6d79969825" MONGO_GIT_HASH="cfc346c59d2cc3dbc903507fc642e22e3097f362"
--disable-warnings-as-errors --disable-warnings-as-errors
--force-jobs # Reapply #906897, fix #935274 --force-jobs # Reapply #906897, fix #935274
--jobs="$(makeopts_jobs)" --jobs="$(makeopts_jobs)"
--use-system-boost --use-system-boost
--use-system-pcre2
--use-system-snappy --use-system-snappy
--use-system-stemmer --use-system-stemmer
--use-system-yaml --use-system-yaml
@@ -192,21 +199,18 @@ src_install() {
systemd_newunit "${FILESDIR}/${PN}.service-r1" "${PN}.service" systemd_newunit "${FILESDIR}/${PN}.service-r1" "${PN}.service"
newtmpfiles "${FILESDIR}"/mongodb.tmpfiles mongodb.conf
insinto /etc/logrotate.d/ insinto /etc/logrotate.d/
newins "${FILESDIR}/${PN}.logrotate" ${PN} newins "${FILESDIR}/${PN}.logrotate" ${PN}
# see bug #526114 # see bug #526114
pax-mark emr "${ED}"/usr/bin/{mongo,mongod,mongos} pax-mark emr "${ED}"/usr/bin/{mongo,mongod,mongos}
diropts -m0750 -o mongodb -g mongodb
keepdir /var/log/${PN}
} }
pkg_postinst() { pkg_postinst() {
tmpfiles_process mongodb.conf
ewarn "Make sure to read the release notes and follow the upgrade process:" ewarn "Make sure to read the release notes and follow the upgrade process:"
ewarn " https://docs.mongodb.com/manual/release-notes/$(ver_cut 1-2)/" ewarn " https://docs.mongodb.com/manual/release-notes/$(ver_cut 1-2)/"
ewarn " https://docs.mongodb.com/manual/release-notes/$(ver_cut 1-2)/#upgrade-procedures" ewarn " https://docs.mongodb.com/manual/release-notes/$(ver_cut 1-2)/#upgrade-procedures"
optfeature "MongoDB Shell" app-admin/mongosh-bin
optfeature "MongoDB tools (mongoimport, mongodump...)" app-admin/mongo-tools
} }