文章目录
abichecker
仓库:https://gitee.com/openeuler/abichecker
依赖:abi-dumper、abi-compliance-checker
- abi-dumper 上游社区:https://github.com/lvc/abi-dumper
- abi-compliance-checker 上游社区:https://github.com/lvc/abi-compliance-checker
用法:
python3 abichecker.py PKGNAME DIR
- PGKNAME:软件包名字,rpm包文件名的前缀需要同 PKGNAME 一样
- DIR:绝对路径,以’/'结尾,如:~/checkdir/,该目录下存在与 PKGNAME 同名的目录,PKGNAME 目录下存放该软件包的两个版本 rpm 包文件,其中需要包含必要的包含动态库的 rpm 包(main、libs、devel等)和 debuginfo rpm 包。
举例:
下面以 musl 包为例,检测 1.2.2 和 1.2.3 两个版本之间的差异:
1)准备两个版本的 rpm 包
通过osc getbinaries --debug ...
获取 obs 服务器上的两个版本的 rpm 包
$ osc getbinaries --debug openEuler:22.03:LTS musl standard_x86_64 x86_64
$ osc getbinaries --debug home:maminjie:branches:openEuler:22.03:LTS musl-1.2.2 standard_x86_64 x86_64
$ ls -1 binaries/
_buildenv
musl-debuginfo-1.2.2-2.oe2203.x86_64.rpm
musl-debuginfo-1.2.3-1.oe2203.x86_64.rpm
musl-debugsource-1.2.2-2.oe2203.x86_64.rpm
musl-debugsource-1.2.3-1.oe2203.x86_64.rpm
musl-devel-1.2.2-2.oe2203.x86_64.rpm
musl-devel-1.2.3-1.oe2203.x86_64.rpm
musl-gcc-1.2.2-2.oe2203.x86_64.rpm
musl-gcc-1.2.3-1.oe2203.x86_64.rpm
musl-libc-1.2.2-2.oe2203.x86_64.rpm
musl-libc-1.2.3-1.oe2203.x86_64.rpm
musl-libc-static-1.2.2-2.oe2203.x86_64.rpm
musl-libc-static-1.2.3-1.oe2203.x86_64.rpm
_statistics
2)重命名
将 binaries 目录重命名为 musl
$ cp -r binaries musl
3)执行 abichecker
$ python3 ~/work/my/abichecker/abichecker.py musl ~/work/tmp/
...
Creating ABI dump
The object ABI has been dumped to:
ABI-ld-musl.so.dump
Preparing, please wait ...
Comparing ABIs ...
Comparing APIs ...
Creating compatibility report ...
Binary compatibility: 99.96%
Source compatibility: 99.9%
Total binary compatibility problems: 3, warnings: 1
Total source compatibility problems: 6, warnings: 1
Report: compat_reports/ld-musl.so/X_to_Y/compat_report.html
Preparing, please wait ...
Comparing ABIs ...
Comparing APIs ...
Creating compatibility report ...
Binary compatibility: 99.96%
Source compatibility: 99.9%
Total binary compatibility problems: 3, warnings: 1
Total source compatibility problems: 6, warnings: 1
Report: compat_reports/ld-musl.so/X_to_Y/compat_report.html
更多关于 abi-dumper、abi-compliance-checker 的使用可以参考 ABI 。