Re: [RFC] building postgres with meson - Mailing list pgsql-hackers

From John Naylor
Subject Re: [RFC] building postgres with meson
Date
Msg-id CAFBsxsGfoXHNqRLCEww4P859fE7c=AeGcs4eccq-H+-0yOp9Kw@mail.gmail.com
Whole thread Raw
In response to Re: [RFC] building postgres with meson  (Andres Freund <andres@anarazel.de>)
Responses Re: [RFC] building postgres with meson  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Thu, Oct 21, 2021 at 5:48 PM Andres Freund <andres@anarazel.de> wrote:

> However, update-unicode is a bit harder.  Partially not directly because of
> meson, but because update-unicode as-is afaict doesn't support VPATH builds,
> and meson enforces those.

> make update-unicode
> ...
> make -C src/common/unicode update-unicode
> '/usr/bin/perl' generate-unicode_norm_table.pl
> Can't open perl script "generate-unicode_norm_table.pl": No such file or directory
>
> It's not too hard to fix. See attached for the minimal stuff that I
> immediately found to be needed.

Thanks for doing that, it works well enough for demonstration. With your patch, and using an autoconf VPATH build, the unicode tables work fine, but it complains of a permission error in generate_unaccent_rules.py. That seems to be because the script is invoked directly rather than as an argument to the python interpreter.

> The slightly bigger issue making update-unicode work with meson is that meson
> doesn't provide support for invoking build targets in specific directories
> (because it doesn't map nicely to e.g. msbuild). But scripts like
> src/common/unicode/generate-unicode_norm_table.pl rely on CWD. It's not hard
> to work around that, but IMO it's better for such scripts to not rely on CWD.

Yeah. I encountered a further issue: With autoconf on HEAD, with a source tree build executed in contrib/unaccent:

$ touch generate_unaccent_rules.py
$ make update-unicode
generate_unaccent_rules.py --unicode-data-file ../../src/common/unicode/UnicodeData.txt --latin-ascii-file Latin-ASCII.xml >unaccent.rules
/bin/sh: generate_unaccent_rules.py: command not found
make: *** [unaccent.rules] Error 127
make: *** Deleting file `unaccent.rules'

...so in this case it seems not to know to use CWD here.

Anyway, this can be put off until the very end, since it's not run often. You've demonstrated how these targets would work, and that's good enough for now.

--
John Naylor
EDB: http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Experimenting with hash tables inside pg_dump
Next
From: Zhihong Yu
Date:
Subject: Re: Multi-Column List Partitioning