From patchwork Thu Nov 3 15:47:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 119454 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 D3678A00C2; Thu, 3 Nov 2022 16:47:30 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3355842D11; Thu, 3 Nov 2022 16:47:30 +0100 (CET) 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 2631E42D16 for ; Thu, 3 Nov 2022 16:47:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667490448; 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=LWW8PxfQ40jStjBcBNfNeNORRFTUGOyLX7oPiiImEQk=; b=dQnpcPSvswdQFMsLBngQi64trn8fg5l2ozSW4vEJu2y1UvrIvnrrMkiGt7uqPggHCX2qwL paxwbY53A3YKpzz+PNaaBcqsJhOQtm8qXqSf9RgO5JbdgVjgcV4LlGjHbrP5UHgFX3Tpe3 jP2NfRqNpDlstb59VXdm9k8ju4dMvMQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-96-_itnaAEANfuqam-aOdz2WA-1; Thu, 03 Nov 2022 11:47:25 -0400 X-MC-Unique: _itnaAEANfuqam-aOdz2WA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 46DC8380664D; Thu, 3 Nov 2022 15:47:25 +0000 (UTC) Received: from fchome.redhat.com (ovpn-193-221.brq.redhat.com [10.40.193.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 765B71121319; Thu, 3 Nov 2022 15:47:24 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ci@dpdk.org Subject: [PATCH 1/2] devtools: unify configuration for ABI check Date: Thu, 3 Nov 2022 16:47:16 +0100 Message-Id: <20221103154717.22368-2-david.marchand@redhat.com> In-Reply-To: <20221103154717.22368-1-david.marchand@redhat.com> References: <20221103154717.22368-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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 We have been skipping removed libraries in the ABI check by updating the check-abi.sh script itself. See, for example, commit 33584c19ddc2 ("raw/dpaa2_qdma: remove driver"). Having two places for exception is a bit confusing, and those exceptions are best placed in a single configuration file out of the check script. Besides, a next patch will switch the check from comparing ABI xml files to directly comparing .so files. In this mode, libabigail does not support the soname_regexp syntax used for the mlx glue libraries. Let's handle these special cases in libabigail.abignore using comments. Taking the raw/dpaa2_qdma driver as an example, it would be possible to skip it by adding: ; SKIP_LIBRARY=librte_net_mlx4_glue +; SKIP_LIBRARY=librte_raw_dpaa2_qdma Signed-off-by: David Marchand --- devtools/check-abi.sh | 4 ++++ devtools/libabigail.abignore | 12 +++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/devtools/check-abi.sh b/devtools/check-abi.sh index c583eae2fd..b1bf633f2a 100755 --- a/devtools/check-abi.sh +++ b/devtools/check-abi.sh @@ -37,6 +37,10 @@ fi error= for dump in $(find $refdir -name "*.dump"); do name=$(basename $dump) + if grep -q "; SKIP_LIBRARY=${name%.dump}\>" $(dirname $0)/libabigail.abignore; then + echo "Skipped $name" >&2 + continue + fi dump2=$(find $newdir -name $name) if [ -z "$dump2" ] || [ ! -e "$dump2" ]; then echo "Error: cannot find $name in $newdir" >&2 diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore index 7a93de3ba1..3ff51509de 100644 --- a/devtools/libabigail.abignore +++ b/devtools/libabigail.abignore @@ -16,9 +16,15 @@ [suppress_variable] name_regexp = _pmd_info$ -; Ignore changes on soname for mlx glue internal drivers -[suppress_file] - soname_regexp = ^librte_.*mlx.*glue\. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Special rules to skip libraries ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; This is not a libabigail rule (see check-abi.sh). +; This is used for driver removal and other special cases like mlx glue libs. +; +; SKIP_LIBRARY=librte_common_mlx5_glue +; SKIP_LIBRARY=librte_net_mlx4_glue ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Experimental APIs exceptions ; From patchwork Thu Nov 3 15:47:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 119455 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 83B23A00C2; Thu, 3 Nov 2022 16:47:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 197FF42D1B; Thu, 3 Nov 2022 16:47:34 +0100 (CET) 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 E550A42D0B for ; Thu, 3 Nov 2022 16:47:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667490452; 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=sQct8p2xYYGWObUhnp1H8LtPx28VWes2QLKBQS0UeNI=; b=Z0vLwZ2YAMdXkKcANXHSVrI33852zPtiaUVdoJ5ager/EVfQVdrbN0E7yfEcKuHSnYrrUC qAa5M7C01MIT84BRvd4p7DIjhu7PgmFEKAw9Td5CoqiLkFlv8TWZPRTDq0OnAwwE8d9Lcx JWT6962lR6DzMxN4yzRT+vAu757kk7A= 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-482-wpTR9bIdOZWs4mXKMDjDcQ-1; Thu, 03 Nov 2022 11:47:29 -0400 X-MC-Unique: wpTR9bIdOZWs4mXKMDjDcQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C96D8811E67; Thu, 3 Nov 2022 15:47:28 +0000 (UTC) Received: from fchome.redhat.com (ovpn-193-221.brq.redhat.com [10.40.193.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D12A2166B26; Thu, 3 Nov 2022 15:47:27 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ci@dpdk.org, Aaron Conole , Michael Santana , Bruce Richardson Subject: [PATCH 2/2] devtools: stop depending on libabigail xml format Date: Thu, 3 Nov 2022 16:47:17 +0100 Message-Id: <20221103154717.22368-3-david.marchand@redhat.com> In-Reply-To: <20221103154717.22368-1-david.marchand@redhat.com> References: <20221103154717.22368-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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 A ABI reference depends on: - DPDK build options, - toolchain compiler and versions, - libabigail version. The reason for the latter point is that, when the ABI reference was generated, ABI xml files were dumped in a format depending on the libabigail version. Those xml files were then later used to compare against modified code. There are a few disadvantages with this method: - since the xml files are dependent on the libabigail version, when updating CI environments, a change in the libabigail package requires regenerating the ABI references, - comparing xml files with abidiff is not well tested, as we (DPDK) uncovered bugs in libabigail that were not hit with comparing .so, Switch to comparing .so directly, remove this dependence and update GHA script. Signed-off-by: David Marchand --- .ci/linux-build.sh | 4 ---- .github/workflows/build.yml | 2 +- MAINTAINERS | 1 - devtools/check-abi.sh | 15 ++++++++------- devtools/gen-abi.sh | 26 -------------------------- devtools/test-meson-builds.sh | 5 ----- 6 files changed, 9 insertions(+), 44 deletions(-) delete mode 100755 devtools/gen-abi.sh diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index baec65a914..ce91b0af04 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -143,8 +143,6 @@ fi if [ "$ABI_CHECKS" = "true" ]; then if [ "$(cat libabigail/VERSION 2>/dev/null)" != "$LIBABIGAIL_VERSION" ]; then rm -rf libabigail - # if we change libabigail, invalidate existing abi cache - rm -rf reference fi if [ ! -d libabigail ]; then @@ -166,7 +164,6 @@ if [ "$ABI_CHECKS" = "true" ]; then meson $OPTS -Dexamples= $refsrcdir $refsrcdir/build ninja -C $refsrcdir/build DESTDIR=$(pwd)/reference ninja -C $refsrcdir/build install - devtools/gen-abi.sh reference find reference/usr/local -name '*.a' -delete rm -rf reference/usr/local/bin rm -rf reference/usr/local/share @@ -174,7 +171,6 @@ if [ "$ABI_CHECKS" = "true" ]; then fi DESTDIR=$(pwd)/install ninja -C build install - devtools/gen-abi.sh install devtools/check-abi.sh reference install ${ABI_CHECKS_WARN_ONLY:-} fi diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a595c12354..b23f8805cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,7 +71,7 @@ jobs: echo -n '::set-output name=libabigail::' echo 'libabigail-${{ matrix.config.os }}' echo -n '::set-output name=abi::' - echo 'abi-${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ matrix.config.cross }}-${{ env.LIBABIGAIL_VERSION }}-${{ env.REF_GIT_TAG }}' + echo 'abi-${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ matrix.config.cross }}-${{ env.REF_GIT_TAG }}' - name: Retrieve ccache cache uses: actions/cache@v2 with: diff --git a/MAINTAINERS b/MAINTAINERS index 1c9922123e..9bafec37e7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -90,7 +90,6 @@ F: devtools/check-spdx-tag.sh F: devtools/check-symbol-change.sh F: devtools/check-symbol-maps.sh F: devtools/checkpatches.sh -F: devtools/gen-abi.sh F: devtools/get-maintainer.sh F: devtools/git-log-fixes.sh F: devtools/load-devel-config diff --git a/devtools/check-abi.sh b/devtools/check-abi.sh index b1bf633f2a..078de43629 100755 --- a/devtools/check-abi.sh +++ b/devtools/check-abi.sh @@ -35,21 +35,22 @@ else fi error= -for dump in $(find $refdir -name "*.dump"); do - name=$(basename $dump) - if grep -q "; SKIP_LIBRARY=${name%.dump}\>" $(dirname $0)/libabigail.abignore; then +for lib in $(find $refdir -name "*.so.*" -a ! -type l); do + name=$(basename $lib) + if grep -q "; SKIP_LIBRARY=${name%.so.*}\>" $(dirname $0)/libabigail.abignore; then echo "Skipped $name" >&2 continue fi - dump2=$(find $newdir -name $name) - if [ -z "$dump2" ] || [ ! -e "$dump2" ]; then + # Look for a library with the same major ABI version + lib2=$(find $newdir -name "${name%.*}.*" -a ! -type l) + if [ -z "$lib2" ] || [ ! -e "$lib2" ]; then echo "Error: cannot find $name in $newdir" >&2 error=1 continue fi - abidiff $ABIDIFF_OPTIONS $dump $dump2 || { + abidiff $ABIDIFF_OPTIONS $lib $lib2 || { abiret=$? - echo "Error: ABI issue reported for 'abidiff $ABIDIFF_OPTIONS $dump $dump2'" >&2 + echo "Error: ABI issue reported for 'abidiff $ABIDIFF_OPTIONS $lib $lib2'" >&2 error=1 echo if [ $(($abiret & 3)) -ne 0 ]; then diff --git a/devtools/gen-abi.sh b/devtools/gen-abi.sh deleted file mode 100755 index f15a3b9aaf..0000000000 --- a/devtools/gen-abi.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -e -# SPDX-License-Identifier: BSD-3-Clause -# Copyright (c) 2019 Red Hat, Inc. - -if [ $# != 1 ]; then - echo "Usage: $0 installdir" >&2 - exit 1 -fi - -installdir=$1 -if [ ! -d $installdir ]; then - echo "Error: install directory '$installdir' does not exist." >&2 - exit 1 -fi - -dumpdir=$installdir/dump -rm -rf $dumpdir -mkdir -p $dumpdir -for f in $(find $installdir -name "*.so.*"); do - if test -L $f; then - continue - fi - - libname=$(basename $f) - abidw --out-file $dumpdir/${libname%.so*}.dump $f -done diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index 3a308bc9af..971650e621 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -188,7 +188,6 @@ build () # [meson options] -Dexamples= $* compile $abirefdir/build install_target $abirefdir/build $abirefdir/$targetdir - $srcdir/devtools/gen-abi.sh $abirefdir/$targetdir # save disk space by removing static libs and apps find $abirefdir/$targetdir/usr/local -name '*.a' -delete @@ -199,10 +198,6 @@ build () # [meson options] install_target $builds_dir/$targetdir \ $(readlink -f $builds_dir/$targetdir/install) echo "Checking ABI compatibility of $targetdir" >&$verbose - echo $srcdir/devtools/gen-abi.sh \ - $(readlink -f $builds_dir/$targetdir/install) >&$veryverbose - $srcdir/devtools/gen-abi.sh \ - $(readlink -f $builds_dir/$targetdir/install) >&$veryverbose echo $srcdir/devtools/check-abi.sh $abirefdir/$targetdir \ $(readlink -f $builds_dir/$targetdir/install) >&$veryverbose $srcdir/devtools/check-abi.sh $abirefdir/$targetdir \