From e9bec1adf6d4147d7b15d6b636ec5bf4294c457b Mon Sep 17 00:00:00 2001 From: Nathan Smyth Date: Thu, 3 May 2018 17:42:24 +1000 Subject: mongodb: 3.4.10 -> 4.0.4 fix: Adding libtool to allow darwin compiles Libtool seems to be required for mongodb to compile on darwin. fix: Marking MongoDB as broken on aarch64 fix: Adding libtools to the pkg imports Update mongodb to 4.0.4 --- lib/licenses.nix | 7 ++++++ pkgs/servers/nosql/mongodb/default.nix | 29 ++++++++++++---------- .../nosql/mongodb/forget-build-dependencies.patch | 10 +++----- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/lib/licenses.nix b/lib/licenses.nix index e2f94e565ce..e37eb57cff9 100644 --- a/lib/licenses.nix +++ b/lib/licenses.nix @@ -649,6 +649,13 @@ lib.mapAttrs (n: v: v // { shortName = n; }) { url = http://metadata.ftp-master.debian.org/changelogs/main/d/debianutils/debianutils_4.8.1_copyright; }; + sspl = { + shortName = "SSPL"; + fullName = "Server Side Public License"; + url = https://www.mongodb.com/licensing/server-side-public-license; + free = false; + }; + tcltk = spdx { spdxId = "TCL"; fullName = "TCL/TK License"; diff --git a/pkgs/servers/nosql/mongodb/default.nix b/pkgs/servers/nosql/mongodb/default.nix index c2ae83f3e8a..966cebc799e 100644 --- a/pkgs/servers/nosql/mongodb/default.nix +++ b/pkgs/servers/nosql/mongodb/default.nix @@ -1,5 +1,5 @@ -{ stdenv, fetchurl, fetchpatch, scons, boost, gperftools, pcre-cpp, snappy -, zlib, libyamlcpp, sasl, openssl, libpcap, Security +{ stdenv, fetchurl, fetchpatch, scons, boost, gperftools, pcre-cpp, snappy, zlib, + libyamlcpp, sasl, openssl, libpcap, wiredtiger, Security, python27, libtool, curl }: # Note: @@ -7,7 +7,8 @@ with stdenv.lib; -let version = "3.4.10"; +let version = "4.0.4"; + python = python27.withPackages (ps: with ps; [ pyyaml typing cheetah ]); system-libraries = [ "pcre" #"asio" -- XXX use package? @@ -19,6 +20,7 @@ let version = "3.4.10"; #"stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs). "yaml" ] ++ optionals stdenv.isLinux [ "tcmalloc" ]; + inherit (stdenv.lib) systems subtractLists; in stdenv.mkDerivation { pname = "mongodb"; @@ -26,14 +28,14 @@ in stdenv.mkDerivation { src = fetchurl { url = "https://fastdl.mongodb.org/src/mongodb-src-r${version}.tar.gz"; - sha256 = "1wz2mhl9z0b1bdkg6m8v8mvw9k60mdv5ybq554xn3yjj9z500f24"; + sha256 = "1qycwr9f99b5cy4nf54yv2y724xis3lwd2h6iv2pfp36qnhsvfh2"; }; nativeBuildInputs = [ scons ]; buildInputs = [ sasl boost gperftools pcre-cpp snappy - zlib libyamlcpp sasl openssl.dev openssl.out libpcap - ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security ]; + zlib libyamlcpp sasl openssl.dev openssl.out libpcap python curl + ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security libtool ]; patches = [ @@ -41,11 +43,6 @@ in stdenv.mkDerivation { # keeping dependencies to build inputs in the final output. # We remove the build flags from buildInfo data. ./forget-build-dependencies.patch - (fetchpatch { - url = https://projects.archlinux.org/svntogit/community.git/plain/trunk/boost160.patch?h=packages/mongodb; - name = "boost160.patch"; - sha256 = "0bvsf3499zj55pzamwjmsssr6x63w434944w76273fr5rxwzcmh8"; - }) ]; postPatch = '' @@ -89,6 +86,11 @@ in stdenv.mkDerivation { preInstall = '' mkdir -p $out/lib ''; + + postInstall = '' + rm $out/bin/install_compass + ''; + prefixKey = "--prefix="; enableParallelBuilding = true; @@ -98,9 +100,10 @@ in stdenv.mkDerivation { meta = { description = "A scalable, high-performance, open source NoSQL database"; homepage = http://www.mongodb.org; - license = licenses.agpl3; + license = licenses.sspl; + broken = stdenv.hostPlatform.isAarch64; #g++ has internal compiler errors maintainers = with maintainers; [ bluescreen303 offline cstrahan ]; - platforms = platforms.unix; + platforms = subtractLists systems.doubles.i686 systems.doubles.unix; }; } diff --git a/pkgs/servers/nosql/mongodb/forget-build-dependencies.patch b/pkgs/servers/nosql/mongodb/forget-build-dependencies.patch index ca2c043deb2..897618cceb1 100644 --- a/pkgs/servers/nosql/mongodb/forget-build-dependencies.patch +++ b/pkgs/servers/nosql/mongodb/forget-build-dependencies.patch @@ -1,8 +1,6 @@ ---- a/site_scons/mongo_scons_utils.py -+++ b/site_scons/mongo_scons_utils.py -@@ -84,14 +84,11 @@ - def default_buildinfo_environment_data(): - return ( +--- a/site_scons/mongo/generators.py ++++ b/site_scons/mongo/generators.py +@@ -18,10 +18,7 @@ def default_buildinfo_environment_data(): ('distmod', '$MONGO_DISTMOD', True, True,), ('distarch', '$MONGO_DISTARCH', True, True,), ('cc', '$CC_VERSION', True, False,), @@ -13,5 +11,3 @@ ('target_arch', '$TARGET_ARCH', True, True,), ('target_os', '$TARGET_OS', True, False,), ) - - # If you want buildInfo and --version to be relatively empty, set -- cgit 1.4.1 From 97c4dff1583b871605964c165056074f0a502d0b Mon Sep 17 00:00:00 2001 From: Nathan Smyth Date: Fri, 31 May 2019 22:14:14 +1000 Subject: mongodb: split packages to expose 3.4, 3.6 and 4.0 --- pkgs/servers/nosql/mongodb/default.nix | 109 ------------------- .../mongodb/forget-build-dependencies-3-4.patch | 17 +++ pkgs/servers/nosql/mongodb/mongodb.nix | 120 +++++++++++++++++++++ pkgs/servers/nosql/mongodb/v3_4.nix | 12 +++ pkgs/servers/nosql/mongodb/v3_6.nix | 12 +++ pkgs/servers/nosql/mongodb/v4_0.nix | 12 +++ pkgs/top-level/all-packages.nix | 16 ++- 7 files changed, 188 insertions(+), 110 deletions(-) delete mode 100644 pkgs/servers/nosql/mongodb/default.nix create mode 100644 pkgs/servers/nosql/mongodb/forget-build-dependencies-3-4.patch create mode 100644 pkgs/servers/nosql/mongodb/mongodb.nix create mode 100644 pkgs/servers/nosql/mongodb/v3_4.nix create mode 100644 pkgs/servers/nosql/mongodb/v3_6.nix create mode 100644 pkgs/servers/nosql/mongodb/v4_0.nix diff --git a/pkgs/servers/nosql/mongodb/default.nix b/pkgs/servers/nosql/mongodb/default.nix deleted file mode 100644 index 966cebc799e..00000000000 --- a/pkgs/servers/nosql/mongodb/default.nix +++ /dev/null @@ -1,109 +0,0 @@ -{ stdenv, fetchurl, fetchpatch, scons, boost, gperftools, pcre-cpp, snappy, zlib, - libyamlcpp, sasl, openssl, libpcap, wiredtiger, Security, python27, libtool, curl -}: - -# Note: -# The command line tools are written in Go as part of a different package (mongodb-tools) - -with stdenv.lib; - -let version = "4.0.4"; - python = python27.withPackages (ps: with ps; [ pyyaml typing cheetah ]); - system-libraries = [ - "pcre" - #"asio" -- XXX use package? - #"wiredtiger" - "boost" - "snappy" - "zlib" - #"valgrind" -- mongodb only requires valgrind.h, which is vendored in the source. - #"stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs). - "yaml" - ] ++ optionals stdenv.isLinux [ "tcmalloc" ]; - inherit (stdenv.lib) systems subtractLists; - -in stdenv.mkDerivation { - pname = "mongodb"; - inherit version; - - src = fetchurl { - url = "https://fastdl.mongodb.org/src/mongodb-src-r${version}.tar.gz"; - sha256 = "1qycwr9f99b5cy4nf54yv2y724xis3lwd2h6iv2pfp36qnhsvfh2"; - }; - - nativeBuildInputs = [ scons ]; - buildInputs = [ - sasl boost gperftools pcre-cpp snappy - zlib libyamlcpp sasl openssl.dev openssl.out libpcap python curl - ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security libtool ]; - - patches = - [ - # MongoDB keeps track of its build parameters, which tricks nix into - # keeping dependencies to build inputs in the final output. - # We remove the build flags from buildInfo data. - ./forget-build-dependencies.patch - ]; - - postPatch = '' - # fix environment variable reading - substituteInPlace SConstruct \ - --replace "env = Environment(" "env = Environment(ENV = os.environ," - '' + stdenv.lib.optionalString stdenv.isDarwin '' - - 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 - '' + stdenv.lib.optionalString stdenv.isi686 '' - - # don't fail by default on i686 - substituteInPlace src/mongo/db/storage/storage_options.h \ - --replace 'engine("wiredTiger")' 'engine("mmapv1")' - ''; - - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument"; - - sconsFlags = [ - "--release" - "--ssl" - #"--rocksdb" # Don't have this packaged yet - "--wiredtiger=${if stdenv.is64bit then "on" else "off"}" - "--js-engine=mozjs" - "--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 - ] ++ map (lib: "--use-system-${lib}") system-libraries; - - preBuild = '' - sconsFlags+=" CC=$CC" - sconsFlags+=" CXX=$CXX" - '' + optionalString stdenv.isAarch64 '' - sconsFlags+=" CCFLAGS='-march=armv8-a+crc'" - ''; - - preInstall = '' - mkdir -p $out/lib - ''; - - postInstall = '' - rm $out/bin/install_compass - ''; - - prefixKey = "--prefix="; - - enableParallelBuilding = true; - - hardeningEnable = [ "pie" ]; - - meta = { - description = "A scalable, high-performance, open source NoSQL database"; - homepage = http://www.mongodb.org; - license = licenses.sspl; - broken = stdenv.hostPlatform.isAarch64; #g++ has internal compiler errors - - maintainers = with maintainers; [ bluescreen303 offline cstrahan ]; - platforms = subtractLists systems.doubles.i686 systems.doubles.unix; - }; -} diff --git a/pkgs/servers/nosql/mongodb/forget-build-dependencies-3-4.patch b/pkgs/servers/nosql/mongodb/forget-build-dependencies-3-4.patch new file mode 100644 index 00000000000..ca2c043deb2 --- /dev/null +++ b/pkgs/servers/nosql/mongodb/forget-build-dependencies-3-4.patch @@ -0,0 +1,17 @@ +--- a/site_scons/mongo_scons_utils.py ++++ b/site_scons/mongo_scons_utils.py +@@ -84,14 +84,11 @@ + def default_buildinfo_environment_data(): + return ( + ('distmod', '$MONGO_DISTMOD', True, True,), + ('distarch', '$MONGO_DISTARCH', True, True,), + ('cc', '$CC_VERSION', True, False,), +- ('ccflags', '$CCFLAGS', True, False,), + ('cxx', '$CXX_VERSION', True, False,), +- ('cxxflags', '$CXXFLAGS', True, False,), +- ('linkflags', '$LINKFLAGS', True, False,), + ('target_arch', '$TARGET_ARCH', True, True,), + ('target_os', '$TARGET_OS', True, False,), + ) + + # If you want buildInfo and --version to be relatively empty, set diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix new file mode 100644 index 00000000000..fd4869f92aa --- /dev/null +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -0,0 +1,120 @@ +{ stdenv, fetchurl, fetchpatch, scons, boost, gperftools, pcre-cpp, snappy, zlib +, libyamlcpp, sasl, openssl, libpcap, wiredtiger, Security, python27, libtool +, curl }: + +# Note: +# The command line tools are written in Go as part of a different package (mongodb-tools) + +with stdenv.lib; + +{ version, sha256, patches ? [ ] }@args: + +let + python = python27.withPackages (ps: with ps; [ pyyaml typing cheetah ]); + system-libraries = [ + "pcre" + #"asio" -- XXX use package? + #"wiredtiger" + "boost" + "snappy" + "zlib" + #"valgrind" -- mongodb only requires valgrind.h, which is vendored in the source. + #"stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs). + "yaml" + ] ++ optionals stdenv.isLinux [ "tcmalloc" ]; + inherit (stdenv.lib) systems subtractLists; + +in stdenv.mkDerivation rec { + inherit version; + name = "mongodb-${version}"; + + src = fetchurl { + url = "https://fastdl.mongodb.org/src/mongodb-src-r${version}.tar.gz"; + inherit sha256; + }; + + nativeBuildInputs = [ scons ]; + buildInputs = [ + sasl + boost + gperftools + pcre-cpp + snappy + zlib + libyamlcpp + sasl + openssl.dev + openssl.out + libpcap + python + curl + ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security libtool ]; + + # MongoDB keeps track of its build parameters, which tricks nix into + # keeping dependencies to build inputs in the final output. + # We remove the build flags from buildInfo data. + inherit patches; + + postPatch = '' + # fix environment variable reading + substituteInPlace SConstruct \ + --replace "env = Environment(" "env = Environment(ENV = os.environ," + '' + stdenv.lib.optionalString stdenv.isDarwin '' + + 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 + '' + stdenv.lib.optionalString stdenv.isi686 '' + + # don't fail by default on i686 + substituteInPlace src/mongo/db/storage/storage_options.h \ + --replace 'engine("wiredTiger")' 'engine("mmapv1")' + ''; + + NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang + "-Wno-unused-command-line-argument"; + + sconsFlags = [ + "--release" + "--ssl" + #"--rocksdb" # Don't have this packaged yet + "--wiredtiger=${if stdenv.is64bit then "on" else "off"}" + "--js-engine=mozjs" + "--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 + ] ++ map (lib: "--use-system-${lib}") system-libraries; + + preBuild = '' + sconsFlags+=" CC=$CC" + sconsFlags+=" CXX=$CXX" + '' + optionalString stdenv.isAarch64 '' + sconsFlags+=" CCFLAGS='-march=armv8-a+crc'" + ''; + + preInstall = '' + mkdir -p "$out/lib" + ''; + + postInstall = '' + rm -f "$out/bin/install_compass" || true + ''; + + prefixKey = "--prefix="; + + enableParallelBuilding = true; + + hardeningEnable = [ "pie" ]; + + meta = { + description = "A scalable, high-performance, open source NoSQL database"; + homepage = "http://www.mongodb.org"; + license = licenses.sspl; + broken = stdenv.hostPlatform.isAarch64; # g++ has internal compiler errors + + maintainers = with maintainers; [ bluescreen303 offline cstrahan ]; + platforms = subtractLists systems.doubles.i686 systems.doubles.unix; + }; +} diff --git a/pkgs/servers/nosql/mongodb/v3_4.nix b/pkgs/servers/nosql/mongodb/v3_4.nix new file mode 100644 index 00000000000..07d27545a58 --- /dev/null +++ b/pkgs/servers/nosql/mongodb/v3_4.nix @@ -0,0 +1,12 @@ +{ stdenv, callPackage, lib, sasl, boost, Security }: + +let + buildMongoDB = callPackage ./mongodb.nix { inherit sasl; inherit boost; inherit Security; }; +in + buildMongoDB { + version = "3.4.20"; + sha256 = "15avrhakbspz0q1w5n7dqzjjfkxi7md64a9axl97gfxi4ln7mhz0"; + patches = [ + ./forget-build-dependencies-3-4.patch + ]; + } diff --git a/pkgs/servers/nosql/mongodb/v3_6.nix b/pkgs/servers/nosql/mongodb/v3_6.nix new file mode 100644 index 00000000000..9000a2b5ed5 --- /dev/null +++ b/pkgs/servers/nosql/mongodb/v3_6.nix @@ -0,0 +1,12 @@ +{ stdenv, callPackage, lib, sasl, boost, Security }: + +let + buildMongoDB = callPackage ./mongodb.nix { inherit sasl; inherit boost; inherit Security; }; +in + buildMongoDB { + version = "3.6.12"; + sha256 = "1fi1ccid4rnfjg6yn3183qrhjqc8hz7jfgdpwp1dy6piw6z85n3l"; + patches = [ + ./forget-build-dependencies.patch + ]; + } diff --git a/pkgs/servers/nosql/mongodb/v4_0.nix b/pkgs/servers/nosql/mongodb/v4_0.nix new file mode 100644 index 00000000000..75e0cecc573 --- /dev/null +++ b/pkgs/servers/nosql/mongodb/v4_0.nix @@ -0,0 +1,12 @@ +{ stdenv, callPackage, lib, sasl, boost, Security }: + +let + buildMongoDB = callPackage ./mongodb.nix { inherit sasl; inherit boost; inherit Security; }; +in + buildMongoDB { + version = "4.0.9"; + sha256 = "0klm6dl1pr9wq4ghm2jjn3wzs1zpj1aabqjqjfddanxq2an7scph"; + patches = [ + ./forget-build-dependencies.patch + ]; + } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bed301ede54..43d85339cf8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15894,7 +15894,21 @@ in }; mysql = mariadb; # TODO: move to aliases.nix - mongodb = callPackage ../servers/nosql/mongodb { + mongodb = hiPrio mongodb-3_4; + + mongodb-3_4 = callPackage ../servers/nosql/mongodb/v3_4.nix { + sasl = cyrus_sasl; + boost = boost160; + inherit (darwin.apple_sdk.frameworks) Security; + }; + + mongodb-3_6 = callPackage ../servers/nosql/mongodb/v3_6.nix { + sasl = cyrus_sasl; + boost = boost160; + inherit (darwin.apple_sdk.frameworks) Security; + }; + + mongodb-4_0 = callPackage ../servers/nosql/mongodb/v4_0.nix { sasl = cyrus_sasl; boost = boost160; openssl = openssl_1_0_2; -- cgit 1.4.1 From 165d8bda8265ca9c247d1ab5e1137117c3236e25 Mon Sep 17 00:00:00 2001 From: Nathan Smyth Date: Sun, 4 Aug 2019 13:09:49 +1000 Subject: mongodb: 3.4.20 -> 3.4.22, 3.6.12 -> 3.6.13, 4.0.9 -> 4.0.11 --- pkgs/servers/nosql/mongodb/mongodb.nix | 32 ++++++++++------------ .../nosql/mongodb/mozjs-45_fix-3-byte-opcode.patch | 27 ++++++++++++++++++ pkgs/servers/nosql/mongodb/v3_4.nix | 8 +++--- pkgs/servers/nosql/mongodb/v3_6.nix | 8 +++--- pkgs/servers/nosql/mongodb/v4_0.nix | 9 +++--- pkgs/top-level/all-packages.nix | 12 ++++---- 6 files changed, 61 insertions(+), 35 deletions(-) create mode 100644 pkgs/servers/nosql/mongodb/mozjs-45_fix-3-byte-opcode.patch diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix index fd4869f92aa..3824fc6d1a7 100644 --- a/pkgs/servers/nosql/mongodb/mongodb.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -1,6 +1,6 @@ -{ stdenv, fetchurl, fetchpatch, scons, boost, gperftools, pcre-cpp, snappy, zlib -, libyamlcpp, sasl, openssl, libpcap, wiredtiger, Security, python27, libtool -, curl }: +{ stdenv, fetchurl, fetchpatch, scons, boost, gperftools, pcre-cpp, snappy, zlib, + libyamlcpp, sasl, openssl, libpcap, wiredtiger, Security, python27, curl, CoreFoundation, cctools +}: # Note: # The command line tools are written in Go as part of a different package (mongodb-tools) @@ -35,20 +35,9 @@ in stdenv.mkDerivation rec { nativeBuildInputs = [ scons ]; buildInputs = [ - sasl - boost - gperftools - pcre-cpp - snappy - zlib - libyamlcpp - sasl - openssl.dev - openssl.out - libpcap - python - curl - ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security libtool ]; + sasl boost gperftools pcre-cpp snappy + zlib libyamlcpp sasl openssl.dev openssl.out libpcap python curl + ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security CoreFoundation cctools ]; # MongoDB keeps track of its build parameters, which tricks nix into # keeping dependencies to build inputs in the final output. @@ -60,6 +49,9 @@ in stdenv.mkDerivation rec { substituteInPlace SConstruct \ --replace "env = Environment(" "env = Environment(ENV = os.environ," '' + stdenv.lib.optionalString stdenv.isDarwin '' + substituteInPlace src/third_party/asio-master/asio/include/asio/detail/config.hpp --replace ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW ASIO_HAS_STD_STRING_VIEW + + substituteInPlace src/third_party/mozjs-45/extract/js/src/jsmath.cpp --replace 'defined(HAVE_SINCOS)' 0 substituteInPlace src/third_party/s2/s1angle.cc --replace drem remainder substituteInPlace src/third_party/s2/s1interval.cc --replace drem remainder @@ -80,7 +72,7 @@ in stdenv.mkDerivation rec { "--release" "--ssl" #"--rocksdb" # Don't have this packaged yet - "--wiredtiger=${if stdenv.is64bit then "on" else "off"}" + "--wiredtiger=on" "--js-engine=mozjs" "--use-sasl-client" "--disable-warnings-as-errors" @@ -92,6 +84,10 @@ in stdenv.mkDerivation rec { sconsFlags+=" CXX=$CXX" '' + optionalString stdenv.isAarch64 '' sconsFlags+=" CCFLAGS='-march=armv8-a+crc'" + '' + optionalString stdenv.isDarwin '' + sconsFlags+=" CPPPATH=${openssl.dev}/include" + '' + optionalString stdenv.isDarwin '' + sconsFlags+=" LIBPATH=${openssl.out}/lib" ''; preInstall = '' diff --git a/pkgs/servers/nosql/mongodb/mozjs-45_fix-3-byte-opcode.patch b/pkgs/servers/nosql/mongodb/mozjs-45_fix-3-byte-opcode.patch new file mode 100644 index 00000000000..8c60cdd1e68 --- /dev/null +++ b/pkgs/servers/nosql/mongodb/mozjs-45_fix-3-byte-opcode.patch @@ -0,0 +1,27 @@ +# HG changeset patch +# User Dan Gohman +# Parent d9b405d82cffb07343a5f2fd941e029298c7f6c4 +# Bug 1390214 - IonMonkey: Don't test for a 3-byte opcode in a 2-byte opcode predicate. +# https://bug1390214.bmoattachments.org/attachment.cgi?id=8902972 + +diff --git a/src/third_party/mozjs-45/extract/js/src/jit/x86-shared/Encoding-x86-shared.h b/src/third_party/mozjs-45/extract/js/src/jit/x86-shared/Encoding-x86-shared.h +--- a/src/third_party/mozjs-45/extract/js/src/jit/x86-shared/Encoding-x86-shared.h ++++ b/src/third_party/mozjs-45/extract/js/src/jit/x86-shared/Encoding-x86-shared.h +@@ -310,17 +310,16 @@ enum ThreeByteOpcodeID { + + // Test whether the given opcode should be printed with its operands reversed. + inline bool IsXMMReversedOperands(TwoByteOpcodeID opcode) + { + switch (opcode) { + case OP2_MOVSD_WsdVsd: // also OP2_MOVPS_WpsVps + case OP2_MOVAPS_WsdVsd: + case OP2_MOVDQ_WdqVdq: +- case OP3_PEXTRD_EdVdqIb: + return true; + default: + break; + } + return false; + } + + enum ThreeByteEscape { diff --git a/pkgs/servers/nosql/mongodb/v3_4.nix b/pkgs/servers/nosql/mongodb/v3_4.nix index 07d27545a58..fb124a6b2e5 100644 --- a/pkgs/servers/nosql/mongodb/v3_4.nix +++ b/pkgs/servers/nosql/mongodb/v3_4.nix @@ -1,11 +1,11 @@ -{ stdenv, callPackage, lib, sasl, boost, Security }: +{ stdenv, callPackage, lib, sasl, boost, Security, CoreFoundation, cctools }: let - buildMongoDB = callPackage ./mongodb.nix { inherit sasl; inherit boost; inherit Security; }; + buildMongoDB = callPackage ./mongodb.nix { inherit sasl; inherit boost; inherit Security; inherit CoreFoundation; inherit cctools; }; in buildMongoDB { - version = "3.4.20"; - sha256 = "15avrhakbspz0q1w5n7dqzjjfkxi7md64a9axl97gfxi4ln7mhz0"; + version = "3.4.22"; + sha256 = "1rizrr69b26y7fb973n52hk387sf3mxzqg8wka4f3zdjdidfyiny"; patches = [ ./forget-build-dependencies-3-4.patch ]; diff --git a/pkgs/servers/nosql/mongodb/v3_6.nix b/pkgs/servers/nosql/mongodb/v3_6.nix index 9000a2b5ed5..412d72b4e66 100644 --- a/pkgs/servers/nosql/mongodb/v3_6.nix +++ b/pkgs/servers/nosql/mongodb/v3_6.nix @@ -1,11 +1,11 @@ -{ stdenv, callPackage, lib, sasl, boost, Security }: +{ stdenv, callPackage, lib, sasl, boost, Security, CoreFoundation, cctools }: let - buildMongoDB = callPackage ./mongodb.nix { inherit sasl; inherit boost; inherit Security; }; + buildMongoDB = callPackage ./mongodb.nix { inherit sasl; inherit boost; inherit Security; inherit CoreFoundation; inherit cctools; }; in buildMongoDB { - version = "3.6.12"; - sha256 = "1fi1ccid4rnfjg6yn3183qrhjqc8hz7jfgdpwp1dy6piw6z85n3l"; + version = "3.6.13"; + sha256 = "1mbvk4bmabrswjdm01jssxcygjpq5799zqyx901nsi12vlcymwg4"; patches = [ ./forget-build-dependencies.patch ]; diff --git a/pkgs/servers/nosql/mongodb/v4_0.nix b/pkgs/servers/nosql/mongodb/v4_0.nix index 75e0cecc573..819d41cd17e 100644 --- a/pkgs/servers/nosql/mongodb/v4_0.nix +++ b/pkgs/servers/nosql/mongodb/v4_0.nix @@ -1,12 +1,13 @@ -{ stdenv, callPackage, lib, sasl, boost, Security }: +{ stdenv, callPackage, lib, sasl, boost, Security, CoreFoundation, cctools }: let - buildMongoDB = callPackage ./mongodb.nix { inherit sasl; inherit boost; inherit Security; }; + buildMongoDB = callPackage ./mongodb.nix { inherit sasl; inherit boost; inherit Security; inherit CoreFoundation; inherit cctools; }; in buildMongoDB { - version = "4.0.9"; - sha256 = "0klm6dl1pr9wq4ghm2jjn3wzs1zpj1aabqjqjfddanxq2an7scph"; + version = "4.0.11"; + sha256 = "0kry8kzzpah0l7j8xa333y1ixwvarc28ip3f6lx5590yy11j8ry2"; patches = [ ./forget-build-dependencies.patch + ./mozjs-45_fix-3-byte-opcode.patch ]; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 43d85339cf8..af291b6301b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15899,20 +15899,22 @@ in mongodb-3_4 = callPackage ../servers/nosql/mongodb/v3_4.nix { sasl = cyrus_sasl; boost = boost160; - inherit (darwin.apple_sdk.frameworks) Security; + inherit (darwin) cctools; + inherit (darwin.apple_sdk.frameworks) CoreFoundation Security; }; mongodb-3_6 = callPackage ../servers/nosql/mongodb/v3_6.nix { sasl = cyrus_sasl; boost = boost160; - inherit (darwin.apple_sdk.frameworks) Security; + inherit (darwin) cctools; + inherit (darwin.apple_sdk.frameworks) CoreFoundation Security; }; mongodb-4_0 = callPackage ../servers/nosql/mongodb/v4_0.nix { sasl = cyrus_sasl; - boost = boost160; - openssl = openssl_1_0_2; - inherit (darwin.apple_sdk.frameworks) Security; + boost = boost169; + inherit (darwin) cctools; + inherit (darwin.apple_sdk.frameworks) CoreFoundation Security; }; nginx-sso = callPackage ../servers/nginx-sso { }; -- cgit 1.4.1 From 44641ed00bf3b1d5914a685137f16910f6454951 Mon Sep 17 00:00:00 2001 From: Nathan Smyth Date: Sun, 4 Aug 2019 16:25:56 +1000 Subject: nixos/tests/mongodb: test against mongodb versions 3.4, 3.6, 4.0 Now has tests for 3.4, 3.6, 4.0. Has some duplication, but it appears to work on my machine. --- nixos/tests/mongodb.nix | 74 +++++++++++++++++----------------- pkgs/servers/nosql/mongodb/mongodb.nix | 35 +++++++++------- pkgs/servers/nosql/mongodb/v3_4.nix | 21 +++++----- pkgs/servers/nosql/mongodb/v3_6.nix | 21 +++++----- pkgs/servers/nosql/mongodb/v4_0.nix | 23 ++++++----- 5 files changed, 94 insertions(+), 80 deletions(-) diff --git a/nixos/tests/mongodb.nix b/nixos/tests/mongodb.nix index 9ebf84eed23..dfb23ce6c0d 100644 --- a/nixos/tests/mongodb.nix +++ b/nixos/tests/mongodb.nix @@ -1,42 +1,42 @@ # This test start mongodb, runs a query using mongo shell -import ./make-test-python.nix ({ pkgs, ...} : let - testQuery = pkgs.writeScript "nixtest.js" '' - db.greetings.insert({ "greeting": "hello" }); - print(db.greetings.findOne().greeting); - ''; -in { - name = "mongodb"; - meta = with pkgs.stdenv.lib.maintainers; { - maintainers = [ bluescreen303 offline cstrahan rvl phile314 ]; - }; +import ./make-test.nix ({ pkgs, ... }: + let + testQuery = pkgs.writeScript "nixtest.js" '' + db.greetings.insert({ "greeting": "hello" }); + print(db.greetings.findOne().greeting); + ''; - nodes = { - one = - { ... }: - { - services = { - mongodb.enable = true; - mongodb.enableAuth = true; - mongodb.initialRootPassword = "root"; - mongodb.initialScript = pkgs.writeText "mongodb_initial.js" '' - db = db.getSiblingDB("nixtest"); - db.createUser({user:"nixtest",pwd:"nixtest",roles:[{role:"readWrite",db:"nixtest"}]}); - ''; - mongodb.extraConfig = '' - # Allow starting engine with only a small virtual disk - storage.journal.enabled: false - storage.mmapv1.smallFiles: true - ''; - }; - }; + runMongoDBTest = pkg: '' + $node->execute("(rm -rf data || true) && mkdir data"); + $node->execute("${pkg}/bin/mongod --fork --logpath logs --dbpath data"); + $node->waitForOpenPort(27017); + + $node->succeed("mongo ${testQuery}") =~ /hello/ or die; + + $node->execute("${pkg}/bin/mongod --shutdown --dbpath data"); + $node->waitForClosedPort(27017); + ''; + + in { + name = "mongodb"; + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ bluescreen303 offline cstrahan rvl phile314 ]; + }; + + nodes = { + node = {...}: { + environment.systemPackages = with pkgs; [ +# mongodb-3_4 + mongodb-3_6 + mongodb-4_0 + ]; + }; }; - testScript = '' - start_all() - one.wait_for_unit("mongodb.service") - one.succeed( - "mongo -u nixtest -p nixtest nixtest ${testQuery} | grep -q hello" - ) - ''; -}) + testScript = "$node->start;" +# + runMongoDBTest pkgs.mongodb-3_4 + + runMongoDBTest pkgs.mongodb-3_6 + + runMongoDBTest pkgs.mongodb-4_0 + + "$node->shutdown;"; + }) diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix index 3824fc6d1a7..da4b46a69da 100644 --- a/pkgs/servers/nosql/mongodb/mongodb.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -1,26 +1,25 @@ -{ stdenv, fetchurl, fetchpatch, scons, boost, gperftools, pcre-cpp, snappy, zlib, - libyamlcpp, sasl, openssl, libpcap, wiredtiger, Security, python27, curl, CoreFoundation, cctools -}: +{ stdenv, fetchurl, scons, boost, gperftools, pcre-cpp, snappy, zlib, libyamlcpp +, sasl, openssl, libpcap, python27, curl, Security, CoreFoundation, cctools }: # Note: # The command line tools are written in Go as part of a different package (mongodb-tools) with stdenv.lib; -{ version, sha256, patches ? [ ] }@args: +{ version, sha256, patches ? [] }@args: let python = python27.withPackages (ps: with ps; [ pyyaml typing cheetah ]); system-libraries = [ - "pcre" - #"asio" -- XXX use package? - #"wiredtiger" "boost" + "pcre" "snappy" + "yaml" "zlib" - #"valgrind" -- mongodb only requires valgrind.h, which is vendored in the source. + #"asio" -- XXX use package? #"stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs). - "yaml" + #"valgrind" -- mongodb only requires valgrind.h, which is vendored in the source. + #"wiredtiger" ] ++ optionals stdenv.isLinux [ "tcmalloc" ]; inherit (stdenv.lib) systems subtractLists; @@ -35,8 +34,18 @@ in stdenv.mkDerivation rec { nativeBuildInputs = [ scons ]; buildInputs = [ - sasl boost gperftools pcre-cpp snappy - zlib libyamlcpp sasl openssl.dev openssl.out libpcap python curl + boost + curl + gperftools + libpcap + libyamlcpp + openssl.dev + openssl.out + pcre-cpp + python + sasl + snappy + zlib ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security CoreFoundation cctools ]; # MongoDB keeps track of its build parameters, which tricks nix into @@ -84,10 +93,6 @@ in stdenv.mkDerivation rec { sconsFlags+=" CXX=$CXX" '' + optionalString stdenv.isAarch64 '' sconsFlags+=" CCFLAGS='-march=armv8-a+crc'" - '' + optionalString stdenv.isDarwin '' - sconsFlags+=" CPPPATH=${openssl.dev}/include" - '' + optionalString stdenv.isDarwin '' - sconsFlags+=" LIBPATH=${openssl.out}/lib" ''; preInstall = '' diff --git a/pkgs/servers/nosql/mongodb/v3_4.nix b/pkgs/servers/nosql/mongodb/v3_4.nix index fb124a6b2e5..113fa0680c3 100644 --- a/pkgs/servers/nosql/mongodb/v3_4.nix +++ b/pkgs/servers/nosql/mongodb/v3_4.nix @@ -1,12 +1,15 @@ { stdenv, callPackage, lib, sasl, boost, Security, CoreFoundation, cctools }: let - buildMongoDB = callPackage ./mongodb.nix { inherit sasl; inherit boost; inherit Security; inherit CoreFoundation; inherit cctools; }; -in - buildMongoDB { - version = "3.4.22"; - sha256 = "1rizrr69b26y7fb973n52hk387sf3mxzqg8wka4f3zdjdidfyiny"; - patches = [ - ./forget-build-dependencies-3-4.patch - ]; - } + buildMongoDB = callPackage ./mongodb.nix { + inherit sasl; + inherit boost; + inherit Security; + inherit CoreFoundation; + inherit cctools; + }; +in buildMongoDB { + version = "3.4.22"; + sha256 = "1rizrr69b26y7fb973n52hk387sf3mxzqg8wka4f3zdjdidfyiny"; + patches = [ ./forget-build-dependencies-3-4.patch ]; +} diff --git a/pkgs/servers/nosql/mongodb/v3_6.nix b/pkgs/servers/nosql/mongodb/v3_6.nix index 412d72b4e66..8da901c00c5 100644 --- a/pkgs/servers/nosql/mongodb/v3_6.nix +++ b/pkgs/servers/nosql/mongodb/v3_6.nix @@ -1,12 +1,15 @@ { stdenv, callPackage, lib, sasl, boost, Security, CoreFoundation, cctools }: let - buildMongoDB = callPackage ./mongodb.nix { inherit sasl; inherit boost; inherit Security; inherit CoreFoundation; inherit cctools; }; -in - buildMongoDB { - version = "3.6.13"; - sha256 = "1mbvk4bmabrswjdm01jssxcygjpq5799zqyx901nsi12vlcymwg4"; - patches = [ - ./forget-build-dependencies.patch - ]; - } + buildMongoDB = callPackage ./mongodb.nix { + inherit sasl; + inherit boost; + inherit Security; + inherit CoreFoundation; + inherit cctools; + }; +in buildMongoDB { + version = "3.6.13"; + sha256 = "1mbvk4bmabrswjdm01jssxcygjpq5799zqyx901nsi12vlcymwg4"; + patches = [ ./forget-build-dependencies.patch ]; +} diff --git a/pkgs/servers/nosql/mongodb/v4_0.nix b/pkgs/servers/nosql/mongodb/v4_0.nix index 819d41cd17e..95606317f31 100644 --- a/pkgs/servers/nosql/mongodb/v4_0.nix +++ b/pkgs/servers/nosql/mongodb/v4_0.nix @@ -1,13 +1,16 @@ { stdenv, callPackage, lib, sasl, boost, Security, CoreFoundation, cctools }: let - buildMongoDB = callPackage ./mongodb.nix { inherit sasl; inherit boost; inherit Security; inherit CoreFoundation; inherit cctools; }; -in - buildMongoDB { - version = "4.0.11"; - sha256 = "0kry8kzzpah0l7j8xa333y1ixwvarc28ip3f6lx5590yy11j8ry2"; - patches = [ - ./forget-build-dependencies.patch - ./mozjs-45_fix-3-byte-opcode.patch - ]; - } + buildMongoDB = callPackage ./mongodb.nix { + inherit sasl; + inherit boost; + inherit Security; + inherit CoreFoundation; + inherit cctools; + }; +in buildMongoDB { + version = "4.0.11"; + sha256 = "0kry8kzzpah0l7j8xa333y1ixwvarc28ip3f6lx5590yy11j8ry2"; + patches = + [ ./forget-build-dependencies.patch ./mozjs-45_fix-3-byte-opcode.patch ]; +} -- cgit 1.4.1 From de69821b541a6143c7b5d31afe463ab3c2cf918b Mon Sep 17 00:00:00 2001 From: Nathan Smyth Date: Wed, 21 Aug 2019 19:33:51 +1000 Subject: mongodb-4_0: 4.0.11 -> 4.0.12 --- .../mongodb/asio-no-experimental-string-view.patch | 20 ++++++++++++++++++++ pkgs/servers/nosql/mongodb/mongodb.nix | 2 -- pkgs/servers/nosql/mongodb/v3_6.nix | 3 ++- pkgs/servers/nosql/mongodb/v4_0.nix | 7 ++++--- 4 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 pkgs/servers/nosql/mongodb/asio-no-experimental-string-view.patch diff --git a/pkgs/servers/nosql/mongodb/asio-no-experimental-string-view.patch b/pkgs/servers/nosql/mongodb/asio-no-experimental-string-view.patch new file mode 100644 index 00000000000..eb5db1818fe --- /dev/null +++ b/pkgs/servers/nosql/mongodb/asio-no-experimental-string-view.patch @@ -0,0 +1,20 @@ +diff --git a/src/third_party/asio-master/asio/include/asio/detail/config.hpp b/src/third_party/asio-master/asio/include/asio/detail/config.hpp +index 7fe6a95a..ff4cc56b 100644 +--- a/src/third_party/asio-master/asio/include/asio/detail/config.hpp ++++ b/src/third_party/asio-master/asio/include/asio/detail/config.hpp +@@ -786,7 +786,6 @@ + # if (__cplusplus >= 201402) + # if __has_include() + # define ASIO_HAS_STD_STRING_VIEW 1 +-# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1 + # endif // __has_include() + # endif // (__cplusplus >= 201402) + # endif // defined(__clang__) +@@ -794,7 +793,6 @@ + # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4) + # if (__cplusplus >= 201402) + # define ASIO_HAS_STD_STRING_VIEW 1 +-# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1 + # endif // (__cplusplus >= 201402) + # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4) + # endif // defined(__GNUC__) diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix index da4b46a69da..3f5aeb4d7da 100644 --- a/pkgs/servers/nosql/mongodb/mongodb.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -58,8 +58,6 @@ in stdenv.mkDerivation rec { substituteInPlace SConstruct \ --replace "env = Environment(" "env = Environment(ENV = os.environ," '' + stdenv.lib.optionalString stdenv.isDarwin '' - substituteInPlace src/third_party/asio-master/asio/include/asio/detail/config.hpp --replace ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW ASIO_HAS_STD_STRING_VIEW - substituteInPlace src/third_party/mozjs-45/extract/js/src/jsmath.cpp --replace 'defined(HAVE_SINCOS)' 0 substituteInPlace src/third_party/s2/s1angle.cc --replace drem remainder diff --git a/pkgs/servers/nosql/mongodb/v3_6.nix b/pkgs/servers/nosql/mongodb/v3_6.nix index 8da901c00c5..68f83631c80 100644 --- a/pkgs/servers/nosql/mongodb/v3_6.nix +++ b/pkgs/servers/nosql/mongodb/v3_6.nix @@ -11,5 +11,6 @@ let in buildMongoDB { version = "3.6.13"; sha256 = "1mbvk4bmabrswjdm01jssxcygjpq5799zqyx901nsi12vlcymwg4"; - patches = [ ./forget-build-dependencies.patch ]; + patches = [ ./forget-build-dependencies.patch ] + ++ stdenv.lib.optionals stdenv.isDarwin [ ./asio-no-experimental-string-view.patch ]; } diff --git a/pkgs/servers/nosql/mongodb/v4_0.nix b/pkgs/servers/nosql/mongodb/v4_0.nix index 95606317f31..51ce1e25062 100644 --- a/pkgs/servers/nosql/mongodb/v4_0.nix +++ b/pkgs/servers/nosql/mongodb/v4_0.nix @@ -9,8 +9,9 @@ let inherit cctools; }; in buildMongoDB { - version = "4.0.11"; - sha256 = "0kry8kzzpah0l7j8xa333y1ixwvarc28ip3f6lx5590yy11j8ry2"; + version = "4.0.12"; + sha256 = "1j8dqa4jr623y87jrdanyib9r7x18srrvdx952q4azcc8zrdwci1"; patches = - [ ./forget-build-dependencies.patch ./mozjs-45_fix-3-byte-opcode.patch ]; + [ ./forget-build-dependencies.patch ./mozjs-45_fix-3-byte-opcode.patch ] + ++ stdenv.lib.optionals stdenv.isDarwin [ ./asio-no-experimental-string-view.patch ]; } -- cgit 1.4.1 From c2eee6ecdbd7c09bd70cf69c136f695b83d93213 Mon Sep 17 00:00:00 2001 From: Thibault Gagnaux Date: Tue, 25 Feb 2020 15:11:53 +0100 Subject: mongodb: 3.4.22 -> 3.4.24 & fix ssl Reverts previous ssl fix commit and updates the mongodb version which fixes the ssl compile problem on darwin. --- pkgs/servers/nosql/mongodb/mongodb.nix | 3 +-- pkgs/servers/nosql/mongodb/v3_4.nix | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix index 3f5aeb4d7da..e83a79184a3 100644 --- a/pkgs/servers/nosql/mongodb/mongodb.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -39,8 +39,7 @@ in stdenv.mkDerivation rec { gperftools libpcap libyamlcpp - openssl.dev - openssl.out + openssl pcre-cpp python sasl diff --git a/pkgs/servers/nosql/mongodb/v3_4.nix b/pkgs/servers/nosql/mongodb/v3_4.nix index 113fa0680c3..2f02ae7f72a 100644 --- a/pkgs/servers/nosql/mongodb/v3_4.nix +++ b/pkgs/servers/nosql/mongodb/v3_4.nix @@ -9,7 +9,7 @@ let inherit cctools; }; in buildMongoDB { - version = "3.4.22"; - sha256 = "1rizrr69b26y7fb973n52hk387sf3mxzqg8wka4f3zdjdidfyiny"; + version = "3.4.24"; + sha256 = "0j6mvgv0jnsnvgkl8505bl88kbxkba66qijlpi1la0dd5pd1imfr"; patches = [ ./forget-build-dependencies-3-4.patch ]; } -- cgit 1.4.1 From 80e6da7bd399fe62b461c8e5f6a4756753af9707 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Mon, 23 Mar 2020 23:33:27 +0100 Subject: mongodb: builds on aarch64 as well --- pkgs/servers/nosql/mongodb/mongodb.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix index e83a79184a3..b4b6334c13f 100644 --- a/pkgs/servers/nosql/mongodb/mongodb.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -110,7 +110,6 @@ in stdenv.mkDerivation rec { description = "A scalable, high-performance, open source NoSQL database"; homepage = "http://www.mongodb.org"; license = licenses.sspl; - broken = stdenv.hostPlatform.isAarch64; # g++ has internal compiler errors maintainers = with maintainers; [ bluescreen303 offline cstrahan ]; platforms = subtractLists systems.doubles.i686 systems.doubles.unix; -- cgit 1.4.1 From 2934f0464161d01aebb347080d5ccb05bd03200d Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Thu, 26 Mar 2020 13:46:22 +0100 Subject: nixos/tests/mongodb: rewrite with python perl-based VM tests are deprecated. --- nixos/tests/mongodb.nix | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/nixos/tests/mongodb.nix b/nixos/tests/mongodb.nix index dfb23ce6c0d..ee7fc50f7ec 100644 --- a/nixos/tests/mongodb.nix +++ b/nixos/tests/mongodb.nix @@ -1,6 +1,6 @@ # This test start mongodb, runs a query using mongo shell -import ./make-test.nix ({ pkgs, ... }: +import ./make-test-python.nix ({ pkgs, ... }: let testQuery = pkgs.writeScript "nixtest.js" '' db.greetings.insert({ "greeting": "hello" }); @@ -8,14 +8,20 @@ import ./make-test.nix ({ pkgs, ... }: ''; runMongoDBTest = pkg: '' - $node->execute("(rm -rf data || true) && mkdir data"); - $node->execute("${pkg}/bin/mongod --fork --logpath logs --dbpath data"); - $node->waitForOpenPort(27017); + node.execute("(rm -rf data || true) && mkdir data") + node.execute( + "${pkg}/bin/mongod --fork --logpath logs --dbpath data" + ) + node.wait_for_open_port(27017) - $node->succeed("mongo ${testQuery}") =~ /hello/ or die; + assert "hello" in node.succeed( + "mongo ${testQuery}" + ) - $node->execute("${pkg}/bin/mongod --shutdown --dbpath data"); - $node->waitForClosedPort(27017); + node.execute( + "${pkg}/bin/mongod --shutdown --dbpath data" + ) + node.wait_for_closed_port(27017) ''; in { @@ -34,9 +40,13 @@ import ./make-test.nix ({ pkgs, ... }: }; }; - testScript = "$node->start;" + testScript = '' + node.start() + '' # + runMongoDBTest pkgs.mongodb-3_4 + runMongoDBTest pkgs.mongodb-3_6 + runMongoDBTest pkgs.mongodb-4_0 - + "$node->shutdown;"; + + '' + node.shutdown() + ''; }) -- cgit 1.4.1 From b65ff5d455724d58cf761c854e4c453aa60ff1d8 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Thu, 26 Mar 2020 14:04:42 +0100 Subject: nixos/release-notes: mention mongodb update --- nixos/doc/manual/release-notes/rl-2003.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nixos/doc/manual/release-notes/rl-2003.xml b/nixos/doc/manual/release-notes/rl-2003.xml index 02d05dec0a2..7674b0a5c0d 100644 --- a/nixos/doc/manual/release-notes/rl-2003.xml +++ b/nixos/doc/manual/release-notes/rl-2003.xml @@ -825,6 +825,11 @@ auth required pam_succeed_if.so uid >= 1000 quiet not systemd-networkd. + + + mongodb has been updated to version 3.4.24. + + -- cgit 1.4.1