On 24/04/2025 10:25, Bruno Haible via Gnulib discussion list wrote:
When the option --enable-systemd was introduced in August 2023, it was
experimental, because the code that uses it (readutmp in gnulib) was new
and not widely tested. Things have changed now: Ubuntu 25.04 ships
with no /var/run/utmp support and thus requires the use of the systemd
libraries; without it, the 'who' program prints nothing. So, I don't
think it's experimental any more.

There are two problem with this configure option:

1) Users are not aware that it is ineffective if the package 'libsystemd-dev'
has not been installed. Witnesses:
   - Comment #11 in 
https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/2103489
   - I tried to build coreutils-9.7 on Ubuntu 25.04. I used the option
     --enabled-systemd and was then surprised to see that 'who' produced
     no output and 'ldd src/who' did not show any systemd library.

There is no mention of this build dependency anywhere in coreutils. Only
gnulib/DEPENDENCIES has it documented, and the comments of m4/systemd.m4.

2) The option --enable-systemd is off by default. On systems like Ubuntu 25.04
(without /var/run/utmp support) this leads to a dysfunctional 'who' program
by default.

What can be done about this?

Ad 1)
(a) One should add a coreutils/DEPENDENCIES file that contains the relevant
     subset of gnulib/DEPENDENCIES, and coreutils/README-install should
     reference it.

+1

(b) If --enable-systemd is specified by the user and libsystemd-dev is not
     installed, the configuration should err out.

+1

Ideally this would be like --with-openssl.
Note gnulib could have more conservative defaults,
that packages can override. Coreutils for example does:
  gl_SET_CRYPTO_CHECK_DEFAULT([auto-gpl-compat])
For -with-systemd it would be good to have no,yes,auto options,
and I think "auto" would be the appropriate gnulib default.

(c) The configuration should, at the end, print a summary of which features
     are enabled and which are not. Like QEMU's configure does, or the one
     of many of Simon Josefsson's packages.

I generally run ./configure with --quiet, and so implicitly get
only the warnings saying what is not detected, which if --with-systemd=auto
was the default, would make it apparent that dependency was not installed.
But yes, an explicit summary of dependencies would make this more apparent.


Opinions?

Ad 2)
(a) The option --enable-systemd should be enabled by default on systems
     that have systemd and where /var/run/utmp does not exist.
(b) The option --enable-systemd should be enabled by default on systems
     which have libsystemd-dev installed.

I would think (b) (build time check) is more appropriate here.
I.e. --with-systemd=auto would check (b) and warn if not,
and --with-systemd=yes would do the same check and error if not.


Opinions?

My preferences would be 1(a) + 1(c) + 2(a). And yours (with rationale)?

cheers,
Pádraig

Reply via email to