devtools: test different build types

Message ID 20210412215339.2439530-1-thomas@monjalon.net (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers
Series devtools: test different build types |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/travis-robot success travis build: passed
ci/github-robot success github build: passed
ci/iol-abi-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Thomas Monjalon April 12, 2021, 9:53 p.m. UTC
  All builds were of type debugoptimized.
It is kept only for builds having an ABI check.
Others will have the default build type (release),
except if specified differently as in the x86 generic build
which will be a test of the non-optimized debug build type.
Some static builds will test the minsize build type.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 devtools/test-meson-builds.sh | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
  

Comments

David Marchand May 21, 2021, 3:03 p.m. UTC | #1
On Mon, Apr 12, 2021 at 11:54 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> @@ -213,9 +218,10 @@ for c in gcc clang ; do
>                         abicheck=ABI

init of buildtype var is missing here.

Rest lgtm.

>                 else
>                         abicheck=skipABI # save time and disk space
> +                       buildtype='--buildtype=minsize'
>                 fi
>                 export CC="$CCACHE $c"
> -               build build-$c-$s $c $abicheck --default-library=$s
> +               build build-$c-$s $c $abicheck $buildtype --default-library=$s
>                 unset CC
>         done
>  done
  
Andrew Rybchenko July 23, 2021, 8:26 p.m. UTC | #2
On 5/21/21 6:03 PM, David Marchand wrote:
> On Mon, Apr 12, 2021 at 11:54 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>> @@ -213,9 +218,10 @@ for c in gcc clang ; do
>>                          abicheck=ABI
> 
> init of buildtype var is missing here.

+1

> Rest lgtm.
> 
>>                  else
>>                          abicheck=skipABI # save time and disk space
>> +                       buildtype='--buildtype=minsize'
>>                  fi
>>                  export CC="$CCACHE $c"
>> -               build build-$c-$s $c $abicheck --default-library=$s
>> +               build build-$c-$s $c $abicheck $buildtype --default-library=$s
>>                  unset CC
>>          done
>>   done
> 
> 

with review notes applied:

Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
  

Patch

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index daf817ac3e..37f258bd48 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -92,13 +92,16 @@  load_env () # <target compiler>
 	command -v $targetcc >/dev/null 2>&1 || return 1
 }
 
-config () # <dir> <builddir> <meson options>
+config () # <dir> <builddir> <ABI check> <meson options>
 {
 	dir=$1
 	shift
 	builddir=$1
 	shift
+	abicheck=$1
+	shift
 	if [ -f "$builddir/build.ninja" ] ; then
+		[ $abicheck = ABI ] || return 0
 		# for existing environments, switch to debugoptimized if unset
 		# so that ABI checks can run
 		if ! $MESON configure $builddir |
@@ -114,7 +117,9 @@  config () # <dir> <builddir> <meson options>
 	else
 		options="$options -Dexamples=l3fwd" # save disk space
 	fi
-	options="$options --buildtype=debugoptimized"
+	if [ $abicheck = ABI ] ; then
+		options="$options --buildtype=debugoptimized"
+	fi
 	for option in $DPDK_MESON_OPTIONS ; do
 		options="$options -D$option"
 	done
@@ -165,7 +170,7 @@  build () # <directory> <target cc | cross file> <ABI check> [meson options]
 		cross=
 	fi
 	load_env $targetcc || return 0
-	config $srcdir $builds_dir/$targetdir $cross --werror $*
+	config $srcdir $builds_dir/$targetdir $abicheck $cross --werror $*
 	compile $builds_dir/$targetdir
 	if [ -n "$DPDK_ABI_REF_VERSION" -a "$abicheck" = ABI ] ; then
 		abirefdir=${DPDK_ABI_REF_DIR:-reference}/$DPDK_ABI_REF_VERSION
@@ -179,7 +184,7 @@  build () # <directory> <target cc | cross file> <ABI check> [meson options]
 			fi
 
 			rm -rf $abirefdir/build
-			config $abirefdir/src $abirefdir/build $cross \
+			config $abirefdir/src $abirefdir/build $abicheck $cross \
 				-Dexamples= $*
 			compile $abirefdir/build
 			install_target $abirefdir/build $abirefdir/$targetdir
@@ -213,9 +218,10 @@  for c in gcc clang ; do
 			abicheck=ABI
 		else
 			abicheck=skipABI # save time and disk space
+			buildtype='--buildtype=minsize'
 		fi
 		export CC="$CCACHE $c"
-		build build-$c-$s $c $abicheck --default-library=$s
+		build build-$c-$s $c $abicheck $buildtype --default-library=$s
 		unset CC
 	done
 done
@@ -227,7 +233,7 @@  generic_machine='nehalem'
 if ! check_cc_flags "-march=$generic_machine" ; then
 	generic_machine='corei7'
 fi
-build build-x86-generic cc skipABI -Dcheck_includes=true \
+build build-x86-generic cc skipABI --buildtype=debug -Dcheck_includes=true \
 	-Dlibdir=lib -Dmachine=$generic_machine $use_shared
 
 # 32-bit with default compiler