Bug 332579 - unversioned plugins library (rpmlint invalid-soname issue)
Summary: unversioned plugins library (rpmlint invalid-soname issue)
Status: RESOLVED DUPLICATE of bug 344537
Alias: None
Product: trojita
Classification: Applications
Component: Core (show other bugs)
Version: 0.4.1
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Trojita default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-25 11:58 UTC by kavol
Modified: 2016-01-25 21:34 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kavol 2014-03-25 11:58:00 UTC
While packaging Trojitá for Fedora[*], I've found that it provides the library libtrojita_plugins.so

I'm not sure if this is intended to be public ... so far I treat it as private, so I've moved it to a subdirectory and added rpath by using cmake parameters:

    -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir}/%{name}
    -DCMAKE_INSTALL_RPATH=%{_libdir}/%{name}

However, if I read the cmake docs correctly, this should better be handled in CMakeLists.txt (sorry, I have not enough cmake knowledge to propose a patch).

If it is intended to be public, then it should be properly versioned, please see
https://fedoraproject.org/wiki/Common_Rpmlint_issues#invalid-soname

Also, I wonder how does it come that a shared library is built, despite the fact that I also set:

    -DBUILD_SHARED_LIBS:BOOL=OFF

which I've copied from the OBS spec (it even doesn't build without that parameter!)?

[*] https://bugzilla.redhat.com/show_bug.cgi?id=1080411
Comment 1 Pali Rohár 2014-03-25 12:22:29 UTC
Library libtrojita_plugins.so provides interfaces for trojita plugins. Every trojita plugin (and trojita executable) must be linked with that libary. And now only plugins inside trojita tree can be compiled and used (due to need for headers inside tree). So in my opinion there is no need to make this library public.

But maybe we can make stable interfaces and provide public header files for plugins outside trojita tree...

Reason why this library is shared is due to linking problems. Without hacks it is not possible to correctly build and link (c++) trojita executable (which can load plugins at runtime) and trojita plugins.

If you want to disable building this shared libary you can disable trojita plugin support via cmake option at compile time.
Comment 2 Jan Kundrát 2014-03-25 12:44:23 UTC
On top of what Pali said, I would like to stress out that this is a private library with no ABI/API guarantees -- "private" in sense that "if anything but stuff provided by Trojita links against this, things will break".

What is the suggested location for such libraries? I'll be happy to adjust the build system properly as long as it does not involve too much deep magic and ugly cmake hacks.
Comment 3 kavol 2014-03-25 13:02:11 UTC
(In reply to comment #2)
> On top of what Pali said, I would like to stress out that this is a private
> library with no ABI/API guarantees -- "private" in sense that "if anything
> but stuff provided by Trojita links against this, things will break".

ok, so moving that out of ld paths was a good step ...

> What is the suggested location for such libraries? I'll be happy to adjust
> the build system properly as long as it does not involve too much deep magic
> and ugly cmake hacks.

I'm not sure if this is accepted universally, but Fedora guidelines suggest a subdirectory of lib, i.e. the abovementioned

%{_libdir}/%{name}

which translates to /usr/lib/trojita or /usr/lib64/trojita

... taking a quick look at directory structure in my Gentoo install, it seems it does the same
Comment 4 Jan Kundrát 2016-01-25 21:34:29 UTC
Seems that this is actually OK to use unversioned .so files like this, at least according to Fedora's policies, as indicated in the other bug.

*** This bug has been marked as a duplicate of bug 344537 ***