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

SONAME of libprofanity.so is unversioned #973

Closed
strugee opened this issue Dec 19, 2017 · 7 comments · Fixed by #1071
Closed

SONAME of libprofanity.so is unversioned #973

strugee opened this issue Dec 19, 2017 · 7 comments · Fixed by #1071
Assignees
Milestone

Comments

@strugee
Copy link
Contributor

strugee commented Dec 19, 2017

Debian requires that all dynamic library SONAMEs are versioned, but according to readelf -a .libs/libprofanity.so | grep SONAME, libprofanity's SONAME is libprofanity.so. This should probably be changed to libprofanity.so.0 or something. Unless I'm missing something?

@pasis
Copy link
Member

pasis commented Jul 30, 2018

This is because of flag -avoid-version in Makefile.am. I can't say the reason why the flag is there though.

@jubalh
Copy link
Member

jubalh commented Aug 13, 2018

I assume it's because libprofanity is so far only intended to be used with profanity.

We have a similar guideline in openSUSE. But it's not strictly needed and in case the library is intended to be only used by that one program we don't require it.
In openSUSE we ship it in the profanity package and don't have a seperate libprofanity package so profanity always uses the "right" libprofanity.

I don't know libprofanity/profanity well enough to know what libprofanity is actually used for.
Is it for the plugins systems? Then it might make sense to have it versioned.

@boothj5 do you have any reason why we should not version it?

@jubalh jubalh added this to the 0.6.0 milestone Sep 5, 2018
@jubalh jubalh modified the milestones: 0.6.0, 0.7.0 Feb 19, 2019
@boothj5
Copy link
Collaborator

boothj5 commented Mar 25, 2019

@jubalh the reasoning you pointed out is correct, it was only packaged with and used by Profanity.

But I can't see any problems with versioning it if needed by some linux distros.

@jubalh
Copy link
Member

jubalh commented Mar 27, 2019

@pasis After reading https://autotools.io/libtool/version.html I'm not sure whether removing -avoid-version and adding -release would already be enough?

@pasis
Copy link
Member

pasis commented Mar 29, 2019

@jubalh I believe it is enough to remove -avoid-version. In this case version will be 0.0.0.

@jubalh
Copy link
Member

jubalh commented Mar 29, 2019

@pasis why 0.0.0 ? And where will it be increased?

@jubalh
Copy link
Member

jubalh commented Apr 18, 2019

Okay I did some research.

Debian packages it via --libdir=/usr/lib/profanity so it's a private library, meaning not versioning it is okay. And the library would be shipped in the same binary package. This would be fine if only profanity itself would use this library.

But since plugins can be developed in both C and Python we should add library versioning to make sure changes to the interface are tracked.

If we remove the -avoid-version we will automatically get 0:0:0 from libtool. We can also explicitly set it via -version-info 0:0:0.

The values are known as current:revision:age.
If the interface changes (changing a function name or its parameters) we need to increase the current value.

revision gets changed whenever we change something internal in the library. Optimizing a function for example, but not changing the interface.

age is the number of back versions this library supports. So if we only add a new function to the library we need to increase this.

jubalh added a commit to jubalh/profanity that referenced this issue Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants