On Sun, 12 Jul 2026 at 19:16, Bruno Haible <[email protected]> wrote: > > Hi, > > Luca Boccassi wrote: > > coreutils is a core/essential package, that is pulled in every build > > chroot and so on. The functionality provided by libsystem is useful > > for full systems, but not so much for build systems or other such > > minimal environments. > > I tend to agree with that. The coreutils programs that use libsystemd > (who, users, pinky) are hardly useful in minimal environments. > For instance, Alpine Linux (which is often used for such minimal environments) > has only a minimal 'who' program and no 'users' and 'pinky' programs at all. > > > Switch usage of the library to dlopen, so that it can be built in but > > runtime optional, and can be avoided if the specific functionality is > > not used, gracefully. If dlopen fails, fallback to the non-systemd > > method gracefully. > > I disagree with this approach. The situation is not that libsystemd would > provide some enhanced results, compared to the non-systemd method. > Rather, the situation is that the relevant distros have removed > the support for the non-systemd method (by not creating a /var/tmp/utmp > file in the first place — cf. Thorsten Kukuk's work > <https://www.thkukuk.de/blog/Y2038_glibc_utmp_64bit/>). The non-systemd > method therefore returns outright broken results. > > In other words, what I don't like is that your proposal introduces a mode > where the three programs are present (and don't fail) but are broken for > all purposes. > > In the minimal environments that you are talking about, it is preferable > if the three programs signal an error instead of returning broken results. > > I see two ways to achieve that: > > a) Minimal environments could be created with no 'who', 'users', 'pinky' > programs. (For instance, the chroot environment creation routine > could skip over these three programs. Or the distro could split the > 'coreutils' package into 'coreutils-minimal' and 'coreutils-global' > packages; 'who', 'users', 'pinky' would be contained in the latter. > > b) Just add the 'who', 'users', 'pinky' program to the minimal environment, > without libsystemd.so. Then any invocation of 'who', 'users', 'pinky' > will automatically fail, due to the missing shared library. > > I find either of these two approaches preferable to what you propose.
Neither of these work in practice in major and important distros like Ubuntu and Fedora. The point is that there is a single build, producing a single package, called coreutils, that provides the same binaries for all use cases. But depending on the use case, one can skip optional libraries, and reduce optional functionality. That is the goal, and neither of those two options help reach it. Building separate versions or separate packages is just not practical or doable for essentials like coreutils, and it's not going to happen. And if a binary links to a library, a dependency is added automatically, it cannot be skipped, these things are not handled manually in any major distribution, it's all implicit based on the dynamic symbols tables. I'll send a new version that goes back to failing hard if the library is missing - the fallback was added following a review on github.
