Hi,

On 2021-12-02 22:07:17 +0100, Daniel Gustafsson wrote:
> > On 2 Dec 2021, at 20:51, Andres Freund <[email protected]> wrote:
> > 
> > Hi,
> > 
> > On 2021-12-01 20:49:21 +0100, Daniel Gustafsson wrote:
> >> Looks like perl2host() was the missing piece, fairywren turned green with
> >> commit c3b34a0ff4.
> > 
> > Does that work with MSVC? I rebased my CI patch ontop of this, and it fails 
> > on
> > windows:
> > https://cirrus-ci.com/task/6093088335593472?logs=ssl_test#L5
> 
> I was under the impression that it did, but it seems that my Appveyor scripts
> had a bug which hid that =( Sorry for that.

I really want to get the CI stuff merged so stuff like this is easier going
forward... FWIW, I have a new colleague working on installing more of the
optional dependencies for windows - but we can add those later.


> This seems to be another case of Perl being perfectly happy to copy and manage
> the files, but Postgres not being able to read them since we'd otherwise die()
> a lot sooner.  The error message is the same as when the msys directory wasn't
> fixed with perl2host:

>   [04:05:47.204] # got: 'psql: error: connection to server at "127.0.0.1", 
> port 59360 failed: certificate present, but not private key file 
> "C:cirrussrctestssltmp_checktmp_test_AIn7/client.key"
> 
> Looking at other tests, we pass a tempdir() to postgres just fine, so that
> clearly works.  The one difference here is that the filename is added with
> "/client.key", so I have a feeling this is a delimiter issue where Windows
> expects a backslash?  In src/test/recovery/t/025_stuck_on_old_timeline.pl we 
> do
> the following, which IMO would be neat if perl2host (or a similar function)
> would do for us:

Hm. Isn't the problem that we are not adding enough of the other path
delimiters? The /client.key seems fine, the problem is that all the other
delimiters were swallowed. Or is that what you mean?

I think the difference might be that the most of the other tests do not pass
such paths to postgres via postgresql.conf (based on a *very* cursory grep). I
assume the guc machinery treats the \ as an escape, and that's why you're
seeing c:cirrussrc... instead of c:\cirrus\src\...


>   my $archivedir_primary = $node_primary->archive_dir;
>   $archivedir_primary =~ s!\\!/!g if $PostgreSQL::Test::Utils::windows_os;
>   $node_primary->append_conf(
>       'postgresql.conf', qq(
>   archive_command = '"$perlbin" "$FindBin::RealBin/cp_history_files" "%p" 
> "$archivedir_primary/%f"'
>   wal_keep_size=128MB
>   ));
> 
> I'll fix it, or revert if I can't make it work. Sorry for the breakage.

And this works because it uses *forward* slashes instad of backward slashes,
which then do not get escaped by the guc machinery.

Greetings,

Andres Freund


Reply via email to