From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edkAI-0003yu-AT for guix-patches@gnu.org; Mon, 22 Jan 2018 17:02:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edkAF-0000ta-90 for guix-patches@gnu.org; Mon, 22 Jan 2018 17:02:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:59007) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1edkAF-0000tS-3d for guix-patches@gnu.org; Mon, 22 Jan 2018 17:02:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1edkAE-0000hy-Q1 for guix-patches@gnu.org; Mon, 22 Jan 2018 17:02:02 -0500 Subject: [bug#30214] [PATCH 10/10] gnu: Add mongo-tools. Resent-Message-ID: Date: Mon, 22 Jan 2018 17:01:33 -0500 From: Leo Famulari Message-ID: <20180122220133.GF15170@jasmine.lan> References: <87h8rd4nxg.fsf@cbaines.net> <20180122210830.28924-1-mail@cbaines.net> <20180122210830.28924-10-mail@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8JPrznbw0YAQ/KXy" Content-Disposition: inline In-Reply-To: <20180122210830.28924-10-mail@cbaines.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Christopher Baines Cc: 30214@debbugs.gnu.org --8JPrznbw0YAQ/KXy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jan 22, 2018 at 09:08:30PM +0000, Christopher Baines wrote: > * gnu/packages/databases.scm (mongo-tools): New variable. Can you add some comments explaining the following section? > + (replace 'build > + (lambda* (#:key inputs outputs #:allow-other-keys) > + (let ((bash (which "bash")) > + (out (assoc-ref outputs "out"))) > + (let build ((tools > + '("bsondump" "mongodump" "mongoexport" "mongofiles" > + "mongoimport" "mongooplog" "mongorestore" > + "mongostat" "mongotop"))) > + (if (null? tools) > + #t > + (if (let* ((tool (car tools)) > + (command > + `("go" "install" "-v" > + "-tags=\"ssl sasl\"" > + "-ldflags" This -ldflags argument avoids the go-build-system's default ldflags, which strip the debugging symbols. Okay if that's what you intended. > + "-extldflags=-Wl,-z,now,-z,relro" > + ,(string-append > + "src/github.com/mongodb/mongo-tools/" > + tool "/main/" tool ".go")))) > + (simple-format #t "build: running ~A\n" > + (string-join command)) > + (zero? (apply system* command))) > + (build (cdr tools)) > + #f))))))))) Do you think the go-build-system should accept some sort of #:make-flags argument to simplify this sort of thing? --8JPrznbw0YAQ/KXy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlpmXzwACgkQJkb6MLrK fwg0xQ//ZMQO7YTzyMbPiZuErpon/9vnpytRr16GBvU7U/vpIIhW+6KfysshAS9m mFt94eA8iuflCAr7iL9PECXVYaKRikc4xfYtyPX2Tm2WjIznjjzJKam7+8/nNBJJ L+rVa3ZphdZHkp33m+L8dgF/b7NNm+Tymkvj9SNSS0qivvBs733knkKCeU/D3K5c 2Bqf/tc6J46evihJ/N35a4aZ1TacGWzq9kbUs0xujwISp/H1CLj3anTnX1jr8FrS q/2Rrxn4DrtKwtw7yW3JW/B/gGt4FCrcmi555siKsqT94Bf3ibOX7d0VwBax0EKB ypcawu7yqK6e/hmjncY55HuNmraMsd95jOw7ffPizJfRD7AvHrbjc9psdkNAqB09 ZQfDuLdHI3xTgWVJD5PFN5ETqj7U+ah09VMDZr5gXCvjL14uU102SkU+MhpyoT1k wfwiWnFA24pwow/HTc9XT2YW/wKiX7Eetfj80jnUvYkCWfMk3F40aNw6eqC6Ifbl RixytbKSQuFLrWMPM4rc7lu2ka89tWNbzU2Fy0pW7KojdPDdwLZIU9A5KHQZ7b/E 1uLHxFsiKu2xttWNVnoelyNKKo/2KRnCWGJqqW6uODL8qZUWMe5/D3SXJGhDClbk LjG5C1YxdCqz8ioy2B5pf+Dpl0OWbkjJ7DFn2tFv9hxKwIruXqc= =FbFJ -----END PGP SIGNATURE----- --8JPrznbw0YAQ/KXy--