Subject: Re: [bug#29299] [PATCH] build-system/go: Don't let Go executables refer to the Go compiler.

From: [email-masked] (Ludovic Courtès)
Date: Thu, 16 Nov 2017 11:52:55 +0100

Hello,

Leo Famulari <[email-masked]> skribis:

> This is a naive adaptation of ((guix build utils)
> remove-store-references). 
>
> It takes ~55 seconds to remove the references from Syncthing's
> executables (96 MiB) on an SSD. Any ideas about how to speed it up?
>
> * guix/build/go-build-system.scm (remove-store-reference, remove-go-references):
> New variables.
> (%standard-phases): Add 'remove-go-references' phase.
> * guix/build/go.scm (go-build): Add allow-go-reference? key.

[...]

> +(define* (remove-store-reference file file-name
> +                                  #:optional (store (%store-directory)))
> +  "Remove from FILE occurrences of FILE-NAME in STORE; return #t when FILE-NAME
> +is encountered in FILE, #f otherwise."

Maybe leave a note about the optimization opportunity.

> +(define* (remove-go-references #:key allow-go-reference?
> +                               inputs outputs #:allow-other-keys)
> +  "Remove any references to the Go compiler from the compiled Go executable
> +files in OUTPUTS."

… and here a comment as to why we’re doing this, possibly linking to
previous discussions.

Otherwise LGTM, thank you!

Ludo’.