Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qGrlw-0003qs-Vn for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Jul 2023 01:57:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qGrlv-00039w-Hl for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Jul 2023 01:57:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qGrlu-00039n-6x for pgsql-hackers@lists.postgresql.org; Wed, 05 Jul 2023 01:57:35 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qGrlq-002Fmw-0L for pgsql-hackers@lists.postgresql.org; Wed, 05 Jul 2023 01:57:33 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 98168320095B; Tue, 4 Jul 2023 21:57:25 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 04 Jul 2023 21:57:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1688522245; x=1688608645; bh=7Y +MkQbI+ofA0t8GVdF9x1QJZC3iTu2GwgAkK/JvG38=; b=ixjXaFYxURaoQ6MHvw 40SR5+Sw2dV5uZxLLvYv1i7nF6ncdEevPCv5YbQfDTQMpo2iGKPcL4tB5DmRFubu amynBtgdMjefi4lbr1mFpVFyC5pcTa61vRXPqkhM6LORf/632lL+JpunxOB9Z1uM zhJC3PT3TQNbIbApqE7Y3JtZkaPUEvoySvUFF2WZUqmL1gPrXUXVPp1DonPkg0rY KbZHKsrmVxgXDsV1pJsFR4410RRBSxllAyM5HCZ/bRppjjQiEHrx9OobYC6ldPbl WGiTTMx22XR+PFwcgasC9tbYaYAlTlyADZ5MwDinUYQHwuBbgv5IEZHHft3ejtWU 1EgA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1688522245; x=1688608645; bh=7Y+MkQbI+ofA0 t8GVdF9x1QJZC3iTu2GwgAkK/JvG38=; b=O/K7VD5f4vFxSrPwITJlOvqhlXrgH 22oMVMI4dscGWu346UaSqh3Gv/4Y3DqIkhW7B1q8udfZYMpyzomo1f4mpHCw4FTI sQDT1o+43kvdovrkKegtjJuUpGV6JzhpnPJ5dEIfy2k5TXtNeyzAPV7JjgI3EPQp V4m8uFuRyeqaqXUGZz4/pUhW74blfSM2u9yerfiKNVcKgd1+UJMiQAjRopcAxb0d 13Qias4AOybRKKU/ToEqqcQRquI4GSLkTHZSl3gH29oJQPcTq6Fkbg09oB+Md2PC GcBWhciDBpH+UpuX1CWriXxudGupwOT96neQCNZ6bBhIAbLz0EGnynVCg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehgdehudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 4 Jul 2023 21:57:23 -0400 (EDT) Date: Wed, 5 Jul 2023 10:57:19 +0900 From: Michael Paquier To: "Drouvot, Bertrand" Cc: PostgreSQL Hackers Subject: Re: Autogenerate some wait events code and documentation Message-ID: References: <106e8d0a-0820-687a-7da5-3143e1f5b05b@gmail.com> <976f4eb1-cbc0-9616-ec26-ebb4a252315c@gmail.com> <69588eaf-02d7-95a8-0da4-3e120de16a59@gmail.com> <0b3cdac7-f078-61a6-76e0-99db7aae78ce@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+o5DIMYclnhl7wRk" Content-Disposition: inline In-Reply-To: <0b3cdac7-f078-61a6-76e0-99db7aae78ce@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --+o5DIMYclnhl7wRk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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_typ= es.pl + $(PERL) $(top_srcdir)/src/backend/utils/activity/generate-wait_event_ty= pes.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' =2E./../../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 =3D 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 =3D 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 nic= er to not +# add that as an include path for the whole backend +waitevent_sources =3D files( 'wait_event.c', ) + +backend_link_with +=3D 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 =66rom src/backend/utils/activity/Makefile to be able to detect pgstat_wait_event.c from wait_event.c: override CPPFLAGS :=3D -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 --+o5DIMYclnhl7wRk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmSkzf4ACgkQnvQgOdby QH2JlQ/6AtNsIlAAHWzsQn+1ma6TPDswccU7I7B4+51b/V5/SjaANJODQfmXHGnq vPPXHMq2hNGc/h4qD9HbboAVSIj+Pm6Vyz86nnODifBeASwNuIR+tMrVywgIuqdk R32vHWtuUKC/glgOozVguLsfuCaoE32efkI3/XPcnm5GXk9TcgV3PTMN4Caj6kkw w1XJ746HJ34/WV9aNBNwS+fwxmJPsQ35CWDOc2plgbKdtjP8kyp18gxAkWLKTa1/ OhmS98A0x6LAhNEsGbr69p0Y1LbzhSyTy2N/UAf/riziyIn1TvS0QM7IQfUCsw5e fbT06AQ+melN+hWmgRTFvEvH6H8e1w4SEde5Pf9coK7LcX83IBhd+SKY+4tzhiwx yuCGsZU9KPQkHZtCKiUPh5APbKGGmIdQXpEk/NjT1jm/kwr24pgvK6fybGn/ayT4 gw+OhPQ7IHJIwh9uWdFVFhu/TkQPCogzWjranta+EGqahHd/aFDA6ee0PIPiNr+O VAegSls9HYbqbMgKooTkVHuD46Scv+whHHxUO+pejR3H5quCsc/Sxp0C1IGEguWJ LJrsLBMuP7SxHvplyYbNyF93eKkwRHanMBIgxBSjg/ko0lk7hBXf6uaF/xlUZ4G+ do3iCH0P6f9XMz15GlhhRisOjdqP56jxR8ZsbVIbBQ/ucVdWFvY= =gDaI -----END PGP SIGNATURE----- --+o5DIMYclnhl7wRk--