From 4021f34520517ddd99d6ecd7ce26eed13be0c260 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Mon, 6 Apr 2020 18:16:52 -0700 Subject: [PATCH] test/make: fix the confirm_abi_deps test. I reversed the arguments to abidiff when I first submitted this test which was causing additions to be reported as removals and vice versa. Signed-off-by: Seth Howell Change-Id: Iac50243f7cda7c1f9c2302af13a34eca844e0689 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1705 Reviewed-by: Aleksey Marchuk Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker Reviewed-by: Jim Harris Reviewed-by: Paul Luse Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins --- module/bdev/nvme/Makefile | 4 ++-- test/make/check_so_deps.sh | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/module/bdev/nvme/Makefile b/module/bdev/nvme/Makefile index b3b24c97f..c15f8c77b 100644 --- a/module/bdev/nvme/Makefile +++ b/module/bdev/nvme/Makefile @@ -34,8 +34,8 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -SO_VER := 2 -SO_MINOR := 1 +SO_VER := 3 +SO_MINOR := 0 SO_SUFFIX := $(SO_VER).$(SO_MINOR) C_SRCS = bdev_nvme.c bdev_nvme_rpc.c nvme_rpc.c common.c bdev_ocssd.c bdev_ocssd_rpc.c diff --git a/test/make/check_so_deps.sh b/test/make/check_so_deps.sh index f3e8411a1..c1d031f31 100755 --- a/test/make/check_so_deps.sh +++ b/test/make/check_so_deps.sh @@ -11,6 +11,7 @@ source "$rootdir/test/common/autotest_common.sh" libdir="$rootdir/build/lib" libdeps_file="$rootdir/mk/spdk.lib_deps.mk" source_abi_dir="$HOME/spdk_20_01/build/lib" +suppression_file="$HOME/abigail_suppressions.ini" function confirm_abi_deps() { local processed_so=0 @@ -25,6 +26,8 @@ function confirm_abi_deps() { return 1 fi + touch $suppression_file + for object in "$libdir"/libspdk_*.so; do so_file=$(basename $object) if [ ! -f "$source_abi_dir/$so_file" ]; then @@ -32,9 +35,9 @@ function confirm_abi_deps() { continue fi - if ! abidiff $libdir/$so_file $source_abi_dir/$so_file --leaf-changes-only --stat > /dev/null; then + if ! abidiff $source_abi_dir/$so_file $libdir/$so_file --leaf-changes-only --suppressions $suppression_file --stat > /dev/null; then found_abi_change=false - output=$(abidiff $libdir/$so_file $source_abi_dir/$so_file --leaf-changes-only --stat) || true + output=$(abidiff $source_abi_dir/$so_file $libdir/$so_file --leaf-changes-only --suppressions $suppression_file --stat) || true new_so_maj=$(readlink $libdir/$so_file | awk -F'\\.so\\.' '{print $2}' | cut -d '.' -f1) new_so_min=$(readlink $libdir/$so_file | awk -F'\\.so\\.' '{print $2}' | cut -d '.' -f2) old_so_maj=$(readlink $source_abi_dir/$so_file | awk -F'\\.so\\.' '{print $2}' | cut -d '.' -f1) @@ -42,6 +45,8 @@ function confirm_abi_deps() { so_name_changed=$(grep "ELF SONAME changed" <<< "$output") || so_name_changed="No" function_summary=$(grep "functions summary" <<< "$output") variable_summary=$(grep "variables summary" <<< "$output") + # remove any filtered out variables. + variable_summary=$(sed "s/ [()][^)]*[)]//g" <<< "$variable_summary") read -r _ _ _ removed_functions _ changed_functions _ added_functions _ <<< "$function_summary" read -r _ _ _ removed_vars _ changed_vars _ added_vars _ <<< "$variable_summary" @@ -75,12 +80,18 @@ function confirm_abi_deps() { echo "SO name for $so_file changed without a change to abi. please revert that change." touch $fail_file fi + + if [ "$new_so_maj" != "$old_so_maj" ] && [ "$new_so_min" != "0" ]; then + echo "SO major version for $so_file was bumped. Please reset the minor version to 0." + touch $fail_file + fi fi continue fi processed_so=$((processed_so+1)) done + rm -f $suppression_file echo "Processed $processed_so objects." }