Re: fedora 42 doesn't have awk: how to deal with autoconf subst?

Simon Josefsson via Bug reports for autoconf <[email protected]> Thu, 17 Apr 2025 13:31:11 +0200
Newsgroups gmane.comp.sysutils.autoconf.bugs,gmane.comp.lib.gnulib.bugs
Message-ID <[email protected]>
Paul Eggert <[email protected]> writes:

> On 2025-04-16 23:31, Simon Josefsson via Bug reports for autoconf wrote:
>
>> I tried reading through the autoconf manual to see if 'awk' is a
>> run-time dependency for running generated ./configure scripts
>
> It is a dependency, and the documentation should mention this

Thank you for patch and background context!

> [ awk cat cmp cp diff echo expr false
> grep ls mkdir mv printf pwd rm rmdir
> sed sort test touch tr true

Of those, I'm guessing awk, grep, sed and ls are the most complex.  The
'diff' tool also stands out, and most of my packages build fine (except
for some spuriois error messages during ./configure) without 'diff', and
it is often not available in containers.

>> 0) Modify autoconf to continue to work in this situation without awk,
>>     replacing it with more POSIX shell or something else?
>
> It might be possible to replace awk with Python (say), but it'd be a
> nontrivial. I doubt whether the shell itself would suffice. Probably
> not worth the effort at this point.

Python is not available in the default Fedora 42 image either.

I think the trend is to either assume /bin/sh with the smallest set of
utilities possible, or to switch everything to some higher-level
language like Python, Rust/Go or Guile.

It seems awk is going away as a standard tool, and it is possible to
either fight that or just accept it.

I would prefer if we can make things work with /bin/sh and as few
low-complex utilities as possible, for bootstrapping reasons.  Making
Python, Rust/Go, Guile etc work on new architectures is serious work,
and sometimes people just give up (e.g., m68k, sh4, sparc64 is not in a
good state here).  So I don't think that is always the right solution.

Having a limited/partial/inefficient awk implementation inside Autoconf,
implemented in /bin/sh, for the functionality that Autoconf needs
itself, would be nice.  It could be used if the system lacks 'awk'.  Or
all code that rely on awk could be rewritten in shell syntax.

/Simon
signature.asc (application/pgp-signature, 1.2 KB)
-----BEGIN PGP SIGNATURE-----

iQNoBAEWCAMQFiEEo8ychwudMQq61M8vUXIrCP5HRaIFAmgA5n8UHHNpbW9uQGpv
c2Vmc3Nvbi5vcmfCHCYAmDMEXJLOtBYJKwYBBAHaRw8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