Re: automatically generating node support functions

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: automatically generating node support functions
Date: 2022-07-11 21:37:55
Message-ID: 20220711213755.gwcysmuypke3wckg@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2022-07-11 16:38:05 -0400, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> > On 2022-07-11 15:54:22 -0400, Tom Lane wrote:
> >> We can't simply move the file list into gen_node_support.pl, because
> >> (a) the build system has to know about the dependencies involved
>
> > Meson has builtin support for tools like gen_node_support.pl reporting which
> > files they've read and then to use those as dependencies. It'd not be a lot of
> > effort to open-code that with make either.
>
> If you want to provide code for that, sure, but I don't know how to do it.

It'd basically be something like a --deps option providing a path to a file
(e.g. .deps/nodetags.Po) where the script would emit something roughly
equivalent to

path/to/nodetags.h: path/to/nodes/nodes.h
path/to/nodetags.h: path/to/nodes/primnodes.h
...
path/to/readfuncs.c: path/to/nodetags.h

It might or might not make sense to output this as one rule instead of
multiple ones.

I think our existing dependency support would do the rest.

We'd still need a dependency on node-support-stamp (or nodetags.h or ...), to
trigger the first invocation of gen_node_support.pl.

I don't think it's worth worrying about this not working reliably for non
--enable-depend builds, there's a lot more broken than this. But it might be a
bit annoying to deal with either a) creating the .deps directory even without
--enable-depend, or b) specifying --deps only optionally.

I can give it a go if this doesn't sound insane.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-07-11 21:56:37 Re: Issue with pg_stat_subscription_stats
Previous Message Nathan Bossart 2022-07-11 21:23:54 Re: Avoid erroring out when unable to remove or parse logical rewrite files to save checkpoint work