Skip to content

src/CMakeLists.txt SOVERSION #252

Open

Description

@pullmoll

I don't think it's a good idea to set the SOVERSION to major.minor.patchlevel in

SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}

The reason is that any project depending on e.g. the libcmark.so.0.28.3 will need to be rebuilt once you update to the next version, even if that is not necessary because there is no ABI change.

IMHO it should be sufficient to use just SOVERSION ${PROJECT_VERSION_MAJOR} because the shared library already carries the full version number of the project.

In the Void Linux template for cmark I currently sed the minor and patch level away
to avoid having to rebuild mkvtoolnix for every cmark update :)

Activity

  1. nwellnhof commented on Jan 18, 2018

    @nwellnhof
    Contributor

    I added the patch level to SOVERSION in 2015 (commit 130b87d) because back then, the ABI changed with patch level releases a couple of times. The ABI has been mostly stable since then, so I'm OK with removing patch level from SOVERSION.

    Major/minor is tied to the version of the Commonmark specification. Some changes to the spec could be considered an API change, so SOVERSION should be bumped with minor releases. Under the current versioning scheme, removing the minor version from SOVERSION also makes it impossible to make API/ABI breaking changes without bumping the major version to 1. As an alternative, it's entirely possible (but slightly confusing) to decouple SOVERSION from the project version. Keeping the same SOVERSION across releases also requires some diligence by the release manager.

    So the questions are:

    1. Is the spec stable enough so possible future changes can be considered bug fixes more than API changes? This is subjective, of course.

    2. Should SOVERSION be decoupled from the project version? We could simply set SOVERSION to 1, 2, 3, ... for future releases whenever there's a breaking change. Backward-incompatible changes always require to bump SOVERSION. For spec changes, it's a judgement call.

    3. Can we make sure that the release manager is aware of these issues? Forgetting to bump SOVERSION can cause lots of trouble for downstream projects, especially language bindings that link against the dynamic library.

  2. pullmoll commented on Jan 18, 2018

    @pullmoll
    Author

    Well, all this is entirely your decisions to take. I know that in many projects the soversion numbers are unrelated to the project version. I guess keeping a major.minor soversion version could work just as well. Cmake creates the intermediary symlinks in that case AFAICT and we, as a project packaging libraries, rely on either major or major.minor versions to track back the source for a specific shared library, i.e. the package name.

    For cmark, when a template was first added to our repository, the entry was just libcmark.so.0 and I wanted to keep it that way, which is why I patched the build.

    From the view of a packager a major soversion change tells that I definitely need to check if the library is still usable at all and need to check all packages depending on it.

    For a minor soversion change I know I need to rebuild dependencies because the API and/or ABI have (or may have) changed.

    Changes to the patchlevel of the soversion are usually irrelevant to a packager. They tell to look for other packages linking against the library's static version (*.a), if any, and rebuild them for bugfixes etc.

    Any package can of course use any scheme for increasing their version numbers. Increasing the soversion numbers OTOH should in some way or another be related to the API/ABI changes or possible breakage. I believe this is the reason why soversion does not need to be derived from the project version, but may well be, if you decide to use the same reasoning for version number bumps.

  3. jgm commented on Jan 18, 2018

    @jgm
    Member
  4. nwellnhof commented on Sep 16, 2021

    @nwellnhof
    Contributor

    Can we reopen this issue? This should be addressed at some point.

  5. reopened this on Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions