Subject: Re: [bug#50227] [PATCH] build-system/go: Trim store references using the native compiler option.

From: Marius Bakke <[email-masked]>
Date: Fri, 27 Aug 2021 19:47:17 +0200

Marius Bakke <[email-masked]> skriver:

> * guix/build/go-build-system.scm (build): Add '-trimpath' to the 'go install'
> invocation.
> (remove-store-references, remove-go-references): Remove procedures.
> (%standard-phases): Don't include remove-go-references.
> * gnu/packages/docker.scm (docker)[arguments]: Add the '-trimpath' option to
> the build flags.  Remove phase remove-go-references.
> * gnu/packages/uucp.scm (nncp)[arguments]: Likewise.

Some context for this patch, which I forgot to save before sending:

I happened to rediscover <https://issues.guix.gnu.org/33620> and pulled
out my yak shaving device again.

This patch removes the custom 'remove-store-references' procedure in
favor of the native '-trimpath' option to 'go install', as alluded to in
the bug report as well as the build system commentary.  I don't spot any
difference in sizes from 'master' apart from one package: Docker.

Docker explodes from 764.4 MiB to 1215.5 MiB with this patch even though
it does use the '-trimpath' option.  Perhaps -trimpath does not work as
well with dynamically linked executables as it does for static?

I'm willing to overlook this regression for now in favor of the reduced
complexity, but comments welcome.