unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [python] set rpath in setup.cfg
@ 2011-10-12 14:55 dtk
  2011-10-12 15:30 ` Ali Polatel
  0 siblings, 1 reply; 8+ messages in thread
From: dtk @ 2011-10-12 14:55 UTC (permalink / raw)
  To: notmuch


Hey guys,

I installed notmuch locally (~/.local) and now the python bindings fail to
find the .so.

Anyone happens to know how to set the rpath in the setup.cfg? Putting it
in the [build] section doesn't work:

~~~snip~~~
$ python setup.py install --prefix=$STOW/notmuch_python
running install
error: error in setup.cfg: command 'build' has no such option 'rpath'
$
~~~snip~~~

Putting it in [build_ext] works but neither that nor building with

~~~snip~~~
$ python setup.py build_ext --rpath=/home/dtk/.local/lib
running build_ext
$ python setup.py install --prefix=$STOW/notmuch_python/
running install
running build
running build_py
copying notmuch/database.py -> build/lib.linux-x86_64-2.7/notmuch
copying notmuch/thread.py -> build/lib.linux-x86_64-2.7/notmuch
copying notmuch/tag.py -> build/lib.linux-x86_64-2.7/notmuch
copying notmuch/globals.py -> build/lib.linux-x86_64-2.7/notmuch
copying notmuch/version.py -> build/lib.linux-x86_64-2.7/notmuch
copying notmuch/message.py -> build/lib.linux-x86_64-2.7/notmuch
copying notmuch/filename.py -> build/lib.linux-x86_64-2.7/notmuch
copying notmuch/__init__.py -> build/lib.linux-x86_64-2.7/notmuch
running install_lib
running install_egg_info
Removing
/home/dtk/.local/stow/notmuch_python//lib/python2.7/site-packages/notmuch-0.9_rc2-py2.7.egg-info
Writing
/home/dtk/.local/stow/notmuch_python//lib/python2.7/site-packages/notmuch-0.9_rc2-py2.7.egg-info
$
~~~snip~~~

seems to have any effect.

Am I missing out on something? Would be great if someone happened to know
a solution.
/me dislikes LD_LIBRARY_PATH :/

tx in advance
dtk

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [python] set rpath in setup.cfg
  2011-10-12 14:55 [python] set rpath in setup.cfg dtk
@ 2011-10-12 15:30 ` Ali Polatel
  2011-10-13  6:12   ` dtk
  0 siblings, 1 reply; 8+ messages in thread
From: Ali Polatel @ 2011-10-12 15:30 UTC (permalink / raw)
  To: dtk; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 1726 bytes --]

On Wed, Oct 12, 2011 at 04:55:30PM +0200, dtk wrote:
>
>Hey guys,
>
>I installed notmuch locally (~/.local) and now the python bindings fail to
>find the .so.
>
>Anyone happens to know how to set the rpath in the setup.cfg? Putting it
>in the [build] section doesn't work:
>
>~~~snip~~~
>$ python setup.py install --prefix=$STOW/notmuch_python
>running install
>error: error in setup.cfg: command 'build' has no such option 'rpath'
>$
>~~~snip~~~
>
>Putting it in [build_ext] works but neither that nor building with
>
>~~~snip~~~
>$ python setup.py build_ext --rpath=/home/dtk/.local/lib
>running build_ext
>$ python setup.py install --prefix=$STOW/notmuch_python/
>running install
>running build
>running build_py
>copying notmuch/database.py -> build/lib.linux-x86_64-2.7/notmuch
>copying notmuch/thread.py -> build/lib.linux-x86_64-2.7/notmuch
>copying notmuch/tag.py -> build/lib.linux-x86_64-2.7/notmuch
>copying notmuch/globals.py -> build/lib.linux-x86_64-2.7/notmuch
>copying notmuch/version.py -> build/lib.linux-x86_64-2.7/notmuch
>copying notmuch/message.py -> build/lib.linux-x86_64-2.7/notmuch
>copying notmuch/filename.py -> build/lib.linux-x86_64-2.7/notmuch
>copying notmuch/__init__.py -> build/lib.linux-x86_64-2.7/notmuch
>running install_lib
>running install_egg_info
>Removing
>/home/dtk/.local/stow/notmuch_python//lib/python2.7/site-packages/notmuch-0.9_rc2-py2.7.egg-info
>Writing
>/home/dtk/.local/stow/notmuch_python//lib/python2.7/site-packages/notmuch-0.9_rc2-py2.7.egg-info
>$
>~~~snip~~~
>
>seems to have any effect.
>
>Am I missing out on something? Would be great if someone happened to know
>a solution.
>/me dislikes LD_LIBRARY_PATH :/
>

May I ask why you dislike LD_LIBRARY_PATH?

		-alip

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [python] set rpath in setup.cfg
  2011-10-12 15:30 ` Ali Polatel
@ 2011-10-13  6:12   ` dtk
  2011-10-13  6:34     ` Jameson Graef Rollins
  0 siblings, 1 reply; 8+ messages in thread
From: dtk @ 2011-10-13  6:12 UTC (permalink / raw)
  To: Ali Polatel; +Cc: notmuch


Hey alip,

On Wed, 12 Oct 2011 18:30:51 +0300, Ali Polatel <polatel@gmail.com> wrote:
> On Wed, Oct 12, 2011 at 04:55:30PM +0200, dtk wrote:
>>/me dislikes LD_LIBRARY_PATH :/
> 
> May I ask why you dislike LD_LIBRARY_PATH?
 
in my experience, it tends to cause awkward side effects that are hard to
debug, the main problem being that it overrides all default paths and is
hard to target at a single problematic application.

google may tell you more[0].

Yours
dtk


-----
[0]here is what it told me:
 * http://linuxmafia.com/faq/Admin/ld-lib-path.html
 * http://blogs.oracle.com/ali/entry/avoiding_ld_library_path_the
 * http://blogs.oracle.com/rie/date/20040710
 * http://prefetch.net/articles/linkers.badldlibrary.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [python] set rpath in setup.cfg
  2011-10-13  6:12   ` dtk
@ 2011-10-13  6:34     ` Jameson Graef Rollins
  2011-10-13  7:09       ` Tomi Ollila
                         ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jameson Graef Rollins @ 2011-10-13  6:34 UTC (permalink / raw)
  To: dtk, Ali Polatel; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 475 bytes --]

On Thu, 13 Oct 2011 08:12:03 +0200, dtk <dtk@gmx.de> wrote:
> in my experience, it tends to cause awkward side effects that are hard to
> debug, the main problem being that it overrides all default paths and is
> hard to target at a single problematic application.

I think it's fairly straightforward to prepend a library path to the ld
library path without overriding all defaults with something like this
(for bash):

LD_LIBRARY_PATH=/new/ld/path:$LD_LIBRARY_PATH

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [python] set rpath in setup.cfg
  2011-10-13  6:34     ` Jameson Graef Rollins
@ 2011-10-13  7:09       ` Tomi Ollila
  2011-10-13  7:59         ` dtk
  2011-10-13  7:42       ` dtk
  2011-10-16 20:04       ` Thomas Schwinge
  2 siblings, 1 reply; 8+ messages in thread
From: Tomi Ollila @ 2011-10-13  7:09 UTC (permalink / raw)
  To: Jameson Graef Rollins; +Cc: notmuch

On Thu 13 Oct 2011 09:34, Jameson Graef Rollins <jrollins@finestructure.net> writes:

> On Thu, 13 Oct 2011 08:12:03 +0200, dtk <dtk@gmx.de> wrote:
>> in my experience, it tends to cause awkward side effects that are hard to
>> debug, the main problem being that it overrides all default paths and is
>> hard to target at a single problematic application.
>
> I think it's fairly straightforward to prepend a library path to the ld
> library path without overriding all defaults with something like this
> (for bash):
>
> LD_LIBRARY_PATH=/new/ld/path:$LD_LIBRARY_PATH

I also have local notmuch installations (3 of them); notmuch command
(among others)  are wrapped in a shell script which setups environment 
variables like:

PATH=/path/to/iroot/bin:$PATH
LD_LIBRARY_PATH=/path/to/iroot/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export PATH LD_LIBRARY_PATH

and then

exec /path/to/iroot/bin/notmuch "$@"

I don't recall a situation when this have failed. 

> jamie.

Tomi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [python] set rpath in setup.cfg
  2011-10-13  6:34     ` Jameson Graef Rollins
  2011-10-13  7:09       ` Tomi Ollila
@ 2011-10-13  7:42       ` dtk
  2011-10-16 20:04       ` Thomas Schwinge
  2 siblings, 0 replies; 8+ messages in thread
From: dtk @ 2011-10-13  7:42 UTC (permalink / raw)
  To: Jameson Graef Rollins; +Cc: notmuch


On Wed, 12 Oct 2011 23:34:28 -0700, Jameson Graef Rollins
<jrollins@finestructure.net> wrote:
> On Thu, 13 Oct 2011 08:12:03 +0200, dtk <dtk@gmx.de> wrote:
>> in my experience, it tends to cause awkward side effects that are hard
to
>> debug, the main problem being that it overrides all default paths and
is
>> hard to target at a single problematic application.
> 
> I think it's fairly straightforward to prepend a library path to the ld
> library path without overriding all defaults with something like this
> (for bash):
> 
> LD_LIBRARY_PATH=/new/ld/path:$LD_LIBRARY_PATH

In fact the problem is not not to override default LD_LIBRARY_PATH
settings (which /really/ should be empty!) but that LD_LIBRARY_PATH
overrides rpath and default system paths.

tx anyway
dtk

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [python] set rpath in setup.cfg
  2011-10-13  7:09       ` Tomi Ollila
@ 2011-10-13  7:59         ` dtk
  0 siblings, 0 replies; 8+ messages in thread
From: dtk @ 2011-10-13  7:59 UTC (permalink / raw)
  To: Tomi Ollila; +Cc: notmuch


On Thu, 13 Oct 2011 10:09:47 +0300, Tomi Ollila <tomi.ollila@iki.fi>
wrote:
> On Thu 13 Oct 2011 09:34, Jameson Graef Rollins
> <jrollins@finestructure.net> writes:
> 
>> On Thu, 13 Oct 2011 08:12:03 +0200, dtk <dtk@gmx.de> wrote:
>>> in my experience, it tends to cause awkward side effects that are hard
>>> to
>>> debug, the main problem being that it overrides all default paths and
is
>>> hard to target at a single problematic application.
>
> I also have local notmuch installations (3 of them); notmuch command
> (among others)  are wrapped in a shell script which setups environment 
> variables like:
> 
> PATH=/path/to/iroot/bin:$PATH
> LD_LIBRARY_PATH=/path/to/iroot/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
> export PATH LD_LIBRARY_PATH

True. Actually, I have expanded PATH and PYTHONPATH to include the local
installations, so all that's missing is the path to the .so for the python
bindings, so

~~~snip~~~
$ LD_LIBRARY_PATH=/home/dtk/.local/lib/ alot
~~~snip~~~

works perfectly; still I find it rather unelegant to have to bother about
linker paths at runtime. I feel making the appropriate settings at build
time would be way nicer! Of course you can write a wrapper script for that,
but since there is RPATH (and I just don't know how to set it in Python's
setup.py), I really don't feel like wrapping each of my bins manually :/

tx
dtk

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [python] set rpath in setup.cfg
  2011-10-13  6:34     ` Jameson Graef Rollins
  2011-10-13  7:09       ` Tomi Ollila
  2011-10-13  7:42       ` dtk
@ 2011-10-16 20:04       ` Thomas Schwinge
  2 siblings, 0 replies; 8+ messages in thread
From: Thomas Schwinge @ 2011-10-16 20:04 UTC (permalink / raw)
  To: Jameson Graef Rollins, dtk, Ali Polatel; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 1254 bytes --]

Hi!

On Wed, 12 Oct 2011 23:34:28 -0700, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> On Thu, 13 Oct 2011 08:12:03 +0200, dtk <dtk@gmx.de> wrote:
> > in my experience, it tends to cause awkward side effects that are hard to
> > debug, the main problem being that it overrides all default paths and is
> > hard to target at a single problematic application.
> 
> I think it's fairly straightforward to prepend a library path to the ld
> library path without overriding all defaults with something like this
> (for bash):
> 
> LD_LIBRARY_PATH=/new/ld/path:$LD_LIBRARY_PATH

This is in fact not safe, and may cause subtle issues: if LD_LIBRARY_PATH
is empty initally, it'll evaluate to:

    LD_LIBRARY_PATH=/new/ld/path:

Of this one, the last element is empty, and ld.so will thus look into the
current directory for libc.so, for example.  Now you cd /tmp/ and enter
ls...  :-)

Or, as it once bit me, you're on a system with such an LD_LIBRARY_PATH
set (without me knowing about it).  You do glibc development, and wonder
why some commands begin acting strangely when you're in the glibc build
directory...

Thus:

    LD_LIBRARY_PATH=/new/ld/path${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-10-16 20:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-12 14:55 [python] set rpath in setup.cfg dtk
2011-10-12 15:30 ` Ali Polatel
2011-10-13  6:12   ` dtk
2011-10-13  6:34     ` Jameson Graef Rollins
2011-10-13  7:09       ` Tomi Ollila
2011-10-13  7:59         ` dtk
2011-10-13  7:42       ` dtk
2011-10-16 20:04       ` Thomas Schwinge

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).