Build failure on thrips

Started by Michael Meskesover 8 years ago7 messages
#1Michael Meskes
meskes@postgresql.org

The bug fix I committed for fixing setlocale in ECPG test cases on Windows
seems to work nicely on all buildfarm animals except thrips. Could anyone with
access to a similar systems please check what's going on or send the
precompiled file that creates the compilation errors?

Thanks.

Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Meskes at (Debian|Postgresql) dot Org
Jabber: michael at xmpp dot meskes dot org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Michael Meskes (#1)
Re: Build failure on thrips

Michael Meskes <meskes@postgresql.org> writes:

The bug fix I committed for fixing setlocale in ECPG test cases on Windows
seems to work nicely on all buildfarm animals except thrips. Could anyone with
access to a similar systems please check what's going on or send the
precompiled file that creates the compilation errors?

It's not just thrips. Of the Windows machines that have reported in since
that commit, only currawong and baiji passed. Although lorikeet,
woodlouse, bowerbird, and brolga are showing green, this proves nothing
because they're all configured to skip the ecpg check (... I wonder why).

In the rest, we have

frogmouth:
thread_implicit.pgc: In function 'test_thread':
thread_implicit.pgc:104:2: warning: implicit declaration of function '_configthreadlocale'
thread_implicit.pgc:104:22: error: '_ENABLE_PER_THREAD_LOCALE' undeclared (first use in this function)

jacana:
Aug 26 09:06:40 thread_implicit.o: In function `test_thread':
Aug 26 09:06:40 c:\mingw\msys\1.0\home\pgrunner\bf\root\HEAD\pgsql.build\src\interfaces\ecpg\test\thread/thread_implicit.pgc:104: undefined reference to `_configthreadlocale'

thrips is showing some weird syntax errors that I suspect mean it's
misinterpreting "_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);"
as a declaration.

So what it looks like to me is that either that function isn't
available on all Windows versions, or there's some other header
you need to include to get it on some versions.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#2)
Re: Build failure on thrips

I wrote:

thrips is showing some weird syntax errors that I suspect mean it's
misinterpreting "_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);"
as a declaration.

Actually, looking closer, isn't the problem that you've stuck a
function call into the midst of declarations? Some compilers
will allow that, but it's not valid C90. You probably just need
to move the call down past "EXEC SQL END DECLARE SECTION".

So what it looks like to me is that either that function isn't
available on all Windows versions, or there's some other header
you need to include to get it on some versions.

Microsoft's own documentation contradicts that:
https://msdn.microsoft.com/en-us/library/26c0tb7x(v=vs.80).aspx

So I'm not sure why the undefined-function results on frogmouth
and jacana, although I notice they are using gcc not MSVC.
Unless someone has a better idea, I'd suggest working around
that like so:

#ifdef WIN32
#ifdef _MSC_VER /* requires MSVC */
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
#endif
#endif

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Michael Meskes
meskes@postgresql.org
In reply to: Tom Lane (#2)
Re: Build failure on thrips

It's not just thrips.  Of the Windows machines that have reported in
since
that commit, only currawong and baiji passed.  Although lorikeet,
woodlouse, bowerbird, and brolga are showing green, this proves
nothing
because they're all configured to skip the ecpg check (... I wonder
why).

I would assume it works on woodlouse as the patch has been submitted by
woodlouse's owner.

Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Meskes at (Debian|Postgresql) dot Org
Jabber: michael at xmpp dot meskes dot org
VfL Borussia! Força Barça! SF 49ers! Use Debian GNU/Linux, PostgreSQL

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Christian Ullrich
chris@chrullrich.net
In reply to: Michael Meskes (#4)
Re: Build failure on thrips

* Michael Meskes wrote:

It's not just thrips. Of the Windows machines that have reported in
since
that commit, only currawong and baiji passed. Although lorikeet,
woodlouse, bowerbird, and brolga are showing green, this proves
nothing
because they're all configured to skip the ecpg check (... I wonder
why).

I would assume it works on woodlouse as the patch has been submitted by
woodlouse's owner.

woodlouse does not do ecpg-check, and Tom is right anyway. I need to get a large sign nailed to my forehead that says "Postgres is C, and declarations must come first."

I'm not sure, and not able to find out right this moment, why thrips' compiler does not accept this code now, because I tested it on thrips (and woodlouse, IIRC) before I sent it in.

--
Christian

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#6Michael Meskes
meskes@postgresql.org
In reply to: Tom Lane (#3)
Re: Build failure on thrips

Unless someone has a better idea, I'd suggest working around
that like so:

#ifdef WIN32
#ifdef _MSC_VER                /* requires MSVC */
   _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
#endif
#endif

Let's try, committed, thanks again Tom.

Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Meskes at (Debian|Postgresql) dot Org
Jabber: michael at xmpp dot meskes dot org
VfL Borussia! Força Barça! SF 49ers! Use Debian GNU/Linux, PostgreSQL

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#7Michael Meskes
meskes@postgresql.org
In reply to: Christian Ullrich (#5)
Re: Build failure on thrips

woodlouse does not do ecpg-check, and Tom is right anyway. I need to
get a large sign nailed to my forehead that says "Postgres is C, and
declarations must come first."

I didn't notice either. I guess /me is getting rusty, sigh.

Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Meskes at (Debian|Postgresql) dot Org
Jabber: michael at xmpp dot meskes dot org
VfL Borussia! Força Barça! SF 49ers! Use Debian GNU/Linux, PostgreSQL

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers