‘guix shell’ is a utility for constructing isolated environments
for development; I’ve put together a “manifest” stating the
build and test requirements for autoconf, starting from a git
checkout.
If we use a relative path for ACBOOTDIR, Automake can’t tell the
difference between Autoconf’s configure script’s aclocal.m4
inclusions (…/m4/*.m4) and the guts of Autoconf
itself (…/lib/autoconf/*.m4) so it puts both of them into
$(am__aclocal_m4_deps). This would be harmless, except that the
guts-of-Autoconf files are named *relative to $ACBOOTDIR*, which
means Make can’t find them later. And this is why a build from a
clean git checkout always starts by regenerating aclocal.m4 and
configure again.
Using an absolute path for ACBOOTDIR gives automake enough of a clue
what’s going on (see the heuristic circa 5500 of current automake.in,
commented “Some modified versions of autoconf don’t use frozen files…”)
for it to produce the same value for $(am__aclocal_m4) that it would
if we were running an installed Autoconf.
It is not clear to me why, but the “parallel autotest and signal
handling” test malfunctions if the active shell is Guix bash. I don’t
think it’s worth investigating in detail, considering I intend to
reimplement parallel autotest using the same technique that Automake’s
parallel test driver uses, i.e. make -j, which should eliminate this
entire class of problems.
* cfg.mk (local-checks-to-skip): Add sc_unportable_grep_q, which has
too many false positives to bother with; for instance, it triggers
on autoconf.texi’s discussion of why grep -q is unportable, and on
the code in maint.mk that implements the check!
(old_NEWS_hash): Update for commit b751bf4949,
which fixed spelling errors in old NEWS.
* doc/autoconf.texi: Remove a doubled word.
* lib/autoconf/programs.m4: Remove a space immediately before a tab.
* lib/m4sugar/m4sh.m4 (_AS_IF): Rephrase documentation to avoid saying
“if IF-FALSE” which triggers the prohibit_doubled_word check.
* NEWS, doc/autoconf.texi (System Services):
Improve documentation for behavior of largefile and year-2038 support.
Say that in the current implementation, year-2038 support
requires largefile support. Say that year-2038 support
matters only for GNU/Linux glibc 2.34+ on 32-bit x86 and ARM.
Prefer brevity when this does not hurt understandability;
for example, prefer active to passive voice.
Prefer “wider” to “larger” when talking about the number of
bits in an integer, as this terminology is more standard.
Tone down the wording in warnings about enabling year-2038 support,
use similar wording in warnings about enabling largefile support,
and warn also about disabling largefile and year-2038 support.
No need for @emph. Also mention rlim_t.
Be a bit more careful about saying “2 GiB” rather than “2 GB”.
Mention that a future version of Autoconf might change
AC_SYS_LARGEFILE to default to --enable-year2038, since
something has gotta happen before 2038.
Coalesce descriptions of --enable-largefile and --enable-year2038
to simplify documentation. Mention that the only system where
AC_SYS_LARGEFILE changes CC is IRIX and that these systems
are obsolete. Say that ‘stat’ can fail due to time_t
overflow. Say that you can’t portably print time_t with %ld.
Say that binary compatibilty problems also can occur when one
library is linking to amother; it’s not just apps vs libraries.
Mention the possibility of modifying libraries to support both
32- and 64-bit interfaces. Warn more consistently about
ABI compatibility issues, but put the bulk of this text
in one location that the other locations refer to.
Commit 6dcecb780a "Port
AC_CHECK_HEADER_STDBOOL to C23" causes AC_CHECK_HEADER_STDBOOL to
always fail, even on systems with a conforming stdbool.h.
There is no longer an 'a' variable so it should not be referenced
in the return statement.
Copyright-paperwork-exempt: yes
They are not needed for Gnulib, and users have an easy way to get
their effect, so for now omit them and just document the easy way.
Also, redo documentation to make it clear that AC_YEAR_2038 is
like AC_SYS_LARGEFILE except with a different year-2038 default.
* NEWS, doc/autoconf.texi: Document the above.
* lib/autoconf/specific.m4 (AC_SYS_YEAR2038_REQUIRED):
(AC_SYS_LARGEFILE_REQUIRED): Remove. Remove some support code.
Perhaps further simplification could be done but I quit while
I was ahead.
Having AC_SYS_LARGEFILE enlarge time_t means that any program that has
already requested large file support will be abruptly migrated to
64-bit time_t (on 32-bit systems) as soon as its configure script is
regenerated with a sufficiently new Autoconf. We’ve received reports
of several widely used programs and libraries that are not prepared
for this migration, with breakage ranging from annoying (garbage
timestamps in messages) through serious (binary compatibility break
in security-critical shared library) to catastrophic (on-disk data
corruption).
Partially revert f6657256a3: in the
absence of AC_SYS_YEAR2038, AC_SYS_LARGEFILE will now only add an
--enable-year2038 command line option to configure. If this option is
used, time_t will be enlarged, allowing people to experiment with the
migration without needing to *edit* the configure script in question,
only regenerate it.
In the process, AC_SYS_LARGEFILE and AC_SYS_YEAR2038 were drastically
overhauled for modularity; it should now be much easier to add support
for platforms that offer large off_t / time_t but not with the standard
feature selection macros. Also, new macros AC_SYS_LARGEFILE_REQUIRED and
AC_SYS_YEAR2038_REQUIRED can be used by programs for which large off_t /
time_t are essential.
The implementation is a little messy because it needs to gracefully
handle the case where AC_SYS_LARGEFILE and AC_SYS_LARGEFILE_REQUIRED
are both used in the same configure script — or, probably more common,
AC_SYS_LARGEFILE (which invokes _AC_SYS_YEAR2038_OPT_IN) followed by
AC_SYS_YEAR2038 — but if macro B is invoked after macro A, there’s no
way for B to change *what macro A expanded to*. The best kludge I
managed to find is to AC_CONFIG_COMMANDS_PRE as a m4-level hook that
sets shell variables in an early diversion.
* lib/autoconf/functions.m4 (AC_FUNC_FSEEKO): Rewrite to avoid dependency
on internal subroutines of AC_SYS_LARGEFILE.
* lib/autoconf/specific.m4 (_AC_SYS_YEAR2038_TEST_INCLUDES): Renamed to
_AC_SYS_YEAR2038_TEST_CODE.
(_AC_SYS_YEAR2038): Refactor into subroutines: _AC_SYS_YEAR2038_OPTIONS,
_AC_SYS_YEAR2038_PROBE, _AC_SYS_YEAR2038_ENABLE.
(AC_SYS_YEAR2038): Update for refactoring.
(_AC_SYS_YEAR2038_OPT_IN): New sorta-top-level macro, for use by
AC_SYS_LARGEFILE, that probes for large time_t only if the
--enable-year2038 option is given.
(AC_SYS_YEAR2038_REQUIRED): New top-level macro that insists on
support for large time_t.
(_AC_SYS_LARGEFILE_TEST_INCLUDES): Renamed to _AC_SYS_LARGEFILE_TEST_CODE.
(_AC_SYS_LARGEFILE_MACRO_VALUE, AC_SYS_LARGEFILE): Refactor along same
lines as above: _AC_SYS_LARGEFILE_OPTIONS, _AC_SYS_LARGEFILE_PROBE,
_AC_SYS_LARGEFILE_ENABLE. Invoke _AC_SYS_YEAR2038_OPT_IN at end of
_AC_SYS_LARGEFILE_PROBE. MinGW-specific logic moved to YEAR2038
macros as it has nothing to do with large file support.
(AC_SYS_LARGEFILE_REQUIRED): New top-level macro that insists on
support for large off_t.
* tests/local.at (_AT_CHECK_ENV): Also allow changes in CPPFLAGS,
enableval, enable_*, withval, with_*.
* doc/autoconf.texi, NEWS: Update documentation to match above changes.
Fix typo in definition of @dvarv.
In documentation and comments, prefer the more-common “C89” to the
equivalent “C90”, and use 2-digit years for C standards as that’s
common usage. Remove some confusing old doc for pre-C89 systems,
as Autoconf assumes C89 or later. Mention C17 and C23 briefly.
Improve doc for malloc, realloc.
This fixes all of the remaining failures exposed by running the
testsuite with GCC 12 and
CC='cc -Wimplicit-function-declaration -Wold-style-definition
-Wimplicit-int -Werror'
.
* lib/autoconf/c.m4 (_AC_C_C89_TEST_GLOBALS): Don’t use K&R function
definitions.
* lib/autoconf/specific.m4 (AC_SYS_RESTARTABLE_SYSCALLS): Likewise.
(AC_FUNC_MKTIME): Declare functions taking no arguments as ‘fn (void)’
not ‘fn ()’.
* lib/autoconf/c.m4 (_AC_C_C99_TEST_GLOBALS): Declare free().
* lib/autoconf/programs.m4 (AC_PROG_MKDIR_P):
Fall back on mkdir -p instead of on a relative path to
install-sh, as the latter now seems to be more of a problem
than the former.
Bash v5.2 includes several new optimizations to the number of
subshells used for various constructs; as a side effect, the value of
SHLVL is less stable than it used to be. Add SHLVL to the list of
built-in shell variables with unstable values, to be ignored when
checking for inappropriate differences to the shell environment
before and after a macro invocation / between two configure runs.
Problem and solution reported by Xi Ruoyao in
https://lists.gnu.org/archive/html/autoconf/2022-09/msg00015.html
Problem also reported by Bruce Dubbs in
https://lists.gnu.org/archive/html/bug-autoconf/2022-09/msg00010.html
* tests/local.at (_AT_CHECK_ENV, AT_CONFIG_CMP): Ignore changes in
value of SHLVL.
Copyright-paperwork-exempt: yes
Problem and solution reported by Roger Crew in:
https://lists.gnu.org/r/bug-autoconf/2022-09/msg00005.html
* lib/m4sugar/m4sh.m4 (_m4_divert(BINSH)): Change from 0 to 1,
and add 2 to HEADER-REVISION, HEADER-COMMENT, HEADER-COPYRIGHT,
M4SH-SANITIZE, M4SH-INIT-FN, and M4SH-INIT.
Copyright-paperwork-exempt: yes
Notced unstable key order when debugging unrelated bug.
Data::Dumper's SortKeys() makes ordering stable and decreases
diffs from run to run. No functional change otherwise.
* lib/Autom4te/C4che.pm
* lib/Autom4te/Request.pm: Sort request keys in serialization.
Copyright-paperwork-exempt: yes
* lib/autoconf/c.m4 (AC_LANG_CALL, AC_LANG_FUNC_LINK_TRY):
Use '(void)' rather than '()' in function prototypes, as the latter
provokes fatal errors in some compilers nowadays.
* lib/autoconf/functions.m4 (AC_FUNC_STRTOD):
* tests/fortran.at (AC_F77_DUMMY_MAIN usage):
* tests/semantics.at (AC_CHECK_DECLS):
Don’t use () in a function decl.
This change is taken from Gnulib, and is needed for apps like GDB.
* lib/autoconf/specific.m4 (_AC_SYS_YEAR2038_TEST_INCLUDES)
(_AC_SYS_YEAR2038, AC_SYS_YEAR2038): New macros, taken (with
renaming) from Gnulib.
(_AC_SYS_LARGEFILE_MACRO_VALUE): #undef before #define.
(AC_SYS_LARGEFILE): Prefer AS_IF and AS_CASE to doing it by hand.
Widen time_t if possible, too. Define __MINGW_USE_VC2005_COMPAT
early if needed.
* lib/autoconf/c.m4 (AC_C_BIGENDIAN): Improve the
inherently-unportable grep trick well enough to survive gcc
-std=c11 -flto when cross-compiling (sr#110687).
Tests of AC_{CHECK_,}HEADER_STDBOOL were failing on Darwin for two
reasons: an m4 quoting bug in tests/local.at causing Darwin sed to
throw syntax errors, and an excessively precise interpretation of how
C99 and C++11 interact. The latter is worth mentioning in NEWS.
* tests/local.at (_AT_DEFINES_CMP_PRUNE): Insert [] before ‘dnl’ in
two places to keep it separate from the result of the m4_bpatsubsts
operation that immediately precedes it.
* lib/autoconf/headers.m4 (AC_CHECK_HEADER_STDBOOL): Allow ‘bool’,
‘true’, and ‘false’ not to be macros, after including stdbool.h,
whenever __cplusplus is defined.
* NEWS: Document change to AC_{CHECK_,}HEADER_STDBOOL.
The main issue was use of s///r; the /r modifier was added in 5.14.
Since the baseline is now 5.10.0 instead of 5.6.0, a couple places
can be tidied up using slightly newer constructs.
* help-extract.pl: Use File::Spec::Functions instead of File::Spec
for reduced clunkiness.
(eval_qq_no_interpolation): Don’t use s///r. Do use \K and (?=...)
to match the empty string (but only in just the right locations),
so we don’t need to use $& in the replacement.
(main): Don’t use s///r.
We have had AC_PREREQ([2.69]) in our own configure.ac since 2021,
and before that it was AC_PREREQ([2.62]) since 2012, so backcompat
code for 2.61 is not necessary anymore.
Also add logging of the name of each candidate executable and bump the
serial number.
The minimum Perl version was raised to 5.8.0 from 5.6.0 in commit
3a9802d601 (but not documented as
such until e8c2d79ec4, and not
actually *enforced* by our own configure script until, er, now)
in order to use Time::HiRes::stat.
Unfortunately, while the Time::HiRes *module* was added in 5.8.0, it
did not export a ‘stat’ function until 5.8.9. More precisely, this
feature was added to Time::HiRes in version 1.92 of that module; Perl
core 5.8.8 shipped Time::HiRes 1.86, 5.8.9 shipped 1.9715. The only
system I have convenient access to, that has older Perls installed,
offers me a choice of 5.8.8 or 5.10.1, so the new requirement means
I cannot test with 5.8.x anymore.
Per https://perldoc.perl.org/perlhist the release history of these
versions of Perl is, in chronological order,
5.8.0 2002-Jul-18
5.8.8 2006-Jan-31
5.10.0 2007-Dec-18
5.8.9 2008-Dec-14 <-- almost a year later than 5.10.0
5.10.1 2009-Aug-22
5.12.0 2010-Apr-12
Per https://perldoc.perl.org/perl5101delta the differences between
5.10.0 and 5.10.1 are small, and do not make me worry about
accidentally introducing code that works on my test boxes but not for
our users, unlike the gulf between 5.8.x and 5.10.x.
Requiring 5.10 will mean that we have access to Digest::SHA, the //
and //= operators, the regexp \K escape, and ‘state’ variables
(lexical scope, persistent value) all of which I can think
of uses for (but none of them are actually used in this patch).
Putting it all together, I think a requirement bump to version 5.10.0
is justified. We are already chopping off the trailing edge at 2006
due to the requirement for M4 1.4.8 (/de facto/ since 2.70) and late
2007 is still 15 years ago.
This patch also makes configure search $PATH for executables named
‘perl5*’ and ‘perl-5.*’ if bare ‘perl’ is too old. To do this, it
introduces a helper macro AClocal_PATH_PROG_GLOBS_FEATURE_CHECK, which
I would *like* to promote to a new Autoconf feature, but I got stuck
on quoting issues — see comments in m4/perl-time-hires.m4.
* NEWS: Document requirement for Perl 5.10.
* m4/perl-time-hires.m4: New file.
* configure.ac: Use AC_PATH_PERL_WITH_TIME_HIRES_STAT to probe for
perl.
* build-aux/fetch.pl (fetch): For .pm files fetched from Automake,
rewrite “use 5.006” to “use 5.010”.
* build-aux/help-extract.pl
* lib/Autom4te/C4che.pm
* lib/Autom4te/ChannelDefs.pm
* lib/Autom4te/Channels.pm
* lib/Autom4te/Config.pm
* lib/Autom4te/Configure_ac.pm
* lib/Autom4te/FileUtils.pm
* lib/Autom4te/General.pm
* lib/Autom4te/Getopt.pm
* lib/Autom4te/Request.pm
* lib/Autom4te/XFile.pm
* tests/mktests.pl: Change “use 5.006” to “use 5.010”.
The former minimum version was 1.4.6. 1.4.6 and 1.4.7 do not track
the original location of text fed to ‘m4wrap’, which breaks autom4te’s
ability to trace macros invoked from _AC_FINALIZE.
Right now, the only _user_ visible effect of this is that autoconf
running on M4 1.4.6 or 1.4.7 will emit an internal error, instead of
the intended warning message, when it processes a configure.ac that
neglects to invoke AC_INIT or AC_OUTPUT. Perhaps more importantly,
it causes a bunch of scary-sounding failures in our own testsuite,
which deliberately doesn’t use AC_OUTPUT sometimes.
M4 1.4.6 and 1.4.7 also have bugs in location tracking of macro
invocations spread over multiple lines, which, guess what, causes
even more testsuite failures.
1.4.8 came out in 2006. As a practical matter, this change to our
requirements means that people using macOS *to run autoconf* (not just
to run generated configure scripts) cannot use the system-provided m4
anymore. {Free,Net,Open}BSD already don’t ship GNU M4 as their system
m4, so users of those OSes should not be affected.