code-google-com / pyv8

Automatically exported from code.google.com/p/pyv8
0 stars 0 forks source link

setup.py incorrectly determine Python mode - x32 or x64 #93

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Just try to build PyV8 (trunk) for Python x32 under any x64 OS. (e.g. for 
standard bundled Python 2.5.4 which is x32 under MacOs 10.6.x which is x64)

What is the expected output? What do you see instead?
Build fails.

What version of the product are you using? On what operating system?
PyV8 from trunk
any Python 2.x.x. x32
MacOs 10.6.7 x64 

Please provide any additional information below.
Setup.py uses platform.architecture()[0] which always returns '64bit' 
independently of whether Python x32 or x64. This is because 
platform.architecture()[0] returns type of OS, which is always x64.

Python bits mode can be determined by the folowing code:
import sys
print sys.maxint

2147483647 will be printed for x32
9223372036854775807 will be printed for x64

(math.ceil(math.log(sys.maxint, 2)) + 1) expression also may be used, it 
returns int=32|64

BTW. Can I commit the fix by myself if you accept the bug?

Original issue reported on code.google.com by viy....@gmail.com on 1 Jul 2011 at 9:34

GoogleCodeExporter commented 9 years ago
Thanks, fixed with PyV8 SVN trunk after r385

Original comment by flier...@gmail.com on 15 Jul 2011 at 3:43