Repository navigation
Use the full version as the SOVERSION - #2342
musicinmybrain wants to merge 1 commit into
Conversation
This assumes that ABI is likely to be broken any time, including in patch releases. If this is a good assumption, then this change fixes google#2340.
|
to confirm: for this project, the major and minor versions can introduce API breaking changes. we would only go to v2 if there was a significant reworking of the project (which is unlikely). given that, do we need this PR? what are the ramifications of the change? |
The This is important in places like Linux distributions because even when the API remains compatible, an ABI break means that programs linked against the shared library need to be recompiled. Indicating this is the entire purpose of versioning the shared library with A good example of an API-compatible change that is not ABI-compatible is given in #2340, where a function with two parameters gained a third parameter with a default value. This is API-compatible, depending on your definition of API, because the compiler will implicitly use the default third parameter for existing code that calls the function with two parameters. However, executables that were already compiled using the headers for old version will actually call the function with two parameters, making no provisions to pass the default third parameter value (which didn’t exist at the time). Depending on calling convention, this might mean that the register that should have the third parameter in it has garbage instead, or perhaps it could lead to stack corruption. If no measures are being taken to detect and avoid ABI breaks in patch releases, then the only honest thing to do is to bump the ABI version of every release, and the easiest way to do that is to use the entire version number. |
|
that works for me. is there a down side? i can't see one. |
|
I mean, we could add a CI job that would ensure that would ensure that soversion is bumped when needed. |
In general, the downside of bumping the SONAME version too often is that it forces distributions and people in similar positions to do dependent package rebuilds and other breaking-change coordination unnecessarily, wasting time and resources. This is undesirable, but failing to bump the SONAME version when it should have been bumped is much worse.
There don’t seem to be any such packages in Fedora; On the other hand, one would think that packages would not generally ship test code, but there are quite a few packages in Fedora that ship test suites, tools, or libraries built on top of gtest/gmock and do have to be rebuilt when the |
(that matches my understanding, yes) |
This assumes that ABI is likely to be broken any time, including in patch releases.
If this is a good assumption, then this change fixes #2340.
If it is strongly believed that patch releases won’t contain ABI-breaking changes, then something like this might make sense instead: