Re: patch to fix client only builds - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: patch to fix client only builds
Date
Msg-id b42b73150811060851g624aad11n8904ec80fc2bc917@mail.gmail.com
Whole thread Raw
In response to Re: patch to fix client only builds  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: patch to fix client only builds  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: patch to fix client only builds  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Nov 6, 2008 at 11:09 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Merlin Moncure" <mmoncure@gmail.com> writes:
>> I'm trying to do client only builds on a bunch of legacy platforms and
>> noticed that the include path is messed up...if keywords.o is not
>> already built, it fails to build be because src/backend/parser but not
>> src/backend is in the include path. (keywords.c includes
>> parser/gram.h).
>
> Hmm, but nobody should be including gram.h directly out of
> backend/parser anyway.  They should be getting it via the symlink in
> src/include/parser.  I think the real problem must be that that symlink
> isn't being created during a client-only build?

ah, correct.  the symlink is setup in src/backend/Makefile

psql Makefile pulls in submake-backend to grab keywords.o.

submake-backend: $(MAKE) -C $(top_builddir)/src/backend/parser keywords.o

so psql build is trying to build directly in backend which breaks (so
is pg_dump, the offender is a backend dependency in pg_dump from
symlinked in dumputils.c).  This looks caused  by a change to clean up
some quoting issues:

revision 1.36
date: 2007/06/18 21:40:58;  author: tgl;  state: Exp;  lines: +18 -5
Arrange for quote_identifier() and pg_dump to not quote keywords that are
unreserved according to the grammar.  The list of unreserved words has gotten
extensive enough that the unnecessary quoting is becoming a bit of an eyesore.
To do this, add knowledge of the keyword category to keywords.c's table.
(Someday we might be able to generate keywords.c's table and the keyword lists
in gram.y from a common source.)
<snip>

IMO, the client only build should be fixed, so we can:
*) put the makefile hack I proposed in
*) implement the keywords.c change suggested above
*) set up backend/parser symlink from different/additional place.

merlin


pgsql-hackers by date:

Previous
From: "Jonah H. Harris"
Date:
Subject: Re: [PATCH] EnableDisableTrigger Cleanup & Questions
Next
From: Alvaro Herrera
Date:
Subject: per-database locale: createdb switches