Merge pull request #303318 from wegank/mongodb-4-drop

mongodb-4_4: drop
This commit is contained in:
Weijia Wang 2024-04-12 15:33:02 +02:00 committed by GitHub
commit d2ca8b1941
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 12 additions and 140 deletions

View File

@ -219,6 +219,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m
- `unifiLTS`, `unifi5` and `unifi6` have been removed, as they require MongoDB versions which are end-of-life. All these versions can be upgraded to `unifi7` directly.
- `mongodb-4_4` has been removed as it has reached end of life. Consequently, `unifi7` and `unifi8` now use MongoDB 5.0 by default.
- `nitter` requires a `guest_accounts.jsonl` to be provided as a path or loaded into the default location at `/var/lib/nitter/guest_accounts.jsonl`. See [Guest Account Branch Deployment](https://github.com/zedeus/nitter/wiki/Guest-Account-Branch-Deployment) for details.
- `boot.supportedFilesystems` and `boot.initrd.supportedFilesystems` are now attribute sets instead of lists. Assignment from lists as done previously is still supported, but checking whether a filesystem is enabled must now by done using `supportedFilesystems.fs or false` instead of using `lib.elem "fs" supportedFilesystems` as was done previously.

View File

@ -39,10 +39,10 @@ in
services.unifi.unifiPackage = lib.mkPackageOption pkgs "unifi5" { };
services.unifi.mongodbPackage = lib.mkPackageOption pkgs "mongodb" {
default = "mongodb-4_4";
default = "mongodb-5_0";
extraDescription = ''
::: {.note}
unifi7 officially only supports mongodb up until 3.6 but works with 4.4.
unifi7 officially only supports mongodb up until 4.4 but works with 5.0.
:::
'';
};

View File

@ -108,7 +108,7 @@ in
unifiVideoPackage = mkPackageOption pkgs "unifi-video" { };
mongodbPackage = mkPackageOption pkgs "mongodb" {
default = "mongodb-4_4";
default = "mongodb-5_0";
};
logDir = mkOption {

View File

@ -33,7 +33,6 @@ import ./make-test-python.nix ({ pkgs, ... }:
nodes = {
node = {...}: {
environment.systemPackages = with pkgs; [
mongodb-4_4
mongodb-5_0
];
};
@ -42,7 +41,6 @@ import ./make-test-python.nix ({ pkgs, ... }:
testScript = ''
node.start()
''
+ runMongoDBTest pkgs.mongodb-4_4
+ runMongoDBTest pkgs.mongodb-5_0
+ ''
node.shutdown()

View File

@ -1,20 +0,0 @@
{ stdenv, callPackage, lib, fetchpatch, sasl, boost, Security, CoreFoundation, cctools }:
let
buildMongoDB = callPackage ./mongodb.nix {
inherit sasl boost Security CoreFoundation cctools;
};
in
buildMongoDB {
version = "4.4.28";
sha256 = "sha256-aq4dJl2FOTOhQ3bzVj0L/0CE3obE7lCx2ecjGNYC8X4=";
patches = [
./forget-build-dependencies-4-4.patch
./fix-build-with-boost-1.79-4_4.patch
(fetchpatch {
name = "mongodb-4.4.15-adjust-the-cache-alignment-assumptions.patch";
url = "https://aur.archlinux.org/cgit/aur.git/plain/mongodb-4.4.15-adjust-cache-alignment-assumptions.patch.arm64?h=mongodb44";
sha256 = "Ah4zdSFgXUJ/HSN8VRLJqDpNy3CjMCBnRqlpALXzx+g=";
})
] ++ lib.optionals stdenv.isDarwin [ ./asio-no-experimental-string-view-4-4.patch ];
}

View File

@ -1,93 +0,0 @@
From f0c7e9190e9d61515ab3f95c6665754d3b972cd1 Mon Sep 17 00:00:00 2001
From: Et7f3 <cadeaudeelie@gmail.com>
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<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
Co-Authored-By: Adrian Pistol <vifino@tty.sh>
---
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 | 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
--- 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 ee87aca4723..bde2c1b2b83 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 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 <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
#include <fstream>
#include "mongo/bson/bson_validate.h"
diff --git a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp
index 9063f140988..d74949d45fc 100644
--- a/src/mongo/util/processinfo_linux.cpp
+++ b/src/mongo/util/processinfo_linux.cpp
@@ -33,7 +33,7 @@
#include "processinfo.h"
-#include <iostream>
+#include <fstream>
#include <malloc.h>
#include <pcrecpp.h>
#include <sched.h>
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 <array>
#include <atomic>
#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
#include <cctype>
#include <cstdint>
#include <cstdlib>
--
2.39.2

View File

@ -87,7 +87,7 @@ in stdenv.mkDerivation rec {
zlib
] ++ lib.optionals stdenv.isDarwin [ Security CoreFoundation cctools ]
++ lib.optional stdenv.isLinux net-snmp
++ lib.optionals (versionAtLeast version "4.4") [ xz ];
++ [ xz ];
# MongoDB keeps track of its build parameters, which tricks nix into
# keeping dependencies to build inputs in the final output.
@ -98,24 +98,15 @@ in stdenv.mkDerivation rec {
# fix environment variable reading
substituteInPlace SConstruct \
--replace "env = Environment(" "env = Environment(ENV = os.environ,"
'' + lib.optionalString (versionAtLeast version "4.4") ''
'' + ''
# 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 <string>' '#include <optional>
#include <string>'
substituteInPlace src/mongo/db/exec/plan_stats.h --replace '#include <string>' '#include <optional>
#include <string>'
'' + lib.optionalString (versionOlder version "5.0") ''
# remove -march overriding, we know better.
sed -i 's/env.Append.*-march=.*$/pass/' SConstruct
'' + lib.optionalString (stdenv.isDarwin && versionOlder version "6.0") ''
substituteInPlace src/third_party/mozjs-${mozjsVersion}/extract/js/src/jsmath.cpp --replace '${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
substituteInPlace src/third_party/s2/s2latlng.cc --replace drem remainder
substituteInPlace src/third_party/s2/s2latlngrect.cc --replace drem remainder
'' + lib.optionalString stdenv.isi686 ''
# don't fail by default on i686
@ -135,7 +126,8 @@ in stdenv.mkDerivation rec {
"--use-sasl-client"
"--disable-warnings-as-errors"
"VARIANT_DIR=nixos" # Needed so we don't produce argument lists that are too long for gcc / ld
] ++ lib.optionals (versionAtLeast version "4.4") [ "--link-model=static" ]
"--link-model=static"
]
++ map (lib: "--use-system-${lib}") system-libraries;
# This seems to fix mongodb not able to find OpenSSL's crypto.h during build
@ -167,10 +159,9 @@ in stdenv.mkDerivation rec {
installTargets =
if (versionAtLeast version "6.0") then "install-devcore"
else if (versionAtLeast version "4.4") then "install-core"
else "install";
else "install-core";
prefixKey = if (versionAtLeast version "4.4") then "DESTDIR=" else "--prefix=";
prefixKey = "DESTDIR=";
enableParallelBuilding = true;

View File

@ -808,6 +808,7 @@ mapAliases ({
moneyplex = throw "'moneyplex' has been removed, as it was broken and unmaintained"; # Added 2024-02-28
mongodb-4_0 = throw "mongodb-4_0 has been removed, it's end of life since April 2022"; # Added 2023-01-05
mongodb-4_2 = throw "mongodb-4_2 has been removed, it's end of life since April 2023"; # Added 2023-06-06
mongodb-4_4 = throw "mongodb-4_4 has been removed, it's end of life since April 2024"; # Added 2024-04-11
moonlander = throw "'moonlander' has been removed due to it being broken and unmaintained"; # Added 2023-11-26
moz-phab = mozphab; # Added 2022-08-09
mozart-binary = throw "'mozart-binary' has been renamed to/replaced by 'mozart2-binary'"; # Converted to throw 2023-09-10

View File

@ -26409,13 +26409,6 @@ with pkgs;
mongodb = hiPrio mongodb-6_0;
mongodb-4_4 = callPackage ../servers/nosql/mongodb/4.4.nix {
sasl = cyrus_sasl;
boost = boost179.override { enableShared = false; };
inherit (darwin) cctools;
inherit (darwin.apple_sdk.frameworks) CoreFoundation Security;
};
mongodb-5_0 = callPackage ../servers/nosql/mongodb/5.0.nix {
sasl = cyrus_sasl;
boost = boost179.override { enableShared = false; };