pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Fix use of openssl.path() if openssl isn't found
5+ messages / 2 participants
[nested] [flat]

Commits from this thread:
  2023-11-08 b64c8b01c2 2a08dda291  Fix use of OPENSSL in SSL tests if command is not found
* Fix use of openssl.path() if openssl isn't found
@ 2023-11-07 22:06 Tristan Partin <tristan@neon.tech>
  2023-11-08 05:53 ` Re: Fix use of openssl.path() if openssl isn't found Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 5+ messages in thread

From: Tristan Partin @ 2023-11-07 22:06 UTC (permalink / raw)
  To: pgsql-hackers

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.patch (text/x-patch, 1.1K) download From d684d6fc1546335804d2ed82ff909991965a61a8 Mon Sep 17 00:00:00 2001 From: Tristan Partin <tristan@neon.tech> Date: Tue, 7 Nov 2023 15:59:04 -0600 Subject: [PATCH v1] Fix use of openssl.path() if openssl isn't found openssl(1) is an optional dependency of the Postgres Meson build, but was inadvertantly required when defining some SSL tests. --- src/test/ssl/meson.build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/ssl/meson.build b/src/test/ssl/meson.build index 4cda81f3bc..c3ffcaa032 100644 --- a/src/test/ssl/meson.build +++ b/src/test/ssl/meson.build @@ -1,5 +1,10 @@ # Copyright (c) 2022-2023, PostgreSQL Global Development Group +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', -- Tristan Partin Neon (https://neon.tech)
^ permalink raw reply [nested|flat] 5+ messages in thread

* Re: Fix use of openssl.path() if openssl isn't found
  2023-11-07 22:06 Fix use of openssl.path() if openssl isn't found Tristan Partin <tristan@neon.tech>
@ 2023-11-08 05:53 ` Michael Paquier <michael@paquier.xyz>
  2023-11-08 06:07   ` Re: Fix use of openssl.path() if openssl isn't found Tristan Partin <tristan@neon.tech>
  0 siblings, 1 reply; 5+ messages in thread

From: Michael Paquier @ 2023-11-08 05:53 UTC (permalink / raw)
  To: Tristan Partin <tristan@neon.tech>; +Cc: pgsql-hackers

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Fix use of openssl.path() if openssl isn't found
  2023-11-07 22:06 Fix use of openssl.path() if openssl isn't found Tristan Partin <tristan@neon.tech>
  2023-11-08 05:53 ` Re: Fix use of openssl.path() if openssl isn't found Michael Paquier <michael@paquier.xyz>
@ 2023-11-08 06:07   ` Tristan Partin <tristan@neon.tech>
  2023-11-08 08:31     ` Re: Fix use of openssl.path() if openssl isn't found Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 5+ messages in thread

From: Tristan Partin @ 2023-11-08 06:07 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: pgsql-hackers

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.patch (text/x-patch, 865B) download From 5fc0460b0b85b8f04976182c0f6ec650c40df833 Mon Sep 17 00:00:00 2001 From: Tristan Partin <tristan@neon.tech> Date: Tue, 7 Nov 2023 15:59:04 -0600 Subject: [PATCH v2] Fix use of openssl.path() if openssl isn't found openssl(1) is an optional dependency of the Postgres Meson build, but was inadvertantly required when defining some SSL tests. --- src/test/ssl/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/ssl/meson.build b/src/test/ssl/meson.build index 4cda81f3bc..ed83c438ef 100644 --- a/src/test/ssl/meson.build +++ b/src/test/ssl/meson.build @@ -7,7 +7,7 @@ tests += { 'tap': { 'env': { 'with_ssl': ssl_library, - 'OPENSSL': openssl.path(), + 'OPENSSL': openssl.found() ? openssl.path : '', }, 'tests': [ 't/001_ssltests.pl', -- Tristan Partin Neon (https://neon.tech)
^ permalink raw reply [nested|flat] 5+ messages in thread

* Re: Fix use of openssl.path() if openssl isn't found
  2023-11-07 22:06 Fix use of openssl.path() if openssl isn't found Tristan Partin <tristan@neon.tech>
  2023-11-08 05:53 ` Re: Fix use of openssl.path() if openssl isn't found Michael Paquier <michael@paquier.xyz>
  2023-11-08 06:07   ` Re: Fix use of openssl.path() if openssl isn't found Tristan Partin <tristan@neon.tech>
@ 2023-11-08 08:31     ` Michael Paquier <michael@paquier.xyz>
  2023-11-08 15:59       ` Re: Fix use of openssl.path() if openssl isn't found Tristan Partin <tristan@neon.tech>
  0 siblings, 1 reply; 5+ messages in thread

From: Michael Paquier @ 2023-11-08 08:31 UTC (permalink / raw)
  To: Tristan Partin <tristan@neon.tech>; +Cc: pgsql-hackers

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Fix use of openssl.path() if openssl isn't found
  2023-11-07 22:06 Fix use of openssl.path() if openssl isn't found Tristan Partin <tristan@neon.tech>
  2023-11-08 05:53 ` Re: Fix use of openssl.path() if openssl isn't found Michael Paquier <michael@paquier.xyz>
  2023-11-08 06:07   ` Re: Fix use of openssl.path() if openssl isn't found Tristan Partin <tristan@neon.tech>
  2023-11-08 08:31     ` Re: Fix use of openssl.path() if openssl isn't found Michael Paquier <michael@paquier.xyz>
@ 2023-11-08 15:59       ` Tristan Partin <tristan@neon.tech>
  0 siblings, 0 replies; 5+ messages in thread

From: Tristan Partin @ 2023-11-08 15:59 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: pgsql-hackers

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)





^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2023-11-08 15:59 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-11-07 22:06 Fix use of openssl.path() if openssl isn't found Tristan Partin <tristan@neon.tech>
2023-11-08 05:53 ` Michael Paquier <michael@paquier.xyz>
2023-11-08 06:07   ` Tristan Partin <tristan@neon.tech>
2023-11-08 08:31     ` Michael Paquier <michael@paquier.xyz>
2023-11-08 15:59       ` Tristan Partin <tristan@neon.tech>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox