[Distutils] How to make easy_install handle platlibs?

Buck Golemon workitharder at gmail.com
Sun Apr 12 19:43:12 CEST 2009


On Sun, Apr 12, 2009 at 8:54 AM, Andrew Straw <strawman at astraw.com> wrote:

> zooko wrote:
> > However, it currently doesn't.  Eggs built on Linux are named something
> > like py2.5-Linux-x86_64.  To know whether such an egg would actually
> > work on your Linux system, you would also need to know whether the
> > Python was compiled with UCS-2 or UCS-4 internal unicode representation,
> > as well as what version of glibc you have.  Is there anything else that
> > would need to be added into the egg name?
>
> Yes, if you used symbols from any shared library in an extension module,
> you'd need to know the version of that shared library. So it's not just
> libc. This is the same on any OS, not just linux.
>
> -Andrew
>

Exactly. The platform name/version ( RedHat 3 / Ubuntu 7.07 / Gentoo X.X )
can serve as a much better proxy for the "version of all shared libraries"
than just the kernel version alone (2.4 / 2.6).

To add to Andrew's example, python-ldap created for Redhat 4 depends on
ldap_r.so.1.0.4 but for RedHat 5 depends on ldap_r.so.1.0.6. Both have
kernel 2.6, so are indistinguishable under current naming scheme.

I notice that for Debian/Ubuntu the lsb_release command is implemented in
Python, although it's mostly just reading out /etc/debian_version. RedHat's
lsb_release uses bash, but similarly just reads in a file. Gentoo also has a
lsb_release.

The "completely correct" way to do this would be to run ldd on all binaries,
stick the result in a metadata file somewhere, then load the version of the
egg where the most (hopefully all) libraries exist.

On the other hand, sticking the egg into the place that distutils uses when
not under easy_install would fix this much more simply, although from what I
hear this would be a big change.

-- 
Buck Golemon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20090412/daa0266f/attachment.htm>


More information about the Distutils-SIG mailing list