fix for windows breakage in regression script

Started by Andrew Dunstanover 21 years ago10 messagespatches
Jump to latest
#1Andrew Dunstan
andrew@dunslane.net

The recent change to pg_regress.sh has apparently broken testing on my
Windows machine - see
http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=loris&dt=2005-01-15%2001:36:36
which contains this:

================== pgsql.2544/src/test/regress/log/postmaster.log ===================
LOG: could not translate host name "''", service "65432" to address: Unknown host
WARNING: could not create listen socket for "''"
FATAL: no socket created for listening

The attached patch seems to cure the problem.

cheers

andrew

Attachments:

regress.patchtext/x-patch; name=regress.patchDownload+2-2
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#1)
Re: fix for windows breakage in regression script

Andrew Dunstan <andrew@dunslane.net> writes:

The recent change to pg_regress.sh has apparently broken testing on my
Windows machine - see
http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=loris&amp;dt=2005-01-15%2001:36:36
which contains this:

Y'know, I wondered why windows wasn't listed in that CASE. I guess the
answer is it didn't have to be right before.

What about the Cygwin port --- will it have the same issue? If so what
should we add?

regards, tom lane

#3Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#2)
Re: fix for windows breakage in regression script

Tom Lane wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

The recent change to pg_regress.sh has apparently broken testing on my
Windows machine - see
http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=loris&amp;dt=2005-01-15%2001:36:36
which contains this:

Y'know, I wondered why windows wasn't listed in that CASE. I guess the
answer is it didn't have to be right before.

What about the Cygwin port --- will it have the same issue? If so what
should we add?

No, Cygwin works OK - still have occasional issues with non-empty
tablespaces, but not this issue. The Cygwin environment itself emulates
unix sockets, I think that's the reason.

cheers

andrew

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#3)
Re: fix for windows breakage in regression script

Andrew Dunstan <andrew@dunslane.net> writes:

Tom Lane wrote:

What about the Cygwin port --- will it have the same issue? If so what
should we add?

No, Cygwin works OK - still have occasional issues with non-empty
tablespaces, but not this issue. The Cygwin environment itself emulates
unix sockets, I think that's the reason.

Hm --- have you checked it since I changed the script?

port/cygwin.h claims that older versions of Cygwin don't have Unix
sockets, and there's a hack in pg_config_manual.h that sure looks like
it will disable HAVE_UNIX_SOCKETS on any Cygwin version. I'm inclined
to think that pg_regress should play it safe and assume no Unix sockets
on Cygwin.

regards, tom lane

#5Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#4)
Re: fix for windows breakage in regression script

Tom Lane wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

Tom Lane wrote:

What about the Cygwin port --- will it have the same issue? If so what
should we add?

No, Cygwin works OK - still have occasional issues with non-empty
tablespaces, but not this issue. The Cygwin environment itself emulates
unix sockets, I think that's the reason.

Hm --- have you checked it since I changed the script?

yes. See
http://www.pgbuildfarm.org/cgi-bin/show_history.pl?nm=gibbon&amp;br=HEAD

port/cygwin.h claims that older versions of Cygwin don't have Unix
sockets, and there's a hack in pg_config_manual.h that sure looks like
it will disable HAVE_UNIX_SOCKETS on any Cygwin version. I'm inclined
to think that pg_regress should play it safe and assume no Unix sockets
on Cygwin.

Mine is fairly up to date - fairly sure I ran an update in the last
month or so, and it was only installed 6 months ago anyway.

I have no idea how far back you would have to go to be missing unix
sockets. Several years I suspect.

cheers

andrew

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#5)
Re: fix for windows breakage in regression script

Andrew Dunstan <andrew@dunslane.net> writes:

Tom Lane wrote:

Hm --- have you checked it since I changed the script?

yes. See
http://www.pgbuildfarm.org/cgi-bin/show_history.pl?nm=gibbon&amp;br=HEAD

[ scratches head... ] Why isn't the #undef in pg_config_manual.h firing
on Cygwin?

regards, tom lane

#7Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#6)
Re: fix for windows breakage in regression script

Tom Lane said:

Andrew Dunstan <andrew@dunslane.net> writes:

Tom Lane wrote:

Hm --- have you checked it since I changed the script?

yes. See
http://www.pgbuildfarm.org/cgi-bin/show_history.pl?nm=gibbon&amp;br=HEAD

[ scratches head... ] Why isn't the #undef in pg_config_manual.h
firing on Cygwin?

The lines say:

#if defined(__QNX__) || defined(__BEOS__) || defined(WIN32)
#undef HAVE_UNIX_SOCKETS
#endif

But on Cygwin, WIN32 is only defined if windows.h has been included (See
previous discussion - I recall advocating NOT using WIN32 as a marker for
just this reason).

cheers

andrew

#8Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#7)
Re: fix for windows breakage in regression script

"Andrew Dunstan" <andrew@dunslane.net> writes:

Tom Lane said:

[ scratches head... ] Why isn't the #undef in pg_config_manual.h
firing on Cygwin?

But on Cygwin, WIN32 is only defined if windows.h has been included (See
previous discussion - I recall advocating NOT using WIN32 as a marker for
just this reason).

Urgh ... so it's only because windows.h isn't included till later that
it works properly.

I'm not sure that we need the code in pg_config_manual.h anymore anyway
--- the configure test should be covering this.  But just before release
is no time to be fooling with such things.

I did add cygwin to the unix_socket=no case in pg_regress, and I'm
inclined to leave it that way because it's really the minimal change
from the script's previous behavior on cygwin. Do you see a strong
reason for undoing that?

regards, tom lane

#9Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#8)
Re: fix for windows breakage in regression script

Tom Lane wrote:

"Andrew Dunstan" <andrew@dunslane.net> writes:

Tom Lane said:

[ scratches head... ] Why isn't the #undef in pg_config_manual.h
firing on Cygwin?

But on Cygwin, WIN32 is only defined if windows.h has been included (See
previous discussion - I recall advocating NOT using WIN32 as a marker for
just this reason).

Urgh ... so it's only because windows.h isn't included till later that
it works properly.

It's a lot more subtle than that :-( . In most cases we end up
including windows.h _only_ if WIN32 is already defined, as it is for us
by the compiler on MinGW.

see: http://archives.postgresql.org/pgsql-hackers/2004-09/msg00206.php
and http://archives.postgresql.org/pgsql-hackers/2004-09/msg00256.php

w.r.t. Cygwin / unix sockets, the test is in port/cygwin.h, and says:

#if CYGWIN_VERSION_DLL_MAJOR < 1001
#undef HAVE_UNIX_SOCKETS
#endif

I don't know how old that is.

I'm not sure that we need the code in pg_config_manual.h anymore anyway
--- the configure test should be covering this.  But just before release
is no time to be fooling with such things.

agreed.

I did add cygwin to the unix_socket=no case in pg_regress, and I'm
inclined to leave it that way because it's really the minimal change
from the script's previous behavior on cygwin. Do you see a strong
reason for undoing that?

Well, nothing seems broken - see buildfarm. And if it ain't broke .../

cheers

andrew
/

#10Reini Urban
rurban@x-ray.at
In reply to: Andrew Dunstan (#9)
Re: fix for windows breakage in regression script

Andrew Dunstan schrieb:

Tom Lane wrote:

"Andrew Dunstan" <andrew@dunslane.net> writes:

Tom Lane said:

[ scratches head... ] Why isn't the #undef in pg_config_manual.h
firing on Cygwin?

But on Cygwin, WIN32 is only defined if windows.h has been included (See
previous discussion - I recall advocating NOT using WIN32 as a marker
for
just this reason).

Urgh ... so it's only because windows.h isn't included till later that
it works properly.

It's a lot more subtle than that :-( . In most cases we end up
including windows.h _only_ if WIN32 is already defined, as it is for us
by the compiler on MinGW.

see: http://archives.postgresql.org/pgsql-hackers/2004-09/msg00206.php
and http://archives.postgresql.org/pgsql-hackers/2004-09/msg00256.php

w.r.t. Cygwin / unix sockets, the test is in port/cygwin.h, and says:

#if CYGWIN_VERSION_DLL_MAJOR < 1001
#undef HAVE_UNIX_SOCKETS
#endif

I don't know how old that is.

This is a perfectly good logic.

I'm not sure that we need the code in pg_config_manual.h anymore anyway
--- the configure test should be covering this.  But just before release
is no time to be fooling with such things.

agreed.

I did add cygwin to the unix_socket=no case in pg_regress, and I'm
inclined to leave it that way because it's really the minimal change
from the script's previous behavior on cygwin. Do you see a strong
reason for undoing that?

Well, nothing seems broken - see buildfarm. And if it ain't broke .../

Without sockets it's just a bit slower. Otherwise I don't care.
It should work on Cygwin with and without.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/