fix: bump SOVERSION to 28 for removed std::string_view symbols (#1694)#1697
Merged
Conversation
…1694) The std::string_view convenience methods (Value(std::string_view), getString, operator[], get, removeMember, isMember) were exported symbols in 1.9.7 -- declared in value.h and defined out-of-line in value.cpp. After 1.9.7 the #1661/#1675 ABI-mismatch fixes made them header-only `inline`, which removed those symbols from the shared library (e.g. Value::removeMember(std::string_view)), but SOVERSION stayed at 27. Removing exported symbols is an incompatible ABI change, so consumers built against 1.9.7's libjsoncpp.so.27 fail to resolve those symbols against later builds that still claim SONAME .so.27 (issue #1694: a system jsoncpp upgrade broke cmake/NFS Ganesha with an undefined-symbol error). Bump SOVERSION 27 -> 28 so the changed ABI gets a distinct SONAME; affected consumers then get a clean rebuild requirement instead of a symbol-lookup crash, and a rebuild against 1.10.0 uses the inline methods (no symbol dependency). The symbols are intentionally not restored: an exported std::string_view symbol's presence depends on whether the library was compiled as C++17, which is the mismatch #1661 fixed.
Coverage Report for CI Build 27674752185Coverage remained the same at 89.903%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1694.
Problem
The
std::string_viewconvenience methods —Value(std::string_view),getString,operator[],get,removeMember,isMember— were exported symbols in 1.9.7 (declared invalue.h, defined out-of-line invalue.cpp). After 1.9.7 the #1661/#1675 ABI-mismatch fixes made them header-onlyinline, which removed those symbols from the shared library while SOVERSION stayed at 27.Verified on master (shared lib, C++17):
Value::removeMember(std::string_view)is no longer exported, while theconst char*/const String&overloads still are.Removing exported symbols is an incompatible ABI change. Because the SONAME stayed
libjsoncpp.so.27, a binary linked against 1.9.7's.so.27(e.g. the reporter's systemcmake/ NFS Ganesha) fails at load withundefined symbol: _ZN4Json5Value12removeMemberESt17basic_string_view...against a later build of.so.27.Fix
Bump
PROJECT_SOVERSION/ mesonsoversion27 → 28. The changed ABI now gets a distinct SONAME (.so.28), so affected consumers get a clean "can't find.so.27" (rebuild required) instead of a symbol-lookup crash. Rebuilt against 1.10.0 they use the inline methods — no symbol dependency.The removed symbols are intentionally not restored: an exported
std::string_viewsymbol's presence depends on whether the library was compiled as C++17, which is exactly the mismatch #1661 fixed.SOVERSION had been bumped every release through 1.9.7 (24→25→26→27) and then stopped; this realigns it with the ABI that actually shipped.