On 2025-04-17 04:31, Simon Josefsson wrote:
Paul Eggert <egg...@cs.ucla.edu> writes:
[ 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.
In a minimal 'configure', if diff is absent then caches are ignored.
This will slow things down but it won't break things.
However, many 'configure's will use diff in more-complicated ways. For
example, when 'configure' checks whether 'grep' can handle long lines,
if 'diff' is missing and grep lacks a --version flag, 'configure' will
error out. This probably worked for you because you were using GNU grep
which has --version, but it won't work in a minimal POSIX environment.
And I imagine there are more-complicated dependencies on 'diff' in some
'configure' files, where if 'diff' is missing 'configure' will configure
your program incorrectly, perhaps merely hurting performance so 'make
check' doesn't catch it.
In short, I wouldn't recommend running 'configure' without 'diff'.
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.
I don't offhand see how that would work, without significantly hurting
performance in the usual case. But if someone could get it to work then
yes it's better if 'configure' depends on fewer programs.
From a minimalist point of view, Fedora's dropping of 'awk' in minimal
containers should not be that big of a deal. If you want to build
programs, you need build tools like gcc that really ought to be missing
in minimal environments. Just add awk to build tool list.