DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] devtools: reduce examples in static builds
@ 2020-04-18 13:19 Thomas Monjalon
  2020-04-19  7:08 ` David Marchand
  2020-04-21  0:30 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
  0 siblings, 2 replies; 7+ messages in thread
From: Thomas Monjalon @ 2020-04-18 13:19 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, david.marchand

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

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..b1c0380809 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=static' ; then
+		options="$options -Dexamples=l3fwd"
+	else
+		options="$options -Dexamples=all"
+	fi
 	options="$options --buildtype=debugoptimized"
 	for option in $DPDK_MESON_OPTIONS ; do
 		options="$options -D$option"
-- 
2.26.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH] devtools: reduce examples in static builds
  2020-04-18 13:19 [dpdk-dev] [PATCH] devtools: reduce examples in static builds Thomas Monjalon
@ 2020-04-19  7:08 ` David Marchand
  2020-04-19 14:29   ` Thomas Monjalon
  2020-04-21  0:30 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
  1 sibling, 1 reply; 7+ messages in thread
From: David Marchand @ 2020-04-19  7:08 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Bruce Richardson

On Sat, Apr 18, 2020 at 3:20 PM 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>
> ---
>  devtools/test-build.sh        | 1 +
>  devtools/test-meson-builds.sh | 7 ++++++-
>  2 files changed, 7 insertions(+), 1 deletion(-)
>
> 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..b1c0380809 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=static' ; then
> +               options="$options -Dexamples=l3fwd"
> +       else
> +               options="$options -Dexamples=all"
> +       fi

Ok, this is hypothetical, but this would not work when no
default-library option is passed (static is the default value).
How about inverting the check and look for default-library=shared ?

Besides, you won't catch already configured directories.
While for make environments, this change will have an effect right away.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH] devtools: reduce examples in static builds
  2020-04-19  7:08 ` David Marchand
@ 2020-04-19 14:29   ` Thomas Monjalon
  2020-04-19 14:40     ` Thomas Monjalon
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Monjalon @ 2020-04-19 14:29 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Bruce Richardson

19/04/2020 09:08, David Marchand:
> On Sat, Apr 18, 2020 at 3:20 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> > --- a/devtools/test-meson-builds.sh
> > +++ b/devtools/test-meson-builds.sh
> > -       options="$options --werror -Dexamples=all"
> > +       options="$options --werror"
> > +       if echo $* | grep -qw -- '--default-library=static' ; then
> > +               options="$options -Dexamples=l3fwd"
> > +       else
> > +               options="$options -Dexamples=all"
> > +       fi
> 
> Ok, this is hypothetical, but this would not work when no
> default-library option is passed (static is the default value).

No, with meson, shared is the default:
	https://mesonbuild.com/Builtin-options.html#core-options

> How about inverting the check and look for default-library=shared ?
> 
> Besides, you won't catch already configured directories.
> While for make environments, this change will have an effect right away.

Yes, I think it is OK to keep old configuration in meson builds
until the build directories are trashed.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH] devtools: reduce examples in static builds
  2020-04-19 14:29   ` Thomas Monjalon
@ 2020-04-19 14:40     ` Thomas Monjalon
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2020-04-19 14:40 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Bruce Richardson

19/04/2020 16:29, Thomas Monjalon:
> 19/04/2020 09:08, David Marchand:
> > On Sat, Apr 18, 2020 at 3:20 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> > > --- a/devtools/test-meson-builds.sh
> > > +++ b/devtools/test-meson-builds.sh
> > > -       options="$options --werror -Dexamples=all"
> > > +       options="$options --werror"
> > > +       if echo $* | grep -qw -- '--default-library=static' ; then
> > > +               options="$options -Dexamples=l3fwd"
> > > +       else
> > > +               options="$options -Dexamples=all"
> > > +       fi
> > 
> > Ok, this is hypothetical, but this would not work when no
> > default-library option is passed (static is the default value).
> 
> No, with meson, shared is the default:
> 	https://mesonbuild.com/Builtin-options.html#core-options

Thanks to an offline explanation, it appears I'm wrong.
The default value is changed in our root meson.build file:
	default_options: ['buildtype=release', 'default_library=static'],

> > How about inverting the check and look for default-library=shared ?

Yes I will invert the check in v2.

> > Besides, you won't catch already configured directories.
> > While for make environments, this change will have an effect right away.
> 
> Yes, I think it is OK to keep old configuration in meson builds
> until the build directories are trashed.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH v2] devtools: reduce examples in static builds
  2020-04-18 13:19 [dpdk-dev] [PATCH] devtools: reduce examples in static builds Thomas Monjalon
  2020-04-19  7:08 ` David Marchand
@ 2020-04-21  0:30 ` Thomas Monjalon
  2020-04-21  6:59   ` David Marchand
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas Monjalon @ 2020-04-21  0:30 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, david.marchand

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(-)

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"
-- 
2.26.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH v2] devtools: reduce examples in static builds
  2020-04-21  0:30 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
@ 2020-04-21  6:59   ` David Marchand
  2020-04-21  9:18     ` Thomas Monjalon
  0 siblings, 1 reply; 7+ messages in thread
From: David Marchand @ 2020-04-21  6:59 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Bruce Richardson

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>

-- 
David Marchand


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH v2] devtools: reduce examples in static builds
  2020-04-21  6:59   ` David Marchand
@ 2020-04-21  9:18     ` Thomas Monjalon
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2020-04-21  9:18 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, David Marchand

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




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-04-21  9:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-18 13:19 [dpdk-dev] [PATCH] devtools: reduce examples in static builds Thomas Monjalon
2020-04-19  7:08 ` David Marchand
2020-04-19 14:29   ` Thomas Monjalon
2020-04-19 14:40     ` Thomas Monjalon
2020-04-21  0:30 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
2020-04-21  6:59   ` David Marchand
2020-04-21  9:18     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).