devtools: reduce examples in static builds
PATCH 1/1 devtools: reduce examples in static builds
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.
--- devtools/test-build.sh | 1 + devtools/test-meson-builds.sh | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-)
devtools/test-build.sh +1 -0
@@ -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
devtools/test-meson-builds.sh +6 -1
@@ -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"
Signature · 1 line
2.26.0
Quoted 30 lines · Thomas Monjalon
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 <[email protected]>--- devtools/test-build.sh | 1 + devtools/test-meson-builds.sh | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-)devtools/test-build.sh +1
-0@@ -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)/examplesdevtools/test-meson-builds.sh +0
-0
devtools/test-meson-builds.sh config () # <dir> <builddir> <meson options> · line 82
Quoted 10 lines
devtools/test-meson-builds.sh +6
-1@@ -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.
Signature · 1 line
David Marchand
19/04/2020 09:08, David Marchand:
Quoted 5 lines · Thomas Monjalon
Quoted 4 lines
devtools/test-meson-builds.sh +1
-1- options="$options --werror -Dexamples=all" + options="$options --werror"
Quoted 8 lines
devtools/test-meson-builds.sh config () # <dir> <builddir> <meson options> · line 82
Quoted 5 lines
devtools/test-meson-builds.sh +5
-0+ if echo $* | grep -qw -- '--default-library=static' ; then + options="$options -Dexamples=l3fwd" + else + options="$options -Dexamples=all" + fiOk, 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
Quoted 4 lines
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.
19/04/2020 16:29, Thomas Monjalon:
Quoted 15 lines
19/04/2020 09:08, David Marchand:
Quoted 5 lines · Thomas Monjalon
Quoted 4 lines
devtools/test-meson-builds.sh +1
-1- options="$options --werror -Dexamples=all" + options="$options --werror"Quoted 8 lines
devtools/test-meson-builds.sh config () # <dir> <builddir> <meson options> · line 82
Quoted 5 lines
devtools/test-meson-builds.sh +5
-0+ if echo $* | grep -qw -- '--default-library=static' ; then + options="$options -Dexamples=l3fwd" + else + options="$options -Dexamples=all" + fiOk, this is hypothetical, but this would not work when no default-library option is passed (static is the default value).
Quoted 2 lines
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'],
Quoted 1 line
Quoted 1 line
How about inverting the check and look for default-library=shared ?
Yes I will invert the check in v2.
Quoted 5 lines
Quoted 2 lines
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.
PATCH v2 1/1 devtools: reduce examples in static builds
In reply to Thomas MonjalonStatic 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.
---
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(-)
devtools/test-build.sh +1 -0
@@ -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
devtools/test-meson-builds.sh +6 -1
@@ -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"
Signature · 1 line
2.26.0
Quoted 8 lines · Thomas Monjalon
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 <[email protected]>
Signature · 1 line
David Marchand
Thomas Monjalon
Applied21/04/2020 08:59, David Marchand:
Quoted 11 lines · Thomas Monjalon
Quoted 8 lines
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 <[email protected]>Acked-by David Marchand <[email protected]>
Applied