public inbox for [email protected]
help / color / mirror / Atom feedFrom: Michael Paquier <[email protected]>
To: Drouvot, Bertrand <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Autogenerate some wait events code and documentation
Date: Wed, 5 Jul 2023 10:57:19 +0900
Message-ID: <ZKTN//[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<ZGSM8oOpXsXrXy/[email protected]>
<[email protected]>
<ZGWrTn//[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
On Tue, Jul 04, 2023 at 09:34:33AM +0200, Drouvot, Bertrand wrote:
> Yeah, with "capture" set to "false" then ninja alldocs does not error out
> and wait_event_types.sgml gets generated.
>
> I'll look at the extra options --code and --docs.
+wait_event_types.sgml: $(top_srcdir)/src/backend/utils/activity/wait_event_names.txt $(top_srcdir)/src/backend/utils/activity/generate-wait_event_types.pl
+ $(PERL) $(top_srcdir)/src/backend/utils/activity/generate-wait_event_types.pl --docs $< > $@
This is doing the same error as meson in v10, there is no need for
the last part doing the redirection because the script outputs
nothing. Here is the command generated:
make -C doc/src/sgml/ wait_event_types.sgml
'/usr/bin/perl'
../../../src/backend/utils/activity/generate-wait_event_types.pl
--docs ../../../src/backend/utils/activity/wait_event_names.txt >
wait_event_types.sgml
+wait_event_names = custom_target('wait_event_names',
+ input: files('../../backend/utils/activity/wait_event_names.txt'),
+ output: ['wait_event_types.h'],
This one was not completely correct (look at fmgrtab, for example), as
it is missing pgstat_wait_event.c in the output generated. We could
perhaps be more selective with all that, including fmgrtab, but I have
left that out for now. Note also the tweak with install_dir to not
install the C file.
+wait_event_names = custom_target('wait_event_names',
+ input: files('./wait_event_names.txt'),
+ output: ['pgstat_wait_event.c'],
+ command: [
+ perl, files('./generate-wait_event_types.pl'),
+ '-o', '@OUTDIR@', '--code',
+ '@INPUT@'
+ ],
+ install: true,
+ install_dir: [false],
+)
[...]
+# these include .c files generated in ../../../include/activity, seems nicer to not
+# add that as an include path for the whole backend
+waitevent_sources = files(
'wait_event.c',
)
+
+backend_link_with += static_library('wait_event_names',
+ waitevent_sources,
+ dependencies: [backend_code],
+ include_directories: include_directories('../../../include/utils'),
+ kwargs: internal_lib_args,
+)
"wait_event_names" with the extra command should not be necessary
here, because we feed from the C file generated in src/include/utils/,
included in wait_event.c. See src/backend/nodes/meson.build for a
similar example
Two of the error messages after rename() in the script were
inconsistent. So reworded these on the way.
I have added a usage() to the script, while on it.
The VPATH build was broken, because the following line was missing
from src/backend/utils/activity/Makefile to be able to detect
pgstat_wait_event.c from wait_event.c:
override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS)
With all that in place, VPATH builds, the CI, meson, configure/make
and the various cleanup targets were working fine, so I have applied
it. Now let's see what the buildfarm tells.
The final --stat number is like that:
22 files changed, 757 insertions(+), 2111 deletions(-)
--
Michael
Attachments:
[application/pgp-signature] signature.asc (833B, ../ZKTN%2F%[email protected]/2-signature.asc)
download
view thread (32+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Autogenerate some wait events code and documentation
In-Reply-To: <ZKTN//[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox