-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It's not currently working because master does not check against ABI. Only released versions >= 2.4
- Loading branch information
1 parent
100db3d
commit 168e27b
Showing
2 changed files
with
81 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/bash | ||
|
||
# Usage: | ||
# | ||
# Scripts/BuildScripts/abi_checker.sh 2 branch_name | ||
# | ||
# Where 2 is the lver | ||
# branch_name is optional and is the name of the git branch | ||
|
||
cd build/Debug/lib | ||
mkdir -p AbiDump/$1 | ||
|
||
if [[ -z $2 || $2=="" ]]; then | ||
branch_name=`git branch --show-current` | ||
else | ||
# Pull Requests can't use git branch, so Github provides it for us | ||
branch_name=$2 | ||
fi | ||
|
||
#if [[ $branch_name == "master" && $1 != 1 ]]; then | ||
# echo "We're in master. Master does not do ABI checks. We're done." | ||
# exit | ||
#fi | ||
|
||
if [[ $1 != 1 ]]; then | ||
echo "--- Fetching base dumps to compare against ---" | ||
wget https://github.com/OGRECave/ogre-next/releases/download/bin-releases/AbiDumps_Ubuntu.18.04.LTS.$2.7z | ||
|
||
echo "--- Extracting base dumps ---" | ||
7z x AbiDumps_Ubuntu.18.04.LTS.$2.7z | ||
fi | ||
|
||
sudo apt-get install -y abi-compliance-checker | ||
|
||
# Dump the libs | ||
FILES="*.so*" | ||
for file in $FILES | ||
do | ||
# Ignore symlinks | ||
if ! [[ -L "$file" ]]; then | ||
echo "Dumping $file" | ||
abi-dumper "$file" -o "AbiDump/$1/$file.dump" -lver $1 & | ||
fi | ||
done | ||
|
||
wait | ||
|
||
# Generate all reports. We need to gather their exit codes to see if they've failed | ||
PIDs=() | ||
for file in $FILES | ||
do | ||
# Ignore symlinks | ||
if ! [[ -L "$file" ]]; then | ||
echo "Checking AbiDump/1/$file.dump vs AbiDump/$1/$file.dump" | ||
abi-compliance-checker -l "$file" -old "AbiDump/1/$file.dump" -new "AbiDump/$1/$file.dump" & | ||
PIDs+=($!) | ||
fi | ||
done | ||
|
||
EXIT_CODE=0 | ||
for pid in "${PIDs[@]}" | ||
do | ||
echo Waiting for $pid | ||
wait "$pid" | ||
CODE="$?" | ||
if [[ "${CODE}" != "0" ]]; then | ||
echo "At least one report failed with exit code => ${CODE}"; | ||
EXIT_CODE=1; | ||
fi | ||
done | ||
|
||
exit $EXIT_CODE |