Skip to content

Commit 20c2779

Browse files
authored
Merge pull request #8702 from Ecordonnier/eco/makefile-stdbuf
makefile: fix build with overriden UTILS
2 parents f1c8a72 + 873c376 commit 20c2779

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/workflows/CICD.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,13 @@ jobs:
387387
test -h /tmp/usr/local/bin/sha512sum
388388
test -h /tmp/usr/local/bin/shake128sum
389389
test -h /tmp/usr/local/bin/shake256sum
390+
- name: "`make UTILS=XXX`"
391+
shell: bash
392+
run: |
393+
set -x
394+
# Regression-test for https://github.com/uutils/coreutils/issues/8701
395+
make UTILS="rm chmod chown chgrp mv du"
396+
390397
build_rust_stable:
391398
name: Build/stable
392399
needs: [ min_version, deps ]

GNUmakefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,15 @@ ifneq ($(OS),Windows_NT)
219219
PROGS := $(PROGS) $(UNIX_PROGS)
220220
# Build the selinux command even if not on the system
221221
PROGS := $(PROGS) $(SELINUX_PROGS)
222-
# Always use external libstdbuf when building with make (Unix only)
223-
CARGOFLAGS += --features feat_external_libstdbuf
224222
endif
225223

226224
UTILS ?= $(PROGS)
227225

226+
ifneq ($(findstring stdbuf,$(UTILS)),)
227+
# Use external libstdbuf per default. It is more robust than embedding libstdbuf.
228+
CARGOFLAGS += --features feat_external_libstdbuf
229+
endif
230+
228231
# Programs with usable tests
229232
TEST_PROGS := \
230233
base32 \

0 commit comments

Comments
 (0)