Rationalizing code-sharing among src/bin/ directories

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Rationalizing code-sharing among src/bin/ directories
Дата
Msg-id 5670.1458752105@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Rationalizing code-sharing among src/bin/ directories  (Robert Haas <robertmhaas@gmail.com>)
Re: Rationalizing code-sharing among src/bin/ directories  (Petr Jelinek <petr@2ndquadrant.com>)
Re: Rationalizing code-sharing among src/bin/ directories  (Magnus Hagander <magnus@hagander.net>)
Re: Rationalizing code-sharing among src/bin/ directories  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: Rationalizing code-sharing among src/bin/ directories  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Rationalizing code-sharing among src/bin/ directories  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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?
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Postgres_fdw join pushdown - getting server crash in left outer join of three table
Следующее
От: "Regina Obe"
Дата:
Сообщение: PostgreSQL 9.6 behavior change with set returning (funct).*