From: Kienan Stewart Date: Tue, 17 Dec 2024 20:30:47 +0000 (-0500) Subject: jjb: Run abidiff on liblttng-ctl during lttng-tools builds X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2ffa5f603d8ceba5f5e68f3152f4520ea7a4e643;p=lttng-ci.git jjb: Run abidiff on liblttng-ctl during lttng-tools builds Change-Id: I0f44698df5de7d6ec8d52ec2e6e5d265a1c1c16a Signed-off-by: Kienan Stewart --- diff --git a/scripts/lttng-tools/build.sh b/scripts/lttng-tools/build.sh index b5198e2..b0a09ac 100755 --- a/scripts/lttng-tools/build.sh +++ b/scripts/lttng-tools/build.sh @@ -531,6 +531,35 @@ if [ "$LTTNG_TOOLS_CLANG_TIDY" = "yes" ]; then fi fi +set +e +ABIDW="$(command -v abidw)" +set -e +if [[ -n "${ABIDW}" ]] && [[ -f "src/lib/lttng-ctl/.libs/liblttng-ctl.so" ]] && [[ -f "src/lib/lttng-ctl/abi_ref/0.0.0/abi.xml" ]]; then + print_header "liblttng-ctl ABI diff" + ABI_XML=$(mktemp) + abidw --drop-undefined-syms --drop-private-types --headers-dir include/ src/lib/lttng-ctl/.libs/liblttng-ctl.so > "${ABI_XML}" + + set +e + output="$(abidiff src/lib/lttng-ctl/abi_ref/0.0.0/abi.xml "${ABI_XML}")" + ret=$? + set -e + if [[ $((ret & 8)) == 8 ]]; then + echo "Breaking changes detected" + exit_status=1 + elif [[ $((ret & 4)) == 4 ]]; then + echo "ABI changes detected" + elif [[ $ret == 0 ]]; then + echo "No ABI changes detected" + else + echo "Error running abidiff" + exit_status=1 + fi + + mkdir -p "${WORKSPACE}/log" + echo "${output}" | tee "${WORKSPACE}/log/abi.diff" + rm -rf "${ABI_XML}" +fi + # Run tests for all configs except 'no-ust' / 'relayd-only' if [ "$LTTNG_TOOLS_RUN_TESTS" = "yes" ] && [[ ! "$conf" =~ (no-ust|relayd-only) ]]; then print_header "Run test suite"