From: ilmari@ilmari.org
To: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: TAP tests and symlinks on Windows
Date: Tue, 09 Jun 2020 11:26:19 +0100
Message-ID: <87sgf4pmb8.fsf@wibble.ilmari.org> (raw)
In-Reply-To: <CAC+AXB3NfdDsp+egpYj=qgD+vPhb_dNRA4vwgcTL+Vmhj38UWw@mail.gmail.com>
References: <c50a646c-d9bb-7c62-a4bf-8256ff6ff338@2ndquadrant.com>
<20200609071931.GE38342@paquier.xyz>
<89a38304-8900-2e6b-de26-19a0312f3a87@2ndquadrant.com>
<CAC+AXB3NfdDsp+egpYj=qgD+vPhb_dNRA4vwgcTL+Vmhj38UWw@mail.gmail.com>
Juan José Santamaría Flecha <juanjo.santamaria@gmail.com> writes:
> On Tue, Jun 9, 2020 at 9:28 AM Peter Eisentraut <
> peter.eisentraut@2ndquadrant.com> wrote:
>
>> On 2020-06-09 09:19, Michael Paquier wrote:
>> > On Mon, Jun 08, 2020 at 02:44:31PM +0200, Peter Eisentraut wrote:
>> >> both contain a TAP skip notice "symlinks not supported on Windows".
>> >>
>> >> This is untrue. Symlinks certainly work on Windows, and we have other
>> TAP
>> >> tests using them, for example for tablespaces.
>> >
>> >> pg_rewind/t/004_pg_xlog_symlink.pl passes for me on Windows if I just
>> remove
>> >> the skip stuff. My attached patch does that.
>> >
>> > What's the version of your perl installation on Windows? With 5.22, I
>> > am still seeing that symlink() is not implemented, causing the tests
>> > of pg_rewind to blow in flight with your patch (MSVC 2015 here).
>>
>> I was using MSYS2 and the Perl version appears to have been 5.30.2.
>> Note sure which one of these two factors makes the difference.
>>
>
> The difference seems to be MSYS2, it also fails for me if I do not
> include 'Win32::Symlink' with Perl 5.30.2.
Amusingly, Win32::Symlink uses a copy of our pgsymlink(), which emulates
symlinks via junction points:
https://metacpan.org/source/AUDREYT/Win32-Symlink-0.06/pgsymlink.c
A portable way of using symlinks if possible would be:
# In a BEGIN block because it overrides CORE::GLOBAL::symlink, which
# only takes effect on code that's compiled after the override is
# installed. We don't care if it fails, since it works without on
# some Windows perls.
BEGIN {
eval { require Win32::Symlink; Win32::Symlink->import; }
}
# symlink() throws an exception if t
if (not eval { symlink("",""); 1; })
{
plan skip_all => 'symlinks not supported';
}
else
{
plan tests => 5;
}
Plus a note in the Win32 docs that Win32::Symlink may be required to run
some tests on some Perl/Windows versions..
- ilmari
--
- Twitter seems more influential [than blogs] in the 'gets reported in
the mainstream press' sense at least. - Matt McLeod
- That'd be because the content of a tweet is easier to condense down
to a mainstream media article. - Calle Dybedahl
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: ilmari@ilmari.org, juanjo.santamaria@gmail.com, peter.eisentraut@2ndquadrant.com, michael@paquier.xyz
Subject: Re: TAP tests and symlinks on Windows
In-Reply-To: <87sgf4pmb8.fsf@wibble.ilmari.org>
* 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