Re: Build failure on thrips

Lists: pgsql-hackers
From: Michael Meskes <meskes(at)postgresql(dot)org>
To: PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>
Cc: chris(at)chrullrich(dot)net
Subject: Build failure on thrips
Date: 2017-08-26 12:26:37
Message-ID: 20170826122637.nkytpnk2nwfuujhn@feivel
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>, chris(at)chrullrich(dot)net
Subject: Re: Build failure on thrips
Date: 2017-08-26 15:42:50
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Michael Meskes <meskes(at)postgresql(dot)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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>, chris(at)chrullrich(dot)net
Subject: Re: Build failure on thrips
Date: 2017-08-26 16:18:02
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>, chris(at)chrullrich(dot)net
Subject: Re: Build failure on thrips
Date: 2017-08-26 16:44:29
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

> 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


From: Christian Ullrich <chris(at)chrullrich(dot)net>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Build failure on thrips
Date: 2017-08-26 16:54:18
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

* 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


From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>, chris(at)chrullrich(dot)net
Subject: Re: Build failure on thrips
Date: 2017-08-26 17:14:17
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

> 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


From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Christian Ullrich <chris(at)chrullrich(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Build failure on thrips
Date: 2017-08-26 17:15:32
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

> 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