Re: TAP tests and symlinks on Windows

2020-07-16 Thread Michael Paquier
On Thu, Jul 16, 2020 at 07:21:27PM +0900, Michael Paquier wrote: > The patch looks good to me. For the sake of the archives, this has been applied as d66b23b0 and the buildfarm is green. I have also changed the related CF entry to reflect what has been done, with Andrew as author, etc: https://co

Re: TAP tests and symlinks on Windows

2020-07-16 Thread Michael Paquier
On Wed, Jul 15, 2020 at 11:04:28AM -0400, Andrew Dunstan wrote: > This is the simplest invocation I found to be reliable on msys2 (and it > took me a long time to find). If you have a tested alternative please > let me know. Having a working MSYS environment is still on my TODO list :) > I don't

Re: TAP tests and symlinks on Windows

2020-07-15 Thread Andrew Dunstan
On 7/14/20 1:31 AM, Michael Paquier wrote: > On Fri, Jul 10, 2020 at 07:58:02AM -0400, Andrew Dunstan wrote: >> After much frustration and gnashing of teeth here's a patch that allows >> almost all the TAP tests involving symlinks to work as expected on all >> Windows build environments, without r

Re: TAP tests and symlinks on Windows

2020-07-14 Thread Peter Eisentraut
On 2020-07-10 13:58, Andrew Dunstan wrote: After much frustration and gnashing of teeth here's a patch that allows almost all the TAP tests involving symlinks to work as expected on all Windows build environments, without requiring an additional Perl module. I have tested this on a system that is

Re: TAP tests and symlinks on Windows

2020-07-13 Thread Michael Paquier
On Fri, Jul 10, 2020 at 07:58:02AM -0400, Andrew Dunstan wrote: > After much frustration and gnashing of teeth here's a patch that allows > almost all the TAP tests involving symlinks to work as expected on all > Windows build environments, without requiring an additional Perl module. > I have test

Re: TAP tests and symlinks on Windows

2020-07-10 Thread Andrew Dunstan
On 7/8/20 9:54 AM, Andrew Dunstan wrote: > > > > Then, with a little more sprinkling of perl2host the pg_basebackup tests > can be made to work on msys2. > > > I'm going to prepare patches along these lines. > > After much frustration and gnashing of teeth here's a patch that allows almost all

Re: TAP tests and symlinks on Windows

2020-07-08 Thread Juan José Santamaría Flecha
On Wed, Jul 8, 2020 at 7:18 PM Andrew Dunstan < andrew.duns...@2ndquadrant.com> wrote: > > On 7/8/20 12:22 PM, Alvaro Herrera wrote: > > On 2020-Jul-08, Andrew Dunstan wrote: > > > >> On 7/8/20 11:07 AM, Juan José Santamaría Flecha wrote: > >>> There is a utility cygpath [1] meant for the conversi

Re: TAP tests and symlinks on Windows

2020-07-08 Thread Andrew Dunstan
On 7/8/20 12:22 PM, Alvaro Herrera wrote: > On 2020-Jul-08, Andrew Dunstan wrote: > >> On 7/8/20 11:07 AM, Juan José Santamaría Flecha wrote: >>> There is a utility cygpath [1] meant for the conversion between Unix >>> and Windows path formats, that might be a meaningful name also. >>> >>> [1] ht

Re: TAP tests and symlinks on Windows

2020-07-08 Thread Alvaro Herrera
On 2020-Jul-08, Andrew Dunstan wrote: > On 7/8/20 11:07 AM, Juan José Santamaría Flecha wrote: > > There is a utility cygpath [1] meant for the conversion between Unix > > and Windows path formats, that might be a meaningful name also. > > > > [1] http://cygwin.net/cygwin-ug-net/cygpath.html > >

Re: TAP tests and symlinks on Windows

2020-07-08 Thread Andrew Dunstan
On 7/8/20 11:07 AM, Juan José Santamaría Flecha wrote: > > On Wed, Jul 8, 2020 at 3:54 PM Andrew Dunstan > > wrote: > > > Incidentally, perl2host is arguably a bad name for this routine - > there > is nothing perl-specific about the paths, they

Re: TAP tests and symlinks on Windows

2020-07-08 Thread Juan José Santamaría Flecha
On Wed, Jul 8, 2020 at 3:54 PM Andrew Dunstan < andrew.duns...@2ndquadrant.com> wrote: > > Incidentally, perl2host is arguably a bad name for this routine - there > is nothing perl-specific about the paths, they are provided by the msys > environment. Maybe virtual2host or some such would be a bet

Re: TAP tests and symlinks on Windows

2020-07-08 Thread Andrew Dunstan
On 7/3/20 10:11 AM, Peter Eisentraut wrote: > On 2020-06-30 14:13, Michael Paquier wrote: >> Attached is an updated patch, where I have tried to use a better >> wording in all the code paths involved. > > This new patch doesn't work for me on MSYS2 yet. > > It fails right now in 010_pg_basebackup

Re: TAP tests and symlinks on Windows

2020-07-05 Thread Michael Paquier
On Sun, Jul 05, 2020 at 08:18:46AM -0400, Andrew Dunstan wrote: > On 7/3/20 10:11 AM, Peter Eisentraut wrote: >> I think all of this is still a bit too fragile it needs further >> consideration. Indeed. I would need a MSYS2 environment to dig into that. This looks trickier than what I am used to

Re: TAP tests and symlinks on Windows

2020-07-05 Thread Andrew Dunstan
On 7/3/20 10:11 AM, Peter Eisentraut wrote: > On 2020-06-30 14:13, Michael Paquier wrote: >> Attached is an updated patch, where I have tried to use a better >> wording in all the code paths involved. > > This new patch doesn't work for me on MSYS2 yet. > > It fails right now in 010_pg_basebackup

Re: TAP tests and symlinks on Windows

2020-07-03 Thread Peter Eisentraut
On 2020-06-30 14:13, Michael Paquier wrote: Attached is an updated patch, where I have tried to use a better wording in all the code paths involved. This new patch doesn't work for me on MSYS2 yet. It fails right now in 010_pg_basebackup.pl at my $realTsDir = TestLib::perl2host("$sho

Re: TAP tests and symlinks on Windows

2020-06-30 Thread Michael Paquier
On Mon, Jun 29, 2020 at 04:56:16PM +0900, Michael Paquier wrote: > On Fri, Jun 26, 2020 at 02:00:37PM +0200, Peter Eisentraut wrote: >> We should be more accurate about things like this: >> >> +# The following tests test symlinks. Windows may not have symlinks, so >> +# skip there. >> >> The issu

Re: TAP tests and symlinks on Windows

2020-06-29 Thread Michael Paquier
On Fri, Jun 26, 2020 at 02:00:37PM +0200, Peter Eisentraut wrote: > We should be more accurate about things like this: > > +# The following tests test symlinks. Windows may not have symlinks, so > +# skip there. > > The issue isn't whether Windows has symlinks, since all versions of Windows > sup

Re: TAP tests and symlinks on Windows

2020-06-26 Thread Peter Eisentraut
On 2020-06-23 12:55, Michael Paquier wrote: I have implemented a patch based on the feedback received that does the following, tested with all three patterns (MSVC only on Windows): - Assume that all non-Windows platform have a proper symlink implementation for perl. - If on Windows, check for th

Re: TAP tests and symlinks on Windows

2020-06-23 Thread Michael Paquier
On Wed, Jun 17, 2020 at 04:44:34PM +0900, Michael Paquier wrote: > Okay. This could be a problem as jacana is proving to have good > coverage AFAIK. So it looks like we are really heading in the > direction is still skipping the test if there is no support for > symlink in the environment. At lea

Re: TAP tests and symlinks on Windows

2020-06-17 Thread Michael Paquier
On Tue, Jun 16, 2020 at 07:53:26AM -0400, Andrew Dunstan wrote: > Not one of them has it. Argh. > I think we'll need a dynamic test for its presence rather than just > assuming it's there. (Use require in an eval for this). Sure. No problem with implementing an automatic detection. > However,

Re: TAP tests and symlinks on Windows

2020-06-17 Thread Michael Paquier
On Tue, Jun 16, 2020 at 08:32:03AM -0400, Andrew Dunstan wrote: > On 6/16/20 8:24 AM, Peter Eisentraut wrote: >> MSYS2, which is basically Cygwin, emulates symlinks with junction >> points, so this happens to work for our purpose.  We could therefore >> enable these tests in that environment, if we

Re: TAP tests and symlinks on Windows

2020-06-16 Thread Andrew Dunstan
On 6/16/20 8:24 AM, Peter Eisentraut wrote: > On 2020-06-09 09:33, Juan José Santamaría Flecha wrote: >> The difference seems to be MSYS2, it also fails for me if I do not >> include 'Win32::Symlink' with Perl 5.30.2. > > MSYS2, which is basically Cygwin, emulates symlinks with junction > points,

Re: TAP tests and symlinks on Windows

2020-06-16 Thread Peter Eisentraut
On 2020-06-09 09:33, Juan José Santamaría Flecha wrote: The difference seems to be MSYS2, it also fails for me if I do not include 'Win32::Symlink' with Perl 5.30.2. MSYS2, which is basically Cygwin, emulates symlinks with junction points, so this happens to work for our purpose. We could the

Re: TAP tests and symlinks on Windows

2020-06-16 Thread Andrew Dunstan
On 6/15/20 2:23 AM, Michael Paquier wrote: > On Sat, Jun 13, 2020 at 03:00:54PM +0900, Michael Paquier wrote: >> My take would be to actually enforce that as a requirement for 14~ if >> that works reliably, and of course not backpatch that change as that's >> clearly an improvement and not a bug

Re: TAP tests and symlinks on Windows

2020-06-16 Thread Juan José Santamaría Flecha
On Mon, Jun 15, 2020 at 8:23 AM Michael Paquier wrote: > > Another thing I spotted is that Win32::Symlink does not allow to > detect properly if a path is a symlink using -l, causing one of the > tests of pg_basebackup to fail when checking if a tablespace path has > been updted. It would be goo

Re: TAP tests and symlinks on Windows

2020-06-14 Thread Michael Paquier
On Sat, Jun 13, 2020 at 03:00:54PM +0900, Michael Paquier wrote: > My take would be to actually enforce that as a requirement for 14~ if > that works reliably, and of course not backpatch that change as that's > clearly an improvement and not a bug fix. It would be good to check > the status of ea

Re: TAP tests and symlinks on Windows

2020-06-12 Thread Michael Paquier
On Fri, Jun 12, 2020 at 02:02:52PM +0200, Juan José Santamaría Flecha wrote: > The first thing that comes to mind is adding an option to vcregress to > choose whether symlinks will be tested or skipped, would that be an > acceptable solution? My take would be to actually enforce that as a requirem

Re: TAP tests and symlinks on Windows

2020-06-12 Thread Juan José Santamaría Flecha
On Fri, Jun 12, 2020 at 9:00 AM Michael Paquier wrote: > On Tue, Jun 09, 2020 at 11:26:19AM +0100, Dagfinn Ilmari Mannsåker wrote: > > Plus a note in the Win32 docs that Win32::Symlink may be required to run > > some tests on some Perl/Windows versions.. > > Planting such a check in individual sc

Re: TAP tests and symlinks on Windows

2020-06-12 Thread Michael Paquier
On Tue, Jun 09, 2020 at 11:26:19AM +0100, Dagfinn Ilmari Mannsåker wrote: > 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 Oh, interesting point. Thanks for the re

Re: TAP tests and symlinks on Windows

2020-06-09 Thread Dagfinn Ilmari Mannsåker
Juan José Santamaría Flecha writes: > On Tue, Jun 9, 2020 at 9:28 AM Peter Eisentraut < > peter.eisentr...@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

Re: TAP tests and symlinks on Windows

2020-06-09 Thread Juan José Santamaría Flecha
On Tue, Jun 9, 2020 at 9:28 AM Peter Eisentraut < peter.eisentr...@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

Re: TAP tests and symlinks on Windows

2020-06-09 Thread Peter Eisentraut
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 tablespa

Re: TAP tests and symlinks on Windows

2020-06-09 Thread Michael Paquier
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

TAP tests and symlinks on Windows

2020-06-08 Thread Peter Eisentraut
The tests src/bin/pg_basebackup/t/010_pg_basebackup.pl src/bin/pg_rewind/t/004_pg_xlog_symlink.pl 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_r