Commit 7d8fcc74 authored by Emily's avatar Emily
Browse files
parent 08667601
Loading
Loading
Loading
Loading
+0 −36
Original line number Diff line number Diff line
{ stdenv, callPackage, lib, sasl, boost
, Security, CoreFoundation, cctools
, avxSupport ? stdenv.hostPlatform.avxSupport
, nixosTests
}:

let
  buildMongoDB = callPackage ./mongodb.nix {
    inherit sasl boost Security CoreFoundation cctools;
  };
  variants = if stdenv.hostPlatform.isLinux then
    {
      version = "5.0.29";
      sha256 = "sha256-27+SXo0fjFwJFFm/NhpDhq95dMwiN8RCJO7j5ic49Ls=";
      patches = [ ./fix-build-with-boost-1.79-5_0-linux.patch ];
    }
  else lib.optionalAttrs stdenv.hostPlatform.isDarwin
    {
      version = "5.0.3"; # at least darwin has to stay on 5.0.3 until the SDK used by nixpkgs is bumped to 10.13
      sha256 = "1p9pq0dfd6lynvnz5p1c8dqp4filzrz86j840xwxwx82dm1zl6p0";
      patches = [ ./fix-build-with-boost-1.79-5_0.patch ]; # no darwin in name to prevent unnecessary rebuild
    };
in
buildMongoDB {
  inherit avxSupport;
  version = variants.version;
  sha256 = variants.sha256;
  patches = [
    ./forget-build-dependencies-4-4.patch
    ./asio-no-experimental-string-view-4-4.patch
    ./fix-gcc-Wno-exceptions-5.0.patch
    # Fix building with python 3.12 since the imp module was removed
    ./mongodb-python312.patch
  ] ++ variants.patches;
  passthru.tests = { inherit (nixosTests) mongodb; };
}
+0 −23
Original line number Diff line number Diff line
--- a/src/third_party/asio-master/asio/include/asio/detail/config.hpp
--- b/src/third_party/asio-master/asio/include/asio/detail/config.hpp
@@ -831,20 +831,8 @@
 #     endif // (__cplusplus >= 201402)
 #    endif // (_LIBCPP_VERSION < 7000)
 #   else // defined(ASIO_HAS_CLANG_LIBCXX)
-#    if (__cplusplus >= 201402)
-#     if __has_include(<experimental/string_view>)
-#      define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
-#     endif // __has_include(<experimental/string_view>)
-#    endif // (__cplusplus >= 201402)
 #   endif // // defined(ASIO_HAS_CLANG_LIBCXX)
 #  endif // defined(__clang__)
-#  if defined(__GNUC__)
-#   if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
-#    if (__cplusplus >= 201402)
-#     define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
-#    endif // (__cplusplus >= 201402)
-#   endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
-#  endif // defined(__GNUC__)
 # endif // !defined(ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
 #endif // !defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
 
+0 −90
Original line number Diff line number Diff line
From fb846bdbd07cc3b8ada6179dccd974072c2b69da Mon Sep 17 00:00:00 2001
From: Et7f3 <cadeaudeelie@gmail.com>
Date: Tue, 19 Jul 2022 22:01:56 +0200
Subject: [PATCH] build: Upgrade boost to 1.79.0

We can see in src/third_party/boost/boost/version.hpp that vendored version of
boost is BOOST_LIB_VERSION "1_76"

We can also see the doc desbribe 2 headers to use filesystems lib: One is
src/third_party/boost/boost/filesystem/fstream.hpp that contains (175-177)
  typedef basic_ifstream<char> ifstream;
  typedef basic_ofstream<char> ofstream;
  typedef basic_fstream<char> fstream;

So this mean they mostly forgot to include a header and include-what-you-use
would catch this error.

In upstream they fixed in a simmilar way
https://github.com/mongodb/mongo/commit/13389dc222fc372442be8c147e09685bb9a26a3a
---
 src/mongo/db/storage/storage_repair_observer.cpp    | 1 +
 src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp | 1 +
 src/mongo/shell/shell_utils_extended.cpp            | 1 +
 src/mongo/util/processinfo_linux.cpp                | 1 +
 src/mongo/util/stacktrace_threads.cpp               | 1 +
 5 files changed, 5 insertions(+)

diff --git a/src/mongo/db/storage/storage_repair_observer.cpp b/src/mongo/db/storage/storage_repair_observer.cpp
index 22b76a6a39c..453f48229cd 100644
--- a/src/mongo/db/storage/storage_repair_observer.cpp
+++ b/src/mongo/db/storage/storage_repair_observer.cpp
@@ -42,6 +42,7 @@
 #endif
 
 #include <boost/filesystem/path.hpp>
+#include <boost/filesystem/fstream.hpp>
 
 #include "mongo/db/dbhelpers.h"
 #include "mongo/db/operation_context.h"
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp
index 2f032e4..d1a90e0 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp
@@ -37,6 +37,7 @@

 #include <boost/filesystem.hpp>
 #include <boost/filesystem/path.hpp>
+#include <boost/filesystem/fstream.hpp>
 #include <pcrecpp.h>

 #include "mongo/base/simple_string_data_comparator.h"
diff --git a/src/mongo/shell/shell_utils_extended.cpp b/src/mongo/shell/shell_utils_extended.cpp
index fbdddc1318d..e37d4c93a11 100644
--- 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>
 
diff --git a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp
index eae0e9b7764..d5cd40f6039 100644
--- a/src/mongo/util/processinfo_linux.cpp
+++ b/src/mongo/util/processinfo_linux.cpp
@@ -52,6 +52,7 @@
 #endif
 
 #include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
 #include <boost/none.hpp>
 #include <boost/optional.hpp>
 #include <fmt/format.h>
diff --git a/src/mongo/util/stacktrace_threads.cpp b/src/mongo/util/stacktrace_threads.cpp
index d2ee29d24b4..d485fa22367 100644
--- 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>
-- 
2.32.1 (Apple Git-133)
+0 −90
Original line number Diff line number Diff line
From fb846bdbd07cc3b8ada6179dccd974072c2b69da Mon Sep 17 00:00:00 2001
From: Et7f3 <cadeaudeelie@gmail.com>
Date: Tue, 19 Jul 2022 22:01:56 +0200
Subject: [PATCH] build: Upgrade boost to 1.79.0

We can see in src/third_party/boost/boost/version.hpp that vendored version of
boost is BOOST_LIB_VERSION "1_76"

We can also see the doc desbribe 2 headers to use filesystems lib: One is
src/third_party/boost/boost/filesystem/fstream.hpp that contains (175-177)
  typedef basic_ifstream<char> ifstream;
  typedef basic_ofstream<char> ofstream;
  typedef basic_fstream<char> fstream;

So this mean they mostly forgot to include a header and include-what-you-use
would catch this error.

In upstream they fixed in a simmilar way
https://github.com/mongodb/mongo/commit/13389dc222fc372442be8c147e09685bb9a26a3a
---
 src/mongo/db/storage/storage_repair_observer.cpp    | 1 +
 src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp | 1 +
 src/mongo/shell/shell_utils_extended.cpp            | 1 +
 src/mongo/util/processinfo_linux.cpp                | 1 +
 src/mongo/util/stacktrace_threads.cpp               | 1 +
 5 files changed, 5 insertions(+)

diff --git a/src/mongo/db/storage/storage_repair_observer.cpp b/src/mongo/db/storage/storage_repair_observer.cpp
index 22b76a6a39c..453f48229cd 100644
--- a/src/mongo/db/storage/storage_repair_observer.cpp
+++ b/src/mongo/db/storage/storage_repair_observer.cpp
@@ -42,6 +42,7 @@
 #endif
 
 #include <boost/filesystem/path.hpp>
+#include <boost/filesystem/fstream.hpp>
 
 #include "mongo/db/dbhelpers.h"
 #include "mongo/db/operation_context.h"
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp
index 07fabadd634..2924a2c74af 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp
@@ -37,6 +37,7 @@
 
 #include <boost/filesystem.hpp>
 #include <boost/filesystem/path.hpp>
+#include <boost/filesystem/fstream.hpp>
 
 #include "mongo/base/simple_string_data_comparator.h"
 #include "mongo/bson/bsonobjbuilder.h"
diff --git a/src/mongo/shell/shell_utils_extended.cpp b/src/mongo/shell/shell_utils_extended.cpp
index fbdddc1318d..e37d4c93a11 100644
--- 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>
 
diff --git a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp
index eae0e9b7764..d5cd40f6039 100644
--- a/src/mongo/util/processinfo_linux.cpp
+++ b/src/mongo/util/processinfo_linux.cpp
@@ -52,6 +52,7 @@
 #endif
 
 #include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
 #include <boost/none.hpp>
 #include <boost/optional.hpp>
 #include <fmt/format.h>
diff --git a/src/mongo/util/stacktrace_threads.cpp b/src/mongo/util/stacktrace_threads.cpp
index d2ee29d24b4..d485fa22367 100644
--- 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>
-- 
2.32.1 (Apple Git-133)
+0 −44
Original line number Diff line number Diff line
From e78b2bf6eaa0c43bd76dbb841add167b443d2bb0 Mon Sep 17 00:00:00 2001
From: Mark Benvenuto <mark.benvenuto@mongodb.com>
Date: Mon, 21 Jun 2021 11:36:56 -0400
Subject: [PATCH] SERVER-57688 Fix debug gcc 11 and clang 12 builds on Fedora
 34

---
 SConstruct                              | 4 ----
 src/mongo/db/query/plan_summary_stats.h | 4 +++-
 src/mongo/util/shim_boost_assert.cpp    | 1 +
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/SConstruct b/SConstruct
index 25fd4a248d0c..23cff6f9da53 100644
--- a/SConstruct
+++ b/SConstruct
@@ -3108,10 +3108,6 @@ def doConfigure(myenv):
         # harmful to capture unused variables we are suppressing for now with a plan to fix later.
         AddToCCFLAGSIfSupported(myenv, "-Wno-unused-lambda-capture")
 
-        # 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")
-
         # Enable sized deallocation support.
         AddToCXXFLAGSIfSupported(myenv, '-fsized-deallocation')
 
diff --git a/src/mongo/db/query/plan_summary_stats.h b/src/mongo/db/query/plan_summary_stats.h
index 58677ab20d25..cfaa2053d16f 100644
--- a/src/mongo/db/query/plan_summary_stats.h
+++ b/src/mongo/db/query/plan_summary_stats.h
@@ -29,9 +29,11 @@
 
 #pragma once
 
-#include "mongo/util/container_size_helper.h"
+#include <optional>
 #include <string>
 
+#include "mongo/util/container_size_helper.h"
+
 namespace mongo {
 
 /**
Loading