From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Rationalizing code-sharing among src/bin/ directories |
Date: | 2016-03-23 17:25:36 |
Message-ID: | CA+TgmoY2CAafkg7CZsumg=rfU_oLCB9HL1RWhBhxCecf4KRXiQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, Mar 23, 2016 at 12:55 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I'm not terribly happy with the hack I used to get pgbench to be able
> to borrow psql's psqlscan.l lexer. It's a mess for the MSVC build
> scripts, and I have seen it causing two concurrent builds of psqlscan.o
> in parallel builds, which is likely to cause a build failure some of
> the time. Another unresolved issue is that we can't apply FLEX_NO_BACKUP
> testing to both of psql's lexers, because that causes each of those
> make steps to want to write lex.backup in the current directory.
>
> I have a modest proposal for improving this: let's move all the code
> that's currently shared by two or more src/bin/ subdirectories into a
> new directory, say src/feutils, and build it into a ".a" library in
> the same way that src/common/ is handled. This would remove the
> following klugy cross-directory links:
>
> src/bin/pgbench/psqlscan.o -> ../../../src/bin/psql/psqlscan.o
> src/bin/psql/dumputils.c -> ../../../src/bin/pg_dump/dumputils.c
> src/bin/psql/keywords.c -> ../../../src/bin/pg_dump/keywords.c
> src/bin/scripts/dumputils.c -> ../../../src/bin/pg_dump/dumputils.c
> src/bin/scripts/keywords.c -> ../../../src/bin/pg_dump/keywords.c
> src/bin/scripts/mbprint.c -> ../../../src/bin/psql/mbprint.c
> src/bin/scripts/print.c -> ../../../src/bin/psql/print.c
>
> Note: the reason for a new subdirectory, rather than putting this
> stuff into src/common/, is that src/common/ is meant for code that's
> shared between frontend and backend, which this stuff is not. Also,
> many of these files depend on libpq which seems like an inappropriate
> dependency for src/common.
>
> Having said that, I also notice these dependencies:
>
> src/bin/pg_dump/kwlookup.c -> ../../../src/backend/parser/kwlookup.c
> src/bin/psql/kwlookup.c -> ../../../src/backend/parser/kwlookup.c
> src/bin/scripts/kwlookup.c -> ../../../src/backend/parser/kwlookup.c
> src/interfaces/ecpg/preproc/kwlookup.c -> ../../../../src/backend/parser/kwlookup.c
> src/bin/initdb/encnames.c -> ../../../src/backend/utils/mb/encnames.c
> src/interfaces/libpq/encnames.c -> ../../../src/backend/utils/mb/encnames.c
>
> which seem like they'd be better handled by moving those files into
> src/common/.
>
> Thoughts?
No objection.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From | Date | Subject | |
---|---|---|---|
Next Message | Petr Jelinek | 2016-03-23 17:30:20 | Re: Rationalizing code-sharing among src/bin/ directories |
Previous Message | Robert Haas | 2016-03-23 17:23:45 | Re: Re: Missing rows with index scan when collation is not "C" (PostgreSQL 9.5) |