Package ABI Diff (Pkg-ABIdiff) — a tool to verify API/ABI compatibility of Linux packages (RPM or DEB).
The tool searches for shared objects in packages and checks their ABIs for backward binary-compatibility (BC) and backward source-compatibility (SC).
The tool does the following:
- Extracts input packages
- Searches for
*.debuginfo
,*.so
and header files - Creates ABI dumps of all found shared objects
- Filters out private part of the ABI using info from header files
- Matches shared objects in old and new packages
- Compares ABI dumps of corresponding objects
- Creates the BC and SC reports
The tool is intended for Linux maintainers who are interested in ensuring backward compatibility, i.e. allow old applications to run (BC) or to be recompiled (SC) with newer versions of RPM/DEB packages.
Sample report: https://abi-laboratory.pro/examples/compat_report/x86_64/libssh/0.6.3-3.fc21/0.7.3-1.fc24/
The tool is developed by Andrey Ponomarenko.
sudo make install prefix=/usr
- Python 2
- ABI Compliance Checker 1.99.25 or newer (https://github.com/lvc/abi-compliance-checker)
- ABI Dumper 0.99.19 or newer (https://github.com/lvc/abi-dumper)
- Universal Ctags (https://github.com/universal-ctags/ctags)
- GNU Binutils
- Elfutils
- G++
pkg-abidiff -old [OLD PACKAGES] -new [NEW PACKAGES] [OPTIONS]
e.g.:
pkg-abidiff -old P1 P1-debug P1-dev -new P2 P2-debug P2-dev
P1 — RPM or DEB package to analyze (with *.so
object files),
P1-debug — corresponding debug-info package (*.debug
files with DWARF info),
P1-dev — corresponding development package (with header files).
You can omit passing of devel packages but the tool will not be able to filter out private part of the ABI from the analysis in this case. You can specify multiple devel packages at a time (to analyze all related header files distributed in separate packages).
Generated ABI dumps will be saved to ./abi_dump
directory and will be reused next times. Use -rebuild
additional option to regenerate ABI dumps.
Generated report will be saved to ./compat_report
directory. Use -rebuild-report
additional option to regenerate report without regenerating of ABI dumps. The report is generated in visual HTML and machine-readable JSON formats.
Having old packages:
OLD/libssh-0.6.3-3.fc21.x86_64.rpm
OLD/libssh-debuginfo-0.6.3-3.fc21.x86_64.rpm
OLD/libssh-devel-0.6.3-3.fc21.x86_64.rpm
and new ones:
NEW/libssh-0.7.3-1.fc24.x86_64.rpm
NEW/libssh-debuginfo-0.7.3-1.fc24.x86_64.rpm
NEW/libssh-devel-0.7.3-1.fc24.x86_64.rpm
we can compare them by this command:
pkg-abidiff -old OLD/libssh-*.rpm -new NEW/libssh-*.rpm
For advanced usage, see output of -h
option.