Date: Wed, 22 Mar 2017 21:08:39 +0000 From: =?UTF-8?Q?Jev_Bj=C3=B6rsell?= <jev@ecadlabs.com> To: Mathieu Arnold <mat@freebsd.org>, "freebsd-ports@freebsd.org" <freebsd-ports@freebsd.org> Subject: Re: question about use of != assignments Message-ID: <CAGKJJV=P3C-vHgnmBkGSAwyGp4MoUf08CQns-HCb7fGcV60P=g@mail.gmail.com> In-Reply-To: <745e3da8-3083-a135-ad5d-d60d5de41dc1@FreeBSD.org> References: <CAGKJJVnvVvjhpa0h1LexgKy806NrkMznVQS0b4%2ByB87nefsxjQ@mail.gmail.com> <745e3da8-3083-a135-ad5d-d60d5de41dc1@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Mar 22, 2017 at 12:16 PM Mathieu Arnold <mat@freebsd.org> wrote: > Le 22/03/2017 =C3=A0 17:57, Jev Bj=C3=B6rsell a =C3=A9crit : > > Hello, > > > > I'm updating net-mgmt/prometheus for which I am the maintainer. > > > > During build, I have added some ldflags for the `go build` step, so tha= t > > build time, version, etc. is recorded in the binary. Before this change > > running `prometheus -version` gives a bunch of blank values, my attache= d > > patch fixes that. > > > > I'm using !=3D assignments in my Makefile to get date, user, and host. > > portlint warns me[0] not to use !=3D assignments, and the linked post > > suggests to use echo $$(${VARIABLE_CMDS}) instead. > > > > TL;DR: do not do that. If you really need to put versions in the > upstream software, put what is available in the Makefile, mainly, > PORTVERSION, and if needed PORTREVISION. > > First, because using !=3D means that every time the Makefile is evaluated= , > it needs to fork to get the values, it slow things down considerably > when build the whole ports tree. > > Second, because we need port builds to be reproducible, it means that if > I build the port today, and you build it tomorrow, it will end up giving > the same package. If you add such customization today, they will be > removed very soon when we go over the whole tree again. > > > Thank you Mathieu. I wanted to keep the FreeBSD package `-version` flag output consistent with what the upstream vendor builds provide, but your point about reproducible builds trumps that desire. I will gut the other items and just rely on ${PORTVERSION}. -Jev
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGKJJV=P3C-vHgnmBkGSAwyGp4MoUf08CQns-HCb7fGcV60P=g>