Johan Mattsson
Johan Mattsson

Reputation: 345

When should I update so version?

I follow a version scheme for a library with a version number of three parts and a so version of two parts. example-1.0.0 and libexample.so.1.0.

The last number in the version string is updated when I make changes without breaking the ABI. The second number is updated when I add new symbols and the major version number is used for incompatible changes.

The so version is updated when symbols are added even if it does not break compatibility with other programs. This means that programs need to be recompiled because the so version has changed even if the library still is ABI compatible with older versions.

Should I avoid updating the so version when I add new symbols?

Upvotes: 1

Views: 319

Answers (1)

Employed Russian
Employed Russian

Reputation: 213646

This means that programs need to be recompiled because the so version has changed even if the library still is ABI compatible with older versions.

That means you are not doing it correctly. You should only change SONAME when doing ABI-incompatible change. It is customary to use example.1 as the SONAME. Documentation.

P.S. If you only care about Linux, you likely should stop doing external versioning altogether, and instead use symbol versioning to provide a single libexample.so.1 that provides multiple ABI-incompatible symbols to both old and new client binaries.

Upvotes: 2

Related Questions