Skip to contentSkip to conversation

test-meson-build: fix check for whether meson has run

PATCH Applied Bruce Richardson 3 participants 3 messages Jan 10, 2019 – Jan 14, 2019 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test-meson-build: fix check for whether meson has run

The current check to see whether we need to call meson or just ninja simply checked if the build directory existed. However, if meson was run but failed, the build directory would still exist. We can fix this by instead checking for the build.ninja file inside the directory. Once that is present, we can use ninja safely and let it worry about rerunning meson if necessary.

Fixes a55277a788df ("devtools: add test script for meson builds")
---
 devtools/test-meson-builds.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/test-meson-builds.sh +1 -1
index 79109b757..3edc805f6 100755
@@ -24,7 +24,7 @@ build () # <directory> <meson options>
 {
 	builddir=$1
 	shift
-	if [ ! -d "$builddir" ] ; then
+	if [ ! -f "$builddir/build.ninja" ] ; then
 		options="--werror -Dexamples=all $*"
 		echo "$MESON $options $srcdir $builddir"
 		$MESON $options $srcdir $builddir
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#1 lore raw
Quoted 28 lines · Bruce Richardson

The current check to see whether we need to call meson or just ninja simply checked if the build directory existed. However, if meson was run
but failed, the build directory would still exist. We can fix this by instead checking for the build.ninja file inside the directory. Once that
is present, we can use ninja safely and let it worry about rerunning meson if necessary.

Fixes a55277a788df ("devtools: add test script for meson builds")

---
 devtools/test-meson-builds.sh | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/test-meson- renamed from devtools/test-meson-builds.sh +0 -0

builds.sh
index 79109b757..3edc805f6 100755

devtools/test-meson-builds.sh +0 -0
@@ -24,7 +24,7 @@ build () # <directory> <meson options>
  {

  builddir=$1
  shift

devtools/test-meson-builds.sh +1 -1
-	if [ ! -d "$builddir" ] ; then
+	if [ ! -f "$builddir/build.ninja" ] ; then
Quoted 3 lines

  options="--werror -Dexamples=all $*" echo "$MESON $options $srcdir $builddir" $MESON $options $srcdir $builddir

Signature · 2 lines
Kind regards,
Luca Boccassi
#2 lore raw

10/01/2019 14:10, Luca Boccassi:

Quoted 10 lines · Bruce Richardson
Quoted 9 lines

The current check to see whether we need to call meson or just ninja simply checked if the build directory existed. However, if meson was run
but failed, the build directory would still exist. We can fix this by instead checking for the build.ninja file inside the directory. Once that
is present, we can use ninja safely and let it worry about rerunning meson if necessary.

Quoted 6 lines
Quoted 4 lines
Fixes a55277a788df ("devtools: add test script for meson builds")

Applied, thanks