Meson rebuilds and reinstalls autoinc and refint libraries during regression tests.

From: Zharkov Roman <r(dot)zharkov(at)postgrespro(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Meson rebuilds and reinstalls autoinc and refint libraries during regression tests.
Date: 2024-11-21 06:40:18
Message-ID: b3e700a20e56aa9b28f7bd7a027f5219@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello!

Accidentally I found that shared libraries autoinc.so and refint.so
rewrites in the "tmp_install" folder during the regression tests.
This happens because these libraries builds again for regression tests
purposes and rewrites by the "install_test_files" test [0].

I tried to change this bahavior, but there are few problems:
It seems, Meson doesn't have a function to just copy a file from one
build directory to another.
There is no way to install the product of the "shared_module()" function
into the two different locations.
"configure_file()" function in "copy mode" runs at setup time and cannot
be used.
"fs.copyfile()" function runs at build time, but I couldn't find the way
to start it after the building of necessary modules. So this function
fails with the "file not found" error. Also it needs the Meson version
>= 0.64

And also there is no single cross platform copy program. I tried to use
"cp" on Linux and "cmd /c copy..." on Windows, but the code has
increased in size very much. Especially, after fixing the slash in the
return value of the "meson.current_build_dir()" function on Windows.
That slash arrives from the "subdir('src/test')" call [1].

To avoid double building of autoinc and refint libraries I suggest to
use the "custom_target()" Meson function and own copy program. The
"custom_target()" function can depends on contrib modules and use any
script to just a copy libraries to the regression tests build directory.
I included the patch which adds copy.py script into the regression tests
directory and uses it to "build" autoinc and refint modules.

What do you think?

Thanks!

Best regards, Roman Zharkov.

[0]
https://github.com/postgres/postgres/blob/f95da9f0e091ddbc5d50ec6c11be772da009b24e/src/test/regress/meson.build#L46
[1]
https://github.com/postgres/postgres/blob/f95da9f0e091ddbc5d50ec6c11be772da009b24e/meson.build#L3095

Attachment Content-Type Size
Avoid-rebuilding-of-spi-modules.patch text/x-diff 1.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message torikoshia 2024-11-21 06:43:22 Re: Add reject_limit option to file_fdw
Previous Message Alexander Korotkov 2024-11-21 06:34:15 Re: POC, WIP: OR-clause support for indexes