pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: [RFC] building postgres with meson -v9
10+ messages / 3 participants
[nested] [flat]

Commits from this thread:
  2022-07-18 1ab0719836 a91242b1bc  Deal with paths containing \ and spaces in basebackup_to_shell tests
  2022-07-06 7775c748db  Remove LLVM_CONFIG from Makefile.global.in
* Re: [RFC] building postgres with meson -v9
@ 2022-07-01 09:33  Andres Freund <andres@anarazel.de>
  0 siblings, 2 replies; 10+ messages in thread

From: Andres Freund @ 2022-07-01 09:33 UTC (permalink / raw)
  To: pgsql-hackers

Hi,

Attached is an updated version of the meson patchset. There has been a steady
stream of incremental work over the last month, with patches from Peter
Eisentraut and Nazir Yavuz.

I tried to address the review comments Peter had downthread about the prep
patches. The one that I know is still outstanding is that there's still
different ways of passing output directories as parameters to a bunch of
scripts added, will resolve that next (some have been fixed).

Now the patchset contains a, somewhat hacky and incomplete, implementation of
pgxs, even when using meson. Basically a compatible Makefile.global.in is
generated.

There's a lot of small and medium sized changes.

As usual the changes are also my git branch [1], which gets updated fairly
regularly.

Greetings,

Andres Freund

[1] https://github.com/anarazel/postgres/tree/meson

Attachments:

  v9-0001-prereq-deal-with-paths-in-basebackup_to_shell-tes.patch.gz (application/x-patch-gzip, 956B) download

  v9-0002-meson-prereq-Specify-output-directory-for-psql-sq.patch.gz (application/x-patch-gzip, 1.4K) download

  v9-0003-meson-prereq-ecpg-add-and-use-output-directory-ar.patch.gz (application/x-patch-gzip, 1.1K) download

  v9-0004-meson-prereq-msvc-explicit-output-file-for-pgflex.patch.gz (application/x-patch-gzip, 944B) download

  v9-0005-meson-prereq-move-snowball_create.sql-creation-in.patch.gz (application/x-patch-gzip, 3.0K) download

  v9-0006-meson-prereq-add-output-path-arg-in-generate-lwlo.patch.gz (application/x-patch-gzip, 841B) download

  v9-0007-meson-prereq-generate-errcodes.pl-accept-output-f.patch.gz (application/x-patch-gzip, 1.1K) download

  v9-0008-meson-prereq-unicode-allow-to-specify-output-dire.patch.gz (application/x-patch-gzip, 935B) download

  v9-0009-meson-prereq-Can-we-get-away-with-not-export-all-.patch.gz (application/x-patch-gzip, 5.5K) download

  v9-0010-meson-prereq-add-src-tools-gen_versioning_script..patch.gz (application/x-patch-gzip, 934B) download

  v9-0011-meson-prereq-remove-LLVM_CONFIG-from-Makefile.glo.patch.gz (application/x-patch-gzip, 509B) download

  v9-0012-meson-prereq-Refactor-PG_TEST_EXTRA-logic-in-auto.patch.gz (application/x-patch-gzip, 1.4K) download

  v9-0013-meson-prereq-Refactor-dtrace-postprocessing-make-.patch.gz (application/x-patch-gzip, 1.1K) download

  v9-0014-meson-prereq-regress-allow-to-specify-director-co.patch.gz (application/x-patch-gzip, 1.7K) download

  v9-0015-wip-split-TESTDIR-into-two.patch.gz (application/x-patch-gzip, 2.0K) download

  v9-0016-meson-Add-meson-based-buildsystem.patch.gz (application/x-patch-gzip, 77.1K) download

  v9-0017-meson-ci-Build-both-with-meson-and-as-before.patch.gz (application/x-patch-gzip, 4.5K) download

^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [RFC] building postgres with meson -v9
@ 2022-07-01 19:01  Justin Pryzby <pryzby@telsasoft.com>
  parent: Andres Freund <andres@anarazel.de>
  1 sibling, 1 reply; 10+ messages in thread

From: Justin Pryzby @ 2022-07-01 19:01 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: pgsql-hackers

vcvarsall isn't needed in cirrus' "check_world" scripts.

I'm missing any way to re/run cirrus only for msbuild OR ninja OR homegrown
with something more granular than "ci-os-only: windows".  (The same thing
applies to the mingw patch).

I'll mail shortly about ccache.

-- 
Justin





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [RFC] building postgres with meson -v9
@ 2022-07-01 19:16  Andres Freund <andres@anarazel.de>
  parent: Justin Pryzby <pryzby@telsasoft.com>
  0 siblings, 0 replies; 10+ messages in thread

From: Andres Freund @ 2022-07-01 19:16 UTC (permalink / raw)
  To: Justin Pryzby <pryzby@telsasoft.com>; +Cc: pgsql-hackers

Hi,

On 2022-07-01 14:01:11 -0500, Justin Pryzby wrote:
> vcvarsall isn't needed in cirrus' "check_world" scripts.

E.g. for the ecpg tests it isn't, except that we don't currently build ecpg on
windows. But I plan to fix that.


> I'm missing any way to re/run cirrus only for msbuild OR ninja OR homegrown
> with something more granular than "ci-os-only: windows".  (The same thing
> applies to the mingw patch).

Not sure that's really worth adding - I don't forsee merging all those
tasks. But I'm open to proposals.


> I'll mail shortly about ccache.

There's a meson PR that should fix some of the issues, need to test it...

Greetings,

Andres Freund





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [RFC] building postgres with meson -v9
@ 2022-07-06 09:03  Peter Eisentraut <peter.eisentraut@enterprisedb.com>
  parent: Andres Freund <andres@anarazel.de>
  1 sibling, 2 replies; 10+ messages in thread

From: Peter Eisentraut @ 2022-07-06 09:03 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; pgsql-hackers

On 01.07.22 11:33, Andres Freund wrote:
> Attached is an updated version of the meson patchset. There has been a steady
> stream of incremental work over the last month, with patches from Peter
> Eisentraut and Nazir Yavuz.
> 
> I tried to address the review comments Peter had downthread about the prep
> patches. The one that I know is still outstanding is that there's still
> different ways of passing output directories as parameters to a bunch of
> scripts added, will resolve that next (some have been fixed).

Here is my rough assessment of where we are with this patch set:

08b4330ded prereq: deal with \ paths in basebackup_to_shell tests.

This still needs clarification, per my previous review.

3bf5b317d5 meson: prereq: Specify output directory for psql sql help script.
2e5ed807f8 meson: prereq: ecpg: add and use output directory argument 
for parse.pl.
4e7fab01c5 meson: prereq: msvc: explicit output file for pgflex.pl
cdcd3da4c4 meson: prereq: add output path arg in generate-lwlocknames.pl
1f655486e4 meson: prereq: generate-errcodes.pl: accept output file
e834c48758 meson: prereq: unicode: allow to specify output directory.

You said you are still finalizing these.  I think we can move ahead with 
these once that is done.

9f4a9b1749 meson: prereq: move snowball_create.sql creation into perl file.

This looks ready, except I think it needs to be hooked into the
distprep target, since it's now a Perl script running at build time.

8951a6721e meson: prereq: Refactor dtrace postprocessing make rules

This looks ready.

bda6a45bae meson: prereq: Refactor PG_TEST_EXTRA logic in autoconf build

I understand the intention behind this, but I think it changes the
behavior in an undesirable way.  Before this patch, you can go into
src/test/ssl/ and run make check manually.  This was indeed the only
way to do it before PG_TEST_EXTRA.  With this patch, this would now
skip all the tests unless you set PG_TEST_EXTRA, even if you run the
specific test directly.

I think this needs a different idea.

eb852cc023 meson: prereq: Can we get away with not export-all'ing libraries?

This is also at <https://commitfest.postgresql.org/38/3396/;, which
hasn't seen any activity in a while.  I think this needs a resolution
one way or the other before we can proceed to the main act.

2cc276ced6 meson: prereq: add src/tools/gen_versioning_script.pl.

Note that in the make build system we can only use perl before
distprep.  So it's not clear whether a script like this would help
unify the code.  Of course, we could still use it with the
understanding that it will be separate.

351ac51a89 meson: prereq: remove LLVM_CONFIG from Makefile.global.in

This can be committed.  AFAICT, LLVM_CONFIG is only used within
configure.

dff7b5a960 meson: prereq: regress: allow to specify director containing 
expected files.

This could use a bit more explanation, but it doesn't look
controversial so far.

243f99da38 wip: split TESTDIR into two.

This one has already caused a bit of confusion, but the explanation at

https://www.postgresql.org/message-id/flat/20220601211112.td2ato4wjqf7afnv%40alap3.anarazel.de#1f250...

seems reasonable.  But it clearly needs further work.

88dd280835 meson: Add meson based buildsystem.
1ee3073a3c meson: ci: Build both with meson and as before.

These are for later. ;-)

In the meantime, also of interest to this effort:

- If we're planning to remove the postmaster symlink in PG16, maybe we
   should start a discussion on that.

- This patch is for unifying the list of languages in NLS, as
   previously discussed: https://commitfest.postgresql.org/38/3737/





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [RFC] building postgres with meson -v9
@ 2022-07-06 13:21  Andres Freund <andres@anarazel.de>
  parent: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
  1 sibling, 3 replies; 10+ messages in thread

From: Andres Freund @ 2022-07-06 13:21 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; +Cc: pgsql-hackers

Hi

On 2022-07-06 11:03:31 +0200, Peter Eisentraut wrote:
> On 01.07.22 11:33, Andres Freund wrote:
> > Attached is an updated version of the meson patchset. There has been a steady
> > stream of incremental work over the last month, with patches from Peter
> > Eisentraut and Nazir Yavuz.
> > 
> > I tried to address the review comments Peter had downthread about the prep
> > patches. The one that I know is still outstanding is that there's still
> > different ways of passing output directories as parameters to a bunch of
> > scripts added, will resolve that next (some have been fixed).
> 
> Here is my rough assessment of where we are with this patch set:
> 
> 08b4330ded prereq: deal with \ paths in basebackup_to_shell tests.
> 
> This still needs clarification, per my previous review.

Hm. I thought I had explained that bit, but apparently not. Well, it's pretty
simple - without this, the test fail on windows for me, as soon as one of the
binaries is in a directory with spaces (which is common on windows). Iimagine
what happens with e.g.
  qq{$gzip --fast > "$escaped_backup_path\\\\%f.gz"}
if $gzip contains spaces.


This doesn't happen currently on CI because nothing runs these tests on
windows yet.


> bda6a45bae meson: prereq: Refactor PG_TEST_EXTRA logic in autoconf build
> 
> I understand the intention behind this, but I think it changes the
> behavior in an undesirable way.  Before this patch, you can go into
> src/test/ssl/ and run make check manually.  This was indeed the only
> way to do it before PG_TEST_EXTRA.  With this patch, this would now
> skip all the tests unless you set PG_TEST_EXTRA, even if you run the
> specific test directly.

It's not a free lunch, I agree. But I think the downsides outweigh the upsides
by far. Not seeing that tests were skipped in the test output is quite
problematic imo. And with meson's testrunner we're going to need something
that deals with skipping these tests - and it's more important to have them
skipped, so that they show up in the test summary.

It's not like it's hard to set PG_TEST_EXTRA for a single command invocation?



> 243f99da38 wip: split TESTDIR into two.
> 
> This one has already caused a bit of confusion, but the explanation at
> 
> https://www.postgresql.org/message-id/flat/20220601211112.td2ato4wjqf7afnv%40alap3.anarazel.de#1f250...
> 
> seems reasonable.  But it clearly needs further work.

Yea. I kind of want to get some of the preparatory stuff out of the way first.


> 88dd280835 meson: Add meson based buildsystem.
> 1ee3073a3c meson: ci: Build both with meson and as before.
> 
> These are for later. ;-)
> 
> In the meantime, also of interest to this effort:
> 
> - If we're planning to remove the postmaster symlink in PG16, maybe we
>   should start a discussion on that.

Yea.


> - This patch is for unifying the list of languages in NLS, as
>   previously discussed: https://commitfest.postgresql.org/38/3737/

There seems little downside to doing so, so ...

Greetings,

Andres Freund





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [RFC] building postgres with meson -v9
@ 2022-07-07 10:09  Peter Eisentraut <peter.eisentraut@enterprisedb.com>
  parent: Andres Freund <andres@anarazel.de>
  2 siblings, 1 reply; 10+ messages in thread

From: Peter Eisentraut @ 2022-07-07 10:09 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: pgsql-hackers

On 06.07.22 15:21, Andres Freund wrote:
>> Here is my rough assessment of where we are with this patch set:
>>
>> 08b4330ded prereq: deal with \ paths in basebackup_to_shell tests.
>>
>> This still needs clarification, per my previous review.
> Hm. I thought I had explained that bit, but apparently not. Well, it's pretty
> simple - without this, the test fail on windows for me, as soon as one of the
> binaries is in a directory with spaces (which is common on windows). Iimagine
> what happens with e.g.
>    qq{$gzip --fast > "$escaped_backup_path\\\\%f.gz"}
> if $gzip contains spaces.
> 
> 
> This doesn't happen currently on CI because nothing runs these tests on
> windows yet.

Hmm, maybe this patch looked different the last time I saw it.  I see 
your point.

The quoting of "$gzip" is clearly necessary.

What about the backslash replacements s{\\}{/}g ?  Is that also required 
for passing the path through the shell?  If so, the treatment of $tar in 
that way doesn't seem necessary, since that doesn't get called through 
an intermediate shell.  (That would then also explain why $gzip in the 
pg_basebackup tests doesn't require that treatment, which had previously 
confused me.)

If my understanding of this is correct, then I suggest:

1. Add a comment to the $gzip =~ s{\\}{/}g ... line.
2. Remove the $tar =~ s{\\}{/}g ... line.
3. Backpatch to PG15.





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [RFC] building postgres with meson -v9
@ 2022-07-13 06:39  Peter Eisentraut <peter.eisentraut@enterprisedb.com>
  parent: Andres Freund <andres@anarazel.de>
  2 siblings, 0 replies; 10+ messages in thread

From: Peter Eisentraut @ 2022-07-13 06:39 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: pgsql-hackers

On 06.07.22 15:21, Andres Freund wrote:
>> - This patch is for unifying the list of languages in NLS, as
>>    previously discussed:https://commitfest.postgresql.org/38/3737/
> There seems little downside to doing so, so ...

This has been committed, so on the next rebase, the languages arguments 
can be removed from the i18n.gettext() calls.






^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [RFC] building postgres with meson -v9
@ 2022-07-13 11:52  Peter Eisentraut <peter.eisentraut@enterprisedb.com>
  parent: Andres Freund <andres@anarazel.de>
  2 siblings, 0 replies; 10+ messages in thread

From: Peter Eisentraut @ 2022-07-13 11:52 UTC (permalink / raw)
  To: Andres Freund <andres@anarazel.de>; +Cc: pgsql-hackers

On 06.07.22 15:21, Andres Freund wrote:
>> bda6a45bae meson: prereq: Refactor PG_TEST_EXTRA logic in autoconf build
>>
>> I understand the intention behind this, but I think it changes the
>> behavior in an undesirable way.  Before this patch, you can go into
>> src/test/ssl/ and run make check manually.  This was indeed the only
>> way to do it before PG_TEST_EXTRA.  With this patch, this would now
>> skip all the tests unless you set PG_TEST_EXTRA, even if you run the
>> specific test directly.
> It's not a free lunch, I agree. But I think the downsides outweigh the upsides
> by far. Not seeing that tests were skipped in the test output is quite
> problematic imo. And with meson's testrunner we're going to need something
> that deals with skipping these tests - and it's more important to have them
> skipped, so that they show up in the test summary.
> 
> It's not like it's hard to set PG_TEST_EXTRA for a single command invocation?

It's probably ok.  I have it set in my environment all the time anyway, 
so it wouldn't affect me.  But it's the sort of thing people might be 
particular about, so I thought it was worth pointing out.






^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [RFC] building postgres with meson -v9
@ 2022-07-14 20:04  Andres Freund <andres@anarazel.de>
  parent: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
  0 siblings, 0 replies; 10+ messages in thread

From: Andres Freund @ 2022-07-14 20:04 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; +Cc: pgsql-hackers

Hi,

On 2022-07-07 12:09:32 +0200, Peter Eisentraut wrote:
> On 06.07.22 15:21, Andres Freund wrote:
> > > Here is my rough assessment of where we are with this patch set:
> > > 
> > > 08b4330ded prereq: deal with \ paths in basebackup_to_shell tests.
> > > 
> > > This still needs clarification, per my previous review.
> > Hm. I thought I had explained that bit, but apparently not. Well, it's pretty
> > simple - without this, the test fail on windows for me, as soon as one of the
> > binaries is in a directory with spaces (which is common on windows). Iimagine
> > what happens with e.g.
> >    qq{$gzip --fast > "$escaped_backup_path\\\\%f.gz"}
> > if $gzip contains spaces.
> > 
> > 
> > This doesn't happen currently on CI because nothing runs these tests on
> > windows yet.
> 
> Hmm, maybe this patch looked different the last time I saw it.

Don't think it had changed since I wrote it first.


> The quoting of "$gzip" is clearly necessary.
> 
> What about the backslash replacements s{\\}{/}g ?  Is that also required for
> passing the path through the shell?

I don't recall the details, but it's definitely needed for embedding it into
postgresql.conf. We could double the escapes instead, but that doesn't seem an
improvement (and wouldn't work when passing it to the shell anymore).


> If so, the treatment of $tar in that
> way doesn't seem necessary, since that doesn't get called through an
> intermediate shell.  (That would then also explain why $gzip in the
> pg_basebackup tests doesn't require that treatment, which had previously
> confused me.)

Yea, it doesn't immediately look like it's needed, and the test passes without
it. I guess I might just have tried to be complete...

Greetings,

Andres Freund





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: [RFC] building postgres with meson -v9
@ 2022-07-15 16:05  Andres Freund <andres@anarazel.de>
  parent: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
  1 sibling, 0 replies; 10+ messages in thread

From: Andres Freund @ 2022-07-15 16:05 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; +Cc: pgsql-hackers

Hi,

On 2022-07-13 08:39:45 +0200, Peter Eisentraut wrote:
> On 06.07.22 15:21, Andres Freund wrote:
> > > - This patch is for unifying the list of languages in NLS, as
> > >    previously discussed:https://commitfest.postgresql.org/38/3737/
> > There seems little downside to doing so, so ...
> 
> This has been committed, so on the next rebase, the languages arguments can
> be removed from the i18n.gettext() calls.

That's done in v10 I posted yesterday.


On 2022-07-06 11:03:31 +0200, Peter Eisentraut wrote:
> 3bf5b317d5 meson: prereq: Specify output directory for psql sql help script.
> 2e5ed807f8 meson: prereq: ecpg: add and use output directory argument for
> parse.pl.
> 4e7fab01c5 meson: prereq: msvc: explicit output file for pgflex.pl
> cdcd3da4c4 meson: prereq: add output path arg in generate-lwlocknames.pl
> 1f655486e4 meson: prereq: generate-errcodes.pl: accept output file
> e834c48758 meson: prereq: unicode: allow to specify output directory.
> 
> You said you are still finalizing these.  I think we can move ahead with
> these once that is done.

I tried to address the pending things in these patches.


> 9f4a9b1749 meson: prereq: move snowball_create.sql creation into perl file.
> 
> This looks ready, except I think it needs to be hooked into the
> distprep target, since it's now a Perl script running at build time.

Done. I vacillated between doing the distprep rule in
src/backend/snowball/Makefile (as most things outside of the backend do) and
src/backend/Makefile (most backend things). Ended up with doing it in
snowball/Makefile.

Greetings,

Andres Freund





^ permalink  raw  reply  [nested|flat] 10+ messages in thread


end of thread, other threads:[~2022-07-15 16:05 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-07-01 09:33 Re: [RFC] building postgres with meson -v9 Andres Freund <andres@anarazel.de>
2022-07-01 19:01 ` Justin Pryzby <pryzby@telsasoft.com>
2022-07-01 19:16   ` Andres Freund <andres@anarazel.de>
2022-07-06 09:03 ` Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2022-07-06 13:21   ` Andres Freund <andres@anarazel.de>
2022-07-07 10:09     ` Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2022-07-14 20:04       ` Andres Freund <andres@anarazel.de>
2022-07-13 06:39     ` Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2022-07-13 11:52     ` Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2022-07-15 16:05   ` Andres Freund <andres@anarazel.de>

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