lvc / abi-compliance-checker

A tool for checking backward API/ABI compatibility of a C/C++ library
https://lvc.github.io/abi-compliance-checker/
GNU Lesser General Public License v2.1
621 stars 76 forks source link

'-headers-list PATH' will also check *.cpp files ABI changes? How to skip all the *.cpp files? #87

Open xuzi123 opened 5 years ago

xuzi123 commented 5 years ago

Hi, I want to use this tool to check ABI changes for header files ONLY? So I use the option

    -headers-list PATH
    The file with a list of headers, that should be checked/dumped.

to specify a list of headers to check. But when I modified the other .cpp files, the tool also report the ABI compliance problems with these changes.

I can not find any options to skip all the .cpp files? Can you tell me how to do this?

Thank you!

lvc commented 5 years ago

Hi,

Try to add -headers-only option.

But it's better to avoid using it in order to check for all possible compatibility problems.

xuzi123 commented 5 years ago

Thank you for your reply!

But I think the -headers-only option dose not satisify my need:

-headers-only
Check header files **without libraries**. It is easy to run, but may
provide a low quality compatibility report with false positives and
without detecting of added/removed symbols.

I use .so files and headers as input. But -headers-only option don't need libraries files?

There are my command lines to run the abicc:

abi-dumper  liblog.so.1.0.0 -o liblog_old.dump  -lver 1 -ld-library-path $ldlibrarypath
abi-dumper  liblog.so.2.0.0 -o liblog_new.dump  -lver 2 -ld-library-path $ldlibrarypath
abi-compliance-checker  -l liblog -old liblog_old.dump -new liblog_new.dump --headers-list target_header -headers-only

Whether I use -headers-only or not, the Binary compatibility was not changed.

The result as following, not use -headers-only:

Reading debug-info
WARNING: incompatible build option detected: -O2 (required -Og for better analysis)
Comparing ABIs ...
Comparing APIs ...
Creating compatibility report ...
Binary compatibility: 98.6%   // not changed 
Source compatibility: 94.7%  // changed
Total binary compatibility problems: 2, warnings: 2
Total source compatibility problems: 4, warnings: 1

use -headers-only:


The object ABI has been dumped to:
  liblog_new.dump
/workspace/repo/abicc/abi-compliance-checker/scripts/../share/abi-compliance-checker/modulesPreparing, please wait ...
Comparing ABIs ...
Comparing APIs ...
Creating compatibility report ...
Binary compatibility: 98.6%    //not changed
Source compatibility: 98.6%   // changed
Total binary compatibility problems: 1, warnings: 1
Total source compatibility problems: 1, warnings: 0 
...

I not changed the target header for liblog, I think the Binary compatibility should be 100%. Do I used wrong arguments?

My tool version

ABI Compliance Checker (ABICC) 2.1
ABI Dumper 2.0

Hi,

Try to add -headers-only option.

But it's better to avoid using it in order to check for all possible compatibility problems.