From: Tristan Partin <tristan@neon.tech>
To: Andres Freund <andres@anarazel.de>
To: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] Missing dep on Catalog.pm in meson rules
Date: Wed, 14 Jun 2023 19:25:51 -0500
Message-ID: <CTCSPI7HIK3H.1K5VJUELDT9GQ@gonk> (raw)
In-Reply-To: <20230614193213.74elqlrhb24i4ouq@awork3.anarazel.de>
References: <87v8g7s6bf.fsf@wibble.ilmari.org>
<CT1MJFE3PEEV.2S08CXLDYMCWP@gonk>
<329a690c-1f4e-4759-8018-8ee562c159f0@app.fastmail.com>
<CT1V90ZD4ZPZ.2J5QU7ZEYSB60@gonk>
<20230602130028.yf4jagpqqmivhx77@alap3.anarazel.de>
<CT26U28ECWTA.3VIVYB9J55L4K@gonk>
<20230602134704.w2gg7nwe2jisd7es@alap3.anarazel.de>
<CT29G866OR1A.P5MR0P1UF545@gonk>
<20230609184354.5stlrg7vfj6dd7rz@awork3.anarazel.de>
<20230614193213.74elqlrhb24i4ouq@awork3.anarazel.de>
On Wed Jun 14, 2023 at 2:32 PM CDT, Andres Freund wrote:
> Hi,
>
> On 2023-06-09 11:43:54 -0700, Andres Freund wrote:
> > On 2023-06-02 10:13:44 -0500, Tristan Partin wrote:
> > > On Fri Jun 2, 2023 at 8:47 AM CDT, Andres Freund wrote:
> > > > Hi,
> > > >
> > > > On 2023-06-02 08:10:43 -0500, Tristan Partin wrote:
> > > > > > I wonder if we instead could just make perl output the files it loads and
> > > > > > handle dependencies automatically that way? But that's more work, so it's
> > > > > > probably the right thing to go for the manual path for now.
> > > > >
> > > > > I am not familar with Perl enough (at all haha) to know if that is
> > > > > possible. I don't know exactly what these Perl files do, but perhaps it
> > > > > might make sense to have some global lookup table that is setup near the
> > > > > beginning of the script.
> > > >
> > > > It'd be nice to have something more general - there are other perl modules we
> > > > load, e.g.
> > > > ./src/backend/catalog/Catalog.pm
> > > > ./src/backend/utils/mb/Unicode/convutils.pm
> > > > ./src/tools/PerfectHash.pm
> > > >
> > > >
> > > > > perl_files = {
> > > > > 'Catalog.pm': files('path/to/Catalog.pm'),
> > > > > ...
> > > > > }
> > > >
> > > > I think you got it, but just to make sure: I was thinking of generating a
> > > > depfile from within perl. Something like what you propose doesn't quite seems
> > > > like a sufficient improvement.
> > >
> > > Whatever I am proposing is definitely subpar to generating a depfile. So
> > > if that can be done, that is the best option!
> >
> > I looked for a bit, but couldn't find an easy way to do so. I would still like
> > to pursue going towards dep files for the perl scripts, even if that requires
> > explicit support in the perl scripts, but that's a change for later.
>
> Took a second look - sure looks like just using values %INC should suffice?
>
> Ilmari, you're the perl expert, is there an issue with that?
>
> Tristan, any chance you're interested hacking that up for a bunch of the
> scripts? Might be worth adding a common helper for, I guess?
>
> Something like
>
> for (values %INC)
> {
> print STDERR "$kw_def_file: $_\n";
> }
>
> seems to roughly do the right thing for gen_keywordlist.pl. Of course for
> something real it'd need an option where to put that data, instead of printing
> to stderr.
I would need to familiarize myself with perl, but since you've written
probably all or almost all that needs to be written, I can probably
scrape by :).
I definitely have the bandwidth to make this change though pending what
Ilmari says.
--
Tristan Partin
Neon (https://neon.tech)
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: pgsql-hackers@postgresql.org
Cc: tristan@neon.tech, andres@anarazel.de, ilmari@ilmari.org
Subject: Re: [PATCH] Missing dep on Catalog.pm in meson rules
In-Reply-To: <CTCSPI7HIK3H.1K5VJUELDT9GQ@gonk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox