[PATCH 3/4] devtools: build all examples externally

David Marchand david.marchand at redhat.com
Tue Jun 13 11:29:39 CEST 2023


On Tue, Jun 13, 2023 at 11:21 AM Bruce Richardson
<bruce.richardson at intel.com> wrote:
>
> On Tue, Jun 13, 2023 at 10:17:40AM +0200, David Marchand wrote:
> > So far, users of test-meson-builds.sh had to define their own set of
> > examples to build externally. This is not that great because users need
> > to maintain this list when examples are removed/added.
> >
> > Rework the script so that the 'all' value triggers an automatic
> > discovery based on what was configured/compiled with meson/ninja.
> >
> > Signed-off-by: David Marchand <david.marchand at redhat.com>
> > ---
> >  devtools/test-meson-builds.sh | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> >
> > diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
> > index 9131088c9d..cab3373544 100755
> > --- a/devtools/test-meson-builds.sh
> > +++ b/devtools/test-meson-builds.sh
> > @@ -299,6 +299,20 @@ export PKG_CONFIG_PATH=$(dirname $pc_file):$PKG_CONFIG_PATH
> >  libdir=$(dirname $(find $DESTDIR -name librte_eal.so))
> >  export LD_LIBRARY_PATH=$libdir:$LD_LIBRARY_PATH
> >  examples=${DPDK_BUILD_TEST_EXAMPLES:-"cmdline helloworld l2fwd l3fwd skeleton timer"}
> > +if [ "$examples" = 'all' ]; then
> > +     examples=$(ninja -C $build_path -t targets all | grep 'examples/.*:.*c_LINKER' |
>
> Since the build has already been done in $build_path at this point, would
> it be easier to get the list of examples from "ls $build_path/examples/dpdk-*"?

Oh yes, it is more robust than parsing ninja targets.
I'll look into it.


> > +             find $srcdir/examples -name Makefile |
> > +             sed -ne "s,$srcdir/examples/\([^/]*\)\ (/.*\|\)/$target/Makefile,\1,p"
> Scripts can be rather cryptic at times. I assume this sed statement is for
> handling examples which have subdirectories/are in subdirs. A comment
> explaining this logic would be good.

Indeed, I'll add a comment.


-- 
David Marchand



More information about the dev mailing list