From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Skip \password TAP test on old IPC::Run versions
Date: Sat, 8 Apr 2023 16:40:12 -0400
Message-ID: <e5262673-8958-298a-faba-d25c79dd9807@dunslane.net> (raw)
In-Reply-To: <3618405.1680985800@sss.pgh.pa.us>
References: <E1pl943-0023OF-Ol@gemulon.postgresql.org>
<6d880ea2-f8ca-f458-4dcd-a7a3e6d6cd7c@dunslane.net>
<3588535.1680971029@sss.pgh.pa.us>
<627E6024-7803-473C-91AF-E8D76C3D99E0@yesql.se>
<3618405.1680985800@sss.pgh.pa.us>
On 2023-04-08 Sa 16:30, Tom Lane wrote:
> Daniel Gustafsson<daniel@yesql.se> writes:
>> On 8 Apr 2023, at 18:23, Tom Lane<tgl@sss.pgh.pa.us> wrote:
>>> Can't we write "use IPC::Run 0.98;" and let
>>> some other code manage the version comparison?
>> We can, but that AFAIK (Andrew might have a better answer) requires the below
>> diff which I think leaves some readability to be desired:
>> - (eval { require IO::Pty; } && eval { $IPC::Run::VERSION >= '0.98' });
>> + (eval { require IO::Pty; } && !!eval { IPC::Run->VERSION('0.98'); 1 });
> Maybe I'm missing something, but I was envisioning
>
> eval { require IO::Pty; use IPC::Run 0.98; }
>
> with no need to do more than check if the eval traps an error.
>
>
You need to be careful with "use". It is executed in the compile phase,
so I'd avoid it here.
cheers
andrew
--
Andrew Dunstan
EDB:https://www.enterprisedb.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: andrew@dunslane.net, tgl@sss.pgh.pa.us, daniel@yesql.se
Subject: Re: pgsql: Skip \password TAP test on old IPC::Run versions
In-Reply-To: <e5262673-8958-298a-faba-d25c79dd9807@dunslane.net>
References: <E1pl943-0023OF-Ol@gemulon.postgresql.org> <6d880ea2-f8ca-f458-4dcd-a7a3e6d6cd7c@dunslane.net> <3588535.1680971029@sss.pgh.pa.us> <627E6024-7803-473C-91AF-E8D76C3D99E0@yesql.se> <3618405.1680985800@sss.pgh.pa.us> <e5262673-8958-298a-faba-d25c79dd9807@dunslane.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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