forked from AcademySoftwareFoundation/OpenImageIO
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Test ABI compliance (AcademySoftwareFoundation#3983)
This patch adds a new test to the CI matrix: verifying that we do not break the ABI during releases. Basically, in addition to building the current checkout, it also builds a checkout of the designated "ABI standard" (generally, the first non-beta release of a major version), then generates ABI dumps of both versions and runs the ABI compliance checker using the tools from https://github.com/lvc Making two builds sounds expensive, but both builds are rigged to be minimal, since only the main two libraries are needed for ABI checks (we can turn off the binary tools, unit tests, python bindings, and support for many formats), and of course the test suite need not run. So actually, it's less expensive than most of the test matrix entries, and it helps ensure that we don't accidentally break ABI when we don't mean to. I'm not sure how many false positives we'll have. We might need to adjust the methodology slightly as we gain experience with this. Signed-off-by: Larry Gritz <[email protected]>
- Loading branch information
Showing
7 changed files
with
138 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Utility script to download and build abi checking tools | ||
# | ||
# Copyright Contributors to the OpenImageIO project. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# https://github.com/OpenImageIO/oiio | ||
|
||
# Exit the whole script if any command fails. | ||
set -ex | ||
|
||
# Where to install the final results | ||
: ${LOCAL_DEPS_DIR:=${PWD}/ext} | ||
: ${ABITOOLS_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist} | ||
|
||
mkdir -p ${LOCAL_DEPS_DIR} | ||
pushd ${LOCAL_DEPS_DIR} | ||
|
||
git clone https://github.com/lvc/vtable-dumper | ||
pushd vtable-dumper ; make install prefix=${ABITOOLS_INSTALL_DIR} ; popd | ||
|
||
git clone https://github.com/lvc/abi-dumper | ||
pushd abi-dumper ; make install prefix=${ABITOOLS_INSTALL_DIR} ; popd | ||
|
||
git clone https://github.com/lvc/abi-compliance-checker | ||
pushd abi-compliance-checker ; make install prefix=${ABITOOLS_INSTALL_DIR} ; popd | ||
|
||
popd | ||
|
||
# ls -R ${LOCAL_DEPS_DIR} | ||
export PATH=${PATH}:${ABITOOLS_INSTALL_DIR}/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright Contributors to the OpenImageIO project. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# https://github.com/OpenImageIO/oiio | ||
|
||
# Important: set -ex causes this whole script to terminate with error if | ||
# any command in it fails. This is crucial for CI tests. | ||
set -e | ||
|
||
# Arguments to this script are: | ||
# BUILDDIR_NEW BUILDDIR_OLD LIBRARIES... | ||
|
||
BUILDDIR_NEW=$1 | ||
shift | ||
BUILDDIR_OLD=$1 | ||
shift | ||
LIBS=$* | ||
|
||
# | ||
# First, create ABI dumps from both builds | ||
# | ||
ABI_ARGS="-bin-only -skip-cxx -public-headers $PWD/dist/include/OpenImageIO " | ||
echo "ABI_CHECK: PWD=${PWD} " | ||
ls -l $BUILDDIR_NEW | ||
ls -l $BUILDDIR_OLD | ||
for dir in $BUILDDIR_NEW $BUILDDIR_OLD ; do | ||
for lib in $LIBS ; do | ||
abi-dumper $ABI_ARGS ${dir}/lib/${lib}.so -o ${dir}/abi-${lib}.dump | ||
done | ||
done | ||
echo "Saved ABI dumps" | ||
|
||
# | ||
# Run the ABI compliance checker, saving the outputs to files | ||
# | ||
for lib in $LIBS ; do | ||
abi-compliance-checker -l $lib -old $BUILDDIR_OLD/abi-$lib.dump -new $BUILDDIR_NEW/abi-$lib.dump | tee ${lib}-abi-results.txt || true | ||
echo -e "\x1b[33;1m" | ||
echo -e "$lib" | ||
fgrep "Binary compatibility:" ${lib}-abi-results.txt | ||
echo -e "\x1b[33;0m" | ||
done | ||
|
||
# | ||
# If the "Binary compatibility" summary results say anything other than 100%, | ||
# we fail! | ||
# | ||
for lib in $LIBS ; do | ||
if [[ `fgrep "Binary compatibility:" ${lib}-abi-results.txt | grep -v 100\%` != "" ]] ; then | ||
cp -r compat_reports ${BUILDDIR_NEW}/compat_reports | ||
exit 1 | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters