From 159f5c8a6eb9c9e386991abaa099483949f5843b Mon Sep 17 00:00:00 2001 From: Etienne Cordonnier Date: Tue, 30 Sep 2025 22:55:37 +0200 Subject: [PATCH] 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