From 057c12c8884da6b02cb845b2ba48690a5b087103 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Wed, 4 Dec 2024 17:24:09 +0100 Subject: [PATCH] use abigail to verify our api surface is compatible --- .github/workflows/checks.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 47c313da6..2736207fc 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -366,6 +366,19 @@ jobs: run: | curl -L "$LINK/cargo-c-x86_64-unknown-linux-musl.tar.gz" | tar xz -C $HOME/.cargo/bin + - name: Install abigail + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: libabigail-dev abigail-tools libbz2-dev + version: 1.0 + - name: Store API + run: | + ldconfig -p | grep "libbz2.so" + libbz2_path=$(ldconfig -p | grep "x86_64-linux-gnu/libbz2.so" | awk '{print $4}') + libbz2_filename=$(basename "$libbz2_path") + echo $libbz2_path + abidw $libbz2_path > /tmp/$libbz2_filename.abi + echo "LIBBZ2_FILENAME=$libbz2_filename" >> $GITHUB_ENV - name: build with and test the result of cargo-c working-directory: libbz2-rs-sys-cdylib run: | @@ -379,3 +392,6 @@ jobs: export LD_LIBRARY_PATH=/tmp/cargo-cbuild-libbzip2-rs/usr/local/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH ./bzpipe < Cargo.toml | ./bzpipe -d > out.txt cmp -s Cargo.toml out.txt + # verify the API surface + abidw /tmp/cargo-cbuild-libbzip2-rs/usr/local/lib/x86_64-linux-gnu/libbz2_rs.so > /tmp/liblibz_rs_sys.so.abi + abidiff --no-unreferenced-symbols --ignore-soname /tmp/$LIBBZ2_FILENAME.abi /tmp/liblibz_rs_sys.so.abi