[Distutils] A change to how platform name is generated for binary distributions?
ronaldoussoren at mac.com
Wed Apr 1 00:21:50 CEST 2009
On 31 Mar, 2009, at 16:13, Dave Peterson wrote:
> We're starting to try and distribute some pre-built binaries on
> Solaris and have come across an issue with how pkg_resources /
> distutils generates the platform specification when the distribution
> includes Python extensions.
> In particular, we'd like to distribute both x86 and amd64 (or
> x86_64) binaries for Solaris on Intel since the OS can run in either
> mode, but all our egg distributions get the same file name no matter
> what architecture they're actually built for. Diving into how the
> platform part of a distribution name gets generated, I find that it
> relies on the results of 'os.uname' via
> distutils.util.get_platform(). This seems like it would cause
> problems on more than just Solaris as it should also happen anytime
> someone is using a 32-bit Python on a 64-bit OS/CPU, no?
One option for this is to patch pkg_resources.get_build_platform
(although IMHO it would be better to fix this in distutils itself).
There's currently some logic for OSX, it should be possible to add
some more code for solaris that sets the rigth architecture based on
the detected architecture and sys.maxint (if uname claims your on an
x86 style CPU and sys.maxint is (much) larger than 2**32 you're on a
x86_64 system and otherwise you're on a x86/i386 system).
Distutils tries to do this automaticly on OSX, based on the compiler
flags that are used to build binaries.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2224 bytes
Desc: not available
More information about the Distutils-SIG