Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 May 2022 19:03:38 -0500
From:      Dmitri Goutnik <dmgk@freebsd.org>
To:        Ben Lavery-Griffiths <ben@lavery-griffiths.com>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: Golang debug/buildinfo
Message-ID:  <YpFm2q2Fvdw4V1Q3@xombo.localdomain>
In-Reply-To: <61959b1c-8075-4f47-9642-15d28115bfd5@www.fastmail.com>
References:  <61959b1c-8075-4f47-9642-15d28115bfd5@www.fastmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--D0fp/AkkLvNf8KFO
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Ben,

On 22-05-27 22:31:52, Ben Lavery-Griffiths wrote:
> Hey all,
>=20
> I maintain the www/gohugo port, with the upgrade to Go 1.18 they project =
has switched to using debug/buildinfo (https://pkg.go.dev/runtime/debug#Bui=
ldInfo), this gets certain information from VCS, as opposed to passing the =
values in via ldflags.
>=20
> Presuming more and more Go projects will use this mechanism, does anyone =
know how we will be dealing with this for building ports?

Currently, go.mk explicitly disables embedding VCS information in binaries =
by=20
passing -buildvcs=3Dfalse flag. Embedding VCS info will not work for port b=
uilds=20
because it required git (or other VCS, depending on the repository [1]), wh=
ich=20
is not available in clean build environments. Other BuildInfo data (compile=
r=20
version, settings etc) should be available.

In cases when upstream code is not able to handle missing VCS info, it will=
=20
probably need to be patched. I'd consider this situation an upstream bug as=
 it=20
effectively prevents packaging.

[2] provides more background on this issue.

[1] https://tip.golang.org/doc/go1.18#go-version
[2] https://github.com/golang/go/issues/51748

> Many thanks,
> Ben
>=20

Best regards,

--=20
Dmitri Goutnik
dg@syrec.org / dmgk@FreeBSD.org

--D0fp/AkkLvNf8KFO
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEElV1urwzdJVGXSG3dwZe2fOviDs0FAmKRZtQACgkQwZe2fOvi
Ds0CXA/8DO6E5+KogJC8Mdc2XAqyHuKKVlfSZWByrqfuVwjCS3+QW6nXj0MOLW3j
ZyaCqsam1iXvgRwpAeL4srrLSP+2VlTzNSX5WSu/IcWKWlQvzXCFpmWkhn68/pO/
KBcEGO2Vie+k5qjmMNOvkuzHS7uBaHqaULHy7rU+3TgVJjLD26XIUT6apKyaFwqD
rWCejVeOnQYUQUIOikQRQ7h3SEF8p92tULsI7rD12jIMFq5ExMk6eASnswf+H7vl
NHitTU8sV9E2XUJ6r6HrOxpuHcLBbCvdLAYsON6D+5q6NrNgmqsVLkumq/rboklZ
by97wKF4s6ZYpj5TkP4Xe/AHdqqfmFvyUWXkYII/oBPNiNIs/SJaibOV2+cPxsqh
aY+Oq4+3sSlo9ZNIx5Fy5Zgyeds87ZHCjE6cn+wlU2HnUf4zt0u6dXfg5LWHJ4E6
aYJaneY1GmD0Rv2nsCLP6h/Ykwk8EiePYtR8Kgo13atcWSt4gu56j/b7tJy7YYg+
lrKg1D0ReQaDAFpILB5BnhQpBSSzQ30fYMkgUHQQ8xHPvkMED5nCyjC5NK9pJLkh
h1V3BuoEkEuorLFExxAolQm0FtmjL9truRtST+P1QMel1jFByxKnSlyFOjpTHPu4
uMpHX8t9Bf/HVHMXwg4qzHggrREbCGbrJPEA3Rx17P3faOHc4uk=
=L888
-----END PGP SIGNATURE-----

--D0fp/AkkLvNf8KFO--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YpFm2q2Fvdw4V1Q3>