Skip to content

Commit

Permalink
check-abi: Default to HEAD for new version
Browse files Browse the repository at this point in the history
  • Loading branch information
real-or-random committed Jan 9, 2024
1 parent 9fb7e2f commit ad5f589
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tools/check-abi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -eu

default_base_version="$(git describe --match "v*.*.*" --abbrev=0)"
default_new_version="master"
default_new_version="HEAD"

display_help_and_exit() {
echo "Usage: $0 <base_ver> <new_ver>"
Expand Down Expand Up @@ -33,7 +33,8 @@ else
fi

checkout_and_build() {
git worktree add -d "$1" "$2"
_orig_dir="$(pwd)"
git worktree add --detach "$1" "$2"
cd "$1"
mkdir build && cd build
cmake -S .. --preset dev-mode \
Expand All @@ -45,20 +46,18 @@ checkout_and_build() {
-DSECP256K1_BUILD_EXAMPLES=OFF
cmake --build . -j "$(nproc)"
abi-dumper src/libsecp256k1.so -o ABI.dump -lver "$2"
cd "$_orig_dir"
}

echo "Comparing $base_version (base version) to $new_version (new version)"
echo

original_dir="$(pwd)"

base_source_dir=$(mktemp -d)
checkout_and_build "$base_source_dir" "$base_version"

new_source_dir=$(mktemp -d)
checkout_and_build "$new_source_dir" "$new_version"

cd "$original_dir"
abi-compliance-checker -lib libsecp256k1 -old "${base_source_dir}/build/ABI.dump" -new "${new_source_dir}/build/ABI.dump"
git worktree remove "$base_source_dir"
git worktree remove "$new_source_dir"

0 comments on commit ad5f589

Please sign in to comment.