[v2] devtools: reduce examples in static builds

Message ID 20200421003056.2438-1-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2] devtools: reduce examples in static builds |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed
ci/iol-testing fail Testing issues

Commit Message

Thomas Monjalon April 21, 2020, 12:30 a.m. UTC
  Static builds can take a lot of space, so reduce the number of examples
built when testing those static builds.

As makefile-based build is close to end of life, completely skip examples
in case of static linkage with make.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---

v2: invert logic with meson because static is the default

---
 devtools/test-build.sh        | 1 +
 devtools/test-meson-builds.sh | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
  

Comments

David Marchand April 21, 2020, 6:59 a.m. UTC | #1
On Tue, Apr 21, 2020 at 2:31 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> Static builds can take a lot of space, so reduce the number of examples
> built when testing those static builds.
>
> As makefile-based build is close to end of life, completely skip examples
> in case of static linkage with make.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Acked-by: David Marchand <david.marchand@redhat.com>
  
Thomas Monjalon April 21, 2020, 9:18 a.m. UTC | #2
21/04/2020 08:59, David Marchand:
> On Tue, Apr 21, 2020 at 2:31 AM Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > Static builds can take a lot of space, so reduce the number of examples
> > built when testing those static builds.
> >
> > As makefile-based build is close to end of life, completely skip examples
> > in case of static linkage with make.
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> 
> Acked-by: David Marchand <david.marchand@redhat.com>

Applied
  

Patch

diff --git a/devtools/test-build.sh b/devtools/test-build.sh
index e6e40588c6..a298115002 100755
--- a/devtools/test-build.sh
+++ b/devtools/test-build.sh
@@ -257,6 +257,7 @@  for conf in $configs ; do
 	echo "================== Build examples for $conf"
 	export RTE_SDK=$(readlink -f $dir)/install/share/dpdk
 	ln -sTf $(pwd)/lib $RTE_SDK/lib # workaround for vm_power_manager
+	grep -q 'SHARED_LIB=n' $dir/.config || # skip examples with static libs
 	${MAKE} -j$J -sC examples \
 		EXTRA_LDFLAGS="$DPDK_DEP_LDFLAGS" $verbose \
 		O=$(readlink -f $dir)/examples
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index c1ff2bb50a..e8df017596 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -74,7 +74,12 @@  config () # <dir> <builddir> <meson options>
 		return
 	fi
 	options=
-	options="$options --werror -Dexamples=all"
+	options="$options --werror"
+	if echo $* | grep -qw -- '--default-library=shared' ; then
+		options="$options -Dexamples=all"
+	else
+		options="$options -Dexamples=l3fwd" # save disk space
+	fi
 	options="$options --buildtype=debugoptimized"
 	for option in $DPDK_MESON_OPTIONS ; do
 		options="$options -D$option"