Re: meson: Optionally disable installation of test modules

2023-03-08 Thread Andrew Dunstan


On 2023-03-08 We 08:49, Nazir Bilal Yavuz wrote:

Hi,

On Mon, 6 Mar 2023 at 18:30, Andrew Dunstan  wrote:

There are two separate issues here, but let's deal with the Windows issue. 
Attached is the log output and also a listing of the runpython directory in the 
build directory.

Thanks for the logs but I couldn't understand the problem. Is there a
way to reproduce this?



Problem now apparently resolved.


cheers


andrew

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


Re: meson: Optionally disable installation of test modules

2023-03-08 Thread Nazir Bilal Yavuz
Hi,

On Mon, 6 Mar 2023 at 18:30, Andrew Dunstan  wrote:
> There are two separate issues here, but let's deal with the Windows issue. 
> Attached is the log output and also a listing of the runpython directory in 
> the build directory.

Thanks for the logs but I couldn't understand the problem. Is there a
way to reproduce this?

For the Linux problem, Andres's patch solves this but you need to run
an extra command. [1]

After applying Andres's patch, you need to run:
$ meson compile install-test-files -C $pgsql
before running the 'running tests'.

I tested on my local and
..
$ meson compile install-test-files -C $pgsql
$ meson test -C $pgsql --setup running --print-errorlogs --no-rebuild
--logbase installcheckworld --no-suite regress-running --no-suite
isolation-running --no-suite ecpg-running
passed successfully.

[1] 
https://www.postgresql.org/message-id/20230308012940.edexipb3vqylcu6r%40awork3.anarazel.de

Regards,
Nazir Bilal Yavuz
Microsoft




Re: meson: Optionally disable installation of test modules

2023-03-06 Thread Nazir Bilal Yavuz
Hi,

On Fri, 3 Mar 2023 at 22:43, Andrew Dunstan  wrote:
> These changes have broken the buildfarm adaptation work in different ways on 
> different platforms.
>
> On Windows (but not Linux), the install_test_files are apparently getting 
> installed under runpython in the build directory rather than in the 
> tmp_install location, so those tests fail. Meanwhile, it's not clear to me 
> how to install them in a standard installation, which means that on Linux the 
> corresponding -running tests are failing.

Is there a way to see the 'meson-logs/testlog.txt' file under the
build directory?

Regards,
Nazir Bilal Yavuz
Microsoft




Re: meson: Optionally disable installation of test modules

2023-03-03 Thread Andrew Dunstan


On 2023-03-03 Fr 01:47, Peter Eisentraut wrote:

On 02.03.23 08:09, Nazir Bilal Yavuz wrote:

On Wed, 1 Mar 2023 at 22:21, Peter Eisentraut
 wrote:


Looks good to me.  I did a small pass over it to adjust some namings.
For example, I renamed test_install_files to test_install_data, so it's
consistent with the overall meson naming:

-install_data(
+test_install_data += files(

Let me know if you have any concerns about this version. Otherwise, I'm
happy to commit it.


That makes sense, thanks!


committed





These changes have broken the buildfarm adaptation work in different 
ways on different platforms.


On Windows (but not Linux), the install_test_files are apparently 
getting installed under runpython in the build directory rather than in 
the tmp_install location, so those tests fail. Meanwhile, it's not clear 
to me how to install them in a standard installation, which means that 
on Linux the corresponding -running tests are failing.



cheers


andrew


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


Re: meson: Optionally disable installation of test modules

2023-03-02 Thread Peter Eisentraut

On 02.03.23 08:09, Nazir Bilal Yavuz wrote:

On Wed, 1 Mar 2023 at 22:21, Peter Eisentraut
 wrote:


Looks good to me.  I did a small pass over it to adjust some namings.
For example, I renamed test_install_files to test_install_data, so it's
consistent with the overall meson naming:

-install_data(
+test_install_data += files(

Let me know if you have any concerns about this version.  Otherwise, I'm
happy to commit it.


That makes sense, thanks!


committed





Re: meson: Optionally disable installation of test modules

2023-03-01 Thread Nazir Bilal Yavuz
Hi,

On Wed, 1 Mar 2023 at 22:21, Peter Eisentraut
 wrote:
>
> Looks good to me.  I did a small pass over it to adjust some namings.
> For example, I renamed test_install_files to test_install_data, so it's
> consistent with the overall meson naming:
>
> -install_data(
> +test_install_data += files(
>
> Let me know if you have any concerns about this version.  Otherwise, I'm
> happy to commit it.

That makes sense, thanks!

Regards,
Nazir Bilal Yavuz
Microsoft




Re: meson: Optionally disable installation of test modules

2023-03-01 Thread Peter Eisentraut

On 23.02.23 19:06, Nazir Bilal Yavuz wrote:

Hi,

Thanks for the review.

On Mon, 20 Feb 2023 at 21:44, Peter Eisentraut
 wrote:


I tested this a bit.  It works fine.  The approach makes sense to me.

The install_additional_files script could be simplified a bit.  You
could use os.makedirs(dest, exist_ok=True) and avoid the error checking.
I don't think any callers try to copy a directory source, so the
shutil.copytree() stuff isn't necessary.  Run pycodestyle over the
script.  And let's put the script into src/tools/ like the other support
scripts.



I updated the patch in line with your comments.


Looks good to me.  I did a small pass over it to adjust some namings. 
For example, I renamed test_install_files to test_install_data, so it's 
consistent with the overall meson naming:


-install_data(
+test_install_data += files(

Let me know if you have any concerns about this version.  Otherwise, I'm 
happy to commit it.
From 661a0f5741b7f368f0f99921d819fd8dcf6b0431 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut 
Date: Wed, 1 Mar 2023 20:03:36 +0100
Subject: [PATCH v4] meson: prevent installation of test files during main
 install

---
 meson.build   | 32 ++-
 src/backend/meson.build   |  7 
 src/test/modules/delay_execution/meson.build  |  6 ++--
 src/test/modules/dummy_index_am/meson.build   |  9 ++
 src/test/modules/dummy_seclabel/meson.build   |  9 ++
 src/test/modules/plsample/meson.build | 10 ++
 src/test/modules/spgist_name_ops/meson.build  | 10 ++
 .../ssl_passphrase_callback/meson.build   |  6 ++--
 src/test/modules/test_bloomfilter/meson.build |  9 ++
 .../modules/test_copy_callbacks/meson.build   |  9 ++
 .../modules/test_custom_rmgrs/meson.build |  9 ++
 src/test/modules/test_ddl_deparse/meson.build |  9 ++
 src/test/modules/test_extensions/meson.build  |  4 +--
 .../modules/test_ginpostinglist/meson.build   |  9 ++
 src/test/modules/test_integerset/meson.build  |  9 ++
 src/test/modules/test_lfind/meson.build   |  9 ++
 src/test/modules/test_oat_hooks/meson.build   |  6 ++--
 src/test/modules/test_parser/meson.build  |  9 ++
 .../test_pg_db_role_setting/meson.build   |  9 ++
 src/test/modules/test_pg_dump/meson.build |  4 +--
 src/test/modules/test_predtest/meson.build|  9 ++
 src/test/modules/test_rbtree/meson.build  |  9 ++
 src/test/modules/test_regex/meson.build   |  9 ++
 src/test/modules/test_rls_hooks/meson.build   |  6 ++--
 src/test/modules/test_shm_mq/meson.build  |  9 ++
 src/test/modules/test_slru/meson.build|  9 ++
 src/test/modules/worker_spi/meson.build   |  9 ++
 src/test/regress/meson.build  | 18 ---
 src/tools/install_test_files  | 28 
 29 files changed, 139 insertions(+), 151 deletions(-)
 create mode 100644 src/tools/install_test_files

diff --git a/meson.build b/meson.build
index 26be83afb6..87cb974ad7 100644
--- a/meson.build
+++ b/meson.build
@@ -2801,6 +2801,10 @@ backend_code = declare_dependency(
   dependencies: os_deps + backend_both_deps + backend_deps,
 )
 
+# install these files only during test, not main install
+test_install_data = []
+test_install_libs = []
+
 # src/backend/meson.build defines backend_mod_code used for extension
 # libraries.
 
@@ -2821,6 +2825,10 @@ subdir('doc/src/sgml')
 
 generated_sources_ac += {'': ['GNUmakefile']}
 
+# After processing src/test, add test_install_libs to the testprep_targets
+# to build them
+testprep_targets += test_install_libs
+
 
 # If there are any files in the source directory that we also generate in the
 # build directory, they might get preferred over the newly generated files,
@@ -2903,14 +2911,36 @@ meson_install_args = meson_args + ['install'] + {
 'muon': []
 }[meson_impl]
 
+# setup tests should  be run first,
+# so define priority for these
+setup_tests_priority = 100
 test('tmp_install',
 meson_bin, args: meson_install_args ,
 env: {'DESTDIR':test_install_destdir},
-priority: 100,
+priority: setup_tests_priority,
 timeout: 300,
 is_parallel: false,
 suite: ['setup'])
 
+# get full paths of test_install_libs to copy them
+test_install_libs_fp = []
+foreach lib: test_install_libs
+  test_install_libs_fp += lib.full_path()
+endforeach
+
+install_test_files = files('src/tools/install_test_files')
+test('install_test_files',
+python, args: [
+  install_test_files,
+  '--datadir', test_install_location / contrib_data_args['install_dir'],
+  '--libdir', test_install_location / dir_lib_pkg,
+  '--install-data', test_install_data,
+  '--install-libs', test_install_libs_fp,
+],
+priority: setup_tests_priority,
+is_parallel: false,
+suite: ['setup'])
+
 test_result_dir = meson.build_root() / 'testrun'
 
 
diff --git a/src/backend/meson.build b/src/backend/meson.build
index 

Re: meson: Optionally disable installation of test modules

2023-02-25 Thread Andres Freund
Hi,

On 2023-02-22 10:09:10 +0100, Peter Eisentraut wrote:
> On 20.02.23 20:48, Andres Freund wrote:
> > On 2023-02-20 19:43:56 +0100, Peter Eisentraut wrote:
> > > I don't think any callers try to copy a directory source, so the
> > > shutil.copytree() stuff isn't necessary.
> > 
> > I'd like to use it for installing docs outside of the normal install
> > target. Of course we could add the ability at a later point, but that seems 
> > a
> > bit pointless back-forth to me.
> 
> I figured it could be useful as a general installation tool, but the current
> script has specific command-line options for this specific purpose, so I
> don't think it would work for your purpose anyway.
> 
> For the purpose here, we really just need something that does
> 
> for src in sys.argv[1:-1]:
> shutil.copy2(src, sys.argv[-1])
> 
> But we need to call it twice for different sets of files and destinations,
> and since we can't have more than one command per test, we either need to
> write two "tests" or write a wrapper script like the one we have here.

How about making the arguments
  --install target-path list of files or directories
  --install another-path another set of files


> I don't know what the best way to slice this is, but it's not a lot of code
> that we couldn't move around again in the future.

That's true. The main work here is going through all the test modules, and
that won't be affected by changing the argument syntax.

Greetings,

Andres Freund




Re: meson: Optionally disable installation of test modules

2023-02-23 Thread Nazir Bilal Yavuz
Hi,

Thanks for the review.

On Mon, 20 Feb 2023 at 21:44, Peter Eisentraut
 wrote:
>
> I tested this a bit.  It works fine.  The approach makes sense to me.
>
> The install_additional_files script could be simplified a bit.  You
> could use os.makedirs(dest, exist_ok=True) and avoid the error checking.
>I don't think any callers try to copy a directory source, so the
> shutil.copytree() stuff isn't necessary.  Run pycodestyle over the
> script.  And let's put the script into src/tools/ like the other support
> scripts.
>

I updated the patch in line with your comments.

Regards,
Nazir Bilal Yavuz
Microsoft
From 7804aa928de7595cb89bfd7668952e1e1fe48038 Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz 
Date: Thu, 23 Feb 2023 20:35:22 +0300
Subject: [PATCH v3] meson: prevent installation of test files during main
 install

---
 meson.build   | 32 ++-
 src/backend/meson.build   |  7 
 src/test/modules/delay_execution/meson.build  |  6 ++--
 src/test/modules/dummy_index_am/meson.build   |  9 ++
 src/test/modules/dummy_seclabel/meson.build   |  9 ++
 src/test/modules/plsample/meson.build | 10 ++
 src/test/modules/spgist_name_ops/meson.build  | 10 ++
 .../ssl_passphrase_callback/meson.build   |  6 ++--
 src/test/modules/test_bloomfilter/meson.build |  9 ++
 .../modules/test_copy_callbacks/meson.build   |  9 ++
 .../modules/test_custom_rmgrs/meson.build |  9 ++
 src/test/modules/test_ddl_deparse/meson.build |  9 ++
 src/test/modules/test_extensions/meson.build  |  4 +--
 .../modules/test_ginpostinglist/meson.build   |  9 ++
 src/test/modules/test_integerset/meson.build  |  9 ++
 src/test/modules/test_lfind/meson.build   |  9 ++
 src/test/modules/test_oat_hooks/meson.build   |  6 ++--
 src/test/modules/test_parser/meson.build  |  9 ++
 .../test_pg_db_role_setting/meson.build   |  9 ++
 src/test/modules/test_pg_dump/meson.build |  4 +--
 src/test/modules/test_predtest/meson.build|  9 ++
 src/test/modules/test_rbtree/meson.build  |  9 ++
 src/test/modules/test_regex/meson.build   |  9 ++
 src/test/modules/test_rls_hooks/meson.build   |  6 ++--
 src/test/modules/test_shm_mq/meson.build  |  9 ++
 src/test/modules/test_slru/meson.build|  9 ++
 src/test/modules/worker_spi/meson.build   |  9 ++
 src/test/regress/meson.build  | 18 ---
 src/tools/install_additional_files| 28 
 29 files changed, 139 insertions(+), 151 deletions(-)
 create mode 100644 src/tools/install_additional_files

diff --git a/meson.build b/meson.build
index f5347044526..1e4b3d5445a 100644
--- a/meson.build
+++ b/meson.build
@@ -2791,6 +2791,10 @@ backend_code = declare_dependency(
   dependencies: os_deps + backend_both_deps + backend_deps,
 )
 
+# install these files only during test, not main install
+test_install_files = []
+test_install_libs = []
+
 # src/backend/meson.build defines backend_mod_code used for extension
 # libraries.
 
@@ -2811,6 +2815,10 @@ subdir('doc/src/sgml')
 
 generated_sources_ac += {'': ['GNUmakefile']}
 
+# After processing src/test, add test_install_libs to the testprep_targets
+# to build them
+testprep_targets += test_install_libs
+
 
 # If there are any files in the source directory that we also generate in the
 # build directory, they might get preferred over the newly generated files,
@@ -2893,14 +2901,36 @@ meson_install_args = meson_args + ['install'] + {
 'muon': []
 }[meson_impl]
 
+# setup tests should  be run first,
+# so define priority for these
+setup_tests_priority = 100
 test('tmp_install',
 meson_bin, args: meson_install_args ,
 env: {'DESTDIR':test_install_destdir},
-priority: 100,
+priority: setup_tests_priority,
 timeout: 300,
 is_parallel: false,
 suite: ['setup'])
 
+# get full paths of test_install_libs to copy them
+test_install_libs_fp = []
+foreach lib: test_install_libs
+  test_install_libs_fp += lib.full_path()
+endforeach
+
+install_additional_files = files('src/tools/install_additional_files')
+test('install_additional_files',
+python, args: [
+  install_additional_files,
+  '--sharedir', test_install_location / contrib_data_args['install_dir'],
+  '--libdir', test_install_location / dir_lib_pkg,
+  '--install_files', test_install_files,
+  '--install_libs', test_install_libs_fp,
+],
+priority: setup_tests_priority,
+is_parallel: false,
+suite: ['setup'])
+
 test_result_dir = meson.build_root() / 'testrun'
 
 
diff --git a/src/backend/meson.build b/src/backend/meson.build
index 4fdd209b826..ccfc382fcfd 100644
--- a/src/backend/meson.build
+++ b/src/backend/meson.build
@@ -180,12 +180,19 @@ backend_mod_code = declare_dependency(
   dependencies: backend_mod_deps,
 )
 
+# normal extension modules
 pg_mod_args = default_mod_args + {
   'dependencies': 

Re: meson: Optionally disable installation of test modules

2023-02-22 Thread Peter Eisentraut

On 20.02.23 20:48, Andres Freund wrote:

On 2023-02-20 19:43:56 +0100, Peter Eisentraut wrote:

I don't think any callers try to copy a directory source, so the
shutil.copytree() stuff isn't necessary.


I'd like to use it for installing docs outside of the normal install
target. Of course we could add the ability at a later point, but that seems a
bit pointless back-forth to me.


I figured it could be useful as a general installation tool, but the 
current script has specific command-line options for this specific 
purpose, so I don't think it would work for your purpose anyway.


For the purpose here, we really just need something that does

for src in sys.argv[1:-1]:
shutil.copy2(src, sys.argv[-1])

But we need to call it twice for different sets of files and 
destinations, and since we can't have more than one command per test, we 
either need to write two "tests" or write a wrapper script like the one 
we have here.


I don't know what the best way to slice this is, but it's not a lot of 
code that we couldn't move around again in the future.






Re: meson: Optionally disable installation of test modules

2023-02-20 Thread Andres Freund
On 2023-02-20 19:43:56 +0100, Peter Eisentraut wrote:
> I don't think any callers try to copy a directory source, so the
> shutil.copytree() stuff isn't necessary.

I'd like to use it for installing docs outside of the normal install
target. Of course we could add the ability at a later point, but that seems a
bit pointless back-forth to me.




Re: meson: Optionally disable installation of test modules

2023-02-20 Thread Peter Eisentraut

On 09.02.23 16:30, Nazir Bilal Yavuz wrote:

On 2/8/23 13:30, Peter Eisentraut wrote:


If you feel that your patch is ready, please add it to the commit 
fest. I look forward to reviewing it.



Thanks! Commit fest entry link: https://commitfest.postgresql.org/42/4173/


I tested this a bit.  It works fine.  The approach makes sense to me.

The install_additional_files script could be simplified a bit.  You 
could use os.makedirs(dest, exist_ok=True) and avoid the error checking. 
  I don't think any callers try to copy a directory source, so the 
shutil.copytree() stuff isn't necessary.  Run pycodestyle over the 
script.  And let's put the script into src/tools/ like the other support 
scripts.






Re: meson: Optionally disable installation of test modules

2023-02-09 Thread Nazir Bilal Yavuz

Hi,


On 2/8/23 13:30, Peter Eisentraut wrote:


If you feel that your patch is ready, please add it to the commit 
fest. I look forward to reviewing it.



Thanks! Commit fest entry link: https://commitfest.postgresql.org/42/4173/


Regards,
Nazir Bilal Yavuz
Microsoft





Re: meson: Optionally disable installation of test modules

2023-02-08 Thread Peter Eisentraut

On 01.02.23 13:41, Nazir Bilal Yavuz wrote:

On 1/31/23 11:44, Peter Eisentraut wrote:

On 30.01.23 18:42, Andres Freund wrote:

Bilal, with a bit of help by me, worked on an alternative approach to
this. It's a lot more verbose in the initial change, but wouldn't 
increase the

amount of work/lines for new test modules. The main advantage is that we
wouldn't have disable the modules by default, which I think would be 
quite

likely to result in plenty people not running the tests.

Sending a link instead of attaching, in case you already registered a 
cfbot entry:

https://github.com/anarazel/postgres/commit/d1d192a860da39af9aa63d7edf643eed07c4

Probably worth adding an install-test-modules target for manual use.


Looks like a good idea.  I'm happy to proceed along that line.


I am adding a patch of an alternative approach. Also, I updated the 
commit at the link by adding regress_module, autoinc_regress and 
refint_regress to the test_install_libs.


If you feel that your patch is ready, please add it to the commit fest. 
I look forward to reviewing it.






Re: meson: Optionally disable installation of test modules

2023-02-01 Thread Nazir Bilal Yavuz

Hi,

On 1/31/23 11:44, Peter Eisentraut wrote:

On 30.01.23 18:42, Andres Freund wrote:

Bilal, with a bit of help by me, worked on an alternative approach to
this. It's a lot more verbose in the initial change, but wouldn't 
increase the

amount of work/lines for new test modules. The main advantage is that we
wouldn't have disable the modules by default, which I think would be 
quite

likely to result in plenty people not running the tests.

Sending a link instead of attaching, in case you already registered a 
cfbot entry:
https://github.com/anarazel/postgres/commit/d1d192a860da39af9aa63d7edf643eed07c4 



Probably worth adding an install-test-modules target for manual use.


Looks like a good idea.  I'm happy to proceed along that line.


I am adding a patch of an alternative approach. Also, I updated the 
commit at the link by adding regress_module, autoinc_regress and 
refint_regress to the test_install_libs.



Regards,
Nazir Bilal Yavuz
Microsoft
From 9e5d2a7f2e81360d728d02abf42959b529942ba3 Mon Sep 17 00:00:00 2001
From: Nazir Bilal Yavuz 
Date: Wed, 1 Feb 2023 14:10:20 +0300
Subject: [PATCH v2] meson: prevent installation of test files during main
 install

---
 meson.build   | 32 +-
 src/backend/meson.build   |  7 
 src/test/install_additional_files | 33 +++
 src/test/modules/delay_execution/meson.build  |  6 ++--
 src/test/modules/dummy_index_am/meson.build   |  9 ++---
 src/test/modules/dummy_seclabel/meson.build   |  9 ++---
 src/test/modules/plsample/meson.build | 10 ++
 src/test/modules/spgist_name_ops/meson.build  | 10 ++
 .../ssl_passphrase_callback/meson.build   |  6 ++--
 src/test/modules/test_bloomfilter/meson.build |  9 ++---
 .../modules/test_copy_callbacks/meson.build   |  9 ++---
 .../modules/test_custom_rmgrs/meson.build |  9 ++---
 src/test/modules/test_ddl_deparse/meson.build |  9 ++---
 src/test/modules/test_extensions/meson.build  |  4 +--
 .../modules/test_ginpostinglist/meson.build   |  9 ++---
 src/test/modules/test_integerset/meson.build  |  9 ++---
 src/test/modules/test_lfind/meson.build   |  9 ++---
 src/test/modules/test_oat_hooks/meson.build   |  6 ++--
 src/test/modules/test_parser/meson.build  |  9 ++---
 .../test_pg_db_role_setting/meson.build   |  9 ++---
 src/test/modules/test_pg_dump/meson.build |  4 +--
 src/test/modules/test_predtest/meson.build|  9 ++---
 src/test/modules/test_rbtree/meson.build  |  9 ++---
 src/test/modules/test_regex/meson.build   |  9 ++---
 src/test/modules/test_rls_hooks/meson.build   |  6 ++--
 src/test/modules/test_shm_mq/meson.build  |  9 ++---
 src/test/modules/test_slru/meson.build|  9 ++---
 src/test/modules/worker_spi/meson.build   |  9 ++---
 src/test/regress/meson.build  | 18 --
 29 files changed, 144 insertions(+), 151 deletions(-)
 create mode 100644 src/test/install_additional_files

diff --git a/meson.build b/meson.build
index e379a252a51..e815ca9606c 100644
--- a/meson.build
+++ b/meson.build
@@ -2805,6 +2805,10 @@ backend_code = declare_dependency(
   dependencies: os_deps + backend_both_deps + backend_deps,
 )
 
+# install these files only during test, not main install
+test_install_files = []
+test_install_libs = []
+
 # src/backend/meson.build defines backend_mod_code used for extension
 # libraries.
 
@@ -2825,6 +2829,10 @@ subdir('doc/src/sgml')
 
 generated_sources_ac += {'': ['GNUmakefile']}
 
+# After processing src/test, add test_install_libs to the testprep_targets
+# to build them
+testprep_targets += test_install_libs
+
 
 # If there are any files in the source directory that we also generate in the
 # build directory, they might get preferred over the newly generated files,
@@ -2907,14 +2915,36 @@ meson_install_args = meson_args + ['install'] + {
 'muon': []
 }[meson_impl]
 
+# setup tests should  be run first,
+# so define priority for these
+setup_tests_priority = 100
 test('tmp_install',
 meson_bin, args: meson_install_args ,
 env: {'DESTDIR':test_install_destdir},
-priority: 100,
+priority: setup_tests_priority,
 timeout: 300,
 is_parallel: false,
 suite: ['setup'])
 
+# get full paths of test_install_libs to copy them
+test_install_libs_fp = []
+foreach lib: test_install_libs
+  test_install_libs_fp += lib.full_path()
+endforeach
+
+install_additional_files = files('src/test/install_additional_files')
+test('install_additional_files',
+python, args: [
+  install_additional_files,
+  '--sharedir', test_install_location / contrib_data_args['install_dir'],
+  '--libdir', test_install_location / dir_lib_pkg,
+  '--install_files', test_install_files,
+  '--install_libs', test_install_libs_fp,
+],
+priority: setup_tests_priority,
+is_parallel: false,
+suite: ['setup'])
+
 test_result_dir = meson.build_root() / 'testrun'
 
 
diff --git 

Re: meson: Optionally disable installation of test modules

2023-01-31 Thread Peter Eisentraut

On 30.01.23 18:42, Andres Freund wrote:

On 2023-01-30 08:37:42 +0100, Peter Eisentraut wrote:

One open issue (IMO) with the meson build system is that it installs the
test modules under src/test/modules/ as part of a normal installation. This
is because there is no way to set up up the build system to install extra
things only when told.  I think we still need a way to disable this somehow,
so that building a production installation doesn't end up with a bunch of
extra files.

The attached simple patch is a starting point for discussion.  It just
disables the subdirectory src/test/modules/ based on some Boolean setting.
This could be some new top-level option, or maybe part of PG_TEST_EXTRA, or
something else?  With this, I get an identical set of installed files from
meson.  I imagine this option would be false by default and developers would
enable it.


Bilal, with a bit of help by me, worked on an alternative approach to
this. It's a lot more verbose in the initial change, but wouldn't increase the
amount of work/lines for new test modules. The main advantage is that we
wouldn't have disable the modules by default, which I think would be quite
likely to result in plenty people not running the tests.

Sending a link instead of attaching, in case you already registered a cfbot 
entry:
https://github.com/anarazel/postgres/commit/d1d192a860da39af9aa63d7edf643eed07c4

Probably worth adding an install-test-modules target for manual use.


Looks like a good idea.  I'm happy to proceed along that line.





Re: meson: Optionally disable installation of test modules

2023-01-30 Thread Andres Freund
Hi,

On 2023-01-30 08:37:42 +0100, Peter Eisentraut wrote:
> One open issue (IMO) with the meson build system is that it installs the
> test modules under src/test/modules/ as part of a normal installation. This
> is because there is no way to set up up the build system to install extra
> things only when told.  I think we still need a way to disable this somehow,
> so that building a production installation doesn't end up with a bunch of
> extra files.
> 
> The attached simple patch is a starting point for discussion.  It just
> disables the subdirectory src/test/modules/ based on some Boolean setting.
> This could be some new top-level option, or maybe part of PG_TEST_EXTRA, or
> something else?  With this, I get an identical set of installed files from
> meson.  I imagine this option would be false by default and developers would
> enable it.

Bilal, with a bit of help by me, worked on an alternative approach to
this. It's a lot more verbose in the initial change, but wouldn't increase the
amount of work/lines for new test modules. The main advantage is that we
wouldn't have disable the modules by default, which I think would be quite
likely to result in plenty people not running the tests.

Sending a link instead of attaching, in case you already registered a cfbot 
entry:
https://github.com/anarazel/postgres/commit/d1d192a860da39af9aa63d7edf643eed07c4

Probably worth adding an install-test-modules target for manual use.

Greetings,

Andres Freund




meson: Optionally disable installation of test modules

2023-01-29 Thread Peter Eisentraut
One open issue (IMO) with the meson build system is that it installs the 
test modules under src/test/modules/ as part of a normal installation. 
This is because there is no way to set up up the build system to install 
extra things only when told.  I think we still need a way to disable 
this somehow, so that building a production installation doesn't end up 
with a bunch of extra files.


The attached simple patch is a starting point for discussion.  It just 
disables the subdirectory src/test/modules/ based on some Boolean 
setting.  This could be some new top-level option, or maybe part of 
PG_TEST_EXTRA, or something else?  With this, I get an identical set of 
installed files from meson.  I imagine this option would be false by 
default and developers would enable it.


Thoughts?
From 2573753c7af13f24cd8de404cbc6e54fdbb3040a Mon Sep 17 00:00:00 2001
From: Peter Eisentraut 
Date: Mon, 30 Jan 2023 08:36:37 +0100
Subject: [PATCH v1] meson: Option to not install test modules

---
 meson.build  | 4 
 src/test/meson.build | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index e379a252a5..603a79668c 100644
--- a/meson.build
+++ b/meson.build
@@ -2809,6 +2809,10 @@ backend_code = declare_dependency(
 # libraries.
 
 
+# WIP
+test_install = false
+
+
 # Then through the main sources. That way contrib can have dependencies on
 # main sources. Note that this explicitly doesn't enter src/test, right now a
 # few regression tests depend on contrib files.
diff --git a/src/test/meson.build b/src/test/meson.build
index 5f3c9c2ba2..adef37b22a 100644
--- a/src/test/meson.build
+++ b/src/test/meson.build
@@ -6,7 +6,9 @@ subdir('isolation')
 subdir('authentication')
 subdir('recovery')
 subdir('subscription')
-subdir('modules')
+if test_install
+  subdir('modules')
+endif
 
 if ssl.found()
   subdir('ssl')
-- 
2.39.1