Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider properly versioning the SONAME of the library #124

Open
charles2910 opened this issue Oct 15, 2024 · 1 comment
Open

Consider properly versioning the SONAME of the library #124

charles2910 opened this issue Oct 15, 2024 · 1 comment

Comments

@charles2910
Copy link

charles2910 commented Oct 15, 2024

Hi (again :-), first of all, thanks for developing NeatVNC!

(it will be a bit of copy-and-pasta from the issue on AML I've just opened any1/aml#15)

There are many big projects using it nowadays such weston and wayvnc. This means these projects rely on NeatVNC's ABI and so do distro maintainers to guarantee proper transitions when there is an ABI change. Currently, NeatVNC defines a fixed version: '0.0.0', in the library() section of meson.build. This in turn makes meson set the SONAME of the library as the major version of the version string which is always 0.

This complicates things for reverse-dependencies and distros, because one breaking change can be introduced in NeatVNC without bumping the SONAME and all of the sudden the reverse dependencies compiled against an older version of the library will stop working. On distros, we rely on the SONAME to not rebuilding every reverse-dependency when a new (backwards-compatible - therefore the same SONAME) of a library is available.

So, in the end I'd like to see NeatVNC managing the SONAME properly. Ideally, it would stick to the major version while it's backwards-compatible, and bump it when a backwards-incompatible change is introduced (removal of public functions, changes on public available structs, etc.). The patch below does this:

diff --git a/meson.build b/meson.build
index 52f4131..8386f57 100644
--- a/meson.build
+++ b/meson.build
@@ -170,7 +170,7 @@ configure_file(
 neatvnc = library(
        'neatvnc',
        sources,
-       version: '0.0.0',
+       version: meson.project_version(),
        dependencies: dependencies,
        include_directories: inc,
        install: true,

Mind that it will only bump the SONAME when bumping NeatVNC's major version.

If instead you don't want to guarantee ABI compatibility between versions, you can bump the SONAME on every new version:

diff --git a/meson.build b/meson.build
index 52f4131..c0c4e9c 100644
--- a/meson.build
+++ b/meson.build
@@ -170,7 +170,8 @@ configure_file(
 neatvnc = library(
        'neatvnc',
        sources,
-       version: '0.0.0',
+       version: meson.project_version(),
+       soversion: meson.project_version(),
        dependencies: dependencies,
        include_directories: inc,
        install: true,

Also, please consider bumping the SONAME since 0.8.0 breaks the ABI.

Cheers

@any1
Copy link
Owner

any1 commented Nov 2, 2024

No worries. I was planning on bumping the soversion on next ABI change. Thanks for the reminder!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants