Обсуждение: more buildfarm breakage

Поиск
Список
Период
Сортировка

more buildfarm breakage

От
Robert Haas
Дата:
mingw is unhappy with my latest stab at fixing the mess created by the
errcodes patch last night.  It appears that there are several files in
src/port that include "postgres.h" even when FRONTEND is defined.  For
example, chklocale.c does this, which looks good:

#ifndef FRONTEND
#include "postgres.h"
#else
#include "postgres_fe.h"
#endif

But dirent.c, pipe.c, and win32error.c just do this, which seems ungood:

#include "postgres.h"

Can we get away with using the former incantation for these files, or
do they really need to include the backend version of that file even
when compiled with -DFRONTEND?  If so, I can fix it by adding some
more dependencies, but I thought I'd ask first.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: more buildfarm breakage

От
Tom Lane
Дата:
Robert Haas <robertmhaas@gmail.com> writes:
> mingw is unhappy with my latest stab at fixing the mess created by the
> errcodes patch last night.  It appears that there are several files in
> src/port that include "postgres.h" even when FRONTEND is defined.  For
> example, chklocale.c does this, which looks good:

> #ifndef FRONTEND
> #include "postgres.h"
> #else
> #include "postgres_fe.h"
> #endif

> But dirent.c, pipe.c, and win32error.c just do this, which seems ungood:

> #include "postgres.h"

I agree, that is not cool.

> Can we get away with using the former incantation for these files, or
> do they really need to include the backend version of that file even
> when compiled with -DFRONTEND?  If so, I can fix it by adding some
> more dependencies, but I thought I'd ask first.

If the #ifndef FRONTEND incantation doesn't work, then either the file
isn't meant to be built for frontend at all (src/port does have some
like that IIRC), or we need to fix the code.

BTW, I noted here that errcodes.h doesn't seem to get built till after
src/port/ is built.  That seems wrong --- there is definitely code in
there that needs to throw errors.
        regards, tom lane


Re: more buildfarm breakage

От
Robert Haas
Дата:
On Fri, Feb 4, 2011 at 1:04 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I agree, that is not cool.

OK, changed.

> BTW, I noted here that errcodes.h doesn't seem to get built till after
> src/port/ is built.  That seems wrong --- there is definitely code in
> there that needs to throw errors.

It does, actually, but it's only guaranteed to be built in time for
the *backend* versions of the object files.  Hence the problem when
the backend headers are used for the frontend build.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: more buildfarm breakage

От
Robert Haas
Дата:
On Fri, Feb 4, 2011 at 1:16 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Fri, Feb 4, 2011 at 1:04 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I agree, that is not cool.
>
> OK, changed.

It looks like pipe.c is full of backend-specific error-reporting code.I could rewrite it to work in the frontend, but
sinceit's obviously
 
not used anywhere there it seems like an exercise in futility.

The viable options appear to be:

1. Use #ifndef FRONTEND to dike out the entire file.
2. Make a small change to the Makefile to only compile this into the
backend version of the library, and just skip it for the frontend
version.
3. Move it into src/backend/port.

My first thought is to go with #3.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company