Fix use of openssl.path() if openssl isn't found

Started by Tristan Partinover 2 years ago5 messageshackers
Jump to latest
#1Tristan Partin
tristan@neon.tech

Found this issue during my Fedora 39 upgrade. Tested that uninstalling
openssl still allows the various ssl tests to run and succeed.

--
Tristan Partin
Neon (https://neon.tech)

Attachments:

v1-0001-Fix-use-of-openssl.path-if-openssl-isn-t-found.patchtext/x-patch; charset=utf-8; name=v1-0001-Fix-use-of-openssl.path-if-openssl-isn-t-found.patchDownload+6-2
#2Michael Paquier
michael@paquier.xyz
In reply to: Tristan Partin (#1)
Re: Fix use of openssl.path() if openssl isn't found

On Tue, Nov 07, 2023 at 04:06:56PM -0600, Tristan Partin wrote:

Found this issue during my Fedora 39 upgrade. Tested that uninstalling
openssl still allows the various ssl tests to run and succeed.

Good catch. You are right that this is inconsistent with what we
expect in the test.

+openssl_path = ''
+if openssl.found()
+ openssl_path = openssl.path()
+endif
+
tests += {
'name': 'ssl',
'sd': meson.current_source_dir(),
@@ -7,7 +12,7 @@ tests += {
'tap': {
'env': {
'with_ssl': ssl_library,
- 'OPENSSL': openssl.path(),
+ 'OPENSSL': openssl_path,
},
'tests': [
't/001_ssltests.pl',

Okay, that's a nit and it leads to the same result, but why not using
the same one-liner style like all the other meson.build files that
rely on optional commands? See pg_verifybackup, pg_dump, etc. That
would be more consistent.
--
Michael

#3Tristan Partin
tristan@neon.tech
In reply to: Michael Paquier (#2)
Re: Fix use of openssl.path() if openssl isn't found

On Tue Nov 7, 2023 at 11:53 PM CST, Michael Paquier wrote:

On Tue, Nov 07, 2023 at 04:06:56PM -0600, Tristan Partin wrote:

Found this issue during my Fedora 39 upgrade. Tested that uninstalling
openssl still allows the various ssl tests to run and succeed.

Good catch. You are right that this is inconsistent with what we
expect in the test.

+openssl_path = ''
+if openssl.found()
+ openssl_path = openssl.path()
+endif
+
tests += {
'name': 'ssl',
'sd': meson.current_source_dir(),
@@ -7,7 +12,7 @@ tests += {
'tap': {
'env': {
'with_ssl': ssl_library,
- 'OPENSSL': openssl.path(),
+ 'OPENSSL': openssl_path,
},
'tests': [
't/001_ssltests.pl',

Okay, that's a nit and it leads to the same result, but why not using
the same one-liner style like all the other meson.build files that
rely on optional commands? See pg_verifybackup, pg_dump, etc. That
would be more consistent.

Because I forgot there were ternary statements in Meson :). Thanks for
the review. Here is v2.

--
Tristan Partin
Neon (https://neon.tech)

Attachments:

v2-0001-Fix-use-of-openssl.path-if-openssl-isn-t-found.patchtext/x-patch; charset=utf-8; name=v2-0001-Fix-use-of-openssl.path-if-openssl-isn-t-found.patchDownload+1-2
#4Michael Paquier
michael@paquier.xyz
In reply to: Tristan Partin (#3)
Re: Fix use of openssl.path() if openssl isn't found

On Wed, Nov 08, 2023 at 12:07:49AM -0600, Tristan Partin wrote:

'with_ssl': ssl_library,
-      'OPENSSL': openssl.path(),
+      'OPENSSL': openssl.found() ? openssl.path : '',

Except that this was incorrect. I've fixed the grammar and applied
that down to 16.
--
Michael

#5Tristan Partin
tristan@neon.tech
In reply to: Michael Paquier (#4)
Re: Fix use of openssl.path() if openssl isn't found

On Wed Nov 8, 2023 at 2:31 AM CST, Michael Paquier wrote:

On Wed, Nov 08, 2023 at 12:07:49AM -0600, Tristan Partin wrote:

'with_ssl': ssl_library,
-      'OPENSSL': openssl.path(),
+      'OPENSSL': openssl.found() ? openssl.path : '',

Except that this was incorrect. I've fixed the grammar and applied
that down to 16.

Coding at 12 in the morning is never conducive to coherent thought :).
Thanks. Sorry for the trouble.

--
Tristan Partin
Neon (https://neon.tech)