[Pythonmac-SIG] building bundles with setuptools, py2app, 64-bit python 2.6

Michael VanLandingham m.vanland at gmail.com
Mon Aug 25 23:15:41 CEST 2008


Finally getting back to this...
So I built and installed setuptools from the 0.6 branch, which got me  
further, but now I get this macholib error (below) during py2app's  
linking phase.  Any way around this or clues as to what it is?   I  
don't see this error if I use the 32-bit python, just the 64 / 4-way  
fat.

Another thing I'm seeing is that running setup.py py2app on my plugin  
w/ the 64-bit python and PyObjC is that it pulls in the 'whole world',  
OpenGL, documentation, everything.  Running the same thing with the  
system Python doesn't do this.  Consequently the resulting plugin  
bundle is too big and it takes much longer to build.

Finally, doing 'lipo -info python2.6-64' suggests that the python-64  
binary isn't just 64-bit, it's 4-way.  Is that intentional?

Thanks again,
Michael



linking /Volumes/max/Sandbox/workshop/PyTestBundle/dist/ 
PyTester.plugin/Contents/Frameworks/Python64.framework/Versions/ 
Current -> 2.6
Traceback (most recent call last):
   File "/Volumes/max/Sandbox/pyobjc_public/pyobjc/py2app/py2app/ 
build_app.py", line 579, in _run
     self.run_normal()
   File "/Volumes/max/Sandbox/pyobjc_public/pyobjc/py2app/py2app/ 
build_app.py", line 650, in run_normal
     self.create_binaries(py_files, pkgdirs, extensions, loader_files)
   File "/Volumes/max/Sandbox/pyobjc_public/pyobjc/py2app/py2app/ 
build_app.py", line 758, in create_binaries
     mm.mm.run_file(runtime)
   File "/Volumes/max/Sandbox/pyobjc_public/pyobjc/macholib/macholib/ 
MachOGraph.py", line 66, in run_file
     m = self.createNode(MachO, pathname)
   File "/Volumes/max/Sandbox/pyobjc_public/pyobjc/macholib/macholib/ 
MachOStandalone.py", line 23, in createNode
     res = super(FilteredMachOGraph, self).createNode(cls, name)
   File "/Volumes/max/Sandbox/pyobjc_public/pyobjc/altgraph/altgraph/ 
ObjectGraph.py", line 148, in createNode
     m = cls(name, *args, **kw)
   File "/Volumes/max/Sandbox/pyobjc_public/pyobjc/macholib/macholib/ 
MachO.py", line 63, in __init__
     self.load(file(filename, 'rb'))
   File "/Volumes/max/Sandbox/pyobjc_public/pyobjc/macholib/macholib/ 
MachO.py", line 73, in load
     self.load_fat(fh)
   File "/Volumes/max/Sandbox/pyobjc_public/pyobjc/macholib/macholib/ 
MachO.py", line 81, in load_fat
     self.fat = fat_header.from_fileobj(fh)
   File "/Volumes/max/Sandbox/pyobjc_public/pyobjc/macholib/macholib/ 
ptypes.py", line 44, in from_fileobj
     return cls.from_str(f.read(cls._size_), **kw)
   File "/Volumes/max/Sandbox/pyobjc_public/pyobjc/macholib/macholib/ 
ptypes.py", line 48, in from_str
     return cls.from_tuple(struct.unpack(endian + cls._format_, s),  
**kw)
error: unpack requires a string argument of length 8
 > /Volumes/max/Sandbox/pyobjc_public/pyobjc/macholib/macholib/ 
ptypes.py(48)from_str()
-> return cls.from_tuple(struct.unpack(endian + cls._format_, s), **kw)
(Pdb)



On Aug 21, 2008, at 4:02 AM, Ronald Oussoren wrote:
>
> On 20 Aug, 2008, at 5:05, Michael VanLandingham wrote:
>> I recently built a Python64.framework & interpreter from the 2.6  
>> sources (using Ronald O's recently recommended build settings), and  
>> then build PyObjC.   Because I got an error running PyObjC's build  
>> script, (setup tries to pull down an URL that's non-existent:  http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c8-py2.6.egg) 
>> , I built and installed setuptools from svn.python.org with/for my  
>> 4-way fat python build.
>>
>> I need to create 64-bit compatible versions of some PyObjC bundles  
>> that we're using.  However, when I tried to use it, like this:
>>
>> $ /usr/local/python64 setup.py py2app
>>
>> I got the error below.  Which points to what looks like a problem  
>> in setuptools.  Can anyone offer any advice here?   Maybe I need a  
>> less cutting edge version of setuptools?
>> Is anyone using 64-bit python, PyObjC to build 64-bit or 4-way fat  
>> apps or plugin bundles, and if so, how?
>
> There might be issues with py2app and setuptools 0.7 (the trunk of  
> setuptools), the 0.6 branch of setuptools should work fine.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20080825/2f1b9281/attachment.htm>


More information about the Pythonmac-SIG mailing list