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

Message ID 20190110103726.23231-1-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series test-meson-build: fix check for whether meson has run |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Bruce Richardson Jan. 10, 2019, 10:37 a.m. UTC
  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")
CC: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 devtools/test-meson-builds.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Luca Boccassi Jan. 10, 2019, 1:10 p.m. UTC | #1
On Thu, 2019-01-10 at 10:37 +0000, Bruce Richardson wrote:
> 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")
> CC: stable@dpdk.org
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  devtools/test-meson-builds.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-
> builds.sh
> index 79109b757..3edc805f6 100755
> --- a/devtools/test-meson-builds.sh
> +++ b/devtools/test-meson-builds.sh
> @@ -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

Acked-by: Luca Boccassi <bluca@debian.org>
  
Thomas Monjalon Jan. 14, 2019, 11:19 a.m. UTC | #2
10/01/2019 14:10, Luca Boccassi:
> On Thu, 2019-01-10 at 10:37 +0000, Bruce Richardson wrote:
> > 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")
> > CC: stable@dpdk.org
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> Acked-by: Luca Boccassi <bluca@debian.org>

Applied, thanks
  

Patch

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 79109b757..3edc805f6 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -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