Re: moving from contrib to bin

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: moving from contrib to bin
Date: 2014-12-22 14:05:24
Message-ID: CAB7nPqTszjAedSUYVVfQ8+H-53xCwkY_QMoEpUjYJK0ZZT0HKQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 18, 2014 at 10:37 AM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> On Thu, Dec 18, 2014 at 4:02 AM, Alvaro Herrera
> <alvherre(at)2ndquadrant(dot)com> wrote:
>>
>> I know this is how it currently works, but it looks way too messy to me:
>>
>> + my $pgarchivecleanup = AddSimpleFrontend('pg_archivecleanup');
>> + my $pgstandby = AddSimpleFrontend('pg_standby');
>> + my $pgtestfsync = AddSimpleFrontend('pg_test_fsync');
>> + my $pgtesttiming = AddSimpleFrontend('pg_test_timing');
>> + my $pgbench = AddSimpleFrontend('pgbench', 1);
>>
>> ISTM we should be something like
>>
>> for each $elem in src/bin/Makefile:$(SUBDIRS)
>> AddSimpleFrontend($elem)
>>
>> and avoid having to list the modules one by one.
>
> If we take this road, I'd like to avoid a huge if/elseif scanning the
> names of the submodules to do the necessary adjustments (Some need
> FRONTEND defined, others ws2_32, etc.). Also, there is the case of
> pg_basebackup where multiple binaries are included with pg_basebackup,
> pg_recvlogical and pg_receivexlog. So I think that we'd need something
> similar to what contrib does, aka:
> my @frontend_excludes = ('pg_basebackup', 'pg_dump', 'pg_dumpall',
> 'pg_xlogdump', 'initdb' ...);
> my frontend_extralibs = ('pgbench' => 'ws2_32.lib');
> my @frontend_uselibpq = ('pgbench', 'pg_ctl', 'pg_upgrade');
> And for each frontend name excluded we have an individual project
> declaration with its own exceptions. With this way of doing when a new
> frontend is added by default in src/bin it will be automatically
> compiled. How does that sound?
And here is an updated patch following those lines. Similarly to the
things in contrib/, a set of variables are used to define for each
module what are the extra libraries, include dirs, etc. This refactors
quite a bit of code, even if there are a couple of exceptions like
pg_xlogdump/ or pg_basebackup/.
--
Michael

Attachment Content-Type Size
20141222_srcbin_win_v2.patch text/x-diff 10.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2014-12-22 14:30:28 Re: moving from contrib to bin
Previous Message Robert Haas 2014-12-22 13:50:43 Re: Doing better at HINTing an appropriate column within errorMissingColumn()