[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,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'],