Skip to contentSkip to conversation

build-sys: fix find-in-path

PATCH Applied Marc-André Lureau 4 participants 5 messages Sep 23, 2016 – Sep 29, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build-sys: fix find-in-path

Fix spelling, the GNU make text functions is not called "find-string" but "findstring".

---
 rules.mak | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rules.mak +1 -1
index 5c82c19..f721988 100644
@@ -132,7 +132,7 @@ endef
 # Looks in the PATH if the argument contains no slash, else only considers one
 # specific directory.  Returns an # empty string if the program doesn't exist
 # there.
-find-in-path = $(if $(find-string /, $1), \
+find-in-path = $(if $(findstring /, $1), \
         $(wildcard $1), \
         $(wildcard $(patsubst %, %/$1, $(subst :, ,$(PATH)))))
 
Signature · 1 line
2.10.0
#1 lore raw
Quoted 13 lines · Marc-André Lureau

Fix spelling, the GNU make text functions is not called "find-string" but "findstring".

---
 rules.mak | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rules.mak +0 -0
index 5c82c19..f721988 100644

rules.mak endef · line 137

Quoted 7 lines
rules.mak +1 -1
@@ -132,7 +132,7 @@ endef
 # Looks in the PATH if the argument contains no slash, else only considers one
 # specific directory.  Returns an # empty string if the program doesn't exist
 # there.
-find-in-path = $(if $(find-string /, $1), \
+find-in-path = $(if $(findstring /, $1), \
         $(wildcard $1), \
         $(wildcard $(patsubst %, %/$1, $(subst :, ,$(PATH)))))

Impact?

#2 lore raw

Hi

----- Original Message -----

Quoted 10 lines
Quoted 8 lines · Marc-André Lureau

Fix spelling, the GNU make text functions is not called "find-string" but "findstring".

---
 rules.mak | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
Quoted 13 lines
rules.mak +1 -1
index 5c82c19..f721988 100644
@@ -132,7 +132,7 @@ endef
 # Looks in the PATH if the argument contains no slash, else only considers
 one
 # specific directory.  Returns an # empty string if the program doesn't
 exist
 # there.
-find-in-path = $(if $(find-string /, $1), \
+find-in-path = $(if $(findstring /, $1), \
         $(wildcard $1), \
Quoted 1 line
         $(wildcard $(patsubst %, %/$1, $(subst :, ,$(PATH)))))

Impact?

Not much in current code base, it's only used by:
tests/tcg/Makefile:ifneq ($(call find-in-path, $(CC_I386)),)

So if you set CC_I386 to an absolute PATH, it's not going to run the I386_TESTS.

This is not very important yet, but better for correctness.

In the future, I hope qemu can have a better tcg-test framework (I am doing some experiment in https://github.com/elmarco/qemu/tree/tcg-tests/tests/tcg), and as part of this work, I found this bug.

Reviewed-by
#3 lore raw
Quoted 30 lines · Marc-André Lureau

Hi

----- Original Message -----

Quoted 10 lines
Quoted 8 lines · Marc-André Lureau

Fix spelling, the GNU make text functions is not called "find-string" but "findstring".

---
 rules.mak | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
Quoted 13 lines
rules.mak +1 -1
index 5c82c19..f721988 100644
@@ -132,7 +132,7 @@ endef
 # Looks in the PATH if the argument contains no slash, else only considers
 one
 # specific directory.  Returns an # empty string if the program doesn't
 exist
 # there.
-find-in-path = $(if $(find-string /, $1), \
+find-in-path = $(if $(findstring /, $1), \
         $(wildcard $1), \
Quoted 1 line
         $(wildcard $(patsubst %, %/$1, $(subst :, ,$(PATH)))))

Impact?

Quoted 8 lines

Not much in current code base, it's only used by:
tests/tcg/Makefile:ifneq ($(call find-in-path, $(CC_I386)),)

So if you set CC_I386 to an absolute PATH, it's not going to run the I386_TESTS.

This is not very important yet, but better for correctness.

In the future, I hope qemu can have a better tcg-test framework (I am doing some experiment in https://github.com/elmarco/qemu/tree/tcg-tests/tests/tcg), and as part of this work, I found this bug.

Thanks. Suggest to amend the commit message with:

Broken in commit 2b2e59e. Fairly harmless: its only use is in tests/tcg/Makefile, where the bug can cause the I386_TESTS not to run when they should.

With this or something similar, you may add