From 2ddc70dc48634288fe30f9b7207af3c3d6e8f912 Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Thu, 7 Jul 2022 12:06:14 +0200 Subject: [PATCH 1/7] mongodb: fix build with boost 1.79 --- pkgs/servers/nosql/mongodb/4.4.nix | 1 + pkgs/servers/nosql/mongodb/5.0.nix | 1 + .../fix-build-with-boost-1.79-4_4.patch | 64 +++++++++++++++++++ .../fix-build-with-boost-1.79-5_0.patch | 64 +++++++++++++++++++ 4 files changed, 130 insertions(+) create mode 100644 pkgs/servers/nosql/mongodb/fix-build-with-boost-1.79-4_4.patch create mode 100644 pkgs/servers/nosql/mongodb/fix-build-with-boost-1.79-5_0.patch diff --git a/pkgs/servers/nosql/mongodb/4.4.nix b/pkgs/servers/nosql/mongodb/4.4.nix index 7dd74e24fc48..9db11e21619b 100644 --- a/pkgs/servers/nosql/mongodb/4.4.nix +++ b/pkgs/servers/nosql/mongodb/4.4.nix @@ -10,5 +10,6 @@ buildMongoDB { sha256 = "sha256-ebg3R6P+tjRvizDzsl7mZzhTfqIaRJPfHBu0IfRvtS8="; patches = [ ./forget-build-dependencies-4-4.patch + ./fix-build-with-boost-1.79-4_4.patch ] ++ lib.optionals stdenv.isDarwin [ ./asio-no-experimental-string-view-4-4.patch ]; } diff --git a/pkgs/servers/nosql/mongodb/5.0.nix b/pkgs/servers/nosql/mongodb/5.0.nix index 6bb2294cfffa..50f9db689eec 100644 --- a/pkgs/servers/nosql/mongodb/5.0.nix +++ b/pkgs/servers/nosql/mongodb/5.0.nix @@ -21,5 +21,6 @@ buildMongoDB { patches = [ ./forget-build-dependencies-4-4.patch ./asio-no-experimental-string-view-4-4.patch + ./fix-build-with-boost-1.79-5_0.patch ]; } diff --git a/pkgs/servers/nosql/mongodb/fix-build-with-boost-1.79-4_4.patch b/pkgs/servers/nosql/mongodb/fix-build-with-boost-1.79-4_4.patch new file mode 100644 index 000000000000..df3055988a41 --- /dev/null +++ b/pkgs/servers/nosql/mongodb/fix-build-with-boost-1.79-4_4.patch @@ -0,0 +1,64 @@ +From 72103f5e888b3bbe697e3d5fa3e76c0c872752f1 Mon Sep 17 00:00:00 2001 +From: Et7f3 +Date: Tue, 19 Jul 2022 22:11:11 +0200 +Subject: [PATCH] build: Upgrade boost to 1.79.0 + +We can see in src/third_party/boost-1.70.0/boost/version.hpp that vendored +version of boost is BOOST_LIB_VERSION "1_70" + +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 ifstream; + typedef basic_ofstream ofstream; + typedef basic_fstream 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 + + 3 files changed, 3 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 ++#include + + #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 85121941458..7464022fb28 100644 +--- a/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp ++++ b/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp +@@ -37,6 +37,7 @@ + + #include + #include ++#include + + #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 8cd7f035f1d..cd672eb513f 100644 +--- a/src/mongo/shell/shell_utils_extended.cpp ++++ b/src/mongo/shell/shell_utils_extended.cpp +@@ -37,6 +37,7 @@ + #endif + + #include ++#include + #include + + #include "mongo/bson/bson_validate.h" +-- +2.32.1 (Apple Git-133) + diff --git a/pkgs/servers/nosql/mongodb/fix-build-with-boost-1.79-5_0.patch b/pkgs/servers/nosql/mongodb/fix-build-with-boost-1.79-5_0.patch new file mode 100644 index 000000000000..9ef5c3af52bf --- /dev/null +++ b/pkgs/servers/nosql/mongodb/fix-build-with-boost-1.79-5_0.patch @@ -0,0 +1,64 @@ +From 5c872a02501cad670d5b7f4f153ae856732a605e Mon Sep 17 00:00:00 2001 +From: Et7f3 +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 ifstream; + typedef basic_ofstream ofstream; + typedef basic_fstream 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 + + 3 files changed, 3 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 ++#include + + #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 + #include ++#include + + #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 ++#include + #include + #include + +-- +2.32.1 (Apple Git-133) + From eedcccd2914cdbf08c2854005571d9400c5ca974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89lie=20BRAMI?= Date: Tue, 5 Jul 2022 02:07:26 +0200 Subject: [PATCH 2/7] mongodb: fix double link of isNamedError on darwin. duplicate symbol 'mongo::error_details::isNamedCode<100>' in: build/nixos/mongo/libmongodmain.a(db.o) build/nixos/third_party/murmurhash3/libmurmurhash3.a(MurmurHash3.o) duplicate symbol 'mongo::error_details::isNamedCode<11000>' in: build/nixos/mongo/libmongodmain.a(db.o) build/nixos/third_party/murmurhash3/libmurmurhash3.a(MurmurHash3.o) ld: 380094 duplicate symbols for architecture x86_64 clang-11: error: linker command failed with exit code 1 (use -v to see invocation) scons: *** [build/nixos/mongo/mongod] Error 1 scons: building terminated because of errors. build/nixos/mongo/mongo failed: Error 1 build/nixos/mongo/mongos failed: Error 1 build/nixos/mongo/mongod failed: Error 1 --- pkgs/servers/nosql/mongodb/v3_6.nix | 11 +++++++++-- pkgs/servers/nosql/mongodb/v4_0.nix | 9 ++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/nosql/mongodb/v3_6.nix b/pkgs/servers/nosql/mongodb/v3_6.nix index 4fc9e3ea9062..08dfc45ead1e 100644 --- a/pkgs/servers/nosql/mongodb/v3_6.nix +++ b/pkgs/servers/nosql/mongodb/v3_6.nix @@ -1,4 +1,4 @@ -{ stdenv, callPackage, lib, sasl, boost, Security, CoreFoundation, cctools }: +{ stdenv, callPackage, fetchpatch, lib, sasl, boost, Security, CoreFoundation, cctools }: let buildMongoDB = callPackage ./mongodb.nix { @@ -12,5 +12,12 @@ in buildMongoDB { version = "3.6.23"; sha256 = "sha256-EJpIerW4zcGJvHfqJ65fG8yNsLRlUnRkvYfC+jkoFJ4="; patches = [ ./forget-build-dependencies.patch ] - ++ lib.optionals stdenv.isDarwin [ ./asio-no-experimental-string-view.patch ]; + ++ lib.optionals stdenv.isDarwin [ + ./asio-no-experimental-string-view.patch + (fetchpatch { + name = "fix double link of isNamedError."; + url = "https://github.com/mongodb/mongo/commit/9c6751b9765d269b667324bb2efe1ca76a916d20.patch"; + sha256 = "sha256-4mcafqhBh7039ocEI9d/gXWck51X68PqtWtz4dapwwI="; + }) + ]; } diff --git a/pkgs/servers/nosql/mongodb/v4_0.nix b/pkgs/servers/nosql/mongodb/v4_0.nix index 9d28a9185ba1..a77d5fee2f29 100644 --- a/pkgs/servers/nosql/mongodb/v4_0.nix +++ b/pkgs/servers/nosql/mongodb/v4_0.nix @@ -21,5 +21,12 @@ in buildMongoDB { sha256 = "sha256-RvfCP462RG+ZVjcb23DgCuxCdfPl2/UgH8N7FgCghGI="; }) ] - ++ lib.optionals stdenv.isDarwin [ ./asio-no-experimental-string-view.patch ]; + ++ lib.optionals stdenv.isDarwin [ + ./asio-no-experimental-string-view.patch + (fetchpatch { + name = "fix double link of isNamedError."; + url = "https://github.com/mongodb/mongo/commit/9c6751b9765d269b667324bb2efe1ca76a916d20.patch"; + sha256 = "sha256-4mcafqhBh7039ocEI9d/gXWck51X68PqtWtz4dapwwI="; + }) + ]; } From a0f42fb89924b4a739f2f9101434b0c7de134dd7 Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Thu, 7 Jul 2022 12:04:02 +0200 Subject: [PATCH 3/7] mongodb: drem doesn't exist after 3.6 --- pkgs/servers/nosql/mongodb/mongodb.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix index 28795890069d..80bf3c69afcd 100644 --- a/pkgs/servers/nosql/mongodb/mongodb.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -72,6 +72,7 @@ in stdenv.mkDerivation rec { --replace "env = Environment(" "env = Environment(ENV = os.environ," '' + lib.optionalString stdenv.isDarwin '' substituteInPlace src/third_party/mozjs-${variants.mozjsVersion}/extract/js/src/jsmath.cpp --replace '${variants.mozjsReplace}' 0 + '' + lib.optionalString (stdenv.isDarwin && versionOlder version "3.6") '' substituteInPlace src/third_party/s2/s1angle.cc --replace drem remainder substituteInPlace src/third_party/s2/s1interval.cc --replace drem remainder substituteInPlace src/third_party/s2/s2cap.cc --replace drem remainder From 2a7c1ea47792b28963e9bacb44f290066eed2a43 Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Fri, 8 Jul 2022 01:15:57 +0200 Subject: [PATCH 4/7] mongodb: asio-no-experimental-string-view.patch is no longer required on darwin --- pkgs/servers/nosql/mongodb/v3_6.nix | 1 - pkgs/servers/nosql/mongodb/v4_0.nix | 1 - 2 files changed, 2 deletions(-) diff --git a/pkgs/servers/nosql/mongodb/v3_6.nix b/pkgs/servers/nosql/mongodb/v3_6.nix index 08dfc45ead1e..9a6379fac440 100644 --- a/pkgs/servers/nosql/mongodb/v3_6.nix +++ b/pkgs/servers/nosql/mongodb/v3_6.nix @@ -13,7 +13,6 @@ in buildMongoDB { sha256 = "sha256-EJpIerW4zcGJvHfqJ65fG8yNsLRlUnRkvYfC+jkoFJ4="; patches = [ ./forget-build-dependencies.patch ] ++ lib.optionals stdenv.isDarwin [ - ./asio-no-experimental-string-view.patch (fetchpatch { name = "fix double link of isNamedError."; url = "https://github.com/mongodb/mongo/commit/9c6751b9765d269b667324bb2efe1ca76a916d20.patch"; diff --git a/pkgs/servers/nosql/mongodb/v4_0.nix b/pkgs/servers/nosql/mongodb/v4_0.nix index a77d5fee2f29..1235123c94a2 100644 --- a/pkgs/servers/nosql/mongodb/v4_0.nix +++ b/pkgs/servers/nosql/mongodb/v4_0.nix @@ -22,7 +22,6 @@ in buildMongoDB { }) ] ++ lib.optionals stdenv.isDarwin [ - ./asio-no-experimental-string-view.patch (fetchpatch { name = "fix double link of isNamedError."; url = "https://github.com/mongodb/mongo/commit/9c6751b9765d269b667324bb2efe1ca76a916d20.patch"; From 2ba2e8d8b2626704931ea077f6bee464dc22d161 Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Fri, 24 Jun 2022 05:07:11 +0200 Subject: [PATCH 5/7] mongodb: backport a fix to 5.0 in openssl detection. --- pkgs/servers/nosql/mongodb/5.0.nix | 1 + .../mongodb/fix-gcc-Wno-exceptions-5.0.patch | 44 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 pkgs/servers/nosql/mongodb/fix-gcc-Wno-exceptions-5.0.patch diff --git a/pkgs/servers/nosql/mongodb/5.0.nix b/pkgs/servers/nosql/mongodb/5.0.nix index 50f9db689eec..cd25525f4fe6 100644 --- a/pkgs/servers/nosql/mongodb/5.0.nix +++ b/pkgs/servers/nosql/mongodb/5.0.nix @@ -22,5 +22,6 @@ buildMongoDB { ./forget-build-dependencies-4-4.patch ./asio-no-experimental-string-view-4-4.patch ./fix-build-with-boost-1.79-5_0.patch + ./fix-gcc-Wno-exceptions-5.0.patch ]; } diff --git a/pkgs/servers/nosql/mongodb/fix-gcc-Wno-exceptions-5.0.patch b/pkgs/servers/nosql/mongodb/fix-gcc-Wno-exceptions-5.0.patch new file mode 100644 index 000000000000..b8803911968b --- /dev/null +++ b/pkgs/servers/nosql/mongodb/fix-gcc-Wno-exceptions-5.0.patch @@ -0,0 +1,44 @@ +From e78b2bf6eaa0c43bd76dbb841add167b443d2bb0 Mon Sep 17 00:00:00 2001 +From: Mark Benvenuto +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 + #include + ++#include "mongo/util/container_size_helper.h" ++ + namespace mongo { + + /** From 6274875188277800937719de9dc3a89ab69d73cd Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Tue, 19 Jul 2022 22:53:46 +0200 Subject: [PATCH 6/7] mongodb: fix build with boost 1.79 on linux --- .../fix-build-with-boost-1.79-4_4.patch | 31 +++++++++++++++++-- .../fix-build-with-boost-1.79-5_0.patch | 30 ++++++++++++++++-- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/nosql/mongodb/fix-build-with-boost-1.79-4_4.patch b/pkgs/servers/nosql/mongodb/fix-build-with-boost-1.79-4_4.patch index df3055988a41..fe1eb4aa3609 100644 --- a/pkgs/servers/nosql/mongodb/fix-build-with-boost-1.79-4_4.patch +++ b/pkgs/servers/nosql/mongodb/fix-build-with-boost-1.79-4_4.patch @@ -1,4 +1,4 @@ -From 72103f5e888b3bbe697e3d5fa3e76c0c872752f1 Mon Sep 17 00:00:00 2001 +From 9a4c7b33e49cdf121ff9dee858539568d009fc27 Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Tue, 19 Jul 2022 22:11:11 +0200 Subject: [PATCH] build: Upgrade boost to 1.79.0 @@ -21,7 +21,9 @@ 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 + - 3 files changed, 3 insertions(+) + src/mongo/util/processinfo_linux.cpp | 2 +- + src/mongo/util/stacktrace_threads.cpp | 1 + + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mongo/db/storage/storage_repair_observer.cpp b/src/mongo/db/storage/storage_repair_observer.cpp index 22b76a6a39c..453f48229cd 100644 @@ -59,6 +61,31 @@ index 8cd7f035f1d..cd672eb513f 100644 #include #include "mongo/bson/bson_validate.h" +diff --git a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp +index de4b84bca5a..7fa9d5d128e 100644 +--- a/src/mongo/util/processinfo_linux.cpp ++++ b/src/mongo/util/processinfo_linux.cpp +@@ -33,7 +33,7 @@ + + #include "processinfo.h" + +-#include ++#include + #include + #include + #include +diff --git a/src/mongo/util/stacktrace_threads.cpp b/src/mongo/util/stacktrace_threads.cpp +index 4667a261ab7..73a36015bd6 100644 +--- a/src/mongo/util/stacktrace_threads.cpp ++++ b/src/mongo/util/stacktrace_threads.cpp +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + #include + #include + #include -- 2.32.1 (Apple Git-133) diff --git a/pkgs/servers/nosql/mongodb/fix-build-with-boost-1.79-5_0.patch b/pkgs/servers/nosql/mongodb/fix-build-with-boost-1.79-5_0.patch index 9ef5c3af52bf..d00ed5e77d67 100644 --- a/pkgs/servers/nosql/mongodb/fix-build-with-boost-1.79-5_0.patch +++ b/pkgs/servers/nosql/mongodb/fix-build-with-boost-1.79-5_0.patch @@ -1,4 +1,4 @@ -From 5c872a02501cad670d5b7f4f153ae856732a605e Mon Sep 17 00:00:00 2001 +From fb846bdbd07cc3b8ada6179dccd974072c2b69da Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Tue, 19 Jul 2022 22:01:56 +0200 Subject: [PATCH] build: Upgrade boost to 1.79.0 @@ -21,7 +21,9 @@ 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 + - 3 files changed, 3 insertions(+) + 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 @@ -59,6 +61,30 @@ index fbdddc1318d..e37d4c93a11 100644 #include #include +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 ++#include + #include + #include + #include +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 + #include + #include ++#include + #include + #include + #include -- 2.32.1 (Apple Git-133) From e7d158d4af2bba63e34cbea4154108920d048f54 Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Wed, 20 Jul 2022 22:59:24 +0200 Subject: [PATCH 7/7] mongodb-4_4: fic-gcc11-optionnal gcc 11 doesn't add by mistake. --- pkgs/servers/nosql/mongodb/mongodb.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix index 80bf3c69afcd..82837e87d1a6 100644 --- a/pkgs/servers/nosql/mongodb/mongodb.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -70,6 +70,13 @@ in stdenv.mkDerivation rec { # fix environment variable reading substituteInPlace SConstruct \ --replace "env = Environment(" "env = Environment(ENV = os.environ," + '' + lib.optionalString (versionAtLeast version "4.4" && versionOlder version "4.6") '' + # Fix debug gcc 11 and clang 12 builds on Fedora + # https://github.com/mongodb/mongo/commit/e78b2bf6eaa0c43bd76dbb841add167b443d2bb0.patch + substituteInPlace src/mongo/db/query/plan_summary_stats.h --replace '#include ' '#include + #include ' + substituteInPlace src/mongo/db/exec/plan_stats.h --replace '#include ' '#include + #include ' '' + lib.optionalString stdenv.isDarwin '' substituteInPlace src/third_party/mozjs-${variants.mozjsVersion}/extract/js/src/jsmath.cpp --replace '${variants.mozjsReplace}' 0 '' + lib.optionalString (stdenv.isDarwin && versionOlder version "3.6") ''