From patchwork Tue Jun 20 14:07:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 128853 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B43CE42D09; Tue, 20 Jun 2023 16:08:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7E08A40DDA; Tue, 20 Jun 2023 16:08:43 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 8F9BD400D6 for ; Tue, 20 Jun 2023 16:08:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687270121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Co0zeLwHidaWkG+loEHzJ3C8FIkEVdWTy1gsr4jWHJY=; b=C3rZadR3rYLxlEkppYCW7jVSa4IHf/UE5Pty/uzkG97rwK4jqGFo7Rw6a0IhJ2HjUVTjWH tUwGx5xWkPYkJ1uOgvWsUW1a374UYYr6r8286Kvwat/I1EvlhNHOXib0IGjt6dOGjcMhac cVWOYhXriLudRIRZeXePGHZkVzY00j0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-126-R5_TRFiDPXSDtKWHHH96Ug-1; Tue, 20 Jun 2023 10:08:34 -0400 X-MC-Unique: R5_TRFiDPXSDtKWHHH96Ug-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6506989E764; Tue, 20 Jun 2023 14:07:46 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BDA5425357; Tue, 20 Jun 2023 14:07:45 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, bruce.richardson@intel.com, Aaron Conole , Michael Santana Subject: [PATCH v3 4/4] ci: build examples externally Date: Tue, 20 Jun 2023 16:07:04 +0200 Message-Id: <20230620140704.171667-5-david.marchand@redhat.com> In-Reply-To: <20230620140704.171667-1-david.marchand@redhat.com> References: <20230613081741.4083273-1-david.marchand@redhat.com> <20230620140704.171667-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Enhance our CI coverage by building examples against an installed DPDK. Signed-off-by: David Marchand Acked-by: Bruce Richardson Acked-by: Aaron Conole --- 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