From 2ddc70dc48634288fe30f9b7207af3c3d6e8f912 Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Thu, 7 Jul 2022 12:06:14 +0200 Subject: [PATCH] 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) +