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 <pe...@eisentraut.org>
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

Reply via email to