pgsql: Blind attempt at a Cygwin fix

Lists: pgsql-committerspgsql-hackers
From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Blind attempt at a Cygwin fix
Date: 2016-01-08 14:49:51
Message-ID: E1aHYMR-0002J0-9K@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Blind attempt at a Cygwin fix

Further portability fix for a967613911f7. Mingw- and MSVC-based builds
appear to be working fine, but Cygwin needs an extra tweak whereby the
new win32security.c file is explicitely added to the list of files to
build in pgport, per Cygwin members brolga and lorikeet.

Author: Michael Paquier

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/e9282e953205a2f3125fc8d1052bc01cb77cd2a3

Modified Files
--------------
configure | 6 ++++++
configure.in | 1 +
2 files changed, 7 insertions(+)


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Blind attempt at a Cygwin fix
Date: 2016-01-08 15:01:26
Message-ID: 23313.1452265286@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> Blind attempt at a Cygwin fix

According to
http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=brolga&dt=2016-01-08%2014%3A51%3A27

brolga now tries to compile win32security.c, which it evidently was not
doing before, but the compile blows up; looks like it is missing #include
calls (which must exist in other places where this code lives ...)

regards, tom lane


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Marco Atzeri <marco(dot)atzeri(at)gmail(dot)com>
Subject: Re: [COMMITTERS] pgsql: Blind attempt at a Cygwin fix
Date: 2016-01-08 15:13:31
Message-ID: 20160108151331.GA584390@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> > Blind attempt at a Cygwin fix
>
> According to
> http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=brolga&dt=2016-01-08%2014%3A51%3A27
>
> brolga now tries to compile win32security.c, which it evidently was not
> doing before, but the compile blows up; looks like it is missing #include
> calls (which must exist in other places where this code lives ...)

Obviously this wasn't the best idea ever. Andrew suggests on IM to
revert this on Cygwin to just do the "isatty" check as originally.

I'm CC'ing Marco Atzeri, who has done Cygwin work lately. Maybe he can
spend some time getting this port fixed.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Marco Atzeri <marco(dot)atzeri(at)gmail(dot)com>
Subject: Re: [COMMITTERS] pgsql: Blind attempt at a Cygwin fix
Date: 2016-01-08 15:39:02
Message-ID: 20160108153902.GA589413@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Alvaro Herrera wrote:
> Tom Lane wrote:
> > Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> > > Blind attempt at a Cygwin fix
> >
> > According to
> > http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=brolga&dt=2016-01-08%2014%3A51%3A27
> >
> > brolga now tries to compile win32security.c, which it evidently was not
> > doing before, but the compile blows up; looks like it is missing #include
> > calls (which must exist in other places where this code lives ...)
>
> Obviously this wasn't the best idea ever. Andrew suggests on IM to
> revert this on Cygwin to just do the "isatty" check as originally.

Here's a proposed patch. Thoughts?

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
Revert-Blind-attempt-at-a-Cygwin-fix.patch text/x-diff 1.8 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Marco Atzeri <marco(dot)atzeri(at)gmail(dot)com>
Subject: Re: [COMMITTERS] pgsql: Blind attempt at a Cygwin fix
Date: 2016-01-08 16:17:35
Message-ID: 2308.1452269855@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> Alvaro Herrera wrote:
>> Obviously this wasn't the best idea ever. Andrew suggests on IM to
>> revert this on Cygwin to just do the "isatty" check as originally.

> Here's a proposed patch. Thoughts?

Ugly, but it will hold the fort until someone can debug the service
code for Cygwin.

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Marco Atzeri <marco(dot)atzeri(at)gmail(dot)com>
Subject: Re: [COMMITTERS] pgsql: Blind attempt at a Cygwin fix
Date: 2016-01-09 17:00:58
Message-ID: 56913CCA.4080509@dunslane.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On 01/08/2016 11:17 AM, Tom Lane wrote:
> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
>> Alvaro Herrera wrote:
>>> Obviously this wasn't the best idea ever. Andrew suggests on IM to
>>> revert this on Cygwin to just do the "isatty" check as originally.
>> Here's a proposed patch. Thoughts?
> Ugly, but it will hold the fort until someone can debug the service
> code for Cygwin.
>
>

I downloaded the official Cygwin packages into a Cygwin instance and
checked how they do things. As I rather expected, they do not use pg_ctl
at all to install or run as a service. Rather, they use the standard
Cygwin service utility cygrunsrv. This is all managed via a SYSV style
init script.

So if anything I'd be inclined to disable all the service-related code
in pg_ctl for Cygwin, and treat it just as we treat Unix.

cheers

andrew


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Marco Atzeri <marco(dot)atzeri(at)gmail(dot)com>
Subject: Re: [COMMITTERS] pgsql: Blind attempt at a Cygwin fix
Date: 2016-01-09 23:10:00
Message-ID: CAB7nPqRV+5dO+5vPs-29Fqzq3U3x9wZL6iGORbP=aH5qFqnAtg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On Sun, Jan 10, 2016 at 2:00 AM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> I downloaded the official Cygwin packages into a Cygwin instance and checked
> how they do things. As I rather expected, they do not use pg_ctl at all to
> install or run as a service. Rather, they use the standard Cygwin service
> utility cygrunsrv. This is all managed via a SYSV style init script.

Thanks for the investigation!

> So if anything I'd be inclined to disable all the service-related code in
> pg_ctl for Cygwin, and treat it just as we treat Unix.

We had better do the same for back branches then. Need of a patch?
--
Michael


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Marco Atzeri <marco(dot)atzeri(at)gmail(dot)com>
Subject: Re: [COMMITTERS] pgsql: Blind attempt at a Cygwin fix
Date: 2016-01-10 13:57:32
Message-ID: CAB7nPqQXghm_SdB5iniupz1atzMxk=95gv9A8ocdo83SXCNjeg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On Sun, Jan 10, 2016 at 8:10 AM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> On Sun, Jan 10, 2016 at 2:00 AM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>> I downloaded the official Cygwin packages into a Cygwin instance and checked
>> how they do things. As I rather expected, they do not use pg_ctl at all to
>> install or run as a service. Rather, they use the standard Cygwin service
>> utility cygrunsrv. This is all managed via a SYSV style init script.
>
> Thanks for the investigation!
>
>> So if anything I'd be inclined to disable all the service-related code in
>> pg_ctl for Cygwin, and treat it just as we treat Unix.
>
> We had better do the same for back branches then. Need of a patch?

OK, here is a patch to disable all the service-related code in pg_ctl
for cygwin. This time it is not a blind shot and this compiles
correctly. Changing the option layer is fine for me if this is
HEAD-only. For back-branches, I would suggest to do nothing, the
service-related code paths are not going to run anyway, any output
going to stderr.
--
Michael

Attachment Content-Type Size
cygwin-removal-service-master.patch text/x-diff 4.8 KB