[1/3] devtools/test-meson-builds: skip missing compilers

Message ID 20190410205224.69977-2-bruce.richardson@intel.com
State Accepted
Delegated to: Thomas Monjalon
Headers show
Series
  • fix test-meson-builds for older distros
Related show

Checks

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

Commit Message

Bruce Richardson April 10, 2019, 8:52 p.m.
if either gcc or clang are missing, skip doing those builds.
This allows a setup to only do, e.g. gcc tests.

CC: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 devtools/test-meson-builds.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Thomas Monjalon April 17, 2019, 2:59 p.m. | #1
10/04/2019 22:52, Bruce Richardson:
> if either gcc or clang are missing, skip doing those builds.
> This allows a setup to only do, e.g. gcc tests.
> 
> CC: stable@dpdk.org
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> --- a/devtools/test-meson-builds.sh
> +++ b/devtools/test-meson-builds.sh
>  # shared and static linked builds with gcc and clang
>  for c in gcc clang ; do
> -	for s in static shared ; do
> -		export CC="ccache $c"
> -		build build-$c-$s --default-library=$s
> -	done
> +	if command -v $c >/dev/null 2>&1 ; then
> +		for s in static shared ; do
> +			export CC="ccache $c"
> +			build build-$c-$s --default-library=$s
> +		done
> +	fi

May I suggest this oneline change instead?

command -v $c >/dev/null 2>&1 || continue
Bruce Richardson April 17, 2019, 3:04 p.m. | #2
On Wed, Apr 17, 2019 at 04:59:53PM +0200, Thomas Monjalon wrote:
> 10/04/2019 22:52, Bruce Richardson:
> > if either gcc or clang are missing, skip doing those builds.
> > This allows a setup to only do, e.g. gcc tests.
> > 
> > CC: stable@dpdk.org
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> > --- a/devtools/test-meson-builds.sh
> > +++ b/devtools/test-meson-builds.sh
> >  # shared and static linked builds with gcc and clang
> >  for c in gcc clang ; do
> > -	for s in static shared ; do
> > -		export CC="ccache $c"
> > -		build build-$c-$s --default-library=$s
> > -	done
> > +	if command -v $c >/dev/null 2>&1 ; then
> > +		for s in static shared ; do
> > +			export CC="ccache $c"
> > +			build build-$c-$s --default-library=$s
> > +		done
> > +	fi
> 
> May I suggest this oneline change instead?
> 
> command -v $c >/dev/null 2>&1 || continue
> 
Looks fine to me. Make the change on apply if you like, otherwise let me
know if you want a V2.

Patch

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index b3b5cfb..60e4168 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -54,10 +54,12 @@  fi
 
 # shared and static linked builds with gcc and clang
 for c in gcc clang ; do
-	for s in static shared ; do
-		export CC="ccache $c"
-		build build-$c-$s --default-library=$s
-	done
+	if command -v $c >/dev/null 2>&1 ; then
+		for s in static shared ; do
+			export CC="ccache $c"
+			build build-$c-$s --default-library=$s
+		done
+	fi
 done
 
 # test compilation with minimal x86 instruction set