Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Travis-ci to run ABI check #626

Merged
merged 13 commits into from
Oct 13, 2015
55 changes: 28 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,53 @@
language: c
os:
- linux
- osx
compiler:
- gcc
- clang
- x86_64-w64-mingw32-gcc
env:
- OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release
- OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release
- OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1
- OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug


matrix:
exclude:
include:
- os: osx
compiler: clang
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release
- os: linux
compiler: gcc
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release
- os: linux
compiler: gcc
- os: osx
compiler: x86_64-w64-mingw32-gcc
- compiler: clang
env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release
- compiler: clang
- os: linux
compiler: gcc
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug
- os: linux
compiler: clang
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release
- compiler: gcc
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1
- compiler: x86_64-w64-mingw32-gcc
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1
- compiler: x86_64-w64-mingw32-gcc
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug
- os: osx
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1

- os: linux
compiler: x86_64-w64-mingw32-gcc
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release
- os: linux
compiler: x86_64-w64-mingw32-gcc
env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release
- os: linux
compiler: gcc-4.8
env: OPJ_CI_ABI_CHECK=1

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- gcc-multilib
- gcc-mingw-w64-base
- binutils-mingw-w64-i686
- binutils-mingw-w64-x86-64
- gcc-mingw-w64-i686
- gcc-mingw-w64-x86-64
- gcc-mingw-w64
- libelf-dev
- elfutils
- texinfo
- exuberant-ctags

install:
- ./tools/travis-ci/install.sh

script:
- ./tools/travis-ci/run.sh
- ./tools/travis-ci/abi-check.sh
131 changes: 131 additions & 0 deletions tools/abi-tracker/openjpeg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{
"Name": "openjpeg",
"Title": "OpenJPEG",
"SourceUrl": "https://github.com/uclouvain/openjpeg/tags",
"Git": "https://github.com/uclouvain/openjpeg.git",
"Maintainer": "Antonin D.",
"MaintainerUrl": "http://www.openjpeg.org/",
"Package": "version.",

"Versions": [
{
"Number": "current",
"Installed": "installed/openjpeg/current",
"Source": "src/openjpeg/current",
"Changelog": "On",
"HeadersDiff": "On",
"PkgDiff": "Off",
"ABIView": "Off",
"ABIDiff": "Off",
"PublicSymbols": "public_symbols/openjpeg/current/list",
"PublicTypes": "public_types/openjpeg/current/list"
},
{
"Number": "2.1",
"Installed": "installed/openjpeg/2.1",
"Source": "src/openjpeg/2.1/version.2.1.tar.gz",
"Changelog": "NEWS",
"HeadersDiff": "On",
"PkgDiff": "Off",
"ABIView": "Off",
"ABIDiff": "Off",
"PublicSymbols": "public_symbols/openjpeg/2.1/list",
"PublicTypes": "public_types/openjpeg/2.1/list"
},
{
"Number": "2.0.1",
"Installed": "installed/openjpeg/2.0.1",
"Source": "src/openjpeg/2.0.1/version.2.0.1.tar.gz",
"Changelog": "NEWS",
"HeadersDiff": "On",
"PkgDiff": "Off",
"ABIView": "Off",
"ABIDiff": "Off",
"PublicSymbols": "public_symbols/openjpeg/2.0.1/list",
"PublicTypes": "public_types/openjpeg/2.0.1/list"
},
{
"Number": "2.0",
"Installed": "installed/openjpeg/2.0",
"Source": "src/openjpeg/2.0/version.2.0.tar.gz",
"Changelog": "NEWS",
"HeadersDiff": "On",
"PkgDiff": "On",
"ABIView": "Off",
"ABIDiff": "Off",
"PublicSymbols": "public_symbols/openjpeg/2.0/list",
"PublicTypes": "public_types/openjpeg/2.0/list"
},
{
"Number": "1.5.2",
"Installed": "installed/openjpeg/1.5.2",
"Source": "src/openjpeg/1.5.2/version.1.5.2.tar.gz",
"Changelog": "NEWS",
"HeadersDiff": "On",
"PkgDiff": "Off",
"ABIView": "Off",
"ABIDiff": "Off",
"PublicSymbols": "public_symbols/openjpeg/1.5.2/list",
"PublicTypes": "public_types/openjpeg/1.5.2/list"
},
{
"Number": "1.5.1",
"Installed": "installed/openjpeg/1.5.1",
"Source": "src/openjpeg/1.5.1/version.1.5.1.tar.gz",
"Changelog": "NEWS",
"HeadersDiff": "On",
"PkgDiff": "Off",
"ABIView": "Off",
"ABIDiff": "Off",
"PublicSymbols": "public_symbols/openjpeg/1.5.1/list",
"PublicTypes": "public_types/openjpeg/1.5.1/list"
},
{
"Number": "1.5",
"Installed": "installed/openjpeg/1.5",
"Source": "src/openjpeg/1.5/version.1.5.tar.gz",
"Changelog": "NEWS",
"HeadersDiff": "On",
"PkgDiff": "Off",
"ABIView": "Off",
"ABIDiff": "Off",
"PublicSymbols": "public_symbols/openjpeg/1.5/list",
"PublicTypes": "public_types/openjpeg/1.5/list"
},
{
"Number": "1.4",
"Installed": "installed/openjpeg/1.4",
"Source": "src/openjpeg/1.4/version.1.4.tar.gz",
"Changelog": "CHANGES",
"HeadersDiff": "On",
"PkgDiff": "Off",
"ABIView": "Off",
"ABIDiff": "Off",
"PublicSymbols": "public_symbols/openjpeg/1.4/list",
"PublicTypes": "public_types/openjpeg/1.4/list"
},
{
"Number": "1.3",
"Installed": "installed/openjpeg/1.3",
"Source": "src/openjpeg/1.3/version.1.3.tar.gz",
"Changelog": "ChangeLog",
"HeadersDiff": "On",
"PkgDiff": "Off",
"ABIView": "Off",
"ABIDiff": "Off",
"PublicSymbols": "public_symbols/openjpeg/1.3/list",
"PublicTypes": "public_types/openjpeg/1.3/list"
},
{
"Number": "1.2",
"Installed": "installed/openjpeg/1.2",
"Source": "src/openjpeg/1.2/version.1.2.tar.gz",
"Changelog": "ChangeLog",
"HeadersDiff": "On",
"PkgDiff": "Off",
"ABIView": "Off",
"ABIDiff": "Off",
"PublicSymbols": "public_symbols/openjpeg/1.2/list",
"PublicTypes": "public_types/openjpeg/1.2/list"
}]
}
77 changes: 77 additions & 0 deletions tools/travis-ci/abi-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/bin/bash

# This script executes the abi-check step when running under travis-ci (in run step)

# Set-up some bash options
set -o nounset ## set -u : exit the script if you try to use an uninitialised variable
set -o errexit ## set -e : exit the script if any statement returns a non-true return value
set -o pipefail ## Fail on error in pipe
set -o xtrace ## set -x : Print a trace of simple commands and their arguments after they are expanded and before they are executed.

# Exit if not ABI check
if [ "${OPJ_CI_ABI_CHECK:-}" != "1" ]; then
exit 0
fi

OPJ_UPLOAD_ABI_REPORT=0
OPJ_LIMIT_ABI_BUILDS="-limit 2"
if [ "${TRAVIS_REPO_SLUG:-}" != "" ]; then
if [ "$(echo "${TRAVIS_REPO_SLUG}" | sed 's/\(^.*\)\/.*/\1/')" == "uclouvain" ] && [ "${TRAVIS_PULL_REQUEST:-}" == "false" ]; then
# Upload report
OPJ_UPLOAD_ABI_REPORT=1
# Build full report
OPJ_LIMIT_ABI_BUILDS=
fi
fi

OPJ_SOURCE_DIR=$(cd $(dirname $0)/../.. && pwd)


mkdir ${HOME}/abi-check
cd ${HOME}/abi-check
# Let's get tools not available with apt
mkdir tools
# Travis doesn't allow package wdiff...
wget -qO - http://mirrors.kernel.org/gnu/wdiff/wdiff-latest.tar.gz | tar -xz
cd wdiff-*
./configure --prefix=${HOME}/abi-check/tools/wdiff &> /dev/null
make &> /dev/null
make check &> /dev/null
make install &> /dev/null
cd ..
export PATH=${PWD}/tools/wdiff/bin:$PATH

wget -qO - https://tools.ietf.org/tools/rfcdiff/rfcdiff-1.42.tgz | tar -xz
mv rfcdiff-1.42 ${PWD}/tools/rfcdiff
export PATH=${PWD}/tools/rfcdiff:$PATH
wget -qO - https://github.com/lvc/installer/archive/0.4.tar.gz | tar -xz
mkdir ${PWD}/tools/abi-tracker
make -C installer-0.4 install prefix=${PWD}/tools/abi-tracker target=abi-tracker
export PATH=${PWD}/tools/abi-tracker/bin:$PATH

mkdir tracker
cd tracker

# Let's create all we need
grep -v Git ${OPJ_SOURCE_DIR}/tools/abi-tracker/openjpeg.json > ./openjpeg.json
abi-monitor ${OPJ_LIMIT_ABI_BUILDS} -get openjpeg.json
cp -f ${OPJ_SOURCE_DIR}/tools/abi-tracker/openjpeg.json ./openjpeg.json
cp -rf ${OPJ_SOURCE_DIR} src/openjpeg/current
abi-monitor ${OPJ_LIMIT_ABI_BUILDS} -build openjpeg.json
abi-tracker -build openjpeg.json

EXIT_CODE=0

# Check API
abi-compliance-checker -l openjpeg -old $(find ./abi_dump/openjpeg/2.1 -name '*.dump') -new $(find ./abi_dump/openjpeg/current -name '*.dump') -header openjpeg.h -api -s || EXIT_CODE=1

# Check ABI
# Disabled for now, problems with symbol visibility...
# abi-compliance-checker -l openjpeg -old $(find ./abi_dump/openjpeg/2.1 -name '*.dump') -new $(find ./abi_dump/openjpeg/current -name '*.dump') -header openjpeg.h -abi -s || EXIT_CODE=1

rm -rf src installed

if [ ${OPJ_UPLOAD_ABI_REPORT} -eq 1 ]; then
echo "TODO: Where to upload the report"
fi
exit $EXIT_CODE
Loading