cpp-httplib: SOVERSION does not indicate binary compatibility accurately

Currently, SOVERSION on the shared library is set to match two version components:

https://github.com/yhirose/cpp-httplib/blob/996acc52537a62435769bf1f873ad0504d6cf620/CMakeLists.txt#L196

This indicates that all 0.18.x releases should be backwards compatible. However, this is not the case. The most recent example is #2022 adding is_connection_closed field in middle of Request class. This caused all field offsets to change, causing software linked to the previous version of the library to start accessing wrong fields.

Please either update SOVERSION to correctly indicate binary compatible, or — even better — set stronger binary compatibility guarantees. This library is used by some huge stuff (for example, LLVM) and people need to spend hours rebuilding it whenever ABI of cpp-httplib changes.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 22 (17 by maintainers)

Commits related to this issue

Most upvoted comments

Hi all.

One thing we do in a project I maintain is having a CI job which builds the project and runs abidiff on it. This way, if we introduce ABI-breaking changes, we can notice it and fix it promptly.

Making cpp-httplib’s ABI more stable would benefit lots of people which prefer using the compiled variant of the library, and I’d be glad to help some way. It also interests me personally as handling ABI changes in Debian is always a bit of an involved process.

@Tachi107 thanks for the great job at #2054, also thanks all for valuable comments and suggestions! 😄

@yhirose I don’t think it’s really something to solve in Cmake. The compatibility is already set to SameMinorVersion there. Otherwise all you could do is set it to ExactVersion and set the patch version on the solib too. But that’s just telling the user “any and all version bumps should be considered breaking”.

@Tachi107’s recommendation sounds good for a way to automate it. Haven’t used it myself though.