diff options
Diffstat (limited to 'dev-db/mongodb/files/mongodb-7.0.18-boost-1.85.patch')
| -rw-r--r-- | dev-db/mongodb/files/mongodb-7.0.18-boost-1.85.patch | 204 |
1 files changed, 204 insertions, 0 deletions
diff --git a/dev-db/mongodb/files/mongodb-7.0.18-boost-1.85.patch b/dev-db/mongodb/files/mongodb-7.0.18-boost-1.85.patch new file mode 100644 index 000000000000..ab9c56c2a83a --- /dev/null +++ b/dev-db/mongodb/files/mongodb-7.0.18-boost-1.85.patch @@ -0,0 +1,204 @@ +From 50d52404a69171052a9a55259ba7cd1ec9ce6a18 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Valenduc?= <francoisvalenduc@gmail.com> +Date: Sat, 26 Apr 2025 12:07:21 +0200 +Subject: [PATCH] fix for boost 1.85 + +--- + src/mongo/db/initialize_server_global_state.cpp | 4 ++-- + src/mongo/db/startup_warnings_mongod.cpp | 1 + + src/mongo/db/storage/backup_block.cpp | 5 ++++- + .../db/storage/storage_engine_lock_file_posix.cpp | 4 ++-- + src/mongo/db/storage/storage_engine_metadata.cpp | 4 ++-- + src/mongo/scripting/engine.cpp | 1 + + src/mongo/shell/shell_utils_launcher.cpp | 13 +++++++------ + src/mongo/shell/shell_utils_launcher.h | 2 +- + src/mongo/unittest/golden_test_base.cpp | 2 +- + 9 files changed, 21 insertions(+), 15 deletions(-) + +diff --git a/src/mongo/db/initialize_server_global_state.cpp b/src/mongo/db/initialize_server_global_state.cpp +index 02a30aac334..e774cc4019a 100644 +--- a/src/mongo/db/initialize_server_global_state.cpp ++++ b/src/mongo/db/initialize_server_global_state.cpp +@@ -33,7 +33,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> +@@ -310,7 +310,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); +diff --git a/src/mongo/db/startup_warnings_mongod.cpp b/src/mongo/db/startup_warnings_mongod.cpp +index af81012ad41..c334e4b386c 100644 +--- a/src/mongo/db/startup_warnings_mongod.cpp ++++ b/src/mongo/db/startup_warnings_mongod.cpp +@@ -33,6 +33,7 @@ + #include "mongo/db/startup_warnings_mongod.h" + + #include <boost/filesystem/operations.hpp> ++#include <boost/filesystem/exception.hpp> + #include <fstream> + + #ifdef __linux__ +diff --git a/src/mongo/db/storage/backup_block.cpp b/src/mongo/db/storage/backup_block.cpp +index 9b8dc29f209..10fd6632fc3 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" +@@ -59,7 +62,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 +diff --git a/src/mongo/db/storage/storage_engine_lock_file_posix.cpp b/src/mongo/db/storage/storage_engine_lock_file_posix.cpp +index 41fefe73cdf..e8d1d0c08ed 100644 +--- a/src/mongo/db/storage/storage_engine_lock_file_posix.cpp ++++ b/src/mongo/db/storage/storage_engine_lock_file_posix.cpp +@@ -57,7 +57,7 @@ void flushMyDirectory(const boost::filesystem::path& file) { + // 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 @@ void flushMyDirectory(const boost::filesystem::path& file) { + } + + +- 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 --git a/src/mongo/db/storage/storage_engine_metadata.cpp b/src/mongo/db/storage/storage_engine_metadata.cpp +index 4008ac80d9b..fe2abacbfca 100644 +--- a/src/mongo/db/storage/storage_engine_metadata.cpp ++++ b/src/mongo/db/storage/storage_engine_metadata.cpp +@@ -222,7 +222,7 @@ void flushMyDirectory(const boost::filesystem::path& file) { + // 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 @@ void flushMyDirectory(const boost::filesystem::path& file) { + } + + +- 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 --git a/src/mongo/scripting/engine.cpp b/src/mongo/scripting/engine.cpp +index 7faf89e5ae8..c5e21a62c4d 100644 +--- a/src/mongo/scripting/engine.cpp ++++ b/src/mongo/scripting/engine.cpp +@@ -34,6 +34,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" +diff --git a/src/mongo/shell/shell_utils_launcher.cpp b/src/mongo/shell/shell_utils_launcher.cpp +index 30a04df5a89..1ff93db38be 100644 +--- a/src/mongo/shell/shell_utils_launcher.cpp ++++ b/src/mongo/shell/shell_utils_launcher.cpp +@@ -36,6 +36,7 @@ + #include <boost/iostreams/stream_buffer.hpp> + #include <boost/iostreams/tee.hpp> + #include <csignal> ++#include <boost/filesystem.hpp> + #include <fcntl.h> + #include <fmt/format.h> + #include <fstream> +@@ -316,26 +317,26 @@ void copyDir(const boost::filesystem::path& from, const boost::filesystem::path& + 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 --git a/src/mongo/shell/shell_utils_launcher.h b/src/mongo/shell/shell_utils_launcher.h +index 65337f061b3..b92d1126c5d 100644 +--- 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> +diff --git a/src/mongo/unittest/golden_test_base.cpp b/src/mongo/unittest/golden_test_base.cpp +index 1544fd3a37b..14f96d0ec75 100644 +--- a/src/mongo/unittest/golden_test_base.cpp ++++ b/src/mongo/unittest/golden_test_base.cpp +@@ -95,7 +95,7 @@ GoldenTestEnvironment::GoldenTestEnvironment() : _goldenDataRoot(".") { + 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-%%%%-%%%%-%%%%-%%%%"); + } +-- +2.49.0 + |
