Re: 003_extrafiles.pl test fails on Windows with the newer Perl versions

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: 003_extrafiles.pl test fails on Windows with the newer Perl versions
Date: 2024-01-30 22:18:49
Message-ID: d239ca03-3da3-7d18-7a42-fbd02f46a914@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2024-01-30 Tu 06:49, Andrew Dunstan wrote:
>
> On 2024-01-30 Tu 06:21, Nazir Bilal Yavuz wrote:
>> Hi,
>>
>> I was trying to install newer Perl versions to Windows CI images and
>> found that 003_extrafiles.pl test fails on Windows with:
>>
>> (0.183s) not ok 2 - file lists match
>> (0.000s) #   Failed test 'file lists match'
>> #   at C:/cirrus/src/bin/pg_rewind/t/003_extrafiles.pl line 81.
>> (0.000s) #     Structures begin differing at:
>> #          $got->[0] =
>> 'C:/cirrus/build/testrun/pg_rewind/003_extrafiles/data/t_003_extrafiles_primary_local_data/pgdata/tst_both_dir'
>>
>> #     $expected->[0] =
>> 'C:\cirrus\build/testrun/pg_rewind/003_extrafiles\data/t_003_extrafiles_primary_local_data/pgdata/tst_both_dir'
>>
>>
>> (0.263s) not ok 5 - file lists match
>> (0.000s) #   Failed test 'file lists match'
>> #   at C:/cirrus/src/bin/pg_rewind/t/003_extrafiles.pl line 81.
>> (0.000s) #     Structures begin differing at:
>> #          $got->[0] =
>> 'C:/cirrus/build/testrun/pg_rewind/003_extrafiles/data/t_003_extrafiles_primary_remote_data/pgdata/tst_both_dir'
>>
>> #     $expected->[0] =
>> 'C:\cirrus\build/testrun/pg_rewind/003_extrafiles\data/t_003_extrafiles_primary_remote_data/pgdata/tst_both_dir'
>>
>>
>> It looks like File::Find converts backslashes to slashes in the newer
>> Perl versions. I tried to find the related commit and found this:
>> https://github.com/Perl/perl5/commit/414f14df98cb1c9a20f92c5c54948b67c09f072d
>>
>>
>> To solve this, I did the same conversion for Windows before comparing
>> the paths. And to support all Perl versions, I decided to always
>> convert them on Windows regardless of the Perl's version. The fix is
>> attached.
>>
>> I looked at other File::Find appearances in the code but they do not
>> compare the paths. So, I do not think there is any need to fix them.
>>
>> Any kind of feedback would be appreciated.
>>
>
> Looks reasonable on the face of it. I'll see about pushing this today.

Pushed to all live branches. Thanks for the patch.

cheers

andrew

--

Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tristan Partin 2024-01-30 22:19:54 Re: psql not responding to SIGINT upon db reconnection
Previous Message Magnus Hagander 2024-01-30 21:58:56 Re: Possibility to disable `ALTER SYSTEM`