guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#30214] [PATCH 10/10] gnu: Add mongo-tools.


From: Christopher Baines
Subject: [bug#30214] [PATCH 10/10] gnu: Add mongo-tools.
Date: Tue, 23 Jan 2018 19:59:53 +0000
User-agent: mu4e 0.9.18; emacs 25.3.1

Leo Famulari <address@hidden> 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.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]