Address “autoconf: forbidden tokens, basic” testsuite failure

On file systems with coarse-grained timestamps, this test was broken by
<https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=713d9822bbfb2923115065efaefed34a0113f8a1>,
which changed autom4te's logic for deciding whether its output file is
newer than its cache file.  After that commit, if their modification
times are equal, the output is considered out of date.  Since both
files are created in quick succession, on file systems with coarse
timestamps (1 or 2s resolution), it is very easy for their
modification times to be equal.

As a stopgap for 2.72, in this test, force the generated configure
script’s mtime to be newer than the cache file.

* tests/tools.at (autoconf: forbidden tokens, basic): After the
  second AT_MTIME_DELAY, touch configure.
This commit is contained in:
Zack Weinberg 2023-12-21 16:30:17 -05:00
parent fdb58df6bb
commit 3fbfb13e7a
2 changed files with 11 additions and 10 deletions

9
NEWS
View File

@ -32,16 +32,11 @@ GNU Autoconf NEWS - User visible changes.
for large files and/or timestamps after 2038 are *available*
but not enabled by default.
This is the cause of the AC_SYS_LARGEFILE, AC_SYS_YEAR2038, and/or
AC_SYS_YEAR2038_RECOMMENDED testsuite failures on some systems.
See <https://savannah.gnu.org/support/index.php?110983> for details
and a workaround.
*** “autoconf: forbidden tokens, basic” testsuite failure
We believe this is another subtle bug in autom4tes handling of
timestamps that are very close together. It only happens on some
operating systems and/or some file systems. It can safely be ignored.
See <https://savannah.gnu.org/support/index.php?110986> for more detail.
*** “Substitute and define special characters” testsuite failure
We believe this to be a bug in some versions of NetBSD /bin/sh.

View File

@ -474,11 +474,17 @@ configure.ac:5: error: possibly undefined macro: _AS@&t@_BAR
configure.ac:6: error: possibly undefined macro: d@&t@nl
]])
# On a file system with coarse timestamp resolution (1 or 2s),
# configure and autom4te's cache files can easily have equal
# timestamps, in which case autom4te will consider the cache
# to be stale. Ensure configure's timestamp is newer.
AT_MTIME_DELAY
touch configure
# A second run (without --force) should succeed and yield only the
# warnings about AC_INIT and AC_OUTPUT.
AT_CHECK_M4([autoconf], 0, [],
# Since warnings are replicated from the cache but "possibly undefined
# macro" errors are not, a second run, without --force, should succeed
# and should yield only the warnings about AC_INIT and AC_OUTPUT.
AT_CHECK_M4([autoconf --verbose], 0, [],
[[trailer.m4: warning: AC_INIT was never used
trailer.m4: warning: AC_OUTPUT was never used
]])