Skip to content

Commit 5b4a202

Browse files
committed
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 #8701 Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
1 parent e2f5dcb commit 5b4a202

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/CICD.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,12 @@ jobs:
341341
! test -f /tmp/usr/local/share/zsh/site-functions/_install
342342
! test -f /tmp/usr/local/share/bash-completion/completions/head
343343
! test -f /tmp/usr/local/share/fish/vendor_completions.d/cat.fish
344+
- name: "`make with UTILS overridden`"
345+
shell: bash
346+
run: |
347+
set -x
348+
# Regression-test for https://github.com/uutils/coreutils/issues/8701
349+
make UTILS="rm chmod chown chgrp mv du"
344350
345351
build_rust_stable:
346352
name: Build/stable

GNUmakefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,15 @@ ifneq ($(OS),Windows_NT)
202202
PROGS := $(PROGS) $(UNIX_PROGS)
203203
# Build the selinux command even if not on the system
204204
PROGS := $(PROGS) $(SELINUX_PROGS)
205-
# Always use external libstdbuf when building with make (Unix only)
206-
CARGOFLAGS += --features feat_external_libstdbuf
207205
endif
208206

209207
UTILS ?= $(PROGS)
210208

209+
ifneq ($(findstring stdbuf,$(UTILS)),)
210+
# Use external libstdbuf per default. It is more robust than embedding libstdbuf.
211+
CARGOFLAGS += --features feat_external_libstdbuf
212+
endif
213+
211214
# Programs with usable tests
212215
TEST_PROGS := \
213216
base32 \

0 commit comments

Comments
 (0)