Issues with multi-arch PYTHONPATH

View: New views
3 Messages — Rating Filter:   Alert me  

Issues with multi-arch PYTHONPATH

by Clint Olsen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm trying to install Hg on two different flavors of Linux (one 64-bit
and the other 32-bit).  This is a local installation in my private bin
directory.  The issue is that I cannot get the 64 and 32-bit builds to
co-exist even though the build areas have the architecture-specific
information in them:

~/ftp/mercurial-1.3.1/build% ls
lib.linux-i686-2.6/  lib.linux-x86_64-2.6/  scripts-2.6/
temp.linux-i686-2.6/  temp.linux-x86_64-2.6/

However, when I look in my python lib directory, I only get one egg file:

 ~/lib/python2.6/site-packages% ls
hgext/  mercurial/  mercurial-1.3.1-py2.6.egg-info

How am I supposed to fix this?

-Clint
_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial

Re: Issues with multi-arch PYTHONPATH

by Greg Ward-17 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Nov 3, 2009 at 8:34 PM, Clint Olsen <clint.olsen@...> wrote:
> I'm trying to install Hg on two different flavors of Linux (one 64-bit
> and the other 32-bit).  This is a local installation in my private bin
> directory.  The issue is that I cannot get the 64 and 32-bit builds to
> co-exist even though the build areas have the architecture-specific
> information in them:
>
> ~/ftp/mercurial-1.3.1/build% ls
> lib.linux-i686-2.6/  lib.linux-x86_64-2.6/  scripts-2.6/
> temp.linux-i686-2.6/  temp.linux-x86_64-2.6/

Yayh!  At least that much about distutils works right!

> However, when I look in my python lib directory, I only get one egg file:
>
>  ~/lib/python2.6/site-packages% ls
> hgext/  mercurial/  mercurial-1.3.1-py2.6.egg-info
>
> How am I supposed to fix this?

Hmmm.  I think this is really a setuptools question, not a Mercurial
question.  I am not a setuptools expert, but I am a distutils expert
(albeit a bit out of practice).  So two ideas occur to me:

  * don't bother to install Mercurial; just run it out of the build
dir by putting /path/to/mercurial/build/lib.linux-$arch-2.6 in your
PYTHONPATH

  * don't use setuptools to install, but go straight to the distutils
layer and tell it exactly what you want:

      python setup.py install --install-lib ~/lib/python2.6-$arch

    and then set PYTHONPATH to ~/lib/python2.6-$arch

I'm rather surprised setuptools doesn't handle this correctly.  You
probably should go ask the setuptools maintainers what you're supposed
to do in this case.

Greg

_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial

Re: Issues with multi-arch PYTHONPATH

by Clint Olsen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Nov 4, 2009 at 1:52 PM, Greg Ward <greg-hg@...> wrote:

> Hmmm.  I think this is really a setuptools question, not a Mercurial
> question.  I am not a setuptools expert, but I am a distutils expert
> (albeit a bit out of practice).  So two ideas occur to me:
>
>  * don't bother to install Mercurial; just run it out of the build
> dir by putting /path/to/mercurial/build/lib.linux-$arch-2.6 in your
> PYTHONPATH
>
>  * don't use setuptools to install, but go straight to the distutils
> layer and tell it exactly what you want:
>
>      python setup.py install --install-lib ~/lib/python2.6-$arch
>
>    and then set PYTHONPATH to ~/lib/python2.6-$arch
>
> I'm rather surprised setuptools doesn't handle this correctly.  You
> probably should go ask the setuptools maintainers what you're supposed
> to do in this case.
>
> Greg

Hi:

I wasn't sure about the division of labor (setuptools vs. Mercurial -
that is foreign to me), so I went in and did surgery on the Makefile
to expose the --exec-prefix and similar arguments to "python setup.py
install ...".  This used to be exposed or it wasn't hidden by a
Makefile layer at one time.  I tried a mixture of the other switches
to control arch-specific information, but they wouldn't play together.
 I got some really cryptic error messages about combinations of
switches being invalid or incorrect configurations.  The entire
process sort of left me annoyed and disappointed, even though it may
not be Mercurial's fault.  But I did get it working using prefix as
$HOME and exec-prefix being $HOME/`uname -m`.

Like you mentioned, it would have been more attractive to me if the
arch-specifics were split down at the site-packages level or even at
$HOME/lib rather than at my home directory, but after awhile I just
got tired of fighting the damn thing and subscribed to the "git er
done" mentality.

Thanks,

-Clint

_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial