-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Please version the ABI for C shared libraries #320
Comments
I don't think we can commit to only incrementing the Would it be possible to use the version number from c/VERSION? It is incremented more often - the downside of having 13 languages in a repository that are released in lock step, is that for individual languages there are spurious releases. @chybz, @jenisys, @ursfassler I'd welcome your opinion here too. |
I guess using The What about the C++ ABI version in |
While I'm totally in for having this automated and consistent across the entire repository, we can't just set It's on my internal todo list of things to have this fixed, though, but we have two things here:
@musicinmybrain The C++ ABI version is automatically updated (all My suggestion would be to have a repository wide |
Would it be possible to have an automated check that detects ABI incompatible changes? If we can catch this during a PR it will be much easier to flag the need for an ABI version change. Would it be correct to assume that when the ABI version changes that is the same as a major versIon change under Semver? |
Sorry if you already know all of the following, but I need to ensure it was said. TLDR - The gory details(maybe better described here) I don't think so and frankly it's even more (cu)cumbersome than that. Detecting ABI changesCould be feasible but would be a vastly disproportionate effort and would certainly involve caching the previous build and calling every function or inspecting mangled symbols inside compiled code and look for potential changes. I doubt anyone sane enough would like to work on that. Developer responsibilityIt's been for ages, each developer involved in compiled languages producing shared objects (.so, .dll, .dylib, ...) know that changing function signatures and data types may have a great impact on backward compatibility (the ABI stuff). Seen in the fieldSome people choose to completely ignore the original numbers and their meaning (from the linked documents in my previous comment) and directly map Semver of the software to SOVERSION, and mostly don't care about ABI (in the sense of the linked document). If you take great care it can be viable, but with multiple languages this is going to be tough (what version X.Y.Z of the Cucumber specification has to do with ABI of the C and C++ implementations is unknown to me). My 2 centsThat libtool convention is less and less followed, so the simple Semver --> VERSION might do the trick and people be happy with it. I used to enforce the ("more correct" at the time [last century]) libtool scheme but nobody seem to care really much these days. If some contributors with an idea on this could share it, that'd be cool. |
Thanks for the explanation. I know just enough The challenge that we (the maintainers of this repository) have to solve, is accepting and releasing contributions for thirteen Gherkin implementations with enough responsiveness so as to not discourage contributions. With the added constraint that nobody can know the intricacies of thirteen different languages, frameworks, distribution systems, ect. And while I'm happy that I can currently ask for advice, this too varies over time and per language as people's interests and availability waxes and wanes. So the current process is optimized to reduce the time and knowledge demands on the maintainers. It doesn't produce the most optimal results, far from it, but it keeps things going. Currently we ask contributors about the type of their changes. Which seems to work well enough to keep us from breaking Semver for the different languages. I reckon we can update that to include some words about breaking an ABI. Then that will trigger a new major release. I'll leave some time for others to comment but I think I can summarize the current consensus as somewhat favourable towards using the release version. "better to have something than nothing". |
There are tools that can help with this. In Fedora, we tend to use Interpreting the results still takes a bit of knowledge, especially for C++ where the rules for ABI compatibility are a lot messier than in C, but it’s a lot better than just trying to audit source code for ABI changes. |
Yes, some helpers exist here and there, but no good cross platform support. And keep in mind that a small change in C or C++ could break the ABI and thus require a Semver change.. So if you ask me, we should not complicate things with ABI (the old way) and use the project Semver X.Y.Z and use that for SOVERSION (that's what CMake does). So if there's a global VERSION file somewhere, I can use that in the C++ part and maybe in the C part, if the maintainer is busy elsewhere. What do you think ? |
The file you can use is |
cool. I'll try to make a PR tomorrow (it's late here). thank you. |
🤔 What's the problem you're trying to solve?
On Linux, system-wide shared libraries are expected to be versioned via
SONAME
.✨ What's your proposed solution?
Set
SOVERSION
inc/CMakeLists.txt
; this can be as simple as:Commit to incrementing the value of
SOVERSION
each time there is an ABI-incompatible change.⛏ Have you considered any alternatives or workarounds?
Downstream .so versioning is an option.
📚 Any additional context?
It looks like the C++ shared library already does this correctly:
gherkin/cpp/src/lib/gherkin/CMakeLists.txt
Lines 34 to 42 in f99769b
The text was updated successfully, but these errors were encountered: