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

Re: [PATCH v2 1/2] Teach git version --build-options about libcurl

From
Jeff King <peff@peff.net>
Date
Jun 24, 2024, 15:29 UTC
Message-ID
<20240624152947.GA20600@coredump.intra.peff.net>
In-Reply-To
<f44f1e25-41ca-0784-3186-f9e1bdae0d4f@gmx.de>
On Mon, Jun 24, 2024 at 04:13:23PM +0200, Johannes Schindelin wrote:
Show 12 quoted lines
> > @@ -757,6 +758,9 @@ void get_version_info(struct strbuf *buf, int show_build_options)
> >
> >  		if (fsmonitor_ipc__is_supported())
> >  			strbuf_addstr(buf, "feature: fsmonitor--daemon\n");
> > +#if defined LIBCURL_VERSION
> > +		strbuf_addf(buf, "libcurl: %s\n", LIBCURL_VERSION);
> 
> I am not sure that this is the most helpful information Git can provide:
> It reports the version against which Git was _compiled_, whereas the
> version it is _running against_ might be quite different.
> 
> Wouldn't calling `curl_version()` make more sense here?

I had a similar thought (and possibly even mentioning both the build version and runtime version could be useful). But I don't think we can call curl_version() here, as the main Git binary is (intentionally) not linked against libcurl at all.

Even #including curl.h feels a little iffy to me, as it is declaring a bunch of symbols that we will not have access to. It works here because LIBCURL_VERSION is presumably a string literal, and not a reference to a symbol. But if anybody mistakenly mentioned another symbol, the compilation would work OK, but we'd fail at link time. Maybe an acceptable risk, though.

-Peff
Previous: Johannes SchindelinNext: Junio C Hamano
Message 10 of 26 in “Teach git version --build-options about zlib+libcurl”
  1. 0/2 Teach git version --build-options about zlib+libcurlRandall S. Becker, Jun 21, 2024
  2. 1/2 Teach git version --build-options about libcurlRandall S. Becker, Jun 21, 2024
  3. Johannes SchindelinJun 24, 2024
  4. Randall BeckerJun 24, 2024
  5. Dragan SimicJun 24, 2024
  6. rsbecker@nexbridge.comJun 24, 2024
  7. Dragan SimicJun 24, 2024
  8. Randall BeckerJun 24, 2024
  9. Johannes SchindelinJul 24, 2024
  10. Jeff KingJun 24, 2024
  11. Junio C HamanoJun 24, 2024
  12. Jeff KingJun 24, 2024
  13. Junio C HamanoJun 25, 2024
  14. Johannes SchindelinJul 24, 2024
  15. Jeff KingJul 24, 2024
  16. Johannes SchindelinJul 24, 2024
  17. Jeff KingJul 25, 2024
  18. Junio C HamanoJul 25, 2024
  19. Jeff KingJul 26, 2024
  20. 2/2 Teach git version --build-options about zlib versions.Randall S. Becker, Jun 21, 2024
  21. Johannes SchindelinJun 24, 2024
  22. Randall BeckerJun 24, 2024
  23. Johannes SchindelinJul 24, 2024
  24. Randall BeckerJul 24, 2024
  25. Junio C HamanoJul 24, 2024
  26. rsbecker@nexbridge.comJul 24, 2024

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.