[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Fwd: SONAME for python modules is bad?



Mathieu Malaterre wrote:
> Forwarding discussion to other debian-cli/debian-java mailing list, to
> get feedback (sorry for duplicates).
> 
> Basically we are looking for policy on SONAME on module, in different
> target language.
> 
> Thanks,
> 
> ---------- Forwarded message ----------
[snip]
> On Wed, Jul 22, 2009 at 8:47 AM, Steve M. Robbins<steve@sumost.ca> wrote:
>> Hi,
>>
>> Recently, Mathieu Malaterre wrote to say that having a SOVERSION on a
>> python module is wrong, with reference to an oblique comment from
>> Josselin Mouette [1].
>>
>> Is this true?  What is the rationale for not versioning these shared
>> objects?

Chow Loong Jin has mostly answered this on debian-python@l.d.o already:
SONAME/SOVERSION is a mechanism used to allow the dynamic linker to load
at runtime the same major version of the library that the code was
linked against at compile time.

Code loaded exclusively via dlopen rather than the implicit action of
the dynamic linker cannot benefit from SONAMEs, so for the sake of
clarity, it is best to omit them rather than allowing people to
mistakenly believe they may have an effect.

> This issue was raised by Denis Barbier. This makes particular sense
> for the C#/Java target language since one setup a proper
> LD_LIBRARY_PATH and then an internal mechanism load the internal glue
> lib. The version of the glue lib is not very important in this case
> and furhtermore cannot even be expressed AFAIK. For instance, in Java:
> 
>  static {
>   try {
>       System.loadLibrary("gdcmjni");
>   } catch (UnsatisfiedLinkError e) {
>     System.err.println("Native code library failed to load. \n" + e);
>     System.exit(1);
>   }
>  }
> 
> 
> In C#:
> 
> [DllImport("gdcmsharpglue", EntryPoint="CSharp_ImageWriterUpcast")]
> 
> 
> It would be extremely nice too if all wrap language would adopt the
> same convention. So that toolkit such as VTK/ITK/GDCM wrapping their
> interface into multiple languages (namely: Tcl, Python, Java, C#)
> could simply decide:
> (1) Allow SONAME
> (2) Use a directory convention libfoo-$SOVERSION/$NAME.so
> 
> for packaging mutiple modules.

It is unclear to me what you are trying to standardize.

> I know that Python had some other convention such as preprending
> underscore, but I have never seen any need for SONAME on modules.

The underscore convention informs Python programmers that the compiled
module is not for their direct use, and is considered private to the
Python library that ships it - such a library will also ship Python
wrapper code that exposes the libraries API, and uses the private
compiled module internally.

Max.

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: