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

Versioning libhl.so file on Linux #698

Open
l0go opened this issue Jul 27, 2024 · 4 comments
Open

Versioning libhl.so file on Linux #698

l0go opened this issue Jul 27, 2024 · 4 comments

Comments

@l0go
Copy link
Contributor

l0go commented Jul 27, 2024

Hi,
I am currently working towards packaging HashLink for the Fedora Linux distribution. One of their guidelines is that .so libraries are versioned, preferably by upstream (you!). This means that libhl.so should be something like libhl.so.0 with 0 incrementing on ABI changes. Would it be possible for this to happen?

@andyli
Copy link
Member

andyli commented Jul 29, 2024

I think when building with CMake, the library is already versioned. See usage of SOVERSION in CMakeLists.txt.

Someone have to remember update it correctly though. It's a bit trickly - the software version number does not implies SOVERSION number. What I wrote initially in CMakeLists.txt that SOVERSION = ${HL_VERSION_MAJOR} is not quite correct. SOVERSION follows semver strictly, i.e. whenever there is any breaking change, it goes up.

@tobil4sk
Copy link
Member

tobil4sk commented Aug 1, 2024

There are tools we can use that compare the ABI with previous versions to check if SOVERSION ought to have changed. We can set up github actions that fail if the ABI changes but the so version remains the same.

MbedTLS does this, and I know they are very diligent with changing the so version on any ABI change 😅 https://github.com/Mbed-TLS/mbedtls/blob/4b9141ccf45e92d42152f9ec19cc69fab31b066b/scripts/abi_check.py

@andyli
Copy link
Member

andyli commented Aug 3, 2024

Yes, I think it's a good direction. Debian's packaging system is able to do this as well.

Not sure if there is a standalone tool hashlink can adopt, or have to write a custom script like MbedTLS.

@l0go
Copy link
Contributor Author

l0go commented Aug 3, 2024

MbedTLS utilizes these tools, which are recommended by Fedora:

There is also abidiff

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

3 participants