Packages built with Go 1.10+ keep unnecessary references to Go inputs

  • Done
  • quality assurance status badge
Details
2 participants
  • Leo Famulari
  • Pierre Neidhardt
Owner
unassigned
Submitted by
Pierre Neidhardt
Severity
normal
Merged with
P
P
Pierre Neidhardt wrote on 14 Dec 2018 16:28
(address . bug-guix@gnu.org)
877egcdt6g.fsf@ambrevar.xyz

Go binaries are statically build, but since Go 1.10, the full paths to
the Go libraries are kept in the binaries, which results in the Go
dependencies being part of the package closure:

$ guix gc --references $(./pre-inst-env guix build --no-grafts kurly)
/gnu/store/2b2md66fbzyspsmd5dj6zkj9hilac40r-tzdata-2018e
/gnu/store/4iwksvq53rlzphfp3xvp63ihlw226c0n-go-github-com-aki237-nscjar-0.0.0-0.e2df936
/gnu/store/5rxdjbk8h0bh1hbaan8y8ib13va2bcmw-net-base-5.3
/gnu/store/ahvdlp6y44qj6kx63rmx1sq8r61x3zc2-go-github-com-alsm-ioprogress-0.0.0-0.063c372
/gnu/store/f8yps0l8p371jgzh6cki0z5n2kgfjiwy-go-github-com-urfave-cli-1.19.1-0.934abfb
/gnu/store/l4lr0f5cjd0nbsaaf8b5dmcw1a1yypr3-glibc-2.27
/gnu/store/pp0bakrbyv9xmp1kyv2114l19s11b74z-gcc-6.4.0-lib

Previously, they did not:

$ guix gc --references $(guix build --no-grafts kurly)
/gnu/store/2b2md66fbzyspsmd5dj6zkj9hilac40r-tzdata-2018e
/gnu/store/5rxdjbk8h0bh1hbaan8y8ib13va2bcmw-net-base-5.3
/gnu/store/l4lr0f5cjd0nbsaaf8b5dmcw1a1yypr3-glibc-2.27
/gnu/store/pp0bakrbyv9xmp1kyv2114l19s11b74z-gcc-6.4.0-lib

It seems to be an upstream bug:


It's still unresolved and only planned for Go 1.13.

Note that adding

"-asmflags=all=-trimpath=/gnu/store"
"-gcflags=all=-trimpath=/gnu/store"

to the build system does not work, because we need to trim the hash too.
-trimpath supports only one parameter, so we can't use it for this purpose.

We could use Boyer-Moore to replace the hashes of all Go dependencies.
We must be careful to only replace paths to Go libraries.

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAlwTzAcACgkQm9z0l6S7
zH/coAf/YvJSuI0oh+xHwPDXes3i2uw1hysc7tAesSk4mGdS6ImsWdLuUEm6V1or
gZ1fNzikwEFzY86F/h6VR0nya/gv17UiyUInZmiVkOrrM1b8tQA7x00YFqjKqr0U
jKtdgN7dXgyLYinK0XG4mnNi9UefWhyQgfeQHPs2NVczbIqsRkB7ECQU9CuSfoeM
qNUkhHVij4y5FX0nuYw5ftrvZTvoIBU+FZ7UuCR3yonNC4q7wEVbKvQiNWFEwdu/
4z2DINUnbBqOL84VjnRa95NobYpCuhse1XyQQBZDVjqUGDwbyDD8BIk15lDHvSa1
YTzzYNjC3spRhE8FdymB0qIc+SE0gg==
=/d4s
-----END PGP SIGNATURE-----

L
L
Leo Famulari wrote on 16 Dec 2018 22:26
(no subject)
(address . control@debbugs.gnu.org)
20181216212623.GA32482@jasmine.lan
merge 33741 33620
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlwWwv8ACgkQJkb6MLrK
fwhztg//fsLVRKJJ1OHzOA9i0aMZJII8pm7Xy1ZWrzmhxUpDq083xjkHEltEIYj+
grdNKEwjfbyVGiH+4fomRMdqZSCXJJrmdVL1bvUEJYNmURD9vRi2g4ofn/gQ0svV
EBwpH96FZs2clVgZ9XRbNJcI9RuUmcMOolNIde9n+CmrdKlKD5BK9YoW0EocqXY2
DHOjfUlYtKXMFDXzzFH5tQ54A7n/ytK1zfRrNTccxdb4WjPLcJKB4jzvCf9Y85sp
T6/qBi9PcoG7PiLwqmEeqSnlxy8dCoeepU0gIACdCgLbtjOjMGn4SkcdCrMrxuek
ZTBrPAM88ymIoMfntOG7JXwqCQySaP/bm56DFOs8ThtIlGZkKFBOaGX2fgNQSoGO
2ZIM+lDd5J1OFHBDnKmOEAchdHGAIVdPgBlOWYgxlfb5CiZCQzpV7V059wnvI2Ah
vDI/UXt3hnAZAsd0MICtA4jNYt6avSAdxeM1ZUkcCp2QR+LcP1Fb55tF+GhN4tmf
bvyc9YxRjSnlSetGQjfTSJBSMMQKhnUKUvTTsR0ukPSZKaUKJSq4g90OxdyuCfuq
0iAZKjMj8liEmt4aScH6Di94nuHv1/UKgIWVQ5mD8ez4TrbboUbyukTFLI8kc7N1
a5HiAzeuCqhgJwxLuM3bNq2bW01SxCuDT2HzYsStP+yw9jy7Dlo=
=KMK0
-----END PGP SIGNATURE-----


?
Your comment

This issue is archived.

To comment on this conversation send an email to 33741@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 33741
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch