From 873c37691d495d579b075a61de4f7d7662037a44 Mon Sep 17 00:00:00 2001 From: Etienne Cordonnier Date: Mon, 22 Sep 2025 10:27:09 +0200 Subject: [PATCH] makefile: fix build with overriden UTILS The make build was failing when the list of UTILS didn't contain stdbuf. This fixes this issue by adding feat_externa_libstdbuf only when stdbuf is being compiled. Fixes https://github.com/uutils/coreutils/issues/8701 Signed-off-by: Etienne Cordonnier --- .github/workflows/CICD.yml | 7 +++++++ GNUmakefile | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index de8fa5998..be7673e95 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -387,6 +387,13 @@ jobs: test -h /tmp/usr/local/bin/sha512sum test -h /tmp/usr/local/bin/shake128sum test -h /tmp/usr/local/bin/shake256sum + - name: "`make UTILS=XXX`" + shell: bash + run: | + set -x + # Regression-test for https://github.com/uutils/coreutils/issues/8701 + make UTILS="rm chmod chown chgrp mv du" + build_rust_stable: name: Build/stable needs: [ min_version, deps ] diff --git a/GNUmakefile b/GNUmakefile index 8e3ae05ca..83a169906 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -219,12 +219,15 @@ ifneq ($(OS),Windows_NT) PROGS := $(PROGS) $(UNIX_PROGS) # Build the selinux command even if not on the system PROGS := $(PROGS) $(SELINUX_PROGS) -# Always use external libstdbuf when building with make (Unix only) - CARGOFLAGS += --features feat_external_libstdbuf endif UTILS ?= $(PROGS) +ifneq ($(findstring stdbuf,$(UTILS)),) + # Use external libstdbuf per default. It is more robust than embedding libstdbuf. + CARGOFLAGS += --features feat_external_libstdbuf +endif + # Programs with usable tests TEST_PROGS := \ base32 \