I'm the author of a C++ library that is being distributed in multiple Linux packaging distributions. The library includes headers and source; Linux packages distribute it as headers + shared library (.so).
I'm looking for guidelines that would make the life of Linux package maintainers easier.
Things I'm interested in include:
API compatibility (e.g. changing function signatures). Obviously maintaining compatibility across minor releases is crucial. What about major version changes?
Binary compatibility (e.g. changing sizes of externally visible data structures). How important is it to be ABI-compatible across minor releases? Are there any issues with breaking that in major releases?
Build versioning advice. I'm currently using CMake - any specific settings that I should set to maximize the chance that package maintainers can just use my CMakeLists.txt?
If there is anything else that I'm missing I'd be glad to hear about it as well.
As a Linux maintainer I can say that both backward binary (ABI) and source (API) compatibility of your library is very important for us.
API changes may break rebuild of some applications (or other libraries) in the distribution that depend on your library. This may break mass-rebuild of the distribution.
ABI changes may break particular binary updates. We need to verify ABI changes in updated libraries and rebuild all dependent applications if some dangerous changes are detected. In this case the user should download the update package for the library and for all dependent applications too. If library is backward API and ABI stable then we can update the library package only.
If you break ABI then please change SONAME
of your library (bump version). And please do not introduce API/ABI changes in micro/patch releases.
I recommend you to use the abi-compliance-checker tool to verify your library for API/ABI backward compatibility. See sample reports of the tool for the Qt library: http://abi-laboratory.pro/tracker/timeline/qt/
You need to compile debug version of your library with addition -g -Og
options and dump ABI of your library with the help of the abi-dumper tool. And then compare two ABI dumps of different versions to generate ABI changes report.