No SONAME/SOVERSION defined
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c, cmake, ubuntu
- Domain
- build-system, release
Research direction
Start with src/CMakeLists.txt and review how the dfx target is installed. Build the shared library, inspect it with objdump -x for its SONAME, and verify that dpkg-shlibdeps can identify dfx-mgr's libdfx dependency. Done means releases define a consistent SONAME and the API/ABI guarantees are documented.
Written by the indexing model from the issue text.
Description
Hi!
libdfx.so currently has no SONAME/SOVERSION defined, which breaks a number of things when creating distro packages (e.g. Ubuntu packages in my case). For instance, when trying to compute shared library dependencies from dfx-mgr on libdfx, dpkg-shlibdeps wont be able to extract the name of the library from libdfx.so, and the dfx-mgr binary won't properly have a libdfx "NEEDED" dependency on the lib.
Typically, libraries shipped in linux distros will:
- be shared libraries (really rare to have static libraries unless they change ABI all the time, and even then distros tend to prefer using shared libraries and rebuilding the reverse dependencies)
- provide some guarantees on API stability
- aim for ABI stability as long as possible, and bump the SONAME when an incompatible change really has to land
For now, while creating packaging aimed at Ubuntu, I've worked around this by defining an Ubuntu specific SONAME "0ubuntu1" with this change:
--- libdfx-2021.2.orig/src/CMakeLists.txt
+++ libdfx-2021.2/src/CMakeLists.txt
@@ -19,6 +19,8 @@ set(LIBDFX_INCLUDE_DIRS
)
add_library(dfx ${libdfx_sources})
-set_target_properties(dfx PROPERTIES PUBLIC_HEADER "include/libdfx.h")
+set_target_properties(dfx PROPERTIES
+ VERSION 0ubuntu1
+ PUBLIC_HEADER "include/libdfx.h")
target_include_directories(dfx PUBLIC ${LIBDFX_INCLUDE_DIRS})
install(TARGETS dfx ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER ${CMAKE_INSTALL_INCLUDEDIR})
So now, the packaged library properly appears with a "SONAME" property (objdump -x libdfx.so | grep SONAME) of libdfx.0ubuntu1, and I also get a libdfx.so symlink that I can ship in the libdfx-dev package.
Obviously, having to track ABI/API downstream in the Ubuntu packaging is cumbersome as it creates Ubuntu specific binaries, extra work and a risk of errors, so it'd be awesome if you could document API/ABI guarantees and define a SONAME in your releases so that all projects downstream of libdfx use the same SONAME. :-)
Thanks!
- Dominant language
- C
- Stars
- 13
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Xilinx/libdfx
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
task
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
vsanthanam/JBird#429 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
bug documentation
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
es-ude/OnDeviceTraining#459 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
bilelmoussaoui/gobject-linter#199 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
bradcypert/plum#53 ·