aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-04-10 16:14:55 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-04-10 16:15:04 -0400
commit31f1f0bb4fd642643994d35c35ecb5b929711a99 (patch)
tree7d9d311a8ad15420038241314c44ed5fd0263463
parent15a8f8caad14c1f85b23d97842d0c27b106cc10e (diff)
downloadpostgresql-31f1f0bb4fd642643994d35c35ecb5b929711a99.tar.gz
postgresql-31f1f0bb4fd642643994d35c35ecb5b929711a99.zip
Put back parallel-safety guards in plpython and src/test/regress/.
I'd hoped that commit 3b8f6e75f was sufficient to ensure parallel safety even when a build started in a subdirectory requires rebuilding of generated headers. This isn't so, because making submake-generated-headers a prerequisite of "all" isn't enough to ensure it's completed before starting on "all"'s other prerequisites. The explicit dependencies we put on the recursive make targets ensure safe ordering before we recurse into child directories, but they don't protect targets to be made in the current directory. Hence, put back some ordering dependencies in directories that we've traditionally expected to be starting points for "standalone" builds, to wit src/pl/plpython and src/test/regress. (The former needs this in order to minimize the work involved in building for both python 2 and python 3; the latter to support packagings that make the regression tests available for out-of-build-tree execution.) Adjust some other dependencies so that these two cases work correctly even at high -j settings. I'm not terribly happy with this partial solution, but I don't see a way to do better without massive makefile restructuring, which we surely aren't doing at this point in the development cycle. In any case, it's little if any worse than what we had in prior releases. Discussion: https://postgr.es/m/1523353963.8169.26.camel@gunduz.org
-rw-r--r--src/Makefile.global.in4
-rw-r--r--src/pl/plpython/Makefile3
-rw-r--r--src/test/regress/GNUmakefile8
3 files changed, 11 insertions, 4 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 20090b360e3..408736cb290 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -563,11 +563,11 @@ endif
submake-libpq:
$(MAKE) -C $(libpq_builddir) all
-submake-libpgport:
+submake-libpgport: | submake-generated-headers
$(MAKE) -C $(top_builddir)/src/port all
$(MAKE) -C $(top_builddir)/src/common all
-submake-libpgfeutils:
+submake-libpgfeutils: | submake-generated-headers
$(MAKE) -C $(top_builddir)/src/port all
$(MAKE) -C $(top_builddir)/src/common all
$(MAKE) -C $(top_builddir)/src/fe_utils all
diff --git a/src/pl/plpython/Makefile b/src/pl/plpython/Makefile
index fb785496ea5..653fe644ee6 100644
--- a/src/pl/plpython/Makefile
+++ b/src/pl/plpython/Makefile
@@ -99,6 +99,9 @@ include $(top_srcdir)/src/Makefile.shlib
all: all-lib
+# Ensure parallel safety if a build is started in this directory
+$(OBJS): | submake-generated-headers
+
install: all install-lib install-data
installdirs: installdirs-lib
diff --git a/src/test/regress/GNUmakefile b/src/test/regress/GNUmakefile
index 7ba4e9c5abb..378bd017530 100644
--- a/src/test/regress/GNUmakefile
+++ b/src/test/regress/GNUmakefile
@@ -43,7 +43,8 @@ pg_regress$(X): pg_regress.o pg_regress_main.o $(WIN32RES) | submake-libpgport
pg_regress.o: pg_regress.c $(top_builddir)/src/port/pg_config_paths.h
pg_regress.o: override CPPFLAGS += -I$(top_builddir)/src/port $(EXTRADEFS)
-$(top_builddir)/src/port/pg_config_paths.h: $(top_builddir)/src/Makefile.global
+# note: because of the submake dependency, this rule's action is really a no-op
+$(top_builddir)/src/port/pg_config_paths.h: | submake-libpgport
$(MAKE) -C $(top_builddir)/src/port pg_config_paths.h
install: all installdirs
@@ -65,6 +66,9 @@ include $(top_srcdir)/src/Makefile.shlib
all: all-lib
+# Ensure parallel safety if a build is started in this directory
+$(OBJS): | submake-libpgport submake-generated-headers
+
# Test input and expected files. These are created by pg_regress itself, so we
# don't have a rule to create them. We do need rules to clean them however.
input_files = $(patsubst $(srcdir)/input/%.source,sql/%.sql, $(wildcard $(srcdir)/input/*.source))
@@ -105,7 +109,7 @@ $(top_builddir)/contrib/spi/refint$(DLSUFFIX): | submake-contrib-spi ;
$(top_builddir)/contrib/spi/autoinc$(DLSUFFIX): | submake-contrib-spi ;
-submake-contrib-spi: | submake-libpgport
+submake-contrib-spi: | submake-libpgport submake-generated-headers
$(MAKE) -C $(top_builddir)/contrib/spi
.PHONY: submake-contrib-spi