[GH-ISSUE #590] ABI changes #7398

Open
opened 2026-06-20 17:26:58 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @kgold2 on GitHub (Jul 10, 2020).
Original GitHub issue: https://github.com/semver/semver/issues/590

Is there any consideration of an ABI break that does not break the API? An ABI break may require a recompile but not changes to the calling source code.

For example, a C program could take a struct parameter. If a new member was added to the struct, the API doesn't break but the ABI does.

Originally created by @kgold2 on GitHub (Jul 10, 2020). Original GitHub issue: https://github.com/semver/semver/issues/590 Is there any consideration of an ABI break that does not break the API? An ABI break may require a recompile but not changes to the calling source code. For example, a C program could take a struct parameter. If a new member was added to the struct, the API doesn't break but the ABI does.
GiteaMirror added the question label 2026-06-20 17:26:58 -05:00
Author
Owner

@steveklabnik commented on GitHub (Jul 10, 2020):

In general, SemVer is only concerned with APIs. This comes from its heritage in dynamically typed scripting languages. That being said, its notion of "API" is up to the maintainer; you as the project owner say what your API is, and if the ABI is part of that or not.

<!-- gh-comment-id:656883947 --> @steveklabnik commented on GitHub (Jul 10, 2020): In general, SemVer is only concerned with APIs. This comes from its heritage in dynamically typed scripting languages. That being said, its notion of "API" is up to the maintainer; you as the project owner say what your API is, and if the ABI is part of that or not.
Author
Owner

@Tieske commented on GitHub (Jul 11, 2020):

@steveklabnik is right. The most important (and most overlooked) element in versioning is defining the scope of the version. For example are "under the hood" database schema changes part of the version, or a file system layout? or in your case the ABI.

<!-- gh-comment-id:657021991 --> @Tieske commented on GitHub (Jul 11, 2020): @steveklabnik is right. The most important (and most overlooked) element in versioning is defining the scope of the version. For example are "under the hood" database schema changes part of the version, or a file system layout? or in your case the ABI.
Author
Owner

@WayneSherman commented on GitHub (Jul 16, 2023):

Regarding API and ABI changes, I agree with this post:
https://stackoverflow.com/a/34194562

Semantic versioning should consider both [source (API) and binary (ABI) changes], and follow the "most changed" one.

  • Breaking source compilation is an incompatible change to users of the library.
  • Breaking runtime execution is an incompatible change to users of the library.

If either source compatibility or binary compatibility changes, it should -- according to semantic versioning -- be a new major version.

<!-- gh-comment-id:1636977059 --> @WayneSherman commented on GitHub (Jul 16, 2023): Regarding API and ABI changes, I agree with this post: https://stackoverflow.com/a/34194562 > Semantic versioning should consider both [source (API) and binary (ABI) changes], and follow the "most changed" one. > > - Breaking source compilation is an incompatible change to users of the library. > - Breaking runtime execution is an incompatible change to users of the library. > > If either source compatibility or binary compatibility changes, it should -- according to semantic versioning -- be a new major version.
Author
Owner

@FStefanni commented on GitHub (Apr 18, 2026):

Hi,

this seems a quite old discussion, but I just want to add an idea I am having, to understand if it could be accepted by the SemVer community.
Basically, if we are dealing with interpreted languages, we can safely ignore ABI issues.

But what if this is not the case? For example, a proprietary/closed-source library. Or maybe a open source library, but which is also distributed pre-compiled to avoid waiting for very long compiling times of dependencies.

In this case, knowing what changed and what has been broken became quite important and distinguish between an ABI break and an API break.

Example:

  • ABI break of a dependency of an open source project? We can imagine a package manager which, detecting this situation, download the source code of such open source project and recompiles. Fixed.
  • API change or closed source project? Sorry, unrecoverable issue (needs a developer)

So my idea is:

  • for backward compatibility, SemVer with 3 digits is fine, and it is still fine for interpreted languages
  • but for compiled langs, we introduce also a 4-digits SemVer: <API break>.<ABI break>.<new feature>.<bug fix>

This makes things obvious, since just by looking at the version we know what happened. And also alleviates developers effort to maintain their code: a developer immediately knows if a dependency can be safely updated, since a recompiling is all what is needed.

What do you think of this idea?
Is this the right place to discuss/propose this idea?

Thanks,
regards

<!-- gh-comment-id:4274476382 --> @FStefanni commented on GitHub (Apr 18, 2026): Hi, this seems a quite old discussion, but I just want to add an idea I am having, to understand if it could be accepted by the SemVer community. Basically, if we are dealing with interpreted languages, we can safely ignore ABI issues. But what if this is not the case? For example, a proprietary/closed-source library. Or maybe a open source library, but which is also distributed pre-compiled to avoid waiting for very long compiling times of dependencies. In this case, knowing what changed and what has been broken became quite important and distinguish between an ABI break and an API break. Example: - ABI break of a dependency of an open source project? We can imagine a package manager which, detecting this situation, download the source code of such open source project and recompiles. Fixed. - API change or closed source project? Sorry, unrecoverable issue (needs a developer) So my idea is: - for backward compatibility, SemVer with 3 digits is fine, and it is still fine for interpreted languages - but for compiled langs, we introduce also a 4-digits SemVer: `<API break>.<ABI break>.<new feature>.<bug fix>` This makes things obvious, since just by looking at the version we know what happened. And also alleviates developers effort to maintain their code: a developer immediately knows if a dependency can be safely updated, since a recompiling is all what is needed. What do you think of this idea? Is this the right place to discuss/propose this idea? Thanks, regards
Author
Owner

@Tieske commented on GitHub (Apr 20, 2026):

In this case distributed binary product is a different product than the source code.

The source has it's own version. The binary product is comprised of 1) the source code, 2) the compile time settings.

If your source doesn't change, but the compiler settings do (causing a breaking change in the ABI), then you have a new major on the binary product. If you control both, you can decide on a new major of your source to keep both in-sync.

As I mentioned above; each version should come with a definition of its scope. In this case defining whether the ABI is or is not part of the version scope.

If you add info on the ABI to the spec, then what's next? compile-time settings, endianness, targetted platforms? A deep rabbit hole...

<!-- gh-comment-id:4279949372 --> @Tieske commented on GitHub (Apr 20, 2026): In this case distributed binary product is a different product than the source code. The source has it's own version. The binary product is comprised of 1) the source code, 2) the compile time settings. If your source doesn't change, but the compiler settings do (causing a breaking change in the ABI), then you have a new major on the binary product. If you control both, you can decide on a new major of your source to keep both in-sync. As I mentioned above; each version should come with a definition of its scope. In this case defining whether the ABI is or is not part of the version scope. If you add info on the ABI to the spec, then what's next? compile-time settings, endianness, targetted platforms? A deep rabbit hole...
Author
Owner

@FStefanni commented on GitHub (Apr 21, 2026):

Hi,

thank you for sharing your opinion.
I disagree on the "rabbit hole", since no other parameter is relevant imho.
Basically what I am trying to say is that already all other stuff is covered and correctly handled by the 3-digits SemVer.

ABI changes are not: when you increase the major you are telling that developers must take action.
But if it is only an ABI change, this is false.

In case of source code distribution, as Rust for example, we can also think about creating a package manager that, in case of ABI breaking change, just happily recompiles the code, since it is the only true required action.
With current 3-digits SemVer schema, we are missing this info.

Regards

<!-- gh-comment-id:4286455626 --> @FStefanni commented on GitHub (Apr 21, 2026): Hi, thank you for sharing your opinion. I disagree on the "rabbit hole", since no other parameter is relevant imho. Basically what I am trying to say is that already all other stuff is covered and correctly handled by the 3-digits SemVer. ABI changes are not: when you increase the major you are telling that developers must take action. But if it is only an ABI change, this is false. In case of source code distribution, as Rust for example, we can also think about creating a package manager that, in case of ABI breaking change, just happily recompiles the code, since it is the only true required action. With current 3-digits SemVer schema, we are missing this info. Regards
Author
Owner

@hasufell commented on GitHub (Apr 21, 2026):

@FStefanni you are aware that you can break ABI without breaking API, yes? And you can break API without breaking ABI.

There is a relation between the two, but it is not that straightforward. That's why SONAMEs for C libraries don't always correspond to the library version (e.g. libc, libcurl).

<!-- gh-comment-id:4286561677 --> @hasufell commented on GitHub (Apr 21, 2026): @FStefanni you are aware that you can break ABI without breaking API, yes? And you can break API without breaking ABI. There is a relation between the two, but it is not that straightforward. That's why SONAMEs for C libraries don't always correspond to the library version (e.g. libc, libcurl).
Author
Owner

@FStefanni commented on GitHub (Apr 22, 2026):

Hi,

thank you for your comment that points out a important aspect.

Yes I am aware that, and in particular that breaking API does not forcefully means breaking ABI.

But here I propose to give more importance to API (first digit) w.r.t. ABI (second digit), since breaking ABI just requires that the developer recompiles the code (trivially fixable), whilst fixing the API requires that the developer understands what changes happen and how to update the code (it requires some effort).

It is the same logic behind "new feature" and "bugfix": "new feature" has the minor (in the 3-digits schema) since it requires some effort by the developers to discover what has been added and how to use possibly it, whilst a "bugfix" is a no brainer.

Regards

<!-- gh-comment-id:4293946404 --> @FStefanni commented on GitHub (Apr 22, 2026): Hi, thank you for your comment that points out a important aspect. Yes I am aware that, and in particular that breaking API does not forcefully means breaking ABI. But here I propose to give more importance to API (first digit) w.r.t. ABI (second digit), since breaking ABI just requires that the developer recompiles the code (trivially fixable), whilst fixing the API requires that the developer understands what changes happen and how to update the code (it requires some effort). It is the same logic behind "new feature" and "bugfix": "new feature" has the minor (in the 3-digits schema) since it requires some effort by the developers to discover what has been added and how to use possibly it, whilst a "bugfix" is a no brainer. Regards
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/semver#7398