Re: [RFC/PATCH] python: search parent lib directory for libnotmuch.so

Subject: Re: [RFC/PATCH] python: search parent lib directory for libnotmuch.so

Date: Tue, 09 Apr 2013 17:21:28 +0200

To: Jed Brown, notmuch@notmuchmail.org

Cc: Sebastian Spaeth

From: Justus Winter


Quoting Jed Brown (2013-04-09 16:57:05)
> Justus Winter <4winter@informatik.uni-hamburg.de> writes:
> >
> > May I ask why you cannot use LD_LIBRARY_PATH? I too install libnotmuch
> > to a non-standard location as unprivileged user and to make this
> > library available I add its path to LD_LIBRARY_PATH. 
> 
> See libdir_in_ldconfig testing in configure: we make a significant
> effort to set RPATH appropriately when installing to a location that is
> not already searched (perhaps via LD_LIBRARY_PATH).  This currently does
> not apply to the Python bindings, so while you can install without
> LD_LIBRARY_PATH and still run the notmuch executable fine, you must set
> LD_LIBRARY_PATH to use the Python bindings.  That is the inconsistency I
> wanted to fix here.

But why do we do that? I always thought that rpath causes more
problems and is to be avoided if possible [0]. But otoh, I didn't even
knew that the notmuch build system uses rpath.

0: e.g. http://wiki.debian.org/RpathIssue

> I don't like the indirection either, but the binary is compiled with
> knowledge of prefix/RPATH, so if we wanted a single canonical location
> to specify this information, I would make it the binary.
> 
> If you don't want to trust Python install directory hierarchy, we could
> have 'setup.py install' write some info about RPATH.

I actually have no strong feelings for or against this proposal. I'm
merely surprised that there is an issue that you are trying to fix
here since exactly this configuration has worked for me since the day
I started using notmuch.

And from my point of view LD_LIBRARY_PATH is the correct way to
instruct the dynamic linker (and as a similar facility the ctypes
library loader) where to look for additional libraries.

Cheers,
Justus

Thread: