Marc-Andre Lemburg <m...@egenix.com> added the comment: Stef Walter wrote: > > New submission from Stef Walter <s...@memberwebs.com>: > > In Lib/distutils/util.py in the get_platform() function there's OS > specific code to create a string which describes the current platform. > This usually includes the OS + version + arch. > > FreeBSD specific code is missing from this function. Currently > get_platform() returns a string specific to the security patch level of > freebsd. For example: > > freebsd-7.2-RELEASE-p3-i386 > > This results in eggs that only work on a specific patch level release of > FreeBSD and are not portable between (for example) 7.2-RELEASE-p2 and > 7.2-RELEASE-p3. > > However FreeBSD is actually binary compatible within a major version > number. For example 7.1 and 7.2 are binary compatible. > > This patch adds freebsd specific code to get_platform() after which it > will return a string like: > > freebsd-7-i386
I think this is more a problem with easy_install than with distutils itself. get_platform() is meant to return a platform string, nothing more, nothing less. It is more meant for human consumption than for scripts to use as basis for checking whether a particular platform is binary compatible to what the user wants to install a distribution archive to. What we could do is provide a new distutils API binary_compatible_platform() which takes the platform string as used in the distribution archive and compares it to the one returned by distutils on the target system. Note that there are various level of compatibility to consider here: * whether the ABI is the same (binary compatible) * whether the code is 32-bit and needs to run on a 64-bit system * whether the typically installed software base is the same * whether the target system provides a compatibility layer which can be used or not * whether the distribution provides code for more than one platform (e.g. Mac universal builds), so that it'll run on more than just one architecture It is usually easier for the user to decide by looking at the file name whether a certain package is suitable or not than to have some script know about all the differences between the various OS versions. Some examples for get_platform() strings which are in fact compatible: darwin-8.11.0-Power_Macintosh (the Python 2.3 way) macosx-10.4-fat (the Python 2.5+ way) macosx-10.4-ppc (actually "fat", but not identified as such due to a bug in distutils for Python 2.4) Aside: For eGenix we have decided to simply drop the get_platform() check in our prebuilt archives altogether - there are just too many dimensions to the problem. Instead, we use the sys.platform variable which provides a much more practical (though, not perfect) solution to the problem of detecting incompatibilities early on in the installation process. ---------- nosy: +lemburg _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6983> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com