Skip to content

Commit bedda9f

Browse files
committed
Process EXTRA_INSTALL serially, during the first temp-install.
This closes a race condition in "make -j check-world"; the symptom was EEXIST errors. Back-patch to v10, before which parallel check-world had worse problems. Discussion: https://postgr.es/m/20181224221601.GA3227827@rfd.leadboat.com
1 parent e7ebc8c commit bedda9f

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

GNUmakefile.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ distclean maintainer-clean:
6363
@rm -rf autom4te.cache/
6464
rm -f config.cache config.log config.status GNUmakefile
6565

66+
check check-tests installcheck installcheck-parallel installcheck-tests: CHECKPREP_TOP=src/test/regress
6667
check check-tests installcheck installcheck-parallel installcheck-tests:
6768
$(MAKE) -C src/test/regress $@
6869

6970
$(call recurse,check-world,src/test src/pl src/interfaces/ecpg contrib src/bin,check)
71+
$(call recurse,checkprep, src/test src/pl src/interfaces/ecpg contrib src/bin)
7072

7173
$(call recurse,installcheck-world,src/test src/pl src/interfaces/ecpg contrib src/bin,installcheck)
7274

src/Makefile.global.in

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#
2020
# Meta configuration
2121

22-
standard_targets = all install installdirs uninstall distprep clean distclean maintainer-clean coverage check installcheck init-po update-po
22+
standard_targets = all install installdirs uninstall distprep clean distclean maintainer-clean coverage check checkprep installcheck init-po update-po
2323
# these targets should recurse even into subdirectories not being built:
2424
standard_always_targets = distprep clean distclean maintainer-clean
2525

@@ -344,11 +344,17 @@ ifeq ($(MAKELEVEL),0)
344344
rm -rf '$(abs_top_builddir)'/tmp_install
345345
$(MKDIR_P) '$(abs_top_builddir)'/tmp_install/log
346346
$(MAKE) -C '$(top_builddir)' DESTDIR='$(abs_top_builddir)'/tmp_install install >'$(abs_top_builddir)'/tmp_install/log/install.log 2>&1
347+
$(MAKE) -j1 $(if $(CHECKPREP_TOP),-C $(CHECKPREP_TOP),) checkprep >>'$(abs_top_builddir)'/tmp_install/log/install.log 2>&1
347348
endif
348-
$(if $(EXTRA_INSTALL),for extra in $(EXTRA_INSTALL); do $(MAKE) -C '$(top_builddir)'/$$extra DESTDIR='$(abs_top_builddir)'/tmp_install install >>'$(abs_top_builddir)'/tmp_install/log/install.log 2>&1 || exit; done)
349349
endif
350350
endif
351351

352+
# Tasks to run serially at the end of temp-install. Some EXTRA_INSTALL
353+
# entries appear more than once in the tree, and parallel installs of the same
354+
# file can fail with EEXIST.
355+
checkprep:
356+
$(if $(EXTRA_INSTALL),for extra in $(EXTRA_INSTALL); do $(MAKE) -C '$(top_builddir)'/$$extra DESTDIR='$(abs_top_builddir)'/tmp_install install || exit; done)
357+
352358
PROVE = @PROVE@
353359
# There are common routines in src/test/perl, and some test suites have
354360
# extra perl modules in their own directory.

src/makefiles/pgxs.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ else
285285
check: submake $(REGRESS_PREP)
286286
$(pg_regress_check) $(REGRESS_OPTS) $(REGRESS)
287287

288-
temp-install: EXTRA_INSTALL+=$(subdir)
288+
checkprep: EXTRA_INSTALL+=$(subdir)
289289
endif
290290
endif # REGRESS
291291

0 commit comments

Comments
 (0)