git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 20, 2016, 19:21 UTC
Message-ID
<xmqq60s0dsj1.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAOiOGAdhMvMfDquviuZSJr12UXK-0Fjc8xWeNJc=Wgp1jYmS2w@mail.gmail.com>
Parker Moore <parkrmoore@gmail.com> writes:
Show 5 quoted lines
>> 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?

It would definitely be a separate (and optional) patch and must come after "do we use = in between or send var/val as two separate arguments?" patch. That was what I meant to say with "... would be version file, but the mechanism to embed it would be the same as today".

Show 10 quoted lines
>> 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.

$ go version go version go1.3.3 linux/amd64

is what I seem to be locally getting, so I'd imagine it would be something like this perhaps?

git-remote-persistent-https:
	case $$(go version) in \
	"go version go"1.[0-5].*) EQ=" " ;; *) EQ="=" ;; esac && \
	go build -o git-remote-persistent-https \
		-ldflags "-X main._BUILD_EMBED_LABEL$${EQ}$(BUILD_LABEL)"
> Would you like me to whip up a patch for it?
Surely, and thanks.
Previous: Parker Moore
Message 8 of 8 in “contrib/persistent-https: update ldflags syntax for Go 1.7+”
  1. contrib/persistent-https: update ldflags syntax for Go 1.7+Parker Moore, Jul 15, 2016
  2. Jeff KingJul 16, 2016
  3. Junio C HamanoJul 18, 2016
  4. Parker MooreJul 19, 2016
  5. Shawn PearceJul 19, 2016
  6. Junio C HamanoJul 19, 2016
  7. Parker MooreJul 19, 2016
  8. Junio C HamanoJul 20, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.