On 10.05.21 20:26, Peter Eisentraut wrote:
The test program libpq_pipeline produced by the test suite in
src/test/modules/libpq_pipeline/ is installed into tmp_install as part
of make check. This isn't a real problem by itself, but I think it
creates a bit of an asymmetric situation that might be worth cleaning up.
Before, the contents of tmp_install exactly matched an actual
installation. There were no extra test programs installed.
Also, the test suite code doesn't actually use that installed version,
so it's not of any use, and it creates confusion about which copy is in
use.
The reason this is there is that the test suite uses PGXS to build the
test program, and so things get installed automatically. I suggest that
we should either write out the build system by hand to avoid this, or
maybe extend PGXS to support building programs but not installing them.
Here is a patch that implements the second solution, which turned out to
be very easy.
From 0c2f11034d66c072ffd2141bc5724c211ffb6ae8 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pe...@eisentraut.org>
Date: Wed, 19 May 2021 08:12:15 +0200
Subject: [PATCH] Add NO_INSTALL option to pgxs
Apply in libpq_pipeline test makefile, so that the test file is not
installed into tmp_install.
Discussion:
https://www.postgresql.org/message-id/flat/cb9d16a6-760f-cd44-28d6-b091d5fb6ca7%40enterprisedb.com
---
src/makefiles/pgxs.mk | 4 ++++
src/test/modules/libpq_pipeline/Makefile | 2 ++
2 files changed, 6 insertions(+)
diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk
index 271e7eaba8..95d0441e9b 100644
--- a/src/makefiles/pgxs.mk
+++ b/src/makefiles/pgxs.mk
@@ -227,6 +227,8 @@ all: all-lib
endif # MODULE_big
+ifndef NO_INSTALL
+
install: all installdirs
ifneq (,$(EXTENSION))
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(addsuffix .control,
$(EXTENSION))) '$(DESTDIR)$(datadir)/extension/'
@@ -336,6 +338,8 @@ endif # with_llvm
uninstall: uninstall-lib
endif # MODULE_big
+endif # NO_INSTALL
+
clean:
ifdef MODULES
diff --git a/src/test/modules/libpq_pipeline/Makefile
b/src/test/modules/libpq_pipeline/Makefile
index b798f5fbbc..c9c5ae1beb 100644
--- a/src/test/modules/libpq_pipeline/Makefile
+++ b/src/test/modules/libpq_pipeline/Makefile
@@ -3,6 +3,8 @@
PROGRAM = libpq_pipeline
OBJS = libpq_pipeline.o
+NO_INSTALL = 1
+
PG_CPPFLAGS = -I$(libpq_srcdir)
PG_LIBS_INTERNAL += $(libpq_pgport)
--
2.31.1