Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7005389

Browse files
committed
pg_upgrade: Don't use separate installation for test.
For pg_upgrade's test we (unless prevented by the caller via via NO_TEMP_INSTALL) built a separate installation. That causes an unnecessary slowdown after the infrastructure introduced by dcae5fa (and unnecessarily duplicates code). Author: Andres Freund Reviewed-By: Tom Lane Discussion: https://postgr.es/m/20190521191918.z7kwnrlj45mk2k67@alap3.anarazel.de https://postgr.es/m/20190521195209.qfzwfxvymguuwlu5@alap3.anarazel.de
1 parent 8e719d3 commit 7005389

File tree

2 files changed

+5
-39
lines changed

2 files changed

+5
-39
lines changed

src/bin/pg_upgrade/Makefile

+2-12
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,6 @@ OBJS = check.o controldata.o dump.o exec.o file.o function.o info.o \
1414
override CPPFLAGS := -DDLSUFFIX=\"$(DLSUFFIX)\" -I$(srcdir) -I$(libpq_srcdir) $(CPPFLAGS)
1515
LDFLAGS_INTERNAL += -L$(top_builddir)/src/fe_utils -lpgfeutils $(libpq_pgport)
1616

17-
ifdef NO_TEMP_INSTALL
18-
tbindir=$(abs_top_builddir)/tmp_install/$(bindir)
19-
tlibdir=$(abs_top_builddir)/tmp_install/$(libdir)
20-
DOINST =
21-
else
22-
tbindir=$(bindir)
23-
tlibdir=$(libdir)
24-
DOINST = --install
25-
endif
26-
2717
all: pg_upgrade
2818

2919
pg_upgrade: $(OBJS) | submake-libpq submake-libpgport submake-libpgfeutils
@@ -45,8 +35,8 @@ clean distclean maintainer-clean:
4535
pg_upgrade_dump_globals.sql \
4636
pg_upgrade_dump_*.custom pg_upgrade_*.log
4737

48-
check: test.sh all
49-
MAKE=$(MAKE) bindir="$(tbindir)" libdir="$(tlibdir)" EXTRA_REGRESS_OPTS="$(EXTRA_REGRESS_OPTS)" $(SHELL) $< $(DOINST)
38+
check: test.sh all temp-install
39+
MAKE=$(MAKE) $(with_temp_install) bindir=$(abs_top_builddir)/tmp_install/$(bindir) EXTRA_REGRESS_OPTS="$(EXTRA_REGRESS_OPTS)" $(SHELL) $<
5040

5141
# installcheck is not supported because there's no meaningful way to test
5242
# pg_upgrade against a single already-running server

src/bin/pg_upgrade/test.sh

+3-27
Original file line numberDiff line numberDiff line change
@@ -70,39 +70,15 @@ export PGHOST
7070
# don't rely on $PWD here, as old shells don't set it
7171
temp_root=`pwd`/tmp_check
7272

73-
if [ "$1" = '--install' ]; then
74-
temp_install=$temp_root/install
75-
bindir=$temp_install/$bindir
76-
libdir=$temp_install/$libdir
77-
78-
"$MAKE" -s -C ../.. install DESTDIR="$temp_install"
79-
80-
# platform-specific magic to find the shared libraries; see pg_regress.c
81-
LD_LIBRARY_PATH=$libdir:$LD_LIBRARY_PATH
82-
export LD_LIBRARY_PATH
83-
DYLD_LIBRARY_PATH=$libdir:$DYLD_LIBRARY_PATH
84-
export DYLD_LIBRARY_PATH
85-
LIBPATH=$libdir:$LIBPATH
86-
export LIBPATH
87-
SHLIB_PATH=$libdir:$SHLIB_PATH
88-
export SHLIB_PATH
89-
PATH=$libdir:$PATH
90-
91-
# We need to make it use psql from our temporary installation,
92-
# because otherwise the installcheck run below would try to
93-
# use psql from the proper installation directory, which might
94-
# be outdated or missing. But don't override anything else that's
95-
# already in EXTRA_REGRESS_OPTS.
96-
EXTRA_REGRESS_OPTS="$EXTRA_REGRESS_OPTS --bindir='$bindir'"
97-
export EXTRA_REGRESS_OPTS
98-
fi
99-
10073
: ${oldbindir=$bindir}
10174

10275
: ${oldsrc=../../..}
10376
oldsrc=`cd "$oldsrc" && pwd`
10477
newsrc=`cd ../../.. && pwd`
10578

79+
# While in normal cases this will already be set up, adding bindir to
80+
# path allows test.sh to be invoked with different versions as
81+
# described in ./TESTING
10682
PATH=$bindir:$PATH
10783
export PATH
10884

0 commit comments

Comments
 (0)