Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75359

Re: rpath alike feature for python scripts

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'binary': 0.07; 'emulate': 0.09; 'extends': 0.09; 'linker': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'setup.py': 0.09; 'wrapper': 0.09; 'python': 0.11; 'stored': 0.12; 'itself.': 0.14; 'corresponds': 0.16; 'objects.': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'scripts.': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'mechanism': 0.19; "python's": 0.19; 'result.': 0.19; 'import': 0.22; 'install': 0.23; 'creating': 0.23; 'installation': 0.23; 'header:User-Agent:1': 0.23; 'mon,': 0.24; 'looks': 0.24; 'script': 0.25; 'primary': 0.26; 'header:X-Complaints-To:1': 0.27; 'feature': 0.29; '(which': 0.31; 'though.': 0.31; 'writes:': 0.31; 'option': 0.32; 'created': 0.35; 'knows': 0.35; 'no,': 0.35; 'objects': 0.35; 'found.': 0.36; 'interact': 0.36; 'charset:us- ascii': 0.36; 'url:org': 0.36; 'should': 0.36; 'depends': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'obtain': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'received:217': 0.63; 'places': 0.64; 'provide': 0.64; 'jul': 0.74
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From dieter <dieter@handshake.de>
Subject Re: rpath alike feature for python scripts
Date Wed, 30 Jul 2014 07:49:46 +0200
References <20140725140813.GA1867@aepfle.de> <87ha24mzzo.fsf@handshake.de> <20140728075740.GA17585@aepfle.de> <1406577605.33116.YahooMailNeo@web163806.mail.gq1.yahoo.com> <20140729072759.GA17626@aepfle.de>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Gmane-NNTP-Posting-Host pd9e0a7d5.dip0.t-ipconnect.de
User-Agent Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux)
Cancel-Lock sha1:Q7LpmspVswSrqrtuvTwhENNBsdc=
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.12422.1406699401.18130.python-list@python.org> (permalink)
Lines 46
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1406699401 news.xs4all.nl 2940 [2001:888:2000:d::a6]:51659
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:75359

Show key headers only | View raw


Olaf Hering <olaf@aepfle.de> writes:

> On Mon, Jul 28, Albert-Jan Roskam wrote:
>> does this help: https://nixos.org/patchelf.html. It is not specific to Python, though.
>
> No, this does not help because its not about patching the result.
> The questions is how to obtain the value with should be patched into the
> result.

You wanted to know how to emulate the "rpath" feature with
Python scripts. The use case for the "rpath" feature looks like:
 
   A binary depends on some shared objects stored at a non-standard
   place. The person linking the binary knows those places
   where the shared objects can likely be found. He uses
   the "rpath" linker option to provide this information.
   It is stored with the created binary and instructs the
   dynamic linker in what additional places it should look
   for shared objects.


Python correspondences:

   binary ~ script
   dynamic linker ~ Python's import mechanism

Python lacks the (static) linking phase. You must invent something:
you may see it as part of script development or as part of the installation
or design it as creating some wrapper which extends the standard
configuration for Python's import mechanism and then call the script
itself.


The primary ways to interact with Python's import mechanism
are "sys.path" and the envvar "PYTHONPATH" (which corresponds
to the envvar "LD_LIBRARY_PATH").


> Looks like I have to dissect setup.py and mimic its behaviour in the
> Makefile.

"setup.py" does nothing with Python's "sys.path".

It looks at "sys.prefix" and "sys.execprefix" to learn where
to install modules/packages and binary scripts.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: rpath alike feature for python scripts dieter <dieter@handshake.de> - 2014-07-30 07:49 +0200

csiph-web