Problem: have to check ABI compatibility manually

Solution: automate it on Travis
This commit is contained in:
Luca Boccassi 2019-01-20 15:19:44 +00:00
parent 331fee4b38
commit f9b0945c1b
2 changed files with 48 additions and 0 deletions

View File

@ -124,6 +124,14 @@ matrix:
- libnorm-dev
- libpgm-dev
- libsodium-dev
- env: BUILD_TYPE=abi-compliance-checker
os: linux
dist: xenial
addons:
apt:
packages:
- abi-dumper
- abi-compliance-checker
sudo: false

View File

@ -0,0 +1,40 @@
#!/usr/bin/env bash
set -x
cd ../../
mkdir tmp
BUILD_PREFIX=$PWD/tmp
CONFIG_OPTS=()
CONFIG_OPTS+=("CFLAGS=-I${BUILD_PREFIX}/include -g -Og")
CONFIG_OPTS+=("CPPFLAGS=-I${BUILD_PREFIX}/include")
CONFIG_OPTS+=("CXXFLAGS=-I${BUILD_PREFIX}/include -g -Og")
CONFIG_OPTS+=("LDFLAGS=-L${BUILD_PREFIX}/lib")
CONFIG_OPTS+=("PKG_CONFIG_PATH=${BUILD_PREFIX}/lib/pkgconfig")
CONFIG_OPTS+=("--prefix=${BUILD_PREFIX}")
CONFIG_OPTS+=("--enable-drafts=no")
function print_abi_api_breakages() {
echo "ABI breakages detected:"
cat compat_reports/libzmq/${LATEST_VERSION}_to_HEAD/abi_affected.txt | c++filt
echo "API breakages detected:"
cat compat_reports/libzmq/${LATEST_VERSION}_to_HEAD/src_affected.txt | c++filt
exit 1
}
./autogen.sh
./configure "${CONFIG_OPTS[@]}"
make VERBOSE=1 -j5
abi-dumper src/.libs/libzmq.so -o ${BUILD_PREFIX}/libzmq.head.dump -lver HEAD
git clone --depth 1 -b latest_release https://github.com/zeromq/libzmq.git latest_release
cd latest_release
LATEST_VERSION=$(git describe --abbrev=0 --tags)
./autogen.sh
./configure "${CONFIG_OPTS[@]}"
make VERBOSe=1 -j5
abi-dumper src/.libs/libzmq.so -o ${BUILD_PREFIX}/libzmq.latest.dump -lver ${LATEST_VERSION}
abi-compliance-checker -l libzmq -d1 ${BUILD_PREFIX}/libzmq.latest.dump -d2 ${BUILD_PREFIX}/libzmq.head.dump -list-affected || print_abi_api_breakages