question about use of != assignments

Mathieu Arnold mat at FreeBSD.org
Wed Mar 22 19:16:14 UTC 2017


Le 22/03/2017 à 17:57, Jev Björsell a écrit :
> 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 that
> build time, version, etc. is recorded in the binary. Before this change
> running `prometheus -version` gives a bunch of blank values, my attached
> patch fixes that.
>
> I'm using != assignments in my Makefile to get date, user, and host.
> portlint warns me[0] not to use != 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 != 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.


-- 
Mathieu Arnold


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20170322/e9a01905/attachment.sig>


More information about the freebsd-ports mailing list