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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 24, 2024 at 04:13:23PM +0200, Johannes Schindelin wrote:

> > @@ -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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux