Skip to contentSkip to conversation

make: support: use `command -v' instead of `which' *second try*

RFC PATCH In review Petr Vorel 4 participants 13 messages Oct 11, 2021 – Jul 24, 2022 Kbuild

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

cover make: support: use `command -v' instead of `which' *second try*

Hi all,

this is a second attempt to introduce command -v.

Changes v1->v2:
* reproduced original issue and fixed by not relying to $(shell command -v ...) but shell with:
$(shell $(SHELL) -c "command -v ...").
* quote variables

Tested only with make defconfig && make help >/dev/null

Petr Vorel (3):
make: support: use command -v' instead of which'
make: Drop type -p ...' fallback support/dependencies: don't check for which'

 Makefile                                      | 22 +++++++++----------
 package/Makefile.in                           |  8 +++----
 support/dependencies/check-host-bison-flex.mk |  4 ++--
 support/dependencies/check-host-cmake.sh      |  2 +-
 support/dependencies/check-host-gzip.sh       |  2 +-
 support/dependencies/check-host-lzip.sh       |  4 ++--
 support/dependencies/check-host-python3.sh    |  2 +-
 support/dependencies/check-host-tar.sh        |  4 ++--
 support/dependencies/check-host-xzcat.sh      |  4 ++--
 support/dependencies/dependencies.sh          | 18 +++++++--------
 .../pkg-toolchain-external.mk                 |  2 +-
 11 files changed, 35 insertions(+), 37 deletions(-)
Signature · 6 lines
2.33.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#1 lore raw

RFC PATCH 1/3 make: support: use `command -v' instead of `which'

`which' has been discontinued after 2.21 release in 2015 due this (git repository is empty [1]) and version shipped in Debian produces warning [2]:

/usr/bin/which: this version of which' is deprecated; use command -v' in scripts instead.

`command is POSIX [3] and supported on all common shells (bash, zsh, dash, busybox sh, mksh).

NOTE: originally merged as ca6a2907c2, but it had to be reverted due errors [4] (originally reported [5]). Problems were:

1) Main problem was that make sometimes expected `command' as a binary/script and run it with execve() (or any other exec*() wrapper), instead of running it through a shell via system() [4]:

    $ make defconfig
    [...]
    $ make help
    make[1]: command: Command not found
    [...]
   Fixed by not relying to $(shell command -v ...) but shell with:
   $(shell $(SHELL) -c "command -v ...").

2) command -v' handles only first parameter (unlike which') [4]. Hopefully fixed with quoting variables. Quoting variables is also needed, because both command -v' without args and type -p' exit 0.

Patch tested on both bash and dash as /bin/sh on various distros with having different make versions, including these previously affected (4.2.1, 4.0, 3.81).

[1] https://git.savannah.gnu.org/cgit/which.git
[2] https://salsa.debian.org/debian/debianutils/-/commit/3a8dd10b4502f7bae8fc6973c13ce23fc9da7efb
[3] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html
[4] https://lore.kernel.org/buildroot/20210930200402.GO1504958@scaer/
[5] https://lore.kernel.org/buildroot/YVTIghzHs82uFBIe@pevik/T/#m95c17eb8374e4e3dd6eee700d397aa12cca0739e

---
 Makefile                                      | 22 +++++++++----------
 package/Makefile.in                           |  8 +++----
 support/dependencies/check-host-bison-flex.mk |  4 ++--
 support/dependencies/check-host-cmake.sh      |  2 +-
 support/dependencies/check-host-gzip.sh       |  2 +-
 support/dependencies/check-host-lzip.sh       |  4 ++--
 support/dependencies/check-host-python3.sh    |  2 +-
 support/dependencies/check-host-tar.sh        |  4 ++--
 support/dependencies/check-host-xzcat.sh      |  4 ++--
 support/dependencies/dependencies.sh          | 16 +++++++-------
 .../pkg-toolchain-external.mk                 |  2 +-
 11 files changed, 35 insertions(+), 35 deletions(-)
Makefile +11 -11
index c960b53a6d..2317655272 100644
@@ -284,12 +284,12 @@ HOSTAS := as
 endif
 ifndef HOSTCC
 HOSTCC := gcc
-HOSTCC := $(shell which $(HOSTCC) || type -p $(HOSTCC) || echo gcc)
+HOSTCC := $(shell $(SHELL) -c "command -v '$(HOSTCC)' || type -p '$(HOSTCC)' || echo gcc")
 endif
 HOSTCC_NOCCACHE := $(HOSTCC)
 ifndef HOSTCXX
 HOSTCXX := g++
-HOSTCXX := $(shell which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++)
+HOSTCXX := $(shell $(SHELL) -c "command -v '$(HOSTCXX)' || type -p '$(HOSTCXX)' || echo g++")
 endif
 HOSTCXX_NOCCACHE := $(HOSTCXX)
 ifndef HOSTCPP
@@ -310,15 +310,15 @@ endif
 ifndef HOSTRANLIB
 HOSTRANLIB := ranlib
 endif
-HOSTAR := $(shell which $(HOSTAR) || type -p $(HOSTAR) || echo ar)
-HOSTAS := $(shell which $(HOSTAS) || type -p $(HOSTAS) || echo as)
-HOSTCPP := $(shell which $(HOSTCPP) || type -p $(HOSTCPP) || echo cpp)
-HOSTLD := $(shell which $(HOSTLD) || type -p $(HOSTLD) || echo ld)
-HOSTLN := $(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln)
-HOSTNM := $(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
-HOSTOBJCOPY := $(shell which $(HOSTOBJCOPY) || type -p $(HOSTOBJCOPY) || echo objcopy)
-HOSTRANLIB := $(shell which $(HOSTRANLIB) || type -p $(HOSTRANLIB) || echo ranlib)
-SED := $(shell which sed || type -p sed) -i -e
+HOSTAR := $(shell '$(SHELL)' -c "command -v '$(HOSTAR)' || type -p '$(HOSTAR)' || echo ar")
+HOSTAS := $(shell '$(SHELL)' -c "command -v '$(HOSTAS)' || type -p '$(HOSTAS)' || echo as")
+HOSTCPP := $(shell '$(SHELL)' -c "command -v '$(HOSTCPP)' || type -p '$(HOSTCPP)' || echo cpp")
+HOSTLD := $(shell '$(SHELL)' -c "command -v '$(HOSTLD)' || type -p '$(HOSTLD)' || echo ld")
+HOSTLN := $(shell '$(SHELL)' -c "command -v '$(HOSTLN)' || type -p '$(HOSTLN)' || echo ln")
+HOSTNM := $(shell '$(SHELL)' -c "command -v '$(HOSTNM)' || type -p '$(HOSTNM)' || echo nm")
+HOSTOBJCOPY := $(shell '$(SHELL)' -c "command -v '$(HOSTOBJCOPY)' || type -p '$(HOSTOBJCOPY)' || echo objcopy")
+HOSTRANLIB := $(shell '$(SHELL)' -c "command -v '$(HOSTRANLIB)' || type -p '$(HOSTRANLIB)' || echo ranlib")
+SED := $(shell $(SHELL) -c "command -v sed || type -p sed") -i -e
 
 export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD
 export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
package/Makefile.in +4 -4
index 86db62ba5b..2ba4d8b381 100644
@@ -4,7 +4,7 @@ endif
 ifndef HOSTMAKE
 HOSTMAKE = $(MAKE)
 endif
-HOSTMAKE := $(shell which $(HOSTMAKE) || type -p $(HOSTMAKE) || echo make)
+HOSTMAKE := $(shell $(SHELL) -c "command -v '$(HOSTMAKE)' || type -p '$(HOSTMAKE)' || echo make")
 
 # If BR2_JLEVEL is 0, scale the maximum concurrency with the number of
 # CPUs. An additional job is used in order to keep processors busy
@@ -222,8 +222,8 @@ else
 TARGET_STRIP = /bin/true
 STRIPCMD = $(TARGET_STRIP)
 endif
-INSTALL := $(shell which install || type -p install)
-UNZIP := $(shell which unzip || type -p unzip) -q
+INSTALL := $(shell $(SHELL) -c "command -v install || type -p install")
+UNZIP := $(shell $(SHELL) -c "command -v unzip || type -p unzip") -q
 
 APPLY_PATCHES = PATH=$(HOST_DIR)/bin:$$PATH support/scripts/apply-patches.sh $(if $(QUIET),-s)
 
@@ -237,7 +237,7 @@ HOST_LDFLAGS  += -L$(HOST_DIR)/lib -Wl,-rpath,$(HOST_DIR)/lib
 # the path to the system perl, before a host-perl built by Buildroot
 # might get installed into $(HOST_DIR)/bin and therefore appears
 # in our PATH. This system perl will be used as INTLTOOL_PERL.
-export PERL=$(shell which perl)
+export PERL=$(shell $(SHELL) -c "command -v perl")
 
 # host-intltool needs libxml-parser-perl, which Buildroot installs in
 # $(HOST_DIR)/lib/perl, so we must make sure that the system perl
support/dependencies/check-host-bison-flex.mk +2 -2
index 14a232fd44..b6cec369f1 100644
@@ -5,10 +5,10 @@
 # that runs on host, e.g. Kconfig. To build code for target use plain
 # host-{bison,flex}.
 
-ifeq ($(shell which bison 2>/dev/null),)
+ifeq ($(shell $(SHELL) -c "command -v bison 2>/dev/null"),)
 BR2_BISON_HOST_DEPENDENCY = host-bison
 endif
 
-ifeq ($(shell which flex 2>/dev/null),)
+ifeq ($(shell $(SHELL) -c "command -v flex 2>/dev/null"),)
 BR2_FLEX_HOST_DEPENDENCY = host-flex
 endif
support/dependencies/check-host-cmake.sh +1 -1
index fadeae9f6b..f202d72a98 100755
@@ -11,7 +11,7 @@ shift
 for candidate; do
 
     # Try to locate the candidate. Discard it if not located.
-    cmake=`which "${candidate}" 2>/dev/null`
+    cmake=`command -v "${candidate}" 2>/dev/null`
     [ -n "${cmake}" ] || continue
 
     # Extract version X.Y from versions in the form X.Y or X.Y.Z
support/dependencies/check-host-gzip.sh +1 -1
index 5f344c5f9b..4dbce72676 100755
@@ -2,7 +2,7 @@
 
 candidate="$1" # ignored
 
-gzip="$(which gzip)"
+gzip="$(command -v gzip)"
 if [ ! -x "${gzip}" ]; then
     # echo nothing: no suitable gzip found
     exit 1
support/dependencies/check-host-lzip.sh +2 -2
index 4f8a2ba3de..5cdfb8252a 100755
@@ -2,9 +2,9 @@
 
 candidate="$1"
 
-lzip=`which $candidate 2>/dev/null`
+lzip=`command -v "$candidate" 2>/dev/null`
 if [ ! -x "$lzip" ]; then
-	lzip=`which lzip 2>/dev/null`
+	lzip=`command -v lzip 2>/dev/null`
 	if [ ! -x "$lzip" ]; then
 		# echo nothing: no suitable lzip found
 		exit 1
support/dependencies/check-host-python3.sh +1 -1
index 17cafd2883..ca504da6ac 100755
@@ -14,7 +14,7 @@ shift
 # a more recent version.
 
 for candidate in "${@}" ; do
-	python3=`which $candidate 2>/dev/null`
+	python3=`command -v "$candidate" 2>/dev/null`
 	if [ ! -x "$python3" ]; then
 		continue
 	fi
support/dependencies/check-host-tar.sh +2 -2
index b7d607a47a..0f0f80038d 100755
@@ -2,9 +2,9 @@
 
 candidate="$1"
 
-tar=`which $candidate`
+tar=`command -v "$candidate"`
 if [ ! -x "$tar" ]; then
-	tar=`which tar`
+	tar=`command -v tar`
 	if [ ! -x "$tar" ]; then
 		# echo nothing: no suitable tar found
 		exit 1
support/dependencies/check-host-xzcat.sh +2 -2
index 10f1c4562a..a022c64faf 100755
@@ -2,9 +2,9 @@
 
 candidate="$1"
 
-xzcat=`which $candidate 2>/dev/null`
+xzcat=`command -v "$candidate" 2>/dev/null`
 if [ ! -x "$xzcat" ]; then
-	xzcat=`which xzcat 2>/dev/null`
+	xzcat=`command -v xzcat 2>/dev/null`
 	if [ ! -x "$xzcat" ]; then
 		# echo nothing: no suitable xzcat found
 		exit 1
support/dependencies/dependencies.sh +8 -8
index c604a9efcc..e720e9372e 100755
@@ -58,7 +58,7 @@ fi
 check_prog_host()
 {
 	prog="$1"
-	if ! which $prog > /dev/null ; then
+	if ! command -v "$prog" > /dev/null ; then
 		echo >&2
 		echo "You must install '$prog' on your build machine" >&2
 		exit 1
@@ -75,7 +75,7 @@ check_prog_host "sed"
 check_prog_host "/usr/bin/file"
 
 # Check make
-MAKE=$(which make 2> /dev/null)
+MAKE=$(command -v make 2> /dev/null)
 if [ -z "$MAKE" ] ; then
 	echo
 	echo "You must install 'make' on your build machine";
@@ -96,9 +96,9 @@ if [ $MAKE_MAJOR -lt 3 ] || [ $MAKE_MAJOR -eq 3 -a $MAKE_MINOR -lt 81 ] ; then
 fi;
 
 # Check host gcc
-COMPILER=$(which $HOSTCC_NOCCACHE 2> /dev/null)
+COMPILER=$(command -v "$HOSTCC_NOCCACHE" 2> /dev/null)
 if [ -z "$COMPILER" ] ; then
-	COMPILER=$(which cc 2> /dev/null)
+	COMPILER=$(command -v cc 2> /dev/null)
 fi;
 if [ -z "$COMPILER" ] ; then
 	echo
@@ -122,9 +122,9 @@ if [ $COMPILER_MAJOR -lt 4 -o $COMPILER_MAJOR -eq 4 -a $COMPILER_MINOR -lt 8 ] ;
 fi;
 
 # check for host CXX
-CXXCOMPILER=$(which $HOSTCXX_NOCCACHE 2> /dev/null)
+CXXCOMPILER=$(command -v "$HOSTCXX_NOCCACHE" 2> /dev/null)
 if [ -z "$CXXCOMPILER" ] ; then
-	CXXCOMPILER=$(which c++ 2> /dev/null)
+	CXXCOMPILER=$(command -v c++ 2> /dev/null)
 fi
 
 if [ -z "$CXXCOMPILER" ] ; then
@@ -164,7 +164,7 @@ fi
 # Check that a few mandatory programs are installed
 missing_progs="no"
 for prog in perl tar wget cpio unzip rsync bc ${DL_TOOLS} ; do
-	if ! which $prog > /dev/null ; then
+	if ! command -v "$prog" > /dev/null ; then
 		echo "You must install '$prog' on your build machine";
 		missing_progs="yes"
 		if test $prog = "svn" ; then
@@ -198,7 +198,7 @@ if [ "${PATCH_MAJOR}" -lt 2 ] || [ "${PATCH_MAJOR}" -eq 2 -a "${PATCH_MINOR}" -l
 fi
 
 if grep ^BR2_NEEDS_HOST_UTF8_LOCALE=y $BR2_CONFIG > /dev/null; then
-	if ! which locale > /dev/null ; then
+	if ! command -v locale > /dev/null ; then
 		echo
 		echo "You need locale support on your build machine to build a toolchain supporting locales"
 		exit 1 ;
toolchain/toolchain-external/pkg-toolchain-external.mk +1 -1
index 68d7a3fe21..2d9d9a5d49 100644
@@ -74,7 +74,7 @@ endif
 ifeq ($(TOOLCHAIN_EXTERNAL_INSTALL_DIR),)
 ifneq ($(TOOLCHAIN_EXTERNAL_PREFIX),)
 # if no path set, figure it out from path
-TOOLCHAIN_EXTERNAL_BIN := $(dir $(shell which $(TOOLCHAIN_EXTERNAL_PREFIX)-gcc))
+TOOLCHAIN_EXTERNAL_BIN := $(dir $(shell $(SHELL) -c "command -v '$(TOOLCHAIN_EXTERNAL_PREFIX)-gcc)'")
 endif
 else
 TOOLCHAIN_EXTERNAL_REL_BIN_PATH = $(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_REL_BIN_PATH))
Signature · 6 lines
2.33.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [RFC PATCH 1/3] make: support: use `command -v' instead of `which'

Petr, All,

On 2021-10-12 00:00 +0200, Petr Vorel spake thusly:

Quoted 5 lines

`which' has been discontinued after 2.21 release in 2015 due this (git repository is empty [1]) and version shipped in Debian produces warning [2]:

/usr/bin/which: this version of which' is deprecated; use command -v' in scripts instead.

In the meantime, this is supposed to have been overrdien by the technical committee:

    https://lwn.net/ml/debian-ctte/[email protected]/

Excerpt:

--8<---
1. The debianutils package must continue to provide the which(1) program until a compatible utility is available in a package that is at least transitively essential in Debian 12.

For the Debian 12 release, we expect which(1) to be in either an Essential package or a transitively Essential package (that is, a package that is depended on by an Essential package).

2. The which(1) program must not print any deprecation warnings. --8<---

As such, the situation is a calmer for now and is less urgent, and we can address it for after 2021.11 (given that Debian 11 was released only 3 months ago, we have a bit of time ahead of us before Debian 12 finally ships! ;-] )

Regards,
Yann E. MORIN.

Quoted 313 lines

`command is POSIX [3] and supported on all common shells (bash, zsh, dash, busybox sh, mksh).

NOTE: originally merged as ca6a2907c2, but it had to be reverted due errors [4] (originally reported [5]). Problems were:

1) Main problem was that make sometimes expected `command' as a binary/script and run it with execve() (or any other exec*() wrapper), instead of running it through a shell via system() [4]:

    $ make defconfig
    [...]
    $ make help
    make[1]: command: Command not found
    [...]
   Fixed by not relying to $(shell command -v ...) but shell with:
   $(shell $(SHELL) -c "command -v ...").

2) command -v' handles only first parameter (unlike which') [4]. Hopefully fixed with quoting variables. Quoting variables is also needed, because both command -v' without args and type -p' exit 0.

Patch tested on both bash and dash as /bin/sh on various distros with having different make versions, including these previously affected (4.2.1, 4.0, 3.81).

[1] https://git.savannah.gnu.org/cgit/which.git
[2] https://salsa.debian.org/debian/debianutils/-/commit/3a8dd10b4502f7bae8fc6973c13ce23fc9da7efb
[3] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html
[4] https://lore.kernel.org/buildroot/20210930200402.GO1504958@scaer/
[5] https://lore.kernel.org/buildroot/YVTIghzHs82uFBIe@pevik/T/#m95c17eb8374e4e3dd6eee700d397aa12cca0739e

---
 Makefile                                      | 22 +++++++++----------
 package/Makefile.in                           |  8 +++----
 support/dependencies/check-host-bison-flex.mk |  4 ++--
 support/dependencies/check-host-cmake.sh      |  2 +-
 support/dependencies/check-host-gzip.sh       |  2 +-
 support/dependencies/check-host-lzip.sh       |  4 ++--
 support/dependencies/check-host-python3.sh    |  2 +-
 support/dependencies/check-host-tar.sh        |  4 ++--
 support/dependencies/check-host-xzcat.sh      |  4 ++--
 support/dependencies/dependencies.sh          | 16 +++++++-------
 .../pkg-toolchain-external.mk                 |  2 +-
 11 files changed, 35 insertions(+), 35 deletions(-)
Makefile +11 -11
index c960b53a6d..2317655272 100644
@@ -284,12 +284,12 @@ HOSTAS := as
 endif
 ifndef HOSTCC
 HOSTCC := gcc
-HOSTCC := $(shell which $(HOSTCC) || type -p $(HOSTCC) || echo gcc)
+HOSTCC := $(shell $(SHELL) -c "command -v '$(HOSTCC)' || type -p '$(HOSTCC)' || echo gcc")
 endif
 HOSTCC_NOCCACHE := $(HOSTCC)
 ifndef HOSTCXX
 HOSTCXX := g++
-HOSTCXX := $(shell which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++)
+HOSTCXX := $(shell $(SHELL) -c "command -v '$(HOSTCXX)' || type -p '$(HOSTCXX)' || echo g++")
 endif
 HOSTCXX_NOCCACHE := $(HOSTCXX)
 ifndef HOSTCPP
@@ -310,15 +310,15 @@ endif
 ifndef HOSTRANLIB
 HOSTRANLIB := ranlib
 endif
-HOSTAR := $(shell which $(HOSTAR) || type -p $(HOSTAR) || echo ar)
-HOSTAS := $(shell which $(HOSTAS) || type -p $(HOSTAS) || echo as)
-HOSTCPP := $(shell which $(HOSTCPP) || type -p $(HOSTCPP) || echo cpp)
-HOSTLD := $(shell which $(HOSTLD) || type -p $(HOSTLD) || echo ld)
-HOSTLN := $(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln)
-HOSTNM := $(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
-HOSTOBJCOPY := $(shell which $(HOSTOBJCOPY) || type -p $(HOSTOBJCOPY) || echo objcopy)
-HOSTRANLIB := $(shell which $(HOSTRANLIB) || type -p $(HOSTRANLIB) || echo ranlib)
-SED := $(shell which sed || type -p sed) -i -e
+HOSTAR := $(shell '$(SHELL)' -c "command -v '$(HOSTAR)' || type -p '$(HOSTAR)' || echo ar")
+HOSTAS := $(shell '$(SHELL)' -c "command -v '$(HOSTAS)' || type -p '$(HOSTAS)' || echo as")
+HOSTCPP := $(shell '$(SHELL)' -c "command -v '$(HOSTCPP)' || type -p '$(HOSTCPP)' || echo cpp")
+HOSTLD := $(shell '$(SHELL)' -c "command -v '$(HOSTLD)' || type -p '$(HOSTLD)' || echo ld")
+HOSTLN := $(shell '$(SHELL)' -c "command -v '$(HOSTLN)' || type -p '$(HOSTLN)' || echo ln")
+HOSTNM := $(shell '$(SHELL)' -c "command -v '$(HOSTNM)' || type -p '$(HOSTNM)' || echo nm")
+HOSTOBJCOPY := $(shell '$(SHELL)' -c "command -v '$(HOSTOBJCOPY)' || type -p '$(HOSTOBJCOPY)' || echo objcopy")
+HOSTRANLIB := $(shell '$(SHELL)' -c "command -v '$(HOSTRANLIB)' || type -p '$(HOSTRANLIB)' || echo ranlib")
+SED := $(shell $(SHELL) -c "command -v sed || type -p sed") -i -e
 
 export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD
 export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
package/Makefile.in +4 -4
index 86db62ba5b..2ba4d8b381 100644
@@ -4,7 +4,7 @@ endif
 ifndef HOSTMAKE
 HOSTMAKE = $(MAKE)
 endif
-HOSTMAKE := $(shell which $(HOSTMAKE) || type -p $(HOSTMAKE) || echo make)
+HOSTMAKE := $(shell $(SHELL) -c "command -v '$(HOSTMAKE)' || type -p '$(HOSTMAKE)' || echo make")
 
 # If BR2_JLEVEL is 0, scale the maximum concurrency with the number of
 # CPUs. An additional job is used in order to keep processors busy
@@ -222,8 +222,8 @@ else
 TARGET_STRIP = /bin/true
 STRIPCMD = $(TARGET_STRIP)
 endif
-INSTALL := $(shell which install || type -p install)
-UNZIP := $(shell which unzip || type -p unzip) -q
+INSTALL := $(shell $(SHELL) -c "command -v install || type -p install")
+UNZIP := $(shell $(SHELL) -c "command -v unzip || type -p unzip") -q
 
 APPLY_PATCHES = PATH=$(HOST_DIR)/bin:$$PATH support/scripts/apply-patches.sh $(if $(QUIET),-s)
 
@@ -237,7 +237,7 @@ HOST_LDFLAGS  += -L$(HOST_DIR)/lib -Wl,-rpath,$(HOST_DIR)/lib
 # the path to the system perl, before a host-perl built by Buildroot
 # might get installed into $(HOST_DIR)/bin and therefore appears
 # in our PATH. This system perl will be used as INTLTOOL_PERL.
-export PERL=$(shell which perl)
+export PERL=$(shell $(SHELL) -c "command -v perl")
 
 # host-intltool needs libxml-parser-perl, which Buildroot installs in
 # $(HOST_DIR)/lib/perl, so we must make sure that the system perl
support/dependencies/check-host-bison-flex.mk +2 -2
index 14a232fd44..b6cec369f1 100644
@@ -5,10 +5,10 @@
 # that runs on host, e.g. Kconfig. To build code for target use plain
 # host-{bison,flex}.
 
-ifeq ($(shell which bison 2>/dev/null),)
+ifeq ($(shell $(SHELL) -c "command -v bison 2>/dev/null"),)
 BR2_BISON_HOST_DEPENDENCY = host-bison
 endif
 
-ifeq ($(shell which flex 2>/dev/null),)
+ifeq ($(shell $(SHELL) -c "command -v flex 2>/dev/null"),)
 BR2_FLEX_HOST_DEPENDENCY = host-flex
 endif
support/dependencies/check-host-cmake.sh +1 -1
index fadeae9f6b..f202d72a98 100755
@@ -11,7 +11,7 @@ shift
 for candidate; do
 
     # Try to locate the candidate. Discard it if not located.
-    cmake=`which "${candidate}" 2>/dev/null`
+    cmake=`command -v "${candidate}" 2>/dev/null`
     [ -n "${cmake}" ] || continue
 
     # Extract version X.Y from versions in the form X.Y or X.Y.Z
support/dependencies/check-host-gzip.sh +1 -1
index 5f344c5f9b..4dbce72676 100755
@@ -2,7 +2,7 @@
 
 candidate="$1" # ignored
 
-gzip="$(which gzip)"
+gzip="$(command -v gzip)"
 if [ ! -x "${gzip}" ]; then
     # echo nothing: no suitable gzip found
     exit 1
support/dependencies/check-host-lzip.sh +2 -2
index 4f8a2ba3de..5cdfb8252a 100755
@@ -2,9 +2,9 @@
 
 candidate="$1"
 
-lzip=`which $candidate 2>/dev/null`
+lzip=`command -v "$candidate" 2>/dev/null`
 if [ ! -x "$lzip" ]; then
-	lzip=`which lzip 2>/dev/null`
+	lzip=`command -v lzip 2>/dev/null`
 	if [ ! -x "$lzip" ]; then
 		# echo nothing: no suitable lzip found
 		exit 1
support/dependencies/check-host-python3.sh +1 -1
index 17cafd2883..ca504da6ac 100755
@@ -14,7 +14,7 @@ shift
 # a more recent version.
 
 for candidate in "${@}" ; do
-	python3=`which $candidate 2>/dev/null`
+	python3=`command -v "$candidate" 2>/dev/null`
 	if [ ! -x "$python3" ]; then
 		continue
 	fi
support/dependencies/check-host-tar.sh +2 -2
index b7d607a47a..0f0f80038d 100755
@@ -2,9 +2,9 @@
 
 candidate="$1"
 
-tar=`which $candidate`
+tar=`command -v "$candidate"`
 if [ ! -x "$tar" ]; then
-	tar=`which tar`
+	tar=`command -v tar`
 	if [ ! -x "$tar" ]; then
 		# echo nothing: no suitable tar found
 		exit 1
support/dependencies/check-host-xzcat.sh +2 -2
index 10f1c4562a..a022c64faf 100755
@@ -2,9 +2,9 @@
 
 candidate="$1"
 
-xzcat=`which $candidate 2>/dev/null`
+xzcat=`command -v "$candidate" 2>/dev/null`
 if [ ! -x "$xzcat" ]; then
-	xzcat=`which xzcat 2>/dev/null`
+	xzcat=`command -v xzcat 2>/dev/null`
 	if [ ! -x "$xzcat" ]; then
 		# echo nothing: no suitable xzcat found
 		exit 1
support/dependencies/dependencies.sh +8 -8
index c604a9efcc..e720e9372e 100755
@@ -58,7 +58,7 @@ fi
 check_prog_host()
 {
 	prog="$1"
-	if ! which $prog > /dev/null ; then
+	if ! command -v "$prog" > /dev/null ; then
 		echo >&2
 		echo "You must install '$prog' on your build machine" >&2
 		exit 1
@@ -75,7 +75,7 @@ check_prog_host "sed"
 check_prog_host "/usr/bin/file"
 
 # Check make
-MAKE=$(which make 2> /dev/null)
+MAKE=$(command -v make 2> /dev/null)
 if [ -z "$MAKE" ] ; then
 	echo
 	echo "You must install 'make' on your build machine";
@@ -96,9 +96,9 @@ if [ $MAKE_MAJOR -lt 3 ] || [ $MAKE_MAJOR -eq 3 -a $MAKE_MINOR -lt 81 ] ; then
 fi;
 
 # Check host gcc
-COMPILER=$(which $HOSTCC_NOCCACHE 2> /dev/null)
+COMPILER=$(command -v "$HOSTCC_NOCCACHE" 2> /dev/null)
 if [ -z "$COMPILER" ] ; then
-	COMPILER=$(which cc 2> /dev/null)
+	COMPILER=$(command -v cc 2> /dev/null)
 fi;
 if [ -z "$COMPILER" ] ; then
 	echo
@@ -122,9 +122,9 @@ if [ $COMPILER_MAJOR -lt 4 -o $COMPILER_MAJOR -eq 4 -a $COMPILER_MINOR -lt 8 ] ;
 fi;
 
 # check for host CXX
-CXXCOMPILER=$(which $HOSTCXX_NOCCACHE 2> /dev/null)
+CXXCOMPILER=$(command -v "$HOSTCXX_NOCCACHE" 2> /dev/null)
 if [ -z "$CXXCOMPILER" ] ; then
-	CXXCOMPILER=$(which c++ 2> /dev/null)
+	CXXCOMPILER=$(command -v c++ 2> /dev/null)
 fi
 
 if [ -z "$CXXCOMPILER" ] ; then
@@ -164,7 +164,7 @@ fi
 # Check that a few mandatory programs are installed
 missing_progs="no"
 for prog in perl tar wget cpio unzip rsync bc ${DL_TOOLS} ; do
-	if ! which $prog > /dev/null ; then
+	if ! command -v "$prog" > /dev/null ; then
 		echo "You must install '$prog' on your build machine";
 		missing_progs="yes"
 		if test $prog = "svn" ; then
@@ -198,7 +198,7 @@ if [ "${PATCH_MAJOR}" -lt 2 ] || [ "${PATCH_MAJOR}" -eq 2 -a "${PATCH_MINOR}" -l
 fi
 
 if grep ^BR2_NEEDS_HOST_UTF8_LOCALE=y $BR2_CONFIG > /dev/null; then
-	if ! which locale > /dev/null ; then
+	if ! command -v locale > /dev/null ; then
 		echo
 		echo "You need locale support on your build machine to build a toolchain supporting locales"
 		exit 1 ;
toolchain/toolchain-external/pkg-toolchain-external.mk +1 -1
index 68d7a3fe21..2d9d9a5d49 100644
@@ -74,7 +74,7 @@ endif
 ifeq ($(TOOLCHAIN_EXTERNAL_INSTALL_DIR),)
 ifneq ($(TOOLCHAIN_EXTERNAL_PREFIX),)
 # if no path set, figure it out from path
-TOOLCHAIN_EXTERNAL_BIN := $(dir $(shell which $(TOOLCHAIN_EXTERNAL_PREFIX)-gcc))
+TOOLCHAIN_EXTERNAL_BIN := $(dir $(shell $(SHELL) -c "command -v '$(TOOLCHAIN_EXTERNAL_PREFIX)-gcc)'")
 endif
 else
 TOOLCHAIN_EXTERNAL_REL_BIN_PATH = $(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_REL_BIN_PATH))
Signature · 6 lines
2.33.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#3 lore raw

Re: [Buildroot] [RFC PATCH 1/3] make: support: use `command -v' instead of `which'

Hi Yann,

Quoted 7 lines

Petr, All,

On 2021-10-12 00:00 +0200, Petr Vorel spake thusly:

Quoted 3 lines

`which' has been discontinued after 2.21 release in 2015 due this (git repository is empty [1]) and version shipped in Debian produces warning [2]:

Quoted 6 lines
Quoted 1 line

/usr/bin/which: this version of which' is deprecated; use command -v' in scripts instead.

In the meantime, this is supposed to have been overrdien by the technical committee:

    https://lwn.net/ml/debian-ctte/[email protected]/

Yep, I've noticed this on LWN as well.

Quoted 11 lines

Excerpt:

--8<---
1. The debianutils package must continue to provide the which(1) program until a compatible utility is available in a package that is at least transitively essential in Debian 12.

For the Debian 12 release, we expect which(1) to be in either an Essential package or a transitively Essential package (that is, a package that is depended on by an Essential package).

Quoted 7 lines

2. The which(1) program must not print any deprecation warnings. --8<---

As such, the situation is a calmer for now and is less urgent, and we can address it for after 2021.11 (given that Debian 11 was released only 3 months ago, we have a bit of time ahead of us before Debian 12 finally ships! ;-] )

Well, some people use Debian testing :). But sure, it was never urgent, the issue does not break build. This time I'm quite confident it works, but one revert was enough => it can wait till more people find time to test it.

Kind regards,
Petr

Quoted 316 lines

Regards,
Yann E. MORIN.

Quoted 313 lines

`command is POSIX [3] and supported on all common shells (bash, zsh, dash, busybox sh, mksh).

NOTE: originally merged as ca6a2907c2, but it had to be reverted due errors [4] (originally reported [5]). Problems were:

1) Main problem was that make sometimes expected `command' as a binary/script and run it with execve() (or any other exec*() wrapper), instead of running it through a shell via system() [4]:

    $ make defconfig
    [...]
    $ make help
    make[1]: command: Command not found
    [...]
   Fixed by not relying to $(shell command -v ...) but shell with:
   $(shell $(SHELL) -c "command -v ...").

2) command -v' handles only first parameter (unlike which') [4]. Hopefully fixed with quoting variables. Quoting variables is also needed, because both command -v' without args and type -p' exit 0.

Patch tested on both bash and dash as /bin/sh on various distros with having different make versions, including these previously affected (4.2.1, 4.0, 3.81).

[1] https://git.savannah.gnu.org/cgit/which.git
[2] https://salsa.debian.org/debian/debianutils/-/commit/3a8dd10b4502f7bae8fc6973c13ce23fc9da7efb
[3] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html
[4] https://lore.kernel.org/buildroot/20210930200402.GO1504958@scaer/
[5] https://lore.kernel.org/buildroot/YVTIghzHs82uFBIe@pevik/T/#m95c17eb8374e4e3dd6eee700d397aa12cca0739e

---
 Makefile                                      | 22 +++++++++----------
 package/Makefile.in                           |  8 +++----
 support/dependencies/check-host-bison-flex.mk |  4 ++--
 support/dependencies/check-host-cmake.sh      |  2 +-
 support/dependencies/check-host-gzip.sh       |  2 +-
 support/dependencies/check-host-lzip.sh       |  4 ++--
 support/dependencies/check-host-python3.sh    |  2 +-
 support/dependencies/check-host-tar.sh        |  4 ++--
 support/dependencies/check-host-xzcat.sh      |  4 ++--
 support/dependencies/dependencies.sh          | 16 +++++++-------
 .../pkg-toolchain-external.mk                 |  2 +-
 11 files changed, 35 insertions(+), 35 deletions(-)
Makefile +11 -11
index c960b53a6d..2317655272 100644
@@ -284,12 +284,12 @@ HOSTAS := as
 endif
 ifndef HOSTCC
 HOSTCC := gcc
-HOSTCC := $(shell which $(HOSTCC) || type -p $(HOSTCC) || echo gcc)
+HOSTCC := $(shell $(SHELL) -c "command -v '$(HOSTCC)' || type -p '$(HOSTCC)' || echo gcc")
 endif
 HOSTCC_NOCCACHE := $(HOSTCC)
 ifndef HOSTCXX
 HOSTCXX := g++
-HOSTCXX := $(shell which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++)
+HOSTCXX := $(shell $(SHELL) -c "command -v '$(HOSTCXX)' || type -p '$(HOSTCXX)' || echo g++")
 endif
 HOSTCXX_NOCCACHE := $(HOSTCXX)
 ifndef HOSTCPP
@@ -310,15 +310,15 @@ endif
 ifndef HOSTRANLIB
 HOSTRANLIB := ranlib
 endif
-HOSTAR := $(shell which $(HOSTAR) || type -p $(HOSTAR) || echo ar)
-HOSTAS := $(shell which $(HOSTAS) || type -p $(HOSTAS) || echo as)
-HOSTCPP := $(shell which $(HOSTCPP) || type -p $(HOSTCPP) || echo cpp)
-HOSTLD := $(shell which $(HOSTLD) || type -p $(HOSTLD) || echo ld)
-HOSTLN := $(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln)
-HOSTNM := $(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
-HOSTOBJCOPY := $(shell which $(HOSTOBJCOPY) || type -p $(HOSTOBJCOPY) || echo objcopy)
-HOSTRANLIB := $(shell which $(HOSTRANLIB) || type -p $(HOSTRANLIB) || echo ranlib)
-SED := $(shell which sed || type -p sed) -i -e
+HOSTAR := $(shell '$(SHELL)' -c "command -v '$(HOSTAR)' || type -p '$(HOSTAR)' || echo ar")
+HOSTAS := $(shell '$(SHELL)' -c "command -v '$(HOSTAS)' || type -p '$(HOSTAS)' || echo as")
+HOSTCPP := $(shell '$(SHELL)' -c "command -v '$(HOSTCPP)' || type -p '$(HOSTCPP)' || echo cpp")
+HOSTLD := $(shell '$(SHELL)' -c "command -v '$(HOSTLD)' || type -p '$(HOSTLD)' || echo ld")
+HOSTLN := $(shell '$(SHELL)' -c "command -v '$(HOSTLN)' || type -p '$(HOSTLN)' || echo ln")
+HOSTNM := $(shell '$(SHELL)' -c "command -v '$(HOSTNM)' || type -p '$(HOSTNM)' || echo nm")
+HOSTOBJCOPY := $(shell '$(SHELL)' -c "command -v '$(HOSTOBJCOPY)' || type -p '$(HOSTOBJCOPY)' || echo objcopy")
+HOSTRANLIB := $(shell '$(SHELL)' -c "command -v '$(HOSTRANLIB)' || type -p '$(HOSTRANLIB)' || echo ranlib")
+SED := $(shell $(SHELL) -c "command -v sed || type -p sed") -i -e
 
 export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD
 export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
package/Makefile.in +4 -4
index 86db62ba5b..2ba4d8b381 100644
@@ -4,7 +4,7 @@ endif
 ifndef HOSTMAKE
 HOSTMAKE = $(MAKE)
 endif
-HOSTMAKE := $(shell which $(HOSTMAKE) || type -p $(HOSTMAKE) || echo make)
+HOSTMAKE := $(shell $(SHELL) -c "command -v '$(HOSTMAKE)' || type -p '$(HOSTMAKE)' || echo make")
 
 # If BR2_JLEVEL is 0, scale the maximum concurrency with the number of
 # CPUs. An additional job is used in order to keep processors busy
@@ -222,8 +222,8 @@ else
 TARGET_STRIP = /bin/true
 STRIPCMD = $(TARGET_STRIP)
 endif
-INSTALL := $(shell which install || type -p install)
-UNZIP := $(shell which unzip || type -p unzip) -q
+INSTALL := $(shell $(SHELL) -c "command -v install || type -p install")
+UNZIP := $(shell $(SHELL) -c "command -v unzip || type -p unzip") -q
 
 APPLY_PATCHES = PATH=$(HOST_DIR)/bin:$$PATH support/scripts/apply-patches.sh $(if $(QUIET),-s)
 
@@ -237,7 +237,7 @@ HOST_LDFLAGS  += -L$(HOST_DIR)/lib -Wl,-rpath,$(HOST_DIR)/lib
 # the path to the system perl, before a host-perl built by Buildroot
 # might get installed into $(HOST_DIR)/bin and therefore appears
 # in our PATH. This system perl will be used as INTLTOOL_PERL.
-export PERL=$(shell which perl)
+export PERL=$(shell $(SHELL) -c "command -v perl")
 
 # host-intltool needs libxml-parser-perl, which Buildroot installs in
 # $(HOST_DIR)/lib/perl, so we must make sure that the system perl
support/dependencies/check-host-bison-flex.mk +2 -2
index 14a232fd44..b6cec369f1 100644
@@ -5,10 +5,10 @@
 # that runs on host, e.g. Kconfig. To build code for target use plain
 # host-{bison,flex}.
 
-ifeq ($(shell which bison 2>/dev/null),)
+ifeq ($(shell $(SHELL) -c "command -v bison 2>/dev/null"),)
 BR2_BISON_HOST_DEPENDENCY = host-bison
 endif
 
-ifeq ($(shell which flex 2>/dev/null),)
+ifeq ($(shell $(SHELL) -c "command -v flex 2>/dev/null"),)
 BR2_FLEX_HOST_DEPENDENCY = host-flex
 endif
support/dependencies/check-host-cmake.sh +1 -1
index fadeae9f6b..f202d72a98 100755
@@ -11,7 +11,7 @@ shift
 for candidate; do
 
     # Try to locate the candidate. Discard it if not located.
-    cmake=`which "${candidate}" 2>/dev/null`
+    cmake=`command -v "${candidate}" 2>/dev/null`
     [ -n "${cmake}" ] || continue
 
     # Extract version X.Y from versions in the form X.Y or X.Y.Z
support/dependencies/check-host-gzip.sh +1 -1
index 5f344c5f9b..4dbce72676 100755
@@ -2,7 +2,7 @@
 
 candidate="$1" # ignored
 
-gzip="$(which gzip)"
+gzip="$(command -v gzip)"
 if [ ! -x "${gzip}" ]; then
     # echo nothing: no suitable gzip found
     exit 1
support/dependencies/check-host-lzip.sh +2 -2
index 4f8a2ba3de..5cdfb8252a 100755
@@ -2,9 +2,9 @@
 
 candidate="$1"
 
-lzip=`which $candidate 2>/dev/null`
+lzip=`command -v "$candidate" 2>/dev/null`
 if [ ! -x "$lzip" ]; then
-	lzip=`which lzip 2>/dev/null`
+	lzip=`command -v lzip 2>/dev/null`
 	if [ ! -x "$lzip" ]; then
 		# echo nothing: no suitable lzip found
 		exit 1
support/dependencies/check-host-python3.sh +1 -1
index 17cafd2883..ca504da6ac 100755
@@ -14,7 +14,7 @@ shift
 # a more recent version.
 
 for candidate in "${@}" ; do
-	python3=`which $candidate 2>/dev/null`
+	python3=`command -v "$candidate" 2>/dev/null`
 	if [ ! -x "$python3" ]; then
 		continue
 	fi
support/dependencies/check-host-tar.sh +2 -2
index b7d607a47a..0f0f80038d 100755
@@ -2,9 +2,9 @@
 
 candidate="$1"
 
-tar=`which $candidate`
+tar=`command -v "$candidate"`
 if [ ! -x "$tar" ]; then
-	tar=`which tar`
+	tar=`command -v tar`
 	if [ ! -x "$tar" ]; then
 		# echo nothing: no suitable tar found
 		exit 1
support/dependencies/check-host-xzcat.sh +2 -2
index 10f1c4562a..a022c64faf 100755
@@ -2,9 +2,9 @@
 
 candidate="$1"
 
-xzcat=`which $candidate 2>/dev/null`
+xzcat=`command -v "$candidate" 2>/dev/null`
 if [ ! -x "$xzcat" ]; then
-	xzcat=`which xzcat 2>/dev/null`
+	xzcat=`command -v xzcat 2>/dev/null`
 	if [ ! -x "$xzcat" ]; then
 		# echo nothing: no suitable xzcat found
 		exit 1
support/dependencies/dependencies.sh +8 -8
index c604a9efcc..e720e9372e 100755
@@ -58,7 +58,7 @@ fi
 check_prog_host()
 {
 	prog="$1"
-	if ! which $prog > /dev/null ; then
+	if ! command -v "$prog" > /dev/null ; then
 		echo >&2
 		echo "You must install '$prog' on your build machine" >&2
 		exit 1
@@ -75,7 +75,7 @@ check_prog_host "sed"
 check_prog_host "/usr/bin/file"
 
 # Check make
-MAKE=$(which make 2> /dev/null)
+MAKE=$(command -v make 2> /dev/null)
 if [ -z "$MAKE" ] ; then
 	echo
 	echo "You must install 'make' on your build machine";
@@ -96,9 +96,9 @@ if [ $MAKE_MAJOR -lt 3 ] || [ $MAKE_MAJOR -eq 3 -a $MAKE_MINOR -lt 81 ] ; then
 fi;
 
 # Check host gcc
-COMPILER=$(which $HOSTCC_NOCCACHE 2> /dev/null)
+COMPILER=$(command -v "$HOSTCC_NOCCACHE" 2> /dev/null)
 if [ -z "$COMPILER" ] ; then
-	COMPILER=$(which cc 2> /dev/null)
+	COMPILER=$(command -v cc 2> /dev/null)
 fi;
 if [ -z "$COMPILER" ] ; then
 	echo
@@ -122,9 +122,9 @@ if [ $COMPILER_MAJOR -lt 4 -o $COMPILER_MAJOR -eq 4 -a $COMPILER_MINOR -lt 8 ] ;
 fi;
 
 # check for host CXX
-CXXCOMPILER=$(which $HOSTCXX_NOCCACHE 2> /dev/null)
+CXXCOMPILER=$(command -v "$HOSTCXX_NOCCACHE" 2> /dev/null)
 if [ -z "$CXXCOMPILER" ] ; then
-	CXXCOMPILER=$(which c++ 2> /dev/null)
+	CXXCOMPILER=$(command -v c++ 2> /dev/null)
 fi
 
 if [ -z "$CXXCOMPILER" ] ; then
@@ -164,7 +164,7 @@ fi
 # Check that a few mandatory programs are installed
 missing_progs="no"
 for prog in perl tar wget cpio unzip rsync bc ${DL_TOOLS} ; do
-	if ! which $prog > /dev/null ; then
+	if ! command -v "$prog" > /dev/null ; then
 		echo "You must install '$prog' on your build machine";
 		missing_progs="yes"
 		if test $prog = "svn" ; then
@@ -198,7 +198,7 @@ if [ "${PATCH_MAJOR}" -lt 2 ] || [ "${PATCH_MAJOR}" -eq 2 -a "${PATCH_MINOR}" -l
 fi
 
 if grep ^BR2_NEEDS_HOST_UTF8_LOCALE=y $BR2_CONFIG > /dev/null; then
-	if ! which locale > /dev/null ; then
+	if ! command -v locale > /dev/null ; then
 		echo
 		echo "You need locale support on your build machine to build a toolchain supporting locales"
 		exit 1 ;
toolchain/toolchain-external/pkg-toolchain-external.mk +1 -1
index 68d7a3fe21..2d9d9a5d49 100644
@@ -74,7 +74,7 @@ endif
 ifeq ($(TOOLCHAIN_EXTERNAL_INSTALL_DIR),)
 ifneq ($(TOOLCHAIN_EXTERNAL_PREFIX),)
 # if no path set, figure it out from path
-TOOLCHAIN_EXTERNAL_BIN := $(dir $(shell which $(TOOLCHAIN_EXTERNAL_PREFIX)-gcc))
+TOOLCHAIN_EXTERNAL_BIN := $(dir $(shell $(SHELL) -c "command -v '$(TOOLCHAIN_EXTERNAL_PREFIX)-gcc)'")
 endif
 else
 TOOLCHAIN_EXTERNAL_REL_BIN_PATH = $(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_REL_BIN_PATH))
Signature · 6 lines
2.33.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

Re: [Buildroot] [RFC PATCH 1/3] make: support: use `command -v' instead of `which'

Quoted 31 lines · Petr Vorel

Hi Yann,

Quoted 7 lines

Petr, All,

On 2021-10-12 00:00 +0200, Petr Vorel spake thusly:

Quoted 3 lines

`which' has been discontinued after 2.21 release in 2015 due this (git repository is empty [1]) and version shipped in Debian produces warning [2]:

Quoted 6 lines
Quoted 1 line

/usr/bin/which: this version of which' is deprecated; use command -v' in scripts instead.

In the meantime, this is supposed to have been overrdien by the technical committee:

     https://lwn.net/ml/debian-ctte/[email protected]/

Yep, I've noticed this on LWN as well.

Quoted 13 lines

Excerpt:

--8<---
1. The debianutils package must continue to provide the which(1) program until a compatible utility is available in a package that is at least transitively essential in Debian 12.

For the Debian 12 release, we expect which(1) to be in either an Essential package or a transitively Essential package (that is, a package that is depended on by an Essential package).

2. The which(1) program must not print any deprecation warnings. --8<---

Quoted 8 lines
Quoted 4 lines

As such, the situation is a calmer for now and is less urgent, and we can address it for after 2021.11 (given that Debian 11 was released only 3 months ago, we have a bit of time ahead of us before Debian 12 finally ships! ;-] )

Well, some people use Debian testing :). But sure, it was never urgent, the issue does not break build. This time I'm quite confident it works, but one revert was enough => it can wait till more people find time to test it.

In the end, it got reverted in debian testing as well, so we can drop this
series (for now). I've marked them as Rejected in patchwork.

Regards,
Arnout

Quoted 316 lines

Kind regards,
Petr

Quoted 311 lines

Regards,
Yann E. MORIN.

Quoted 308 lines

`command is POSIX [3] and supported on all common shells (bash, zsh, dash, busybox sh, mksh).

NOTE: originally merged as ca6a2907c2, but it had to be reverted due errors [4] (originally reported [5]). Problems were:

1) Main problem was that make sometimes expected `command' as a binary/script and run it with execve() (or any other exec*() wrapper), instead of running it through a shell via system() [4]:

$ make defconfig
[...]
$ make help
make[1]: command: Command not found
[...]

Fixed by not relying to $(shell command -v ...) but shell with:
$(shell $(SHELL) -c "command -v ...").

2) command -v' handles only first parameter (unlike which') [4]. Hopefully fixed with quoting variables. Quoting variables is also needed, because both command -v' without args and type -p' exit 0.

Patch tested on both bash and dash as /bin/sh on various distros with having different make versions, including these previously affected (4.2.1, 4.0, 3.81).

[1] https://git.savannah.gnu.org/cgit/which.git
[2] https://salsa.debian.org/debian/debianutils/-/commit/3a8dd10b4502f7bae8fc6973c13ce23fc9da7efb
[3] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html
[4] https://lore.kernel.org/buildroot/20210930200402.GO1504958@scaer/
[5] https://lore.kernel.org/buildroot/YVTIghzHs82uFBIe@pevik/T/#m95c17eb8374e4e3dd6eee700d397aa12cca0739e

---
  Makefile                                      | 22 +++++++++----------
  package/Makefile.in                           |  8 +++----
  support/dependencies/check-host-bison-flex.mk |  4 ++--
  support/dependencies/check-host-cmake.sh      |  2 +-
  support/dependencies/check-host-gzip.sh       |  2 +-
  support/dependencies/check-host-lzip.sh       |  4 ++--
  support/dependencies/check-host-python3.sh    |  2 +-
  support/dependencies/check-host-tar.sh        |  4 ++--
  support/dependencies/check-host-xzcat.sh      |  4 ++--
  support/dependencies/dependencies.sh          | 16 +++++++-------
  .../pkg-toolchain-external.mk                 |  2 +-
  11 files changed, 35 insertions(+), 35 deletions(-)
Makefile +11 -11
index c960b53a6d..2317655272 100644
@@ -284,12 +284,12 @@ HOSTAS := as
  endif
  ifndef HOSTCC
  HOSTCC := gcc
-HOSTCC := $(shell which $(HOSTCC) || type -p $(HOSTCC) || echo gcc)
+HOSTCC := $(shell $(SHELL) -c "command -v '$(HOSTCC)' || type -p '$(HOSTCC)' || echo gcc")
  endif
  HOSTCC_NOCCACHE := $(HOSTCC)
  ifndef HOSTCXX
  HOSTCXX := g++
-HOSTCXX := $(shell which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++)
+HOSTCXX := $(shell $(SHELL) -c "command -v '$(HOSTCXX)' || type -p '$(HOSTCXX)' || echo g++")
  endif
  HOSTCXX_NOCCACHE := $(HOSTCXX)
  ifndef HOSTCPP
@@ -310,15 +310,15 @@ endif
  ifndef HOSTRANLIB
  HOSTRANLIB := ranlib
  endif
-HOSTAR := $(shell which $(HOSTAR) || type -p $(HOSTAR) || echo ar)
-HOSTAS := $(shell which $(HOSTAS) || type -p $(HOSTAS) || echo as)
-HOSTCPP := $(shell which $(HOSTCPP) || type -p $(HOSTCPP) || echo cpp)
-HOSTLD := $(shell which $(HOSTLD) || type -p $(HOSTLD) || echo ld)
-HOSTLN := $(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln)
-HOSTNM := $(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm)
-HOSTOBJCOPY := $(shell which $(HOSTOBJCOPY) || type -p $(HOSTOBJCOPY) || echo objcopy)
-HOSTRANLIB := $(shell which $(HOSTRANLIB) || type -p $(HOSTRANLIB) || echo ranlib)
-SED := $(shell which sed || type -p sed) -i -e
+HOSTAR := $(shell '$(SHELL)' -c "command -v '$(HOSTAR)' || type -p '$(HOSTAR)' || echo ar")
+HOSTAS := $(shell '$(SHELL)' -c "command -v '$(HOSTAS)' || type -p '$(HOSTAS)' || echo as")
+HOSTCPP := $(shell '$(SHELL)' -c "command -v '$(HOSTCPP)' || type -p '$(HOSTCPP)' || echo cpp")
+HOSTLD := $(shell '$(SHELL)' -c "command -v '$(HOSTLD)' || type -p '$(HOSTLD)' || echo ld")
+HOSTLN := $(shell '$(SHELL)' -c "command -v '$(HOSTLN)' || type -p '$(HOSTLN)' || echo ln")
+HOSTNM := $(shell '$(SHELL)' -c "command -v '$(HOSTNM)' || type -p '$(HOSTNM)' || echo nm")
+HOSTOBJCOPY := $(shell '$(SHELL)' -c "command -v '$(HOSTOBJCOPY)' || type -p '$(HOSTOBJCOPY)' || echo objcopy")
+HOSTRANLIB := $(shell '$(SHELL)' -c "command -v '$(HOSTRANLIB)' || type -p '$(HOSTRANLIB)' || echo ranlib")
+SED := $(shell $(SHELL) -c "command -v sed || type -p sed") -i -e
 
  export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD
  export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
package/Makefile.in +4 -4
index 86db62ba5b..2ba4d8b381 100644
@@ -4,7 +4,7 @@ endif
  ifndef HOSTMAKE
  HOSTMAKE = $(MAKE)
  endif
-HOSTMAKE := $(shell which $(HOSTMAKE) || type -p $(HOSTMAKE) || echo make)
+HOSTMAKE := $(shell $(SHELL) -c "command -v '$(HOSTMAKE)' || type -p '$(HOSTMAKE)' || echo make")
 
  # If BR2_JLEVEL is 0, scale the maximum concurrency with the number of
  # CPUs. An additional job is used in order to keep processors busy
@@ -222,8 +222,8 @@ else
  TARGET_STRIP = /bin/true
  STRIPCMD = $(TARGET_STRIP)
  endif
-INSTALL := $(shell which install || type -p install)
-UNZIP := $(shell which unzip || type -p unzip) -q
+INSTALL := $(shell $(SHELL) -c "command -v install || type -p install")
+UNZIP := $(shell $(SHELL) -c "command -v unzip || type -p unzip") -q
 
  APPLY_PATCHES = PATH=$(HOST_DIR)/bin:$$PATH support/scripts/apply-patches.sh $(if $(QUIET),-s)
 
@@ -237,7 +237,7 @@ HOST_LDFLAGS  += -L$(HOST_DIR)/lib -Wl,-rpath,$(HOST_DIR)/lib
  # the path to the system perl, before a host-perl built by Buildroot
  # might get installed into $(HOST_DIR)/bin and therefore appears
  # in our PATH. This system perl will be used as INTLTOOL_PERL.
-export PERL=$(shell which perl)
+export PERL=$(shell $(SHELL) -c "command -v perl")
 
  # host-intltool needs libxml-parser-perl, which Buildroot installs in
  # $(HOST_DIR)/lib/perl, so we must make sure that the system perl
support/dependencies/check-host-bison-flex.mk +2 -2
index 14a232fd44..b6cec369f1 100644
@@ -5,10 +5,10 @@
  # that runs on host, e.g. Kconfig. To build code for target use plain
  # host-{bison,flex}.
 
-ifeq ($(shell which bison 2>/dev/null),)
+ifeq ($(shell $(SHELL) -c "command -v bison 2>/dev/null"),)
  BR2_BISON_HOST_DEPENDENCY = host-bison
  endif
 
-ifeq ($(shell which flex 2>/dev/null),)
+ifeq ($(shell $(SHELL) -c "command -v flex 2>/dev/null"),)
  BR2_FLEX_HOST_DEPENDENCY = host-flex
  endif
support/dependencies/check-host-cmake.sh +1 -1
index fadeae9f6b..f202d72a98 100755
@@ -11,7 +11,7 @@ shift
  for candidate; do
 
      # Try to locate the candidate. Discard it if not located.
-    cmake=`which "${candidate}" 2>/dev/null`
+    cmake=`command -v "${candidate}" 2>/dev/null`
      [ -n "${cmake}" ] || continue
 
      # Extract version X.Y from versions in the form X.Y or X.Y.Z
support/dependencies/check-host-gzip.sh +1 -1
index 5f344c5f9b..4dbce72676 100755
@@ -2,7 +2,7 @@
 
  candidate="$1" # ignored
 
-gzip="$(which gzip)"
+gzip="$(command -v gzip)"
  if [ ! -x "${gzip}" ]; then
      # echo nothing: no suitable gzip found
      exit 1
support/dependencies/check-host-lzip.sh +2 -2
index 4f8a2ba3de..5cdfb8252a 100755
@@ -2,9 +2,9 @@
 
  candidate="$1"
 
-lzip=`which $candidate 2>/dev/null`
+lzip=`command -v "$candidate" 2>/dev/null`
  if [ ! -x "$lzip" ]; then
-	lzip=`which lzip 2>/dev/null`
+	lzip=`command -v lzip 2>/dev/null`
  	if [ ! -x "$lzip" ]; then
  		# echo nothing: no suitable lzip found
  		exit 1
support/dependencies/check-host-python3.sh +1 -1
index 17cafd2883..ca504da6ac 100755
@@ -14,7 +14,7 @@ shift
  # a more recent version.
 
  for candidate in "${@}" ; do
-	python3=`which $candidate 2>/dev/null`
+	python3=`command -v "$candidate" 2>/dev/null`
  	if [ ! -x "$python3" ]; then
  		continue
  	fi
support/dependencies/check-host-tar.sh +2 -2
index b7d607a47a..0f0f80038d 100755
@@ -2,9 +2,9 @@
 
  candidate="$1"
 
-tar=`which $candidate`
+tar=`command -v "$candidate"`
  if [ ! -x "$tar" ]; then
-	tar=`which tar`
+	tar=`command -v tar`
  	if [ ! -x "$tar" ]; then
  		# echo nothing: no suitable tar found
  		exit 1
support/dependencies/check-host-xzcat.sh +2 -2
index 10f1c4562a..a022c64faf 100755
@@ -2,9 +2,9 @@
 
  candidate="$1"
 
-xzcat=`which $candidate 2>/dev/null`
+xzcat=`command -v "$candidate" 2>/dev/null`
  if [ ! -x "$xzcat" ]; then
-	xzcat=`which xzcat 2>/dev/null`
+	xzcat=`command -v xzcat 2>/dev/null`
  	if [ ! -x "$xzcat" ]; then
  		# echo nothing: no suitable xzcat found
  		exit 1
support/dependencies/dependencies.sh +8 -8
index c604a9efcc..e720e9372e 100755
@@ -58,7 +58,7 @@ fi
  check_prog_host()
  {
  	prog="$1"
-	if ! which $prog > /dev/null ; then
+	if ! command -v "$prog" > /dev/null ; then
  		echo >&2
  		echo "You must install '$prog' on your build machine" >&2
  		exit 1
@@ -75,7 +75,7 @@ check_prog_host "sed"
  check_prog_host "/usr/bin/file"
 
  # Check make
-MAKE=$(which make 2> /dev/null)
+MAKE=$(command -v make 2> /dev/null)
  if [ -z "$MAKE" ] ; then
  	echo
  	echo "You must install 'make' on your build machine";
@@ -96,9 +96,9 @@ if [ $MAKE_MAJOR -lt 3 ] || [ $MAKE_MAJOR -eq 3 -a $MAKE_MINOR -lt 81 ] ; then
  fi;
 
  # Check host gcc
-COMPILER=$(which $HOSTCC_NOCCACHE 2> /dev/null)
+COMPILER=$(command -v "$HOSTCC_NOCCACHE" 2> /dev/null)
  if [ -z "$COMPILER" ] ; then
-	COMPILER=$(which cc 2> /dev/null)
+	COMPILER=$(command -v cc 2> /dev/null)
  fi;
  if [ -z "$COMPILER" ] ; then
  	echo
@@ -122,9 +122,9 @@ if [ $COMPILER_MAJOR -lt 4 -o $COMPILER_MAJOR -eq 4 -a $COMPILER_MINOR -lt 8 ] ;
  fi;
 
  # check for host CXX
-CXXCOMPILER=$(which $HOSTCXX_NOCCACHE 2> /dev/null)
+CXXCOMPILER=$(command -v "$HOSTCXX_NOCCACHE" 2> /dev/null)
  if [ -z "$CXXCOMPILER" ] ; then
-	CXXCOMPILER=$(which c++ 2> /dev/null)
+	CXXCOMPILER=$(command -v c++ 2> /dev/null)
  fi
 
  if [ -z "$CXXCOMPILER" ] ; then
@@ -164,7 +164,7 @@ fi
  # Check that a few mandatory programs are installed
  missing_progs="no"
  for prog in perl tar wget cpio unzip rsync bc ${DL_TOOLS} ; do
-	if ! which $prog > /dev/null ; then
+	if ! command -v "$prog" > /dev/null ; then
  		echo "You must install '$prog' on your build machine";
  		missing_progs="yes"
  		if test $prog = "svn" ; then
@@ -198,7 +198,7 @@ if [ "${PATCH_MAJOR}" -lt 2 ] || [ "${PATCH_MAJOR}" -eq 2 -a "${PATCH_MINOR}" -l
  fi
 
  if grep ^BR2_NEEDS_HOST_UTF8_LOCALE=y $BR2_CONFIG > /dev/null; then
-	if ! which locale > /dev/null ; then
+	if ! command -v locale > /dev/null ; then
  		echo
  		echo "You need locale support on your build machine to build a toolchain supporting locales"
  		exit 1 ;
toolchain/toolchain-external/pkg-toolchain-external.mk +1 -1
index 68d7a3fe21..2d9d9a5d49 100644
@@ -74,7 +74,7 @@ endif
  ifeq ($(TOOLCHAIN_EXTERNAL_INSTALL_DIR),)
  ifneq ($(TOOLCHAIN_EXTERNAL_PREFIX),)
  # if no path set, figure it out from path
-TOOLCHAIN_EXTERNAL_BIN := $(dir $(shell which $(TOOLCHAIN_EXTERNAL_PREFIX)-gcc))
+TOOLCHAIN_EXTERNAL_BIN := $(dir $(shell $(SHELL) -c "command -v '$(TOOLCHAIN_EXTERNAL_PREFIX)-gcc)'")
  endif
  else
  TOOLCHAIN_EXTERNAL_REL_BIN_PATH = $(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_REL_BIN_PATH))
Signature · 1 line
2.33.0
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

author
#5 lore raw

Re: [Buildroot] [RFC PATCH 1/3] make: support: use `command -v' instead of `which'

Hi all,

Quoted 10 lines
Quoted 3 lines

Well, some people use Debian testing :). But sure, it was never urgent, the issue does not break build. This time I'm quite confident it works, but one revert was enough => it can wait till more people find time to

test it.

In the end, it got reverted in debian testing as well, so we can drop
this
series (for now). I've marked them as Rejected in patchwork.

Thanks, I haven't noticed myself. The revert [1] was released

in debianutils 5.6 [1].

Kind regards,
Petr

[1]
https://salsa.debian.org/debian/debianutils/-/commit/3694cf60572a6c231f2e931f4d075950113599d4

Quoted 3 lines

Regards,
Arnout

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

author
#6 lore raw

RFC PATCH 2/3 make: Drop `type -p ...' fallback

In reply to Petr Vorel

`command -v' is good enough as it's POSIX.
For easier debugging previous problems removed separately.

---
 Makefile            | 22 +++++++++++-----------
 package/Makefile.in |  6 +++---
 2 files changed, 14 insertions(+), 14 deletions(-)
Makefile +11 -11
index 2317655272..81b7173974 100644
@@ -284,12 +284,12 @@ HOSTAS := as
 endif
 ifndef HOSTCC
 HOSTCC := gcc
-HOSTCC := $(shell $(SHELL) -c "command -v '$(HOSTCC)' || type -p '$(HOSTCC)' || echo gcc")
+HOSTCC := $(shell $(SHELL) -c "command -v '$(HOSTCC)' || echo gcc")
 endif
 HOSTCC_NOCCACHE := $(HOSTCC)
 ifndef HOSTCXX
 HOSTCXX := g++
-HOSTCXX := $(shell $(SHELL) -c "command -v '$(HOSTCXX)' || type -p '$(HOSTCXX)' || echo g++")
+HOSTCXX := $(shell $(SHELL) -c "command -v '$(HOSTCXX)' || echo g++")
 endif
 HOSTCXX_NOCCACHE := $(HOSTCXX)
 ifndef HOSTCPP
@@ -310,15 +310,15 @@ endif
 ifndef HOSTRANLIB
 HOSTRANLIB := ranlib
 endif
-HOSTAR := $(shell '$(SHELL)' -c "command -v '$(HOSTAR)' || type -p '$(HOSTAR)' || echo ar")
-HOSTAS := $(shell '$(SHELL)' -c "command -v '$(HOSTAS)' || type -p '$(HOSTAS)' || echo as")
-HOSTCPP := $(shell '$(SHELL)' -c "command -v '$(HOSTCPP)' || type -p '$(HOSTCPP)' || echo cpp")
-HOSTLD := $(shell '$(SHELL)' -c "command -v '$(HOSTLD)' || type -p '$(HOSTLD)' || echo ld")
-HOSTLN := $(shell '$(SHELL)' -c "command -v '$(HOSTLN)' || type -p '$(HOSTLN)' || echo ln")
-HOSTNM := $(shell '$(SHELL)' -c "command -v '$(HOSTNM)' || type -p '$(HOSTNM)' || echo nm")
-HOSTOBJCOPY := $(shell '$(SHELL)' -c "command -v '$(HOSTOBJCOPY)' || type -p '$(HOSTOBJCOPY)' || echo objcopy")
-HOSTRANLIB := $(shell '$(SHELL)' -c "command -v '$(HOSTRANLIB)' || type -p '$(HOSTRANLIB)' || echo ranlib")
-SED := $(shell $(SHELL) -c "command -v sed || type -p sed") -i -e
+HOSTAR := $(shell '$(SHELL)' -c "command -v '$(HOSTAR)' || echo ar")
+HOSTAS := $(shell '$(SHELL)' -c "command -v '$(HOSTAS)' || echo as")
+HOSTCPP := $(shell '$(SHELL)' -c "command -v '$(HOSTCPP)' || echo cpp")
+HOSTLD := $(shell '$(SHELL)' -c "command -v '$(HOSTLD)' || echo ld")
+HOSTLN := $(shell '$(SHELL)' -c "command -v '$(HOSTLN)' || echo ln")
+HOSTNM := $(shell '$(SHELL)' -c "command -v '$(HOSTNM)' || echo nm")
+HOSTOBJCOPY := $(shell '$(SHELL)' -c "command -v '$(HOSTOBJCOPY)' || echo objcopy")
+HOSTRANLIB := $(shell '$(SHELL)' -c "command -v '$(HOSTRANLIB)' || echo ranlib")
+SED := $(shell $(SHELL) -c "command -v sed") -i -e
 
 export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD
 export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
package/Makefile.in +3 -3
index 2ba4d8b381..4e993ecd5f 100644
@@ -4,7 +4,7 @@ endif
 ifndef HOSTMAKE
 HOSTMAKE = $(MAKE)
 endif
-HOSTMAKE := $(shell $(SHELL) -c "command -v '$(HOSTMAKE)' || type -p '$(HOSTMAKE)' || echo make")
+HOSTMAKE := $(shell $(SHELL) -c "command -v '$(HOSTMAKE)' || echo make")
 
 # If BR2_JLEVEL is 0, scale the maximum concurrency with the number of
 # CPUs. An additional job is used in order to keep processors busy
@@ -222,8 +222,8 @@ else
 TARGET_STRIP = /bin/true
 STRIPCMD = $(TARGET_STRIP)
 endif
-INSTALL := $(shell $(SHELL) -c "command -v install || type -p install")
-UNZIP := $(shell $(SHELL) -c "command -v unzip || type -p unzip") -q
+INSTALL := $(shell $(SHELL) -c "command -v install")
+UNZIP := $(shell $(SHELL) -c "command -v unzip") -q
 
 APPLY_PATCHES = PATH=$(HOST_DIR)/bin:$$PATH support/scripts/apply-patches.sh $(if $(QUIET),-s)
 
Signature · 6 lines
2.33.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Tested-by Reviewed-by on v1 2/3
#7 lore raw

Re: [Buildroot] [RFC PATCH 2/3] make: Drop `type -p ...' fallback

Quoted 3 lines · On Tue, 12 Oct 2021 00:00:24 +0200 Petr Vorel <[email protected]> wrote:

`command -v' is good enough as it's POSIX.
For easier debugging previous problems removed separately.

On doing some reading[1] I've discovered that this is a minefield. Having said that, I'm pretty sure what currently happens isn't good either.

My only concern might be that theres old RHEL (its always RHEL ;)) systems out there which could break. Some of my coleagues use old RHEL VMs for their build machines. I'm going to try and see if I can get access but I wouldn't hold up the patch waiting.

I've given this patch applied with the previous one a test and is working fine on my system. I'm wondering if my tested by tag is appropriate for the previous patch since I haven't tested it in isolation.

uname -a
Linux 5.14.12-arch1-1 #1 SMP PREEMPT Wed, 13 Oct 2021 16:58:16 +0000 x86_64 GNU/Linux

make --version
GNU Make 4.3
Built for x86_64-pc-linux-gnu

/bin/sh --version
GNU bash, version 5.1.8(1)-release (x86_64-pc-linux-gnu)

[1]
https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then

Quoted 75 lines
---
 Makefile            | 22 +++++++++++-----------
 package/Makefile.in |  6 +++---
 2 files changed, 14 insertions(+), 14 deletions(-)
Makefile +0 -1
index 2317655272..81b7173974 100644
@@ -284,12 +284,12 @@ HOSTAS := as
 endif
 ifndef HOSTCC
 HOSTCC := gcc
-HOSTCC := $(shell $(SHELL) -c "command -v '$(HOSTCC)' || type -p
'$(HOSTCC)' || echo gcc") +HOSTCC := $(shell $(SHELL) -c "command -v
'$(HOSTCC)' || echo gcc") endif

HOSTCC_NOCCACHE := $(HOSTCC)
ifndef HOSTCXX
HOSTCXX := g++
-HOSTCXX := $(shell $(SHELL) -c "command -v '$(HOSTCXX)' || type -p '$(HOSTCXX)' || echo g++") +HOSTCXX := $(shell $(SHELL) -c "command

Makefile +0 -2
-v '$(HOSTCXX)' || echo g++") endif
 HOSTCXX_NOCCACHE := $(HOSTCXX)
 ifndef HOSTCPP
@@ -310,15 +310,15 @@ endif
 ifndef HOSTRANLIB
 HOSTRANLIB := ranlib
 endif
-HOSTAR := $(shell '$(SHELL)' -c "command -v '$(HOSTAR)' || type -p
'$(HOSTAR)' || echo ar") -HOSTAS := $(shell '$(SHELL)' -c "command -v
'$(HOSTAS)' || type -p '$(HOSTAS)' || echo as") -HOSTCPP := $(shell
'$(SHELL)' -c "command -v '$(HOSTCPP)' || type -p '$(HOSTCPP)' ||
echo cpp") -HOSTLD := $(shell '$(SHELL)' -c "command -v '$(HOSTLD)'
|| type -p '$(HOSTLD)' || echo ld") -HOSTLN := $(shell '$(SHELL)' -c
"command -v '$(HOSTLN)' || type -p '$(HOSTLN)' || echo ln") -HOSTNM
:= $(shell '$(SHELL)' -c "command -v '$(HOSTNM)' || type -p
'$(HOSTNM)' || echo nm") -HOSTOBJCOPY := $(shell '$(SHELL)' -c
"command -v '$(HOSTOBJCOPY)' || type -p '$(HOSTOBJCOPY)' || echo
objcopy") -HOSTRANLIB := $(shell '$(SHELL)' -c "command -v
'$(HOSTRANLIB)' || type -p '$(HOSTRANLIB)' || echo ranlib") -SED :=
$(shell $(SHELL) -c "command -v sed || type -p sed") -i -e +HOSTAR :=
$(shell '$(SHELL)' -c "command -v '$(HOSTAR)' || echo ar") +HOSTAS :=
$(shell '$(SHELL)' -c "command -v '$(HOSTAS)' || echo as") +HOSTCPP

:= $(shell '$(SHELL)' -c "command -v '$(HOSTCPP)' || echo cpp")

Makefile +4 -0
+HOSTLD := $(shell '$(SHELL)' -c "command -v '$(HOSTLD)' || echo ld")
+HOSTLN := $(shell '$(SHELL)' -c "command -v '$(HOSTLN)' || echo ln")
+HOSTNM := $(shell '$(SHELL)' -c "command -v '$(HOSTNM)' || echo nm")
+HOSTOBJCOPY := $(shell '$(SHELL)' -c "command -v '$(HOSTOBJCOPY)' ||

echo objcopy") +HOSTRANLIB := $(shell '$(SHELL)' -c "command -v '$(HOSTRANLIB)' || echo ranlib") +SED := $(shell $(SHELL) -c "command -v sed") -i -e export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE diff --git a/package/Makefile.in b/package/Makefile.in index 2ba4d8b381..4e993ecd5f 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -4,7 +4,7 @@ endif
ifndef HOSTMAKE
HOSTMAKE = $(MAKE)
endif
-HOSTMAKE := $(shell $(SHELL) -c "command -v '$(HOSTMAKE)' || type -p '$(HOSTMAKE)' || echo make") +HOSTMAKE := $(shell $(SHELL) -c "command -v '$(HOSTMAKE)' || echo make")
# If BR2_JLEVEL is 0, scale the maximum concurrency with the number
of # CPUs. An additional job is used in order to keep processors busy

Makefile +0 -1
@@ -222,8 +222,8 @@ else
 TARGET_STRIP = /bin/true
 STRIPCMD = $(TARGET_STRIP)
 endif
-INSTALL := $(shell $(SHELL) -c "command -v install || type -p

install") -UNZIP := $(shell $(SHELL) -c "command -v unzip || type -p unzip") -q +INSTALL := $(shell $(SHELL) -c "command -v install") +UNZIP := $(shell $(SHELL) -c "command -v unzip") -q

Quoted 2 lines

APPLY_PATCHES = PATH=$(HOST_DIR)/bin:$$PATH
support/scripts/apply-patches.sh $(if $(QUIET),-s)

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

author
#8 lore raw

Re: [Buildroot] [RFC PATCH 2/3] make: Drop `type -p ...' fallback

Hi Cyril,

Quoted 7 lines
Quoted 2 lines · On Tue, 12 Oct 2021 00:00:24 +0200 Petr Vorel <[email protected]> wrote:

`command -v' is good enough as it's POSIX.
For easier debugging previous problems removed separately.

Quoted 8 lines

On doing some reading[1] I've discovered that this is a minefield. Having said that, I'm pretty sure what currently happens isn't good either.

My only concern might be that theres old RHEL (its always RHEL ;)) systems out there which could break. Some of my coleagues use old RHEL VMs for their build machines. I'm going to try and see if I can get access but I wouldn't hold up the patch waiting.

Thanks a lot for pointing this out. Which RHEL version do you mean? Testing it would save me time to install CentOS (if you mean CentOS 6).

Quoted 4 lines

I've given this patch applied with the previous one a test and is working fine on my system. I'm wondering if my tested by tag is appropriate for the previous patch since I haven't tested it in isolation.

Well, if this (i.e. second) patch works previous version should work as well.

Quoted 10 lines

uname -a
Linux 5.14.12-arch1-1 #1 SMP PREEMPT Wed, 13 Oct 2021 16:58:16 +0000 x86_64 GNU/Linux

make --version
GNU Make 4.3
Built for x86_64-pc-linux-gnu

/bin/sh --version
GNU bash, version 5.1.8(1)-release (x86_64-pc-linux-gnu)

I tested it on similar environment. Tested it also on older distros (Debian buster (oldstable) and Cent0S 7.

Quoted 6 lines

[1]
https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then

Quoted 1 line

<snip>

Kind regards,
Petr
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#9 lore raw

Re: [Buildroot] [RFC PATCH 2/3] make: Drop `type -p ...' fallback

In reply to Cyril Bur

Cyril, All,

On 2021-10-28 14:52 +0100, Cyril Bur spake thusly:

Quoted 8 lines
Quoted 3 lines · On Tue, 12 Oct 2021 00:00:24 +0200 Petr Vorel <[email protected]> wrote:

`command -v' is good enough as it's POSIX.
For easier debugging previous problems removed separately.

On doing some reading[1] I've discovered that this is a minefield.

Hmm.. A very long history lesson. Thanks! :-)

Quoted 4 lines

Having said that, I'm pretty sure what currently happens isn't good either.

My only concern might be that theres old RHEL (its always RHEL ;))

**jiggles**

Quoted 8 lines

systems out there which could break. Some of my coleagues use old RHEL VMs for their build machines. I'm going to try and see if I can get access but I wouldn't hold up the patch waiting.

I've given this patch applied with the previous one a test and is working fine on my system. I'm wondering if my tested by tag is appropriate for the previous patch since I haven't tested it in isolation.

A tested-by tag is always welcome: it means some people were interested enough that they went off their daily lives and took time to test the patch.

Thaks!

Regards,
Yann E. MORIN.

Quoted 98 lines

uname -a
Linux 5.14.12-arch1-1 #1 SMP PREEMPT Wed, 13 Oct 2021 16:58:16 +0000 x86_64 GNU/Linux

make --version
GNU Make 4.3
Built for x86_64-pc-linux-gnu

/bin/sh --version
GNU bash, version 5.1.8(1)-release (x86_64-pc-linux-gnu)

[1]
https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then

Quoted 75 lines
---
 Makefile            | 22 +++++++++++-----------
 package/Makefile.in |  6 +++---
 2 files changed, 14 insertions(+), 14 deletions(-)
Makefile +0 -1
index 2317655272..81b7173974 100644
@@ -284,12 +284,12 @@ HOSTAS := as
 endif
 ifndef HOSTCC
 HOSTCC := gcc
-HOSTCC := $(shell $(SHELL) -c "command -v '$(HOSTCC)' || type -p
'$(HOSTCC)' || echo gcc") +HOSTCC := $(shell $(SHELL) -c "command -v
'$(HOSTCC)' || echo gcc") endif

HOSTCC_NOCCACHE := $(HOSTCC)
ifndef HOSTCXX
HOSTCXX := g++
-HOSTCXX := $(shell $(SHELL) -c "command -v '$(HOSTCXX)' || type -p '$(HOSTCXX)' || echo g++") +HOSTCXX := $(shell $(SHELL) -c "command

Makefile +0 -2
-v '$(HOSTCXX)' || echo g++") endif
 HOSTCXX_NOCCACHE := $(HOSTCXX)
 ifndef HOSTCPP
@@ -310,15 +310,15 @@ endif
 ifndef HOSTRANLIB
 HOSTRANLIB := ranlib
 endif
-HOSTAR := $(shell '$(SHELL)' -c "command -v '$(HOSTAR)' || type -p
'$(HOSTAR)' || echo ar") -HOSTAS := $(shell '$(SHELL)' -c "command -v
'$(HOSTAS)' || type -p '$(HOSTAS)' || echo as") -HOSTCPP := $(shell
'$(SHELL)' -c "command -v '$(HOSTCPP)' || type -p '$(HOSTCPP)' ||
echo cpp") -HOSTLD := $(shell '$(SHELL)' -c "command -v '$(HOSTLD)'
|| type -p '$(HOSTLD)' || echo ld") -HOSTLN := $(shell '$(SHELL)' -c
"command -v '$(HOSTLN)' || type -p '$(HOSTLN)' || echo ln") -HOSTNM
:= $(shell '$(SHELL)' -c "command -v '$(HOSTNM)' || type -p
'$(HOSTNM)' || echo nm") -HOSTOBJCOPY := $(shell '$(SHELL)' -c
"command -v '$(HOSTOBJCOPY)' || type -p '$(HOSTOBJCOPY)' || echo
objcopy") -HOSTRANLIB := $(shell '$(SHELL)' -c "command -v
'$(HOSTRANLIB)' || type -p '$(HOSTRANLIB)' || echo ranlib") -SED :=
$(shell $(SHELL) -c "command -v sed || type -p sed") -i -e +HOSTAR :=
$(shell '$(SHELL)' -c "command -v '$(HOSTAR)' || echo ar") +HOSTAS :=
$(shell '$(SHELL)' -c "command -v '$(HOSTAS)' || echo as") +HOSTCPP

:= $(shell '$(SHELL)' -c "command -v '$(HOSTCPP)' || echo cpp")

Makefile +4 -0
+HOSTLD := $(shell '$(SHELL)' -c "command -v '$(HOSTLD)' || echo ld")
+HOSTLN := $(shell '$(SHELL)' -c "command -v '$(HOSTLN)' || echo ln")
+HOSTNM := $(shell '$(SHELL)' -c "command -v '$(HOSTNM)' || echo nm")
+HOSTOBJCOPY := $(shell '$(SHELL)' -c "command -v '$(HOSTOBJCOPY)' ||

echo objcopy") +HOSTRANLIB := $(shell '$(SHELL)' -c "command -v '$(HOSTRANLIB)' || echo ranlib") +SED := $(shell $(SHELL) -c "command -v sed") -i -e export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE diff --git a/package/Makefile.in b/package/Makefile.in index 2ba4d8b381..4e993ecd5f 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -4,7 +4,7 @@ endif
ifndef HOSTMAKE
HOSTMAKE = $(MAKE)
endif
-HOSTMAKE := $(shell $(SHELL) -c "command -v '$(HOSTMAKE)' || type -p '$(HOSTMAKE)' || echo make") +HOSTMAKE := $(shell $(SHELL) -c "command -v '$(HOSTMAKE)' || echo make")
# If BR2_JLEVEL is 0, scale the maximum concurrency with the number
of # CPUs. An additional job is used in order to keep processors busy

Makefile +0 -1
@@ -222,8 +222,8 @@ else
 TARGET_STRIP = /bin/true
 STRIPCMD = $(TARGET_STRIP)
 endif
-INSTALL := $(shell $(SHELL) -c "command -v install || type -p

install") -UNZIP := $(shell $(SHELL) -c "command -v unzip || type -p unzip") -q +INSTALL := $(shell $(SHELL) -c "command -v install") +UNZIP := $(shell $(SHELL) -c "command -v unzip") -q

Quoted 2 lines

APPLY_PATCHES = PATH=$(HOST_DIR)/bin:$$PATH
support/scripts/apply-patches.sh $(if $(QUIET),-s)

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#10 lore raw

Re: [Buildroot] [RFC PATCH 2/3] make: Drop `type -p ...' fallback

Quoted 12 lines · On Thu, 11 Nov 2021 09:13:39 +0100 "Yann E. MORIN" <[email protected]>…

Cyril, All,

On 2021-10-28 14:52 +0100, Cyril Bur spake thusly:

Quoted 8 lines
Quoted 3 lines · On Tue, 12 Oct 2021 00:00:24 +0200 Petr Vorel <[email protected]> wrote:

`command -v' is good enough as it's POSIX.
For easier debugging previous problems removed separately.

On doing some reading[1] I've discovered that this is a minefield.

Quoted 8 lines

Hmm.. A very long history lesson. Thanks! :-)

Quoted 4 lines

Having said that, I'm pretty sure what currently happens isn't good either.

My only concern might be that theres old RHEL (its always RHEL ;))

**jiggles**

I'll add that I have tried to test on the old RHEL VM that colleagues insist on still using and the build doesn't work, no fault of BR though. I suspect that all working directories are actualy mounted on top of a FAT or some funky windows share (I can't see the underlying store) so cp -p ... fails because the unlieing store (whatever it is) can't do the correct permissions (educated guess). I can't remember which package (I think perhaps libc) uses these copies so they fail.

Yes I did try to run out of a tmpfs but didn't have access to one big enough.

I don't expect a fix, just thought I'd make you aware. Also, just to be clear those problems are obviously nothing to do with this patch or series!

Quoted 5 lines
Quoted 5 lines

systems out there which could break. Some of my coleagues use old RHEL VMs for their build machines. I'm going to try and see if I can get access but I wouldn't hold up the patch waiting.

Quoted 9 lines
Quoted 4 lines

I've given this patch applied with the previous one a test and is working fine on my system. I'm wondering if my tested by tag is appropriate for the previous patch since I haven't tested it in isolation.

A tested-by tag is always welcome: it means some people were interested enough that they went off their daily lives and took time to test the patch.

Glad to be of assistance.

Cyril

Quoted 104 lines

Thaks!

Regards,
Yann E. MORIN.

Quoted 98 lines

uname -a
Linux 5.14.12-arch1-1 #1 SMP PREEMPT Wed, 13 Oct 2021 16:58:16 +0000 x86_64 GNU/Linux

make --version
GNU Make 4.3
Built for x86_64-pc-linux-gnu

/bin/sh --version
GNU bash, version 5.1.8(1)-release (x86_64-pc-linux-gnu)

[1]
https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then

Quoted 75 lines
---
 Makefile            | 22 +++++++++++-----------
 package/Makefile.in |  6 +++---
 2 files changed, 14 insertions(+), 14 deletions(-)
Makefile +0 -1
index 2317655272..81b7173974 100644
@@ -284,12 +284,12 @@ HOSTAS := as
 endif
 ifndef HOSTCC
 HOSTCC := gcc
-HOSTCC := $(shell $(SHELL) -c "command -v '$(HOSTCC)' || type -p

'$(HOSTCC)' || echo gcc") +HOSTCC := $(shell $(SHELL) -c "command

Makefile +0 -3
-v '$(HOSTCC)' || echo gcc") endif
 HOSTCC_NOCCACHE := $(HOSTCC)
 ifndef HOSTCXX
 HOSTCXX := g++
-HOSTCXX := $(shell $(SHELL) -c "command -v '$(HOSTCXX)' || type
-p '$(HOSTCXX)' || echo g++") +HOSTCXX := $(shell $(SHELL) -c

"command -v '$(HOSTCXX)' || echo g++") endif
HOSTCXX_NOCCACHE := $(HOSTCXX)
ifndef HOSTCPP

Makefile +0 -3
@@ -310,15 +310,15 @@ endif
 ifndef HOSTRANLIB
 HOSTRANLIB := ranlib
 endif
-HOSTAR := $(shell '$(SHELL)' -c "command -v '$(HOSTAR)' || type
-p '$(HOSTAR)' || echo ar") -HOSTAS := $(shell '$(SHELL)' -c
 "command -v '$(HOSTAS)' || type -p '$(HOSTAS)' || echo as")
-HOSTCPP := $(shell '$(SHELL)' -c "command -v '$(HOSTCPP)' ||

type -p '$(HOSTCPP)' || echo cpp") -HOSTLD := $(shell '$(SHELL)'

Makefile +0 -3
-c "command -v '$(HOSTLD)' || type -p '$(HOSTLD)' || echo ld")
-HOSTLN := $(shell '$(SHELL)' -c "command -v '$(HOSTLN)' || type
-p '$(HOSTLN)' || echo ln") -HOSTNM := $(shell '$(SHELL)' -c

"command -v '$(HOSTNM)' || type -p '$(HOSTNM)' || echo nm") -HOSTOBJCOPY := $(shell '$(SHELL)' -c "command -v '$(HOSTOBJCOPY)' || type -p '$(HOSTOBJCOPY)' || echo objcopy") -HOSTRANLIB := $(shell '$(SHELL)' -c "command -v '$(HOSTRANLIB)'

|| type -p '$(HOSTRANLIB)' || echo ranlib") -SED := $(shell
$(SHELL) -c "command -v sed || type -p sed") -i -e +HOSTAR :=
$(shell '$(SHELL)' -c "command -v '$(HOSTAR)' || echo ar")
+HOSTAS := $(shell '$(SHELL)' -c "command -v '$(HOSTAS)' || echo
as") +HOSTCPP := $(shell '$(SHELL)' -c "command -v '$(HOSTCPP)'
|| echo cpp") +HOSTLD := $(shell '$(SHELL)' -c "command -v
'$(HOSTLD)' || echo ld") +HOSTLN := $(shell '$(SHELL)' -c
"command -v '$(HOSTLN)' || echo ln") +HOSTNM := $(shell
'$(SHELL)' -c "command -v '$(HOSTNM)' || echo nm") +HOSTOBJCOPY
:= $(shell '$(SHELL)' -c "command -v '$(HOSTOBJCOPY)' || echo

objcopy") +HOSTRANLIB := $(shell '$(SHELL)' -c "command -v '$(HOSTRANLIB)' || echo ranlib") +SED := $(shell $(SHELL) -c "command -v sed") -i -e export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE diff --git a/package/Makefile.in b/package/Makefile.in index 2ba4d8b381..4e993ecd5f 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -4,7 +4,7 @@ endif ifndef HOSTMAKE HOSTMAKE = $(MAKE) endif -HOSTMAKE := $(shell $(SHELL) -c "command -v '$(HOSTMAKE)' || type -p '$(HOSTMAKE)' || echo make") +HOSTMAKE := $(shell $(SHELL) -c "command -v '$(HOSTMAKE)' || echo make") # If BR2_JLEVEL is 0, scale the maximum concurrency with the number of # CPUs. An additional job is used in order to keep processors busy @@ -222,8 +222,8 @@ else
TARGET_STRIP = /bin/true
STRIPCMD = $(TARGET_STRIP)
endif
-INSTALL := $(shell $(SHELL) -c "command -v install || type -p install") -UNZIP := $(shell $(SHELL) -c "command -v unzip || type -p unzip") -q +INSTALL := $(shell $(SHELL) -c "command -v install") +UNZIP := $(shell $(SHELL) -c "command -v unzip") -q

Quoted 2 lines

APPLY_PATCHES = PATH=$(HOST_DIR)/bin:$$PATH
support/scripts/apply-patches.sh $(if $(QUIET),-s)

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

author
#11 lore raw

RFC PATCH 3/3 support/dependencies: don't check for `which'

In reply to Petr Vorel

It's requirement has been removed in previous commit.

---
 support/dependencies/dependencies.sh | 2 --
 1 file changed, 2 deletions(-)
support/dependencies/dependencies.sh +0 -2
index e720e9372e..0502dcc9bb 100755
@@ -65,8 +65,6 @@ check_prog_host()
 	fi
 }
 
-# Verify that which is installed
-check_prog_host "which"
 # Verify that sed is installed
 check_prog_host "sed"
 
Signature · 6 lines
2.33.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#12 lore raw
In reply to Petr Vorel

Hi all,

could anybody test this patchset please?

Kind regards,
Petr

Quoted 18 lines

Hi all,

this is a second attempt to introduce command -v.

Changes v1->v2:
* reproduced original issue and fixed by not relying to $(shell command -v ...) but shell with:
$(shell $(SHELL) -c "command -v ...").
* quote variables

Tested only with make defconfig && make help >/dev/null

Petr Vorel (3):
make: support: use command -v' instead of which'
make: Drop type -p ...' fallback support/dependencies: don't check for which'

Quoted 12 lines
 Makefile                                      | 22 +++++++++----------
 package/Makefile.in                           |  8 +++----
 support/dependencies/check-host-bison-flex.mk |  4 ++--
 support/dependencies/check-host-cmake.sh      |  2 +-
 support/dependencies/check-host-gzip.sh       |  2 +-
 support/dependencies/check-host-lzip.sh       |  4 ++--
 support/dependencies/check-host-python3.sh    |  2 +-
 support/dependencies/check-host-tar.sh        |  4 ++--
 support/dependencies/check-host-xzcat.sh      |  4 ++--
 support/dependencies/dependencies.sh          | 18 +++++++--------
 .../pkg-toolchain-external.mk                 |  2 +-
 11 files changed, 35 insertions(+), 37 deletions(-)

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot