DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, bruce.richardson@intel.com
Subject: [PATCH v3 3/4] devtools: build all examples externally
Date: Tue, 20 Jun 2023 16:07:03 +0200	[thread overview]
Message-ID: <20230620140704.171667-4-david.marchand@redhat.com> (raw)
In-Reply-To: <20230620140704.171667-1-david.marchand@redhat.com>

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@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
Changes since v2:
- dropped unneeded -e in sed cmdline,

Changes since v1:
- reworked built examples discovery,
- added comment for people who are not sed fluent,

---
 devtools/test-meson-builds.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 9131088c9d..1eb28a2490 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -299,6 +299,22 @@ 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=$(find $build_path/examples -maxdepth 1 -type f -name "dpdk-*" |
+	while read target; do
+		target=${target%%:*}
+		target=${target#$build_path/examples/dpdk-}
+		if [ -e $srcdir/examples/$target/Makefile ]; then
+			echo $target
+			continue
+		fi
+		# Some examples binaries are built from an example sub
+		# directory, discover the "top level" example name.
+		find $srcdir/examples -name Makefile |
+		sed -n "s,$srcdir/examples/\([^/]*\)\(/.*\|\)/$target/Makefile,\1,p"
+	done | sort -u |
+	tr '\n' ' ')
+fi
 # if pkg-config defines the necessary flags, test building some examples
 if pkg-config --define-prefix libdpdk >/dev/null 2>&1; then
 	export PKGCONF="pkg-config --define-prefix"
-- 
2.40.1


  parent reply	other threads:[~2023-06-20 14:09 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13  8:17 [PATCH 0/4] Test examples compilation externally David Marchand
2023-06-13  8:17 ` [PATCH 1/4] examples/fips_validation: fix external build David Marchand
2023-06-13 15:05   ` [EXT] " Gowrishankar Muthukrishnan
2023-06-13  8:17 ` [PATCH 2/4] examples/server_node_efd: simplify build configuration David Marchand
2023-06-13 11:05   ` David Marchand
2023-06-13  8:17 ` [PATCH 3/4] devtools: build all examples externally David Marchand
2023-06-13  9:20   ` Bruce Richardson
2023-06-13  9:29     ` David Marchand
2023-06-13  9:23   ` Bruce Richardson
2023-06-13  8:17 ` [PATCH 4/4] ci: build " David Marchand
2023-06-13  9:21 ` [PATCH 0/4] Test examples compilation externally Bruce Richardson
2023-06-13 14:06 ` [PATCH v2 " David Marchand
2023-06-13 14:06   ` [PATCH v2 1/4] examples/fips_validation: fix external build David Marchand
2023-06-13 14:06   ` [PATCH v2 2/4] examples/server_node_efd: simplify build configuration David Marchand
2023-06-20  9:42     ` Thomas Monjalon
2023-06-20  9:58       ` David Marchand
2023-06-13 14:06   ` [PATCH v2 3/4] devtools: build all examples externally David Marchand
2023-06-20  9:45     ` Thomas Monjalon
2023-06-20  9:52       ` David Marchand
2023-06-13 14:06   ` [PATCH v2 4/4] ci: build " David Marchand
2023-06-16 13:14     ` Aaron Conole
2023-06-20 14:07 ` [PATCH v3 0/4] Test examples compilation externally David Marchand
2023-06-20 14:07   ` [PATCH v3 1/4] examples/fips_validation: fix external build David Marchand
2023-06-21  6:23     ` David Marchand
2023-06-20 14:07   ` [PATCH v3 2/4] examples/server_node_efd: simplify build configuration David Marchand
2023-06-20 14:07   ` David Marchand [this message]
2023-06-20 14:07   ` [PATCH v3 4/4] ci: build examples externally David Marchand
2023-06-22 13:48   ` [PATCH] examples/l2fwd-cat: fix external build Thomas Monjalon
2023-06-22 13:55     ` Thomas Monjalon
2023-06-22 13:54   ` [PATCH v3 0/4] Test examples compilation externally Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230620140704.171667-4-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).