The various builds done by the "test-meson-builds.sh" script can take a
large amount of space on disk. Some simple changes allow us to reduce
the space used significantly. Specifically:
* use the default "release" build, which does not include debug
  information, for builds where we won't check ABI.
* use shared linkage rather than static for the 32-bit builds.

After making these changes a set of builds produced by test-meson-builds
shrank from ~17G to ~7G on my system.

Signed-off-by: Bruce Richardson <[email protected]>
---
 devtools/test-meson-builds.sh | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 4fff1f7177..f1053bd7be 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -103,13 +103,19 @@ 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
+               if [ "$abicheck" != ABI ] ; then
+                       return
+               fi
                # for existing environments, switch to debugoptimized if unset
                # so that ABI checks can run
                if ! $MESON configure $builddir |
@@ -130,7 +136,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
@@ -181,7 +189,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
@@ -255,14 +263,11 @@ build build-x86-generic cc skipABI -Dcheck_includes=true \
 if check_cc_flags '-m32' ; then
        target_override='i386-pc-linux-gnu'
        if [ -d '/usr/lib/i386-linux-gnu' ] ; then
-               # 32-bit pkgconfig on Debian/Ubuntu, use cross file
-               build build-32b $srcdir/config/x86/cross-32bit-debian.ini ABI
+               build build-32b $srcdir/config/x86/cross-32bit-debian.ini ABI 
$use_shared
        elif [ -d '/usr/lib32' ] ; then
-               # 32-bit pkgconfig on Arch
-               build build-32b $srcdir/config/x86/cross-32bit-arch.ini ABI
+               build build-32b $srcdir/config/x86/cross-32bit-arch.ini ABI 
$use_shared
        else
-               # 32-bit pkgconfig on RHEL/Fedora (lib vs lib64)
-               build build-32b $srcdir/config/x86/cross-32bit-fedora.ini ABI
+               build build-32b $srcdir/config/x86/cross-32bit-fedora.ini ABI 
$use_shared
        fi
        target_override=
 fi
-- 
2.48.1

Reply via email to