From eb1ce34d3d7dd7ecdd1fc17347bc12755313f050 Mon Sep 17 00:00:00 2001 From: Simon Chatterjee Date: Tue, 30 Jun 2020 10:03:01 +0100 Subject: [PATCH 1/2] gperftools: fix build on ARM The use of libunwind by tcmalloc segfaults on ARM, so don't use that. See eg https://www.dcddcc.com/blog/2018-06-09-building-mongodb-for-32-bit-ARM-on-debian-ubuntu.html#problem-6-tcmalloc-and-libunwind --- pkgs/development/libraries/gperftools/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/gperftools/default.nix b/pkgs/development/libraries/gperftools/default.nix index 039231c0142..410e790255f 100644 --- a/pkgs/development/libraries/gperftools/default.nix +++ b/pkgs/development/libraries/gperftools/default.nix @@ -8,7 +8,8 @@ stdenv.mkDerivation rec { sha256 = "1jb30zxmw7h9qxa8yi76rfxj4ssk60rv8n9y41m6pzqfk9lwis0y"; }; - buildInputs = stdenv.lib.optional stdenv.isLinux libunwind; + # tcmalloc uses libunwind in a way that works correctly only on non-ARM linux + buildInputs = stdenv.lib.optional (stdenv.isLinux && !(stdenv.isAarch64 || stdenv.isAarch32)) libunwind; prePatch = stdenv.lib.optionalString stdenv.isDarwin '' substituteInPlace Makefile.am --replace stdc++ c++ From 44391a72b2e08a31680b934df9585ffa326253dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 11 Jul 2020 11:07:18 +0200 Subject: [PATCH 2/2] mongodb: add basic check For example, it detected the issue fixed in the parent commit (tested on aarch64). --- 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 8ffdbcd63c4..2c058edbcca 100644 --- a/pkgs/servers/nosql/mongodb/mongodb.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -102,6 +102,13 @@ in stdenv.mkDerivation rec { rm -f "$out/bin/install_compass" || true ''; + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + "$out/bin/mongo" --version + runHook postInstallCheck + ''; + prefixKey = "--prefix="; enableParallelBuilding = true;