Thread: meson and tmp_install

meson and tmp_install

From
Andrew Dunstan
Date:
Yesterday when testing a patch I got annoyed when my test failed. I
tested it like this:

    meson test ldap_password_func/001_mutated_bindpasswd

It turned out that I needed to do this:

    meson test tmp_install ldap_password_func/001_mutated_bindpasswd

The Makefile equivalent ensures that you have a tmp_install without
having to request to explicitly. It would be nice if we could make meson
do the same thing, and also honor NO_TEMP_INSTALL if set.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com




Re: meson and tmp_install

From
Andres Freund
Date:
Hi,

On 2022-12-20 07:12:04 -0500, Andrew Dunstan wrote:
> Yesterday when testing a patch I got annoyed when my test failed. I
> tested it like this:
> 
>     meson test ldap_password_func/001_mutated_bindpasswd
> 
> It turned out that I needed to do this:
> 
>     meson test tmp_install ldap_password_func/001_mutated_bindpasswd
> 
> The Makefile equivalent ensures that you have a tmp_install without
> having to request to explicitly. It would be nice if we could make meson
> do the same thing, and also honor NO_TEMP_INSTALL if set.

I would like that too, but there's no easy fix that doesn't have
downsides as far as I am aware. We could make the temp install a build
target that the tests depend on, but for historical reasons in meson
that means that the 'all' target depends on temp-install. Which isn't
great.

My current thinking is that we should get away from needing the
temporary install and instead allow to run the tests against the build
directory itself. The temp-install adds a fair bit of overhead and
failure potential. The only reason we need it is that a) initdb and a
few other programs insist that postgres needs to be in the same
directory b) contrib modules currently need to reside in one single
directory.

Greetings,

Andres Freund



Re: meson and tmp_install

From
Nikita Malakhov
Date:
Hi!

Didn't know where to ask, so I've chosen this thread - there is no any
documentation on meson build platform in PostgreSQL docs. Is this
okay? For me it was a surprise when the meson platform was added,
and I have had to spend some time sweeping through meson docs
when I'd added new source files, to build Postgres successfully.

Thanks!

On Tue, Dec 20, 2022 at 8:30 PM Andres Freund <andres@anarazel.de> wrote:
Hi,

On 2022-12-20 07:12:04 -0500, Andrew Dunstan wrote:
> Yesterday when testing a patch I got annoyed when my test failed. I
> tested it like this:
>
>     meson test ldap_password_func/001_mutated_bindpasswd
>
> It turned out that I needed to do this:
>
>     meson test tmp_install ldap_password_func/001_mutated_bindpasswd
>
> The Makefile equivalent ensures that you have a tmp_install without
> having to request to explicitly. It would be nice if we could make meson
> do the same thing, and also honor NO_TEMP_INSTALL if set.

I would like that too, but there's no easy fix that doesn't have
downsides as far as I am aware. We could make the temp install a build
target that the tests depend on, but for historical reasons in meson
that means that the 'all' target depends on temp-install. Which isn't
great.

My current thinking is that we should get away from needing the
temporary install and instead allow to run the tests against the build
directory itself. The temp-install adds a fair bit of overhead and
failure potential. The only reason we need it is that a) initdb and a
few other programs insist that postgres needs to be in the same
directory b) contrib modules currently need to reside in one single
directory.

Greetings,

Andres Freund




--
Regards,
Nikita Malakhov
Postgres Professional 

Re: meson and tmp_install

From
Andres Freund
Date:
Hi,

On 2022-12-20 21:11:26 +0300, Nikita Malakhov wrote:
> Didn't know where to ask, so I've chosen this thread - there is no any
> documentation on meson build platform in PostgreSQL docs.

There is now:
https://www.postgresql.org/docs/devel/install-meson.html

Needs further work, but it's a start.


> Is this okay? For me it was a surprise when the meson platform was
> added

It's been discussed on the list for a year or so before it was
added. It's a large change, so unfortunately it's not something that I
could get done in a single day, with perfect docs from the get go.

Greetings,

Andres Freund



Re: meson and tmp_install

From
Nikita Malakhov
Date:
Hi!

That's great, thanks! Discussion list is very long so I've missed this topic.
Just a suggestion - I've checked the link above, maybe there should be
added a small part on where build files are located and how to add new
sources for successful build?

On Tue, Dec 20, 2022 at 9:22 PM Andres Freund <andres@anarazel.de> wrote:
Hi,

On 2022-12-20 21:11:26 +0300, Nikita Malakhov wrote:
> Didn't know where to ask, so I've chosen this thread - there is no any
> documentation on meson build platform in PostgreSQL docs.

There is now:
https://www.postgresql.org/docs/devel/install-meson.html

Needs further work, but it's a start.


> Is this okay? For me it was a surprise when the meson platform was
> added

It's been discussed on the list for a year or so before it was
added. It's a large change, so unfortunately it's not something that I
could get done in a single day, with perfect docs from the get go.

Greetings,

Andres Freund


--
Regards,
Nikita Malakhov
Postgres Professional