Build and test failures with Autoconf 2.70

Zack Weinberg <[email protected]>
Newsgroups gmane.comp.sysutils.automake.general,gmane.comp.sysutils.automake.patches
Message-ID <CAKCAbMjC+zZwyprjcoN3eC_+=mFLYvYGr7SjQwn-=mEjVQciTA@mail.gmail.com>
Autoconf 2.70 (released last week) makes a few changes that broke
Automake’s expectations, mostly in the test suite.  I regret not
having had the time to test Automake with the new Autoconf prior to
the release.

The attached patch fixes two of the problems:

 - AC_PACKAGE_NAME and AC_PACKAGE_VERSION are now defined unconditionally.
   AM_INIT_AUTOMAKE needs to use m4_ifset instead of m4_ifdef to diagnose
   the obsolete use of AC_INIT with fewer than two arguments.  (This change
   is compatible with autoconf 2.69; m4_ifset is much older, and it means
   ‘defined with a non-empty value’.)

 - autoconf now issues a warning if fed a configure script that doesn’t
   invoke both AC_INIT and AC_OUTPUT; this, plus a problem with system-
   provided tools (still under investigation) broke the *build* on macOS;
   it also causes a couple of spurious testsuite failures.  See
   https://savannah.gnu.org/support/?110397 for more detail on the macOS
   build failure.

   I may not have found all the places where this is an issue.  It's hard
   to grep for the absence of something.

There are still four testsuite failures on my dev box, which runs Debian
unstable:

FAIL: t/distcheck-missing-m4.sh
FAIL: t/distcheck-outdated-m4.sh
FAIL: t/libobj-basic.sh
FAIL: t/remake-not-after-make-dist.sh

These are genuine regressions; they do not happen with autoconf 2.69 on the
same system.  They all appear to be cases of autoconf and/or aclocal
getting run when the test suite does not expect them to be run.  I am
stumped as to why, and would appreciate any debugging assistance you can
provide. test-suite.log is also attached.

(I see several more failures on a variety of non-Linux machines provided by
the GCC Compile Farm, but it's probably not worth tracking those down until
we get the regressions on an all-GNU OS sorted out.)

Thanks,
zw
0001-Fix-some-build-and-test-failures-with-Autoconf-2.70.patch (text/x-patch, 3.8 KB)
From 24b2aae4ea61cefccb7e86de9e078516d7ccf1af Mon Sep 17 00:00:00 2001
From: Zack Weinberg <[email protected]>
Date: Mon, 14 Dec 2020 14:50:47 -0500
Subject: [PATCH] Fix some build and test failures with Autoconf 2.70.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Autoconf 2.70 (released last week) makes a few changes that broke Automake’s
expectations, mostly in the test suite.  This patch addresses two of the
problems:

 - autoconf now issues a warning if fed a configure script that doesn’t invoke
   both AC_INIT and AC_OUTPUT; this, plus a problem with system-provided
   tools (still under investigation) broke the *build* on macOS; it also
   causes a couple of spurious testsuite failures.

 - AC_PACKAGE_NAME and AC_PACKAGE_VERSION are now defined unconditionally.
   AM_INIT_AUTOMAKE needs to use m4_ifset instead of m4_ifdef to diagnose
   the obsolete use of AC_INIT with fewer than two arguments.  (This change
   is compatible with autoconf 2.69; m4_ifset is much older, and it means
   ‘defined with a non-empty value’.)

* configure.ac: Use both AC_INIT and AC_OUTPUT in test configure scripts.
* t/deprecated-acinit.sh, t/init.sh: Likewise.
* m4/init.m4 (AM_INIT_AUTOMAKE): Use m4_ifset, not m4_ifdef, to detect
  AC_PACKAGE_NAME and/or AC_PACKAGE_VERSION not having a value.
---
 configure.ac           | 9 +++++++--
 m4/init.m4             | 2 +-
 t/deprecated-acinit.sh | 1 +
 t/init.sh              | 1 +
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 45507b6f4..065317411 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,7 +123,9 @@ fi
 
 AC_CACHE_CHECK([whether autoconf works], [am_cv_autoconf_works],
 [mkdir conftest
-echo 'AC''_INIT' > conftest/conftest.ac
+printf '%s\n' > conftest/conftest.ac \
+  'AC''_INIT([smoke-test], [1])' \
+  'AC''_OUTPUT'
 if AM_RUN_LOG([cd conftest && $am_AUTOCONF -o /dev/null conftest.ac]);
 then
   am_cv_autoconf_works=yes
@@ -139,7 +141,10 @@ fi
 AC_CACHE_CHECK([whether autoconf is recent enough], [am_cv_autoconf_version],
 [mkdir conftest
 dnl Creative quoting required to avoid spurious expansion of AC_PREREQ macro
-echo 'AC'"_PREREQ([[$required_autoconf_version]])" > conftest/conftest.ac
+printf '%s\n' > conftest/conftest.ac \
+  'AC'"_PREREQ([[$required_autoconf_version]])" \
+  'AC''_INIT([smoke-test], [1])' \
+  'AC''_OUTPUT'
 if AM_RUN_LOG([cd conftest && $am_AUTOCONF -o /dev/null conftest.ac]);
 then
   am_cv_autoconf_version=yes
diff --git a/m4/init.m4 b/m4/init.m4
index f82d756c2..cbe8fddf8 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -64,7 +64,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
 [_AM_SET_OPTIONS([$1])dnl
 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
 m4_if(
-  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+  m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
   [ok:ok],,
   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
diff --git a/t/deprecated-acinit.sh b/t/deprecated-acinit.sh
index 21614bafa..f393d6534 100644
--- a/t/deprecated-acinit.sh
+++ b/t/deprecated-acinit.sh
@@ -35,6 +35,7 @@ for ac_init in AC_INIT 'AC_INIT([Makefile.am])'; do
         $ac_init
         $am_init_automake
         AC_CONFIG_FILES([Makefile])
+        AC_OUTPUT
 END
     cat configure.ac # For debugging.
     $ACLOCAL 2>stderr && { cat stderr >&2; exit 1; }
diff --git a/t/init.sh b/t/init.sh
index c6f6d6461..df138a040 100644
--- a/t/init.sh
+++ b/t/init.sh
@@ -25,6 +25,7 @@ for ac_init_args in '' '([x])'; do
     unindent >configure.ac <<END
       AC_INIT$ac_init_args
       AM_INIT_AUTOMAKE$am_init_args
+      AC_OUTPUT
 END
     cat configure.ac # For debugging.
     # The error message should mention AC_INIT, not AC_PACKAGE_VERSION.
-- 
2.29.2
automake-failures-with-autoconf-270.log.gz (application/gzip, 145.5 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.