From 7856a385d1a54a4876a3e056eddfbd1a12ae3536 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 1 Feb 2021 10:30:36 +0100 Subject: [PATCH] Fix parallel build of the sample when using configure Don't add both a directory and its subdirectories to SAMPLES_SUBDIRS as this can result in 2 sub-makes building in the same directory in parallel: one make process recursing into sub-subdirectory from the subdirectory and another one running directly inside it. This notably results in recurring failures in GitHub Actions CI builds. We still need to create makefile.in in the subdirectories containing other samples, so add a separate SAMPLES_SUBTREES variable and use it to collect such directories, instead of putting them into SAMPLES_SUBDIRS itself. --- configure | 10 ++++++++-- configure.in | 14 ++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 6a3359f960..2e6534e1a6 100755 --- a/configure +++ b/configure @@ -29103,7 +29103,8 @@ $as_echo "$as_me: WARNING: wxGLCanvas not implemented for this port, library wil $as_echo "#define wxUSE_GLCANVAS 1" >>confdefs.h - SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl opengl/cube opengl/penguin opengl/isosurf opengl/pyramid" + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl/cube opengl/penguin opengl/isosurf opengl/pyramid" + SAMPLES_SUBTREES="$SAMPLES_SUBTREES opengl" fi fi @@ -37119,7 +37120,8 @@ if test "$wxUSE_HTML" = "yes"; then $as_echo "#define wxUSE_HTML 1" >>confdefs.h USE_HTML=1 - SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html html/about html/help html/helpview html/printing html/test html/virtual html/widget html/zip htlbox" + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html/about html/help html/helpview html/printing html/test html/virtual html/widget html/zip htlbox" + SAMPLES_SUBTREES="$SAMPLES_SUBTREES html" fi USE_XRC=0 @@ -41306,6 +41308,10 @@ for subdir in $SUBDIRS; do if test -d $srcdir/samples/$sample; then makefiles="samples/$sample/Makefile.in $makefiles" fi + done + + for subtree in $SAMPLES_SUBTREES; do + makefiles="samples/$subtree/Makefile.in $makefiles" done else disabled_var=DISABLED_`echo $subdir | tr '[a-z]' '[A-Z]'` diff --git a/configure.in b/configure.in index 04b1ac38df..94135f8e44 100644 --- a/configure.in +++ b/configure.in @@ -3914,7 +3914,8 @@ if test "$wxUSE_OPENGL" = "yes" -o "$wxUSE_OPENGL" = "auto"; then USE_OPENGL=1 AC_DEFINE(wxUSE_OPENGL) AC_DEFINE(wxUSE_GLCANVAS) - SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl opengl/cube opengl/penguin opengl/isosurf opengl/pyramid" + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl/cube opengl/penguin opengl/isosurf opengl/pyramid" + SAMPLES_SUBTREES="$SAMPLES_SUBTREES opengl" fi fi @@ -7391,7 +7392,8 @@ USE_HTML=0 if test "$wxUSE_HTML" = "yes"; then AC_DEFINE(wxUSE_HTML) USE_HTML=1 - SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html html/about html/help html/helpview html/printing html/test html/virtual html/widget html/zip htlbox" + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html/about html/help html/helpview html/printing html/test html/virtual html/widget html/zip htlbox" + SAMPLES_SUBTREES="$SAMPLES_SUBTREES html" fi USE_XRC=0 @@ -8729,6 +8731,14 @@ for subdir in $SUBDIRS; do makefiles="samples/$sample/Makefile.in $makefiles" fi done + + dnl also create makefiles for the subdirectories containing + dnl other samples that are not added to SAMPLES_SUBDIRS because + dnl we don't want to recurse into them when building everything + dnl because we still want to allow building them explicitly + for subtree in $SAMPLES_SUBTREES; do + makefiles="samples/$subtree/Makefile.in $makefiles" + done else dnl assume that everything compiles for utils &c dnl any that shouldn't be built can be added to