diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2020-03-26 18:15:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-26 18:15:09 +0100 |
commit | 90dcc3360327e250536eeeca7fe9d887c9f7a817 (patch) | |
tree | 18c2d40b00d76a55e819e39ed406ef1b24c8404c | |
parent | ebb6e385eac53f74963c95ac25cc22b16d161177 (diff) | |
parent | b65ff5d455724d58cf761c854e4c453aa60ff1d8 (diff) |
Merge pull request #40082 from jarjee/update/mongodb
mongodb: 3.4.10 -> 4.0.12
-rw-r--r-- | lib/licenses.nix | 7 | ||||
-rw-r--r-- | nixos/doc/manual/release-notes/rl-2003.xml | 5 | ||||
-rw-r--r-- | nixos/tests/mongodb.nix | 84 | ||||
-rw-r--r-- | pkgs/servers/nosql/mongodb/asio-no-experimental-string-view.patch | 20 | ||||
-rw-r--r-- | pkgs/servers/nosql/mongodb/forget-build-dependencies-3-4.patch | 17 | ||||
-rw-r--r-- | pkgs/servers/nosql/mongodb/forget-build-dependencies.patch | 10 | ||||
-rw-r--r-- | pkgs/servers/nosql/mongodb/mongodb.nix (renamed from pkgs/servers/nosql/mongodb/default.nix) | 93 | ||||
-rw-r--r-- | pkgs/servers/nosql/mongodb/mozjs-45_fix-3-byte-opcode.patch | 27 | ||||
-rw-r--r-- | pkgs/servers/nosql/mongodb/v3_4.nix | 15 | ||||
-rw-r--r-- | pkgs/servers/nosql/mongodb/v3_6.nix | 16 | ||||
-rw-r--r-- | pkgs/servers/nosql/mongodb/v4_0.nix | 17 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 22 |
12 files changed, 245 insertions, 88 deletions
diff --git a/lib/licenses.nix b/lib/licenses.nix index e2f94e565ce27..e37eb57cff97d 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/nixos/doc/manual/release-notes/rl-2003.xml b/nixos/doc/manual/release-notes/rl-2003.xml index 02d05dec0a2b8..7674b0a5c0de4 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 <command>systemd-networkd</command>. </para> </listitem> + <listitem> + <para> + <package>mongodb</package> has been updated to version <literal>3.4.24</literal>. + </para> + </listitem> </itemizedlist> </section> </section> diff --git a/nixos/tests/mongodb.nix b/nixos/tests/mongodb.nix index 9ebf84eed2325..ee7fc50f7ecc0 100644 --- a/nixos/tests/mongodb.nix +++ b/nixos/tests/mongodb.nix @@ -1,42 +1,52 @@ # 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-python.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.wait_for_open_port(27017) + + assert "hello" in node.succeed( + "mongo ${testQuery}" + ) + + node.execute( + "${pkg}/bin/mongod --shutdown --dbpath data" + ) + node.wait_for_closed_port(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/asio-no-experimental-string-view.patch b/pkgs/servers/nosql/mongodb/asio-no-experimental-string-view.patch new file mode 100644 index 0000000000000..eb5db1818fe0a --- /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(<experimental/string_view>) + # define ASIO_HAS_STD_STRING_VIEW 1 +-# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1 + # endif // __has_include(<experimental/string_view>) + # 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/forget-build-dependencies-3-4.patch b/pkgs/servers/nosql/mongodb/forget-build-dependencies-3-4.patch new file mode 100644 index 0000000000000..ca2c043deb2d3 --- /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/forget-build-dependencies.patch b/pkgs/servers/nosql/mongodb/forget-build-dependencies.patch index ca2c043deb2d3..897618cceb12a 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 diff --git a/pkgs/servers/nosql/mongodb/default.nix b/pkgs/servers/nosql/mongodb/mongodb.nix index c2ae83f3e8af0..b4b6334c13f5c 100644 --- a/pkgs/servers/nosql/mongodb/default.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -1,58 +1,63 @@ -{ stdenv, fetchurl, fetchpatch, scons, boost, gperftools, pcre-cpp, snappy -, zlib, libyamlcpp, sasl, openssl, libpcap, Security -}: +{ 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; -let version = "3.4.10"; - 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" ]; - -in stdenv.mkDerivation { - pname = "mongodb"; +{ version, sha256, patches ? [] }@args: + +let + python = python27.withPackages (ps: with ps; [ pyyaml typing cheetah ]); + system-libraries = [ + "boost" + "pcre" + "snappy" + "yaml" + "zlib" + #"asio" -- XXX use package? + #"stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs). + #"valgrind" -- mongodb only requires valgrind.h, which is vendored in the source. + #"wiredtiger" + ] ++ 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"; - sha256 = "1wz2mhl9z0b1bdkg6m8v8mvw9k60mdv5ybq554xn3yjj9z500f24"; + inherit sha256; }; nativeBuildInputs = [ scons ]; buildInputs = [ - sasl boost gperftools pcre-cpp snappy - zlib libyamlcpp sasl openssl.dev openssl.out libpcap - ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security ]; - - 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 - (fetchpatch { - url = https://projects.archlinux.org/svntogit/community.git/plain/trunk/boost160.patch?h=packages/mongodb; - name = "boost160.patch"; - sha256 = "0bvsf3499zj55pzamwjmsssr6x63w434944w76273fr5rxwzcmh8"; - }) - ]; + boost + curl + gperftools + libpcap + libyamlcpp + openssl + 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 + # 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/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 @@ -66,13 +71,14 @@ in stdenv.mkDerivation { --replace 'engine("wiredTiger")' 'engine("mmapv1")' ''; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument"; + 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"}" + "--wiredtiger=on" "--js-engine=mozjs" "--use-sasl-client" "--disable-warnings-as-errors" @@ -87,8 +93,13 @@ in stdenv.mkDerivation { ''; preInstall = '' - mkdir -p $out/lib + mkdir -p "$out/lib" ''; + + postInstall = '' + rm -f "$out/bin/install_compass" || true + ''; + prefixKey = "--prefix="; enableParallelBuilding = true; @@ -97,10 +108,10 @@ in stdenv.mkDerivation { meta = { description = "A scalable, high-performance, open source NoSQL database"; - homepage = http://www.mongodb.org; - license = licenses.agpl3; + homepage = "http://www.mongodb.org"; + license = licenses.sspl; maintainers = with maintainers; [ bluescreen303 offline cstrahan ]; - platforms = platforms.unix; + platforms = subtractLists systems.doubles.i686 systems.doubles.unix; }; } 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 0000000000000..8c60cdd1e688d --- /dev/null +++ b/pkgs/servers/nosql/mongodb/mozjs-45_fix-3-byte-opcode.patch @@ -0,0 +1,27 @@ +# HG changeset patch +# User Dan Gohman <sunfish@mozilla.com> +# 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 new file mode 100644 index 0000000000000..2f02ae7f72ade --- /dev/null +++ b/pkgs/servers/nosql/mongodb/v3_4.nix @@ -0,0 +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.24"; + sha256 = "0j6mvgv0jnsnvgkl8505bl88kbxkba66qijlpi1la0dd5pd1imfr"; + 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 0000000000000..68f83631c801e --- /dev/null +++ b/pkgs/servers/nosql/mongodb/v3_6.nix @@ -0,0 +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 = "3.6.13"; + sha256 = "1mbvk4bmabrswjdm01jssxcygjpq5799zqyx901nsi12vlcymwg4"; + 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 new file mode 100644 index 0000000000000..51ce1e25062de --- /dev/null +++ b/pkgs/servers/nosql/mongodb/v4_0.nix @@ -0,0 +1,17 @@ +{ 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.12"; + sha256 = "1j8dqa4jr623y87jrdanyib9r7x18srrvdx952q4azcc8zrdwci1"; + patches = + [ ./forget-build-dependencies.patch ./mozjs-45_fix-3-byte-opcode.patch ] + ++ stdenv.lib.optionals stdenv.isDarwin [ ./asio-no-experimental-string-view.patch ]; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4ab001d27844e..d3fac637ca8d5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15894,11 +15894,27 @@ 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; - openssl = openssl_1_0_2; - 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) cctools; + inherit (darwin.apple_sdk.frameworks) CoreFoundation Security; + }; + + mongodb-4_0 = callPackage ../servers/nosql/mongodb/v4_0.nix { + sasl = cyrus_sasl; + boost = boost169; + inherit (darwin) cctools; + inherit (darwin.apple_sdk.frameworks) CoreFoundation Security; }; nginx-sso = callPackage ../servers/nginx-sso { }; |