RE: [PATCH v0 1/1] Teach git version --build-options about OpenSSL

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

 



On Thursday, June 20, 2024 2:27 PM, Junio C Hamano wrote:
>"Randall S. Becker" <the.n.e.key@xxxxxxxxx> writes:
>
>> This change uses the OpenSSL supplied OPENSSL_VERSION_TEXT #define
>> supplied for this purpose by that project. If the #define is not
>> present, the version is not reported.
>>
>> Signed-off-by: Randall S. Becker <rsbecker@xxxxxxxxxxxxx>
>> ---
>>  help.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/help.c b/help.c
>> index 1d057aa607..ce55aaa2c0 100644
>> --- a/help.c
>> +++ b/help.c
>> @@ -757,6 +757,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 OPENSSL_VERSION_TEXT
>> +		strbuf_addf(buf, "OpenSSL: %s\n", OPENSSL_VERSION_TEXT);
>#endif
>>  	}
>>  }
>
>It is kind-a surprising that we do not need to play with any Makefile macros for this
>implementation.
>
>If some unknown version (either in the long past or in the future) of OpenSSL does
>not define the constant, this is just compiled out and that would be OK.
>
>If some unknown version of OpenSSL does define it but not as a string constant, it
>would break the build, e.g.,
>
>	#define OPENSSL_VERSION_TEXT 2 plus 4 is 6
>
>We could stringify it ourselves, but that is probably not worth worrying about.

AFAIK, this #define is guaranteed to be TEXT by OpenSSL. There are other forms of the version content that are numeric. I think this was a change introduced around v1.1.1. Now that opensslv.h is included, we can depend on this being available (or not if it is not defined). Stringification should not be required. It is present through the upcoming v3.4. There are other string and numeric forms of the version, but this one is most informative (tag and date) from a support standpoint. The only thing missing is the git commit, but it would take a lot to get that put into that project.

>Will queue.  Thanks.

Thanks.





[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