Skip to content

cmake: give cachelib_nvmitem a SOVERSION like the other libraries - #500

Open
michel-slm wants to merge 1 commit into
facebook:mainfrom
michel-slm:cachelib-nvmitem-soversion
Open

michel-slm wants to merge 1 commit into
facebook:mainfrom
michel-slm:cachelib-nvmitem-soversion

Conversation

@michel-slm

Copy link
Copy Markdown
Contributor

Summary

cachelib_nvmitem was split out of cachelib_allocator to break a dependency cycle with cachelib_navy, but it was never added to the set_target_properties(... SOVERSION VERSION) list that the other seven libraries are in. With BUILD_SHARED_LIBS=ON it is the only installed library without a soname, a bare libcachelib_nvmitem.so that libcachelib_allocator.so.19 then depends on by that unversioned name. Distribution packaging treats an unversioned .so as a development symlink and strips it from runtime packages, which would break the allocator library at load time; and the soname bump on a major version change would never reach it.

One line: add cachelib_nvmitem to the list.

Before

From a getdeps --shared-lib build on Fedora Rawhide aarch64, the link inputs of binary_trace_gen:

datatype/libcachelib_datatype.so.19.1.0
allocator/libcachelib_allocator.so.19.1.0
navy/libcachelib_navy.so.19.1.0
allocator/libcachelib_nvmitem.so          <-- no version
shm/libcachelib_shm.so.19.1.0
common/libcachelib_common.so.19.1.0

After

Same build with this patch, installed tree (Fedora package cachelib-19^20260918.38gitee4c153):

/usr/lib64/libcachelib_allocator.so.19
/usr/lib64/libcachelib_allocator.so.19.1.0
...
/usr/lib64/libcachelib_nvmitem.so.19
/usr/lib64/libcachelib_nvmitem.so.19.1.0
/usr/lib64/libcachelib_shm.so.19
/usr/lib64/libcachelib_shm.so.19.1.0

and the consumers' DT_NEEDED now reads libcachelib_nvmitem.so.19()(64bit) alongside the other seven sonames.

🤖 Generated with Claude Code

cachelib_nvmitem was split out of cachelib_allocator to break a cycle
with cachelib_navy, but it was not added to the list of targets that
get SOVERSION/VERSION when BUILD_SHARED_LIBS is on. It is the only
installed library that ends up as an unversioned libcachelib_nvmitem.so,
which distribution packaging treats as a development symlink.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Michel Lind <salimma@fedoraproject.org>
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant