From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, bruce.richardson@intel.com,
Aaron Conole <aconole@redhat.com>,
Michael Santana <maicolgabriel@hotmail.com>
Subject: [PATCH v3 4/4] ci: build examples externally
Date: Tue, 20 Jun 2023 16:07:04 +0200 [thread overview]
Message-ID: <20230620140704.171667-5-david.marchand@redhat.com> (raw)
In-Reply-To: <20230620140704.171667-1-david.marchand@redhat.com>
Enhance our CI coverage by building examples against an installed DPDK.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Aaron Conole <aconole@redhat.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,
---
.ci/linux-build.sh | 27 ++++++++++++++++++++++++++-
.github/workflows/build.yml | 6 +++---
2 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index 9631e342b5..d0d9f89bae 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -1,7 +1,7 @@
#!/bin/sh -xe
if [ -z "${DEF_LIB:-}" ]; then
- DEF_LIB=static ABI_CHECKS= BUILD_DOCS= RUN_TESTS= $0
+ DEF_LIB=static ABI_CHECKS= BUILD_DOCS= BUILD_EXAMPLES= RUN_TESTS= $0
DEF_LIB=shared $0
exit
fi
@@ -99,6 +99,7 @@ if [ "$MINI" = "true" ]; then
else
OPTS="$OPTS -Ddisable_libs="
fi
+OPTS="$OPTS -Dlibdir=lib"
if [ "$ASAN" = "true" ]; then
OPTS="$OPTS -Db_sanitize=address"
@@ -168,3 +169,27 @@ if [ "$RUN_TESTS" = "true" ]; then
catch_coredump
[ "$failed" != "true" ]
fi
+
+# Test examples compilation with an installed dpdk
+if [ "$BUILD_EXAMPLES" = "true" ]; then
+ [ -d install ] || DESTDIR=$(pwd)/install ninja -C build install
+ export LD_LIBRARY_PATH=$(dirname $(find $(pwd)/install -name librte_eal.so)):$LD_LIBRARY_PATH
+ export PKG_CONFIG_PATH=$(dirname $(find $(pwd)/install -name libdpdk.pc)):$PKG_CONFIG_PATH
+ export PKGCONF="pkg-config --define-prefix"
+ find build/examples -maxdepth 1 -type f -name "dpdk-*" |
+ while read target; do
+ target=${target%%:*}
+ target=${target#build/examples/dpdk-}
+ if [ -e 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 examples -name Makefile |
+ sed -n "s,examples/\([^/]*\)\(/.*\|\)/$target/Makefile,\1,p"
+ done | sort -u |
+ while read example; do
+ make -C install/usr/local/share/dpdk/examples/$example clean shared
+ done
+fi
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 3b629fcdbd..414dd089e0 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -20,6 +20,7 @@ jobs:
BUILD_32BIT: ${{ matrix.config.cross == 'i386' }}
BUILD_DEBUG: ${{ contains(matrix.config.checks, 'debug') }}
BUILD_DOCS: ${{ contains(matrix.config.checks, 'doc') }}
+ BUILD_EXAMPLES: ${{ contains(matrix.config.checks, 'examples') }}
CC: ccache ${{ matrix.config.compiler }}
DEF_LIB: ${{ matrix.config.library }}
LIBABIGAIL_VERSION: libabigail-2.1
@@ -39,7 +40,7 @@ jobs:
mini: mini
- os: ubuntu-20.04
compiler: gcc
- checks: abi+debug+doc+tests
+ checks: abi+debug+doc+examples+tests
- os: ubuntu-20.04
compiler: clang
checks: asan+doc+tests
@@ -96,12 +97,11 @@ jobs:
- name: Install packages
run: sudo apt install -y ccache libarchive-dev libbsd-dev libfdt-dev
libibverbs-dev libjansson-dev libnuma-dev libpcap-dev libssl-dev
- ninja-build python3-pip python3-pyelftools python3-setuptools
+ ninja-build pkg-config python3-pip python3-pyelftools python3-setuptools
python3-wheel zlib1g-dev
- name: Install libabigail build dependencies if no cache is available
if: env.ABI_CHECKS == 'true' && steps.libabigail-cache.outputs.cache-hit != 'true'
run: sudo apt install -y autoconf automake libdw-dev libtool libxml2-dev
- pkg-config
- name: Install i386 cross compiling packages
if: env.BUILD_32BIT == 'true'
run: sudo apt install -y gcc-multilib g++-multilib
--
2.40.1
next prev parent reply other threads:[~2023-06-20 14:08 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 ` [PATCH v3 3/4] devtools: build all examples externally David Marchand
2023-06-20 14:07 ` David Marchand [this message]
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-5-david.marchand@redhat.com \
--to=david.marchand@redhat.com \
--cc=aconole@redhat.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=maicolgabriel@hotmail.com \
--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).