* prefix and python site-packages
@ 2014-04-23 8:21 Olaf Hering
2014-04-23 9:06 ` Ian Campbell
2014-04-24 10:55 ` Ian Jackson
0 siblings, 2 replies; 7+ messages in thread
From: Olaf Hering @ 2014-04-23 8:21 UTC (permalink / raw)
To: ian.campbell, ian.jackson; +Cc: xen-devel
configure --prefix=/some/where puts pygrub and xen/lowlevel/xc.so below
/some/where. But pygrub fails because it can not find the python
site-packages. Is there a clean way to automate something like this?
diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index 7759b1a..4134082 100644
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -14,6 +14,7 @@
#
import os, sys, string, struct, tempfile, re, traceback
+sys.path.insert(0, "/some/where/lib64/python2.6/site-packages")
import errno
import copy
import logging
Olaf
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: prefix and python site-packages
2014-04-23 8:21 prefix and python site-packages Olaf Hering
@ 2014-04-23 9:06 ` Ian Campbell
2014-04-23 9:33 ` Olaf Hering
2014-04-24 10:55 ` Ian Jackson
1 sibling, 1 reply; 7+ messages in thread
From: Ian Campbell @ 2014-04-23 9:06 UTC (permalink / raw)
To: Olaf Hering; +Cc: ian.jackson, xen-devel
On Wed, 2014-04-23 at 10:21 +0200, Olaf Hering wrote:
> configure --prefix=/some/where puts pygrub and xen/lowlevel/xc.so below
> /some/where. But pygrub fails because it can not find the python
> site-packages. Is there a clean way to automate something like this?
Is this https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=693721 ? I
suppose not quite.
I think if you are installing to a non-standard prefix then you might
expect to need to take manual action, like
editing /etc/python*/sitecustomize.py or setting $PYTHONPATH (this is
analogous to editing /etc/ld.so.conf or setting $LD_LIBRARY_PATH I
think).
I don't suppose python has an analogue of -rpath?
Ian.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: prefix and python site-packages
2014-04-23 9:06 ` Ian Campbell
@ 2014-04-23 9:33 ` Olaf Hering
2014-04-23 9:54 ` Ian Campbell
0 siblings, 1 reply; 7+ messages in thread
From: Olaf Hering @ 2014-04-23 9:33 UTC (permalink / raw)
To: Ian Campbell; +Cc: ian.jackson, xen-devel
On Wed, Apr 23, Ian Campbell wrote:
> I don't suppose python has an analogue of -rpath?
Looks like sys.path.insert() is the python way of rpath.
Would it be acceptable to tweak pygrub at install time and insert
something like the hack I had posted earlier? From what I have seen
pygrub is the only remaining binary using the xen.lowlevel stuff.
Olaf
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: prefix and python site-packages
2014-04-23 9:33 ` Olaf Hering
@ 2014-04-23 9:54 ` Ian Campbell
2014-04-23 10:05 ` Olaf Hering
0 siblings, 1 reply; 7+ messages in thread
From: Ian Campbell @ 2014-04-23 9:54 UTC (permalink / raw)
To: Olaf Hering; +Cc: ian.jackson, xen-devel
On Wed, 2014-04-23 at 11:33 +0200, Olaf Hering wrote:
> On Wed, Apr 23, Ian Campbell wrote:
>
> > I don't suppose python has an analogue of -rpath?
>
> Looks like sys.path.insert() is the python way of rpath.
> Would it be acceptable to tweak pygrub at install time and insert
> something like the hack I had posted earlier?
Does Python distutils (used by tools/pygrub/setup.py) not have any
support for doing this sort of thing automatically?
> From what I have seen
> pygrub is the only remaining binary using the xen.lowlevel stuff.
It only uses it to decide if the hypervisor supports 64 bit PV guests.
Since the we no longer have a 32-bit hypervisor perhaps we can just nuke
that check and sidestep the whole problem?
Ian.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: prefix and python site-packages
2014-04-23 9:54 ` Ian Campbell
@ 2014-04-23 10:05 ` Olaf Hering
2014-04-23 10:08 ` Ian Campbell
0 siblings, 1 reply; 7+ messages in thread
From: Olaf Hering @ 2014-04-23 10:05 UTC (permalink / raw)
To: Ian Campbell; +Cc: ian.jackson, xen-devel
On Wed, Apr 23, Ian Campbell wrote:
> On Wed, 2014-04-23 at 11:33 +0200, Olaf Hering wrote:
> > On Wed, Apr 23, Ian Campbell wrote:
> >
> > > I don't suppose python has an analogue of -rpath?
> >
> > Looks like sys.path.insert() is the python way of rpath.
> > Would it be acceptable to tweak pygrub at install time and insert
> > something like the hack I had posted earlier?
>
> Does Python distutils (used by tools/pygrub/setup.py) not have any
> support for doing this sort of thing automatically?
I have to check.
But how would pygrub, or any other helloworld.py, know that it was
installed into --prefix= and its libs/modules are also in --prefix=? I
think something has to be hardcoded, unless PYTHONPATH or simimar is
used to point to a specific --prefix=.
> > From what I have seen
> > pygrub is the only remaining binary using the xen.lowlevel stuff.
>
> It only uses it to decide if the hypervisor supports 64 bit PV guests.
> Since the we no longer have a 32-bit hypervisor perhaps we can just nuke
> that check and sidestep the whole problem?
It also uses fsimage and grub.*, which is also installed below --prefix=
Olaf
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: prefix and python site-packages
2014-04-23 10:05 ` Olaf Hering
@ 2014-04-23 10:08 ` Ian Campbell
0 siblings, 0 replies; 7+ messages in thread
From: Ian Campbell @ 2014-04-23 10:08 UTC (permalink / raw)
To: Olaf Hering; +Cc: ian.jackson, xen-devel
On Wed, 2014-04-23 at 12:05 +0200, Olaf Hering wrote:
> On Wed, Apr 23, Ian Campbell wrote:
>
> > On Wed, 2014-04-23 at 11:33 +0200, Olaf Hering wrote:
> > > On Wed, Apr 23, Ian Campbell wrote:
> > >
> > > > I don't suppose python has an analogue of -rpath?
> > >
> > > Looks like sys.path.insert() is the python way of rpath.
> > > Would it be acceptable to tweak pygrub at install time and insert
> > > something like the hack I had posted earlier?
> >
> > Does Python distutils (used by tools/pygrub/setup.py) not have any
> > support for doing this sort of thing automatically?
>
> I have to check.
> But how would pygrub, or any other helloworld.py, know that it was
> installed into --prefix= and its libs/modules are also in --prefix=? I
> think something has to be hardcoded, unless PYTHONPATH or simimar is
> used to point to a specific --prefix=.
setuyp.py is the thing which does all of this installing, so it knows
where everything is going. It presumably also knows the default python
path.
How does this work for every other python library/application out there?
I can't imagine we are special here.
> > > From what I have seen
> > > pygrub is the only remaining binary using the xen.lowlevel stuff.
> >
> > It only uses it to decide if the hypervisor supports 64 bit PV guests.
> > Since the we no longer have a 32-bit hypervisor perhaps we can just nuke
> > that check and sidestep the whole problem?
>
> It also uses fsimage and grub.*, which is also installed below --prefix=
OK, I only looked at xen.lowlevel since that was what you mentioned.
Ian.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: prefix and python site-packages
2014-04-23 8:21 prefix and python site-packages Olaf Hering
2014-04-23 9:06 ` Ian Campbell
@ 2014-04-24 10:55 ` Ian Jackson
1 sibling, 0 replies; 7+ messages in thread
From: Ian Jackson @ 2014-04-24 10:55 UTC (permalink / raw)
To: Olaf Hering; +Cc: ian.campbell, xen-devel
Olaf Hering writes ("prefix and python site-packages"):
> configure --prefix=/some/where puts pygrub and xen/lowlevel/xc.so below
> /some/where. But pygrub fails because it can not find the python
> site-packages. Is there a clean way to automate something like this?
I think normally --prefix should refer to somewhere where your python
will look for packages.
If it doesn't, computing the correct path to use is going to be
complicated I think.
Ian.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-04-24 10:55 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-23 8:21 prefix and python site-packages Olaf Hering
2014-04-23 9:06 ` Ian Campbell
2014-04-23 9:33 ` Olaf Hering
2014-04-23 9:54 ` Ian Campbell
2014-04-23 10:05 ` Olaf Hering
2014-04-23 10:08 ` Ian Campbell
2014-04-24 10:55 ` Ian Jackson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.