Re: Minor meson gripe

From: Andres Freund <andres(at)anarazel(dot)de>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Minor meson gripe
Date: 2023-02-09 20:56:05
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 2023-02-09 11:01:31 -0800, Peter Geoghegan wrote:
> Currently, meson has a test suite named "setup". According to the
> Wiki, this is needed to get something equivalent to "make check", by
> running "meson test -v --suite setup --suite regress".


> Some questions about this:
> * Isn't it confusing that we have a suite by that name, given that we
> also need to use the unrelated --setup flag for some nearby testing
> recipes?

Hm. I don't find it particularly confusing, but I don't think I'm a good judge
of that, too close.

> * Why do we actually need a "setup" suite?
> Offhand it appears that a simple "meson test -v --suite regress" works
> just as well. Have I missed something?

It'll work, but only if you have run setup before. And it'll not use changed C

The setup suite creates the installation in tmp_install/. So if you haven't
run the tests before, it'll fail due to that missing. If you have run it
before, but have changed code, it'll not get used.

The background for the issue is that while meson test supports dependencies
for each test, and will build exactly the required dependencies if you run
individual tests with meson test, it unfortunately also adds all the test
dependencies to the default ninja target.

That's mostly for historical reasons, because initially meson didn't support
dependencies for tests. There's recent work on changing that though.

Creating the temp installation every time you run 'ninja' would not be
nice. On slower machines it can take quite a while.

I think medium term we should just stop requiring a temporary install to run
tests, it's substantial, unnecessary, overhead, and it requires us to build
way too much to run basic tests. It'd not take a whole lot to make that work:

- a search path for finding extensions, which'd be very useful for other
reasons as well

- a way to tell 'postgres', 'initdb' etc, which use find_other_exec(), that
they should use PATH

- a way to tell initdb where to find things like postgres.bki, postgres where
it can find timezone data, etc.


Andres Freund

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2023-02-09 20:59:29 pg_usleep for multisecond delays
Previous Message Andres Freund 2023-02-09 20:38:55 Re: MacOS: xsltproc fails with "warning: failed to load external entity"