From: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Thomas Kellerer <shammat@gmx.net>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Is this a bug in pg_current_logfile() on Windows?
Date: Thu, 9 Jul 2020 11:22:43 -0400
Message-ID: <dd5de297-4e8e-b323-f489-ea719b3583ed@2ndQuadrant.com> (raw)
In-Reply-To: <1819000.1594307053@sss.pgh.pa.us>
References: <412ae8da-76bb-640f-039a-f3513499e53d@gmx.net>
<1716646.1594226496@sss.pgh.pa.us>
<bb8f2c7f-2bee-35bd-d57e-62864e95bb89@gmx.net>
<1733826.1594243608@sss.pgh.pa.us>
<252f062c-2b75-1bc3-e08a-3541719b27c0@2ndQuadrant.com>
<1739104.1594250997@sss.pgh.pa.us>
<1777519.1594262442@sss.pgh.pa.us>
<fcf4b905-8aff-2c65-ae4c-ec28a9a02370@2ndQuadrant.com>
<1818128.1594305850@sss.pgh.pa.us>
<bc5246bf-f43f-f29f-0a56-230cf80f5ce3@2ndQuadrant.com>
<1819000.1594307053@sss.pgh.pa.us>
On 7/9/20 11:04 AM, Tom Lane wrote:
> Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:
>> On 7/9/20 10:44 AM, Tom Lane wrote:
>>> Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:
>>>> On 7/8/20 10:40 PM, Tom Lane wrote:
>>>>> The most likely theory about that, I think, is that IPC::Run::run already
>>>>> translated any \r\n occurrences in the psql command's output to plain \n.
>>> It's not hard to believe that the latter two are using a different libc
>>> implementation, but how would that affect the behavior of the TAP
>>> infrastructure? Are they also using different Perls? (By hypothesis,
>>> the pg_current_logfile bug exists across all Windows builds, so we have
>>> to explain why the TAP tests only reveal it on some of these animals.)
>> But the perls they are using are indeed different - msys animals have to
>> use msys' perl for TAP tests because native perl doesn't understand msys
>> file paths. Conversely, MSVC animals must use native perl (AS or
>> Strawberry) to run TAP tests. So jacana and fairywren, the two msys
>> animals, are doing what you expect5ed and drongo and bowerbird, the two
>> MSVC animals, are not.
> Ah-hah. So this leads to the conclusion that in native perl, IPC::Run
> is doing \r\n conversion for us while in msys perl it is not.
>
> Therefore, we either should figure out how to get msys perl to do
> that conversion (and remove it from our code altogether), or make the
> conversions conditional on "is it msys perl?". I am not quite sure
> if the existing tests "if $Config{osname} eq 'msys'" are a legitimate
> implementation of that condition or not --- it seems like nominally
> they are checking the OS not the Perl, but maybe it's close enough.
>
>
If the reported OS is msys (it's a pseudo OS in effect) then the perl
must be msys' perl. Even when called from msys, native perl reports the
OS as MSWin32. So yes, close enough.
cheers
andrew
--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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-general@postgresql.org
Cc: andrew.dunstan@2ndquadrant.com, tgl@sss.pgh.pa.us, shammat@gmx.net, pgsql-hackers@lists.postgresql.org
Subject: Re: Is this a bug in pg_current_logfile() on Windows?
In-Reply-To: <dd5de297-4e8e-b323-f489-ea719b3583ed@2ndQuadrant.com>
References: <412ae8da-76bb-640f-039a-f3513499e53d@gmx.net> <1716646.1594226496@sss.pgh.pa.us> <bb8f2c7f-2bee-35bd-d57e-62864e95bb89@gmx.net> <1733826.1594243608@sss.pgh.pa.us> <252f062c-2b75-1bc3-e08a-3541719b27c0@2ndQuadrant.com> <1739104.1594250997@sss.pgh.pa.us> <1777519.1594262442@sss.pgh.pa.us> <fcf4b905-8aff-2c65-ae4c-ec28a9a02370@2ndQuadrant.com> <1818128.1594305850@sss.pgh.pa.us> <bc5246bf-f43f-f29f-0a56-230cf80f5ce3@2ndQuadrant.com> <1819000.1594307053@sss.pgh.pa.us> <dd5de297-4e8e-b323-f489-ea719b3583ed@2ndQuadrant.com>
* 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