Skip to content

Commit 31f1f0b

Browse files
committed
Put back parallel-safety guards in plpython and src/test/regress/.
I'd hoped that commit 3b8f6e7 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
1 parent 15a8f8c commit 31f1f0b

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/Makefile.global.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,11 @@ endif
563563
submake-libpq:
564564
$(MAKE) -C $(libpq_builddir) all
565565

566-
submake-libpgport:
566+
submake-libpgport: | submake-generated-headers
567567
$(MAKE) -C $(top_builddir)/src/port all
568568
$(MAKE) -C $(top_builddir)/src/common all
569569

570-
submake-libpgfeutils:
570+
submake-libpgfeutils: | submake-generated-headers
571571
$(MAKE) -C $(top_builddir)/src/port all
572572
$(MAKE) -C $(top_builddir)/src/common all
573573
$(MAKE) -C $(top_builddir)/src/fe_utils all

src/pl/plpython/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ include $(top_srcdir)/src/Makefile.shlib
9999

100100
all: all-lib
101101

102+
# Ensure parallel safety if a build is started in this directory
103+
$(OBJS): | submake-generated-headers
104+
102105
install: all install-lib install-data
103106

104107
installdirs: installdirs-lib

src/test/regress/GNUmakefile

+6-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ pg_regress$(X): pg_regress.o pg_regress_main.o $(WIN32RES) | submake-libpgport
4343
pg_regress.o: pg_regress.c $(top_builddir)/src/port/pg_config_paths.h
4444
pg_regress.o: override CPPFLAGS += -I$(top_builddir)/src/port $(EXTRADEFS)
4545

46-
$(top_builddir)/src/port/pg_config_paths.h: $(top_builddir)/src/Makefile.global
46+
# note: because of the submake dependency, this rule's action is really a no-op
47+
$(top_builddir)/src/port/pg_config_paths.h: | submake-libpgport
4748
$(MAKE) -C $(top_builddir)/src/port pg_config_paths.h
4849

4950
install: all installdirs
@@ -65,6 +66,9 @@ include $(top_srcdir)/src/Makefile.shlib
6566

6667
all: all-lib
6768

69+
# Ensure parallel safety if a build is started in this directory
70+
$(OBJS): | submake-libpgport submake-generated-headers
71+
6872
# Test input and expected files. These are created by pg_regress itself, so we
6973
# don't have a rule to create them. We do need rules to clean them however.
7074
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 ;
105109

106110
$(top_builddir)/contrib/spi/autoinc$(DLSUFFIX): | submake-contrib-spi ;
107111

108-
submake-contrib-spi: | submake-libpgport
112+
submake-contrib-spi: | submake-libpgport submake-generated-headers
109113
$(MAKE) -C $(top_builddir)/contrib/spi
110114

111115
.PHONY: submake-contrib-spi

0 commit comments

Comments
 (0)