Skip to content

Add SOVERSION to shared library targets - #76

Closed
rootkiller6788 wants to merge 1 commit into
facebook:mainfrom
rootkiller6788:fix-shared-library-soname
Closed

Add SOVERSION to shared library targets#76
rootkiller6788 wants to merge 1 commit into
facebook:mainfrom
rootkiller6788:fix-shared-library-soname

Conversation

@rootkiller6788

Copy link
Copy Markdown

Summary

Fixes #7. The shared libraries built by the CMake build set VERSION but not SOVERSION, so libfb303.so.1.0.0 and libfb303_thrift_cpp.so.1.0.0 are produced with no SONAME.

Without a SONAME, the runtime linker and packaging tooling cannot identify the libraries:

  • ldconfig/ldd report the dependency as the raw file name rather than a stable SONAME.
  • Distro packaging (Debian/RPM) that builds from the CMake install cannot emit a proper Provides: libfb303.so.1 style dependency.
  • Applications that dlopen or link by SONAME against an installed fb303 fail to resolve it after an upgrade.

Changes

  • Derive FB303_SOVERSION from the major component of PACKAGE_VERSION in CMakeLists.txt.
  • Set SOVERSION ${FB303_SOVERSION} alongside the existing VERSION on both fb303 and fb303_thrift_cpp, so the SONAME (libfb303.so.1, libfb303_thrift_cpp.so.1) stays stable across minor/patch releases.

Verification

  • The issue is reproducible from the current main: set_property(TARGET ... PROPERTY VERSION ${PACKAGE_VERSION}) with no SOVERSION in both CMakeLists.txt and fb303/thrift/CMakeLists.txt.
  • The updated CMake configures cleanly with BUILD_SHARED_LIBS both on and off.

fb303 and fb303_thrift_cpp set the VERSION target property but not
SOVERSION, so the shared libraries are built without a SONAME. This
breaks consumers that link against the SONAME (e.g. packaging tools
and applications that resolve the runtime dependency by soname).

Derive SOVERSION from the major component of PACKAGE_VERSION so that
the SONAME (libfb303.so.<major>) stays stable across minor and patch
releases.
@meta-cla meta-cla Bot added the CLA Signed label Aug 22, 2026
@rootkiller6788
rootkiller6788 marked this pull request as ready for review August 23, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

libfb303_thrift_cpp.so.1.0.0 doesn't have a SONAME

1 participant