Re: [Distutils] How to make easy_install handle platlibs?

At 10:43 AM 4/12/2009 -0700, Buck Golemon wrote:
On Sun, Apr 12, 2009 at 8:54 AM, Andrew Straw <<mailto:strawman@astraw.com>strawman@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.
On OS X, there's a similar thing done to get the platform name/version, and there's special version comparison code to determine compatibility; if this could be implemented for other platforms, that would be great.
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.
For easy_install, yes. For pip, probably not so much. In fact, my guess would be that pip already supports this, as long as you can install from source, rather than from eggs.

On Apr 12, 12:46 pm, "P.J. Eby" <p...@telecommunity.com> wrote:
On Sun, Apr 12, 2009 at 8:54 AM, Andrew Straw <<mailto:straw...@astraw.com>straw...@astraw.com> wrote: 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.
For easy_install, yes. For pip, probably not so much. In fact, my guess would be that pip already supports this, as long as you can install from source, rather than from eggs.
Are you saying I should dump easy_install in favor of pip? I hadn't heard of it till now.
participants (2)
-
Buck
-
P.J. Eby