Re: Is this a bug in pg_current_logfile() on Windows?
Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
From: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Thomas Kellerer <shammat@gmx.net>, pgsql-hackers@lists.postgresql.org
Date: 2020-07-09T15:22:43Z
Lists: pgsql-hackers, pgsql-general
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
Commits
-
Tighten up Windows CRLF conversion in our TAP test scripts.
- d0390509a182 9.5.23 landed
- ce9d053423fd 9.6.19 landed
- a3cfb10764bb 12.4 landed
- 89162b7364bf 11.9 landed
- 4c17c5a8529c 10.14 landed
- 17b87b3049fa 13.0 landed
- 91bdf499b37b 14.0 landed
-
Fix pg_current_logfile() to not emit a carriage return on Windows.
- 90b418f81645 11.9 landed
- 765ad260a18f 10.14 landed
- 601d419b2b5d 13.0 landed
- 2564e2d08546 12.4 landed
- 183926da3162 14.0 landed
-
Further tighten Windows CRLF conversion in our TAP test scripts.
- ffb4cee43bdc 14.0 landed
-
Add test coverage for pg_current_logfile() function.
- 1c4e88e2fe41 14.0 landed
-
Fix failures to ignore \r when reading Windows-style newlines.
- b654714f9bcf 13.0 cited
-
Fix TAP infrastructure to support Mingw better
- 33f3bbc6d37d 10.0 cited