Re: [PATCH] contrib/persistent-https: update ldflags syntax for Go 1.7+

2 messages, 2 authors, 2016-07-19 · open the first message on its own page

Re: [PATCH] contrib/persistent-https: update ldflags syntax for Go 1.7+

From: Junio C Hamano <hidden>
Date: 2016-07-19 17:04:43

Shawn Pearce [off-list ref] writes:
On Mon, Jul 18, 2016 at 9:32 PM, Parker Moore [off-list ref] wrote:
quoted
quoted
The label does not even identify the version of the source in any way, so I am not sure how people are depending on that feature anyway ;-)
Would it be a better solution simply to remove this build flag?
Alternatively, if Git wished to support Go v1.5 and below, I would be
more than happy to send a patch with a dynamic lookup in the Makefile
based on the output of `go version`. I would be more than happy to
submit either patch.
I think we could remove that BUILD_LABEL entirely. Colby liked having
a marker so he knows what "version" a user is running, but without any
correlation to source here it just isn't that useful.
Inside an organization where people use it as a tool supplied by
somebody else, who is the designated supplier of it, build-stamp may
be sufficient to identify what "version" a user is running.  If we
wanted to do a "here is the source that was built from", the logical
place to pull that information from would be ../../GIT-VERSION-FILE,
but the mechanism to embed the information would still be -X var=val
(or "-X var val" for older Go).

So unless the "dynamic lookup in the Makefile" turns out to be too
gross, we would want to keep the mechanism and just make it usable
for versions before 1.5 and also after 1.7, I would guess.

Re: [PATCH] contrib/persistent-https: update ldflags syntax for Go 1.7+

From: Parker Moore <hidden>
Date: 2016-07-19 23:32:55

the logical place to pull that information from would be ../../GIT-VERSION-FILE,
I agree. It would make more sense to build this to a specific version
or git revision rather
than a time. Perhaps that would be a different patch?
So unless the "dynamic lookup in the Makefile" turns out to be too
gross, we would want to keep the mechanism and just make it usable
for versions before 1.5 and also after 1.7, I would guess.
A dynamic lookup of the go version would look for go 1.0, 1.1, 1.2,
1.3, 1.4 and 1.5.0.
These versions would be incompatible with the `X var=val` syntax. I am
not too familiar
with Makefile syntax for numerical comparison, but I believe this
would be fairly simple.
Would you like me to whip up a patch for it?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help