Skip to content

Commit 73af9e9

Browse files
authored
Merge pull request #8782 from Ecordonnier/eco/makefile-fix
2 makefile fixes
2 parents 6e422b7 + 159f5c8 commit 73af9e9

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/workflows/CICD.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,11 @@ jobs:
379379
set -x
380380
# Regression-test for https://github.com/uutils/coreutils/issues/8701
381381
make UTILS="rm chmod chown chgrp mv du"
382+
# Verifies that
383+
# 1. there is no "error: none of the selected packages contains this
384+
# feature: feat_external_libstdbuf"
385+
# 2. the makefile doesn't try to install libstdbuf even though stdbuf is skipped
386+
DESTDIR=/tmp/ make SKIP_UTILS="stdbuf" install
382387
383388
build_rust_stable:
384389
name: Build/stable

GNUmakefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ ifneq ($(OS),Windows_NT)
228228
PROGS := $(PROGS) $(SELINUX_PROGS)
229229
endif
230230

231-
UTILS ?= $(PROGS)
231+
UTILS ?= $(filter-out $(SKIP_UTILS),$(PROGS))
232232

233233
ifneq ($(findstring stdbuf,$(UTILS)),)
234234
# Use external libstdbuf per default. It is more robust than embedding libstdbuf.
@@ -306,7 +306,7 @@ TEST_PROGS := \
306306
who
307307

308308
TESTS := \
309-
$(sort $(filter $(UTILS),$(filter-out $(SKIP_UTILS),$(TEST_PROGS))))
309+
$(sort $(filter $(UTILS),$(TEST_PROGS)))
310310

311311
TEST_NO_FAIL_FAST :=
312312
TEST_SPEC_FEATURE :=
@@ -326,7 +326,7 @@ endef
326326

327327
# Output names
328328
EXES := \
329-
$(sort $(filter $(UTILS),$(filter-out $(SKIP_UTILS),$(PROGS))))
329+
$(sort $(UTILS))
330330

331331
INSTALLEES := ${EXES}
332332
ifeq (${MULTICALL}, y)
@@ -352,7 +352,7 @@ build-coreutils:
352352

353353
build: build-coreutils build-pkgs locales
354354

355-
$(foreach test,$(filter-out $(SKIP_UTILS),$(PROGS)),$(eval $(call TEST_BUSYBOX,$(test))))
355+
$(foreach test,$(UTILS),$(eval $(call TEST_BUSYBOX,$(test))))
356356

357357
test:
358358
${CARGO} test ${CARGOFLAGS} --features "$(TESTS) $(TEST_SPEC_FEATURE)" --no-default-features $(TEST_NO_FAIL_FAST)
@@ -482,7 +482,7 @@ endif
482482

483483
install: build install-manpages install-completions install-locales
484484
mkdir -p $(INSTALLDIR_BIN)
485-
ifneq ($(OS),Windows_NT)
485+
ifneq (,$(and $(findstring stdbuf,$(UTILS)),$(findstring feat_external_libstdbuf,$(CARGOFLAGS))))
486486
mkdir -p $(DESTDIR)$(LIBSTDBUF_DIR)
487487
$(INSTALL) -m 755 $(BUILDDIR)/deps/libstdbuf* $(DESTDIR)$(LIBSTDBUF_DIR)/
488488
endif

0 commit comments

Comments
 (0)