From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ee4kk-0001Um-Rt for guix-patches@gnu.org; Tue, 23 Jan 2018 15:01:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ee4kg-0001Qx-NH for guix-patches@gnu.org; Tue, 23 Jan 2018 15:01:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:60300) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ee4kg-0001Qq-K5 for guix-patches@gnu.org; Tue, 23 Jan 2018 15:01:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ee4kg-0007Jy-D2 for guix-patches@gnu.org; Tue, 23 Jan 2018 15:01:02 -0500 Subject: [bug#30214] [PATCH 10/10] gnu: Add mongo-tools. Resent-Message-ID: References: <87h8rd4nxg.fsf@cbaines.net> <20180122210830.28924-1-mail@cbaines.net> <20180122210830.28924-10-mail@cbaines.net> <20180122220133.GF15170@jasmine.lan> From: Christopher Baines In-reply-to: <20180122220133.GF15170@jasmine.lan> Date: Tue, 23 Jan 2018 19:59:53 +0000 Message-ID: <87shaw5osm.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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: Leo Famulari Cc: 30214@debbugs.gnu.org --=-=-= Content-Type: text/plain Leo Famulari writes: > 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")) bash here is unused, I forget where it came from. I'll remove it. >> + (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. The build phase is a bit of guesswork from me, plus some prior art in the mongo-tools README [1] and the Debian package rules file [2]. I think I got the -ldflags from the latter. It sounds like stripping debug symbols is a good default behaviour, but I'm only guessing as to what this means. 1: https://github.com/mongodb/mongo-tools#building-tools 2: https://anonscm.debian.org/cgit/pkg-mongodb/mongo-tools.git/tree/debian/rules >> + "-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? Maybe, but I'm not sure of how many other packages will be similar to mongo-tools. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlpnlDlfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9Xff4A//anmYEbgXftWSZ0zAmtQ83xyJSHYQNjVaNi0HW3Os69PR6J010+tbRJ7l DrrtN8osjA10hRc03CEqhto7C4LDKJJjcqVVuBLnwUXcPyIiP/9ADr/9dtOrTqaK FyDyEUBkkGwmKG29JCK2fAk0oaKw8w1eEHEykMQOJp5mLl3ORv2jHlhQqz77ITjq UMVke5y15xOW7wojFg46KcaYzea0JTBOIIxepJfrL0VweVkzEkStCYnrag1rXU7Q vFVOGuWFhqxYZ6taJ1m7PF6q1NqBAp6H/QXWvtpIYamDLyFZvxQNsc0SGIy2I01C Qk6kjkunGcPSdmYaJuTh2Ktt70qRIPeRHCbnkBoCCLWxW053Gr/NZ28Ba2OnSTNi Jn5sIdE5y+BL1DceN2nhO9nQlucVdC6JBMQSPGzU0KRi2FLAXn361HVeZhKdXjh1 qIb3ry7OdfXBSCTrtH3KWo9m7LsdDPJPrxtbhRwf7hmY+38+Mg0W0g4E37mreIjO 4ZCy8gmIj6SnnfvTQ2juJGLM5BTEHRPgADMMIIroBj87qE6NCYGeiaZPJVJwJSNc jAtVUBdzSPqetCDiOFmHImMLF3rdvjtrURPNpCJ8iOD5Gt0uGfVUqEn3JZgwv1u5 TfuUbk0521ZyEZgaXRAE8efyEYO7Rowgfggpg/CKwpayGhn6Zro= =2Ks5 -----END PGP SIGNATURE----- --=-=-=--