From 84a6e1e1ca76c5f858cdce717442b9a8d102f5f9 Mon Sep 17 00:00:00 2001 From: Etienne Cordonnier Date: Tue, 30 Sep 2025 22:30:53 +0200 Subject: [PATCH 1/2] GNUmakefile: filter out SKIP_UTILS from UTILS This fixes this corner-case where SKIP_UTILS was not taken into account in the logic enabling feat_external_libstdbuf: ``` sudo make install SKIP_UTILS=stdbuf ... error: none of the selected packages contains this feature: feat_external_libstdbuf ``` Signed-off-by: Etienne Cordonnier --- GNUmakefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 41ba59349..846bc94f5 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -228,7 +228,7 @@ ifneq ($(OS),Windows_NT) PROGS := $(PROGS) $(SELINUX_PROGS) endif -UTILS ?= $(PROGS) +UTILS ?= $(filter-out $(SKIP_UTILS),$(PROGS)) ifneq ($(findstring stdbuf,$(UTILS)),) # Use external libstdbuf per default. It is more robust than embedding libstdbuf. @@ -306,7 +306,7 @@ TEST_PROGS := \ who TESTS := \ - $(sort $(filter $(UTILS),$(filter-out $(SKIP_UTILS),$(TEST_PROGS)))) + $(sort $(filter $(UTILS),$(TEST_PROGS))) TEST_NO_FAIL_FAST := TEST_SPEC_FEATURE := @@ -326,7 +326,7 @@ endef # Output names EXES := \ - $(sort $(filter $(UTILS),$(filter-out $(SKIP_UTILS),$(PROGS)))) + $(sort $(UTILS)) INSTALLEES := ${EXES} ifeq (${MULTICALL}, y) @@ -352,7 +352,7 @@ build-coreutils: build: build-coreutils build-pkgs locales -$(foreach test,$(filter-out $(SKIP_UTILS),$(PROGS)),$(eval $(call TEST_BUSYBOX,$(test)))) +$(foreach test,$(UTILS),$(eval $(call TEST_BUSYBOX,$(test)))) test: ${CARGO} test ${CARGOFLAGS} --features "$(TESTS) $(TEST_SPEC_FEATURE)" --no-default-features $(TEST_NO_FAIL_FAST) From 159f5c8a6eb9c9e386991abaa099483949f5843b Mon Sep 17 00:00:00 2001 From: Etienne Cordonnier Date: Tue, 30 Sep 2025 22:55:37 +0200 Subject: [PATCH 2/2] GNUmakefile: fix installation logic for libstdbuf It is better to check whether we're actually compiling libstdbuf, rather than to check whether we're on windows, in order to decide whether libstdbuf should get installed. Signed-off-by: Etienne Cordonnier --- .github/workflows/CICD.yml | 5 +++++ GNUmakefile | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index c5bbf7f11..7c62cc0cb 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -379,6 +379,11 @@ jobs: set -x # Regression-test for https://github.com/uutils/coreutils/issues/8701 make UTILS="rm chmod chown chgrp mv du" + # Verifies that + # 1. there is no "error: none of the selected packages contains this + # feature: feat_external_libstdbuf" + # 2. the makefile doesn't try to install libstdbuf even though stdbuf is skipped + DESTDIR=/tmp/ make SKIP_UTILS="stdbuf" install build_rust_stable: name: Build/stable diff --git a/GNUmakefile b/GNUmakefile index 846bc94f5..04af26315 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -482,7 +482,7 @@ endif install: build install-manpages install-completions install-locales mkdir -p $(INSTALLDIR_BIN) -ifneq ($(OS),Windows_NT) +ifneq (,$(and $(findstring stdbuf,$(UTILS)),$(findstring feat_external_libstdbuf,$(CARGOFLAGS)))) mkdir -p $(DESTDIR)$(LIBSTDBUF_DIR) $(INSTALL) -m 755 $(BUILDDIR)/deps/libstdbuf* $(DESTDIR)$(LIBSTDBUF_DIR)/ endif