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 <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH] devtools: select targets in build test
Date: Thu,  4 Feb 2021 14:34:35 +0100	[thread overview]
Message-ID: <20210204133435.3117-1-david.marchand@redhat.com> (raw)

When a target compilation is broken, one way to skip the target is to
uninstall the associated toolchain.
But it is not always possible and you end up with hacking the script to
avoid this target until a fix is ready.

It is also often quicker to check a fix on a failing target before
checking compilation on all targets.

Introduce a variable to select targets.

Example:
$ DPDK_BUILD_TEST_TARGETS=build-x86-mingw \
    ./devtools/test-meson-builds.sh
ninja: Entering directory `/home/dmarchan/builds/build-x86-mingw'
[...]
Found ninja-1.10.1 at /usr/bin/ninja
[19/19] Linking target examples/dpdk-helloworld.exe

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 devtools/test-meson-builds.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index c11ae87e0d..3e88e8291e 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -92,6 +92,15 @@ load_env () # <target compiler>
 	command -v $targetcc >/dev/null 2>&1 || return 1
 }
 
+target_is_selected()
+{
+	if [ -z "${DPDK_BUILD_TEST_TARGETS:-}" ]; then
+		return 0
+	fi
+	target_filter=" $DPDK_BUILD_TEST_TARGETS "
+	! [ "${target_filter##* $1 }" = "${target_filter}" ]
+}
+
 config () # <dir> <builddir> <meson options>
 {
 	dir=$1
@@ -149,6 +158,7 @@ install_target () # <builddir> <installdir>
 build () # <directory> <target cc | cross file> <ABI check> [meson options]
 {
 	targetdir=$1
+	target_is_selected $targetdir || return 0
 	shift
 	crossfile=
 	[ -r $1 ] && crossfile=$1 || targetcc=$1
@@ -271,6 +281,8 @@ for f in $srcdir/config/ppc/ppc* ; do
 	build $targetdir $f ABI $use_shared
 done
 
+target_is_selected build-x86-default || exit 0
+
 # Test installation of the x86-default target, to be used for checking
 # the sample apps build using the pkg-config file for cflags and libs
 load_env cc
-- 
2.23.0


             reply	other threads:[~2021-02-04 13:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 13:34 David Marchand [this message]
2021-02-04 13:59 ` Thomas Monjalon
2021-02-04 14:48   ` David Marchand
2021-02-04 15:48     ` 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=20210204133435.3117-1-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).