Re: issue with meson builds on msys2

From: Andres Freund <andres(at)anarazel(dot)de>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: issue with meson builds on msys2
Date: 2023-05-15 23:43:56
Message-ID: 20230515234356.7ysq7w6jjsofeunt@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Hi,

On 2023-05-15 15:30:28 -0700, Andres Freund wrote:
> As soon as either the pg_ctl for the start, or the whole bash invocation, has
> stdin redirected, the problem vanishes.

For a moment I thought this could be related to InheritStdHandles() - but no,
it doesn't make a difference.

There's loads of handles referencing cygwin alive in pg_ctl.

Based on difference in strace output for bash -c "pg_ctl stop" for the case
where start redirected stdin (#1) and where not (#2), it looks like some part
of msys / cygwin sees that stdin is alive when preparing to execute "pg_ctl
stop", and then runs into trouble.

The way we start the child process on windows makes the use of cmd.exe for
redirection pretty odd.

I couldn't trivially reproduce this with a much simpler case (just nohup
sleep). Perhaps it's dependent on a wrapper cmd or such.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2023-05-16 04:15:06 pgsql: psql: Adjust capitalization of table heading
Previous Message Andres Freund 2023-05-15 22:30:28 Re: issue with meson builds on msys2

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-05-15 23:58:07 Re: Using make_ctags leaves tags files in git
Previous Message Peter Smith 2023-05-15 23:43:37 Re: [DOC] Update ALTER SUBSCRIPTION documentation v2