Opened 15 years ago

Closed 15 years ago

#21316 closed defect (fixed)

Failing to build py2app apps due to macholib error

Reported by: dmitrykichenko@… Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 1.8.0
Keywords: LP64 Cc: torsten@…, xbenlau@…
Port: py26-macholib

Description

Building apps with py2app fails on Snow Leopard with MacPorts' python26 and both py26-py2app and py26-py2app-devel (and the latest SVN checkout too). The problem appears to be with macholib.

I have tried compiling all ports with a +universal flag. Everything compiles without issue, except for when compiling a universal build where apr fails to build as a 64-bit binary but everything else builds just fine. The issue crops up with my own apps as well as a dummy app and a one-line setup.py.

Here is the traceback for when attempting to build an app:

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-0.4.2-py2.6.egg/py2app/build_app.py", line 589, in _run
    self.run_normal()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-0.4.2-py2.6.egg/py2app/build_app.py", line 660, in run_normal
    self.create_binaries(py_files, pkgdirs, extensions, loader_files)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/py2app-0.4.2-py2.6.egg/py2app/build_app.py", line 768, in create_binaries
    mm.mm.run_file(runtime)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/macholib/MachOGraph.py", line 66, in run_file
    m = self.createNode(MachO, pathname)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/macholib/MachOStandalone.py", line 23, in createNode
    res = super(FilteredMachOGraph, self).createNode(cls, name)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/altgraph/ObjectGraph.py", line 148, in createNode
    m = cls(name, *args, **kw)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/macholib/MachO.py", line 63, in __init__
    self.load(file(filename, 'rb'))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/macholib/MachO.py", line 78, in load
    self.load_header(fh, 0, size)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/macholib/MachO.py", line 108, in load_header
    hdr = MachOHeader(self, fh, offset, size, magic, hdr, endian)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/macholib/MachO.py", line 148, in __init__
    self.load(fh)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/macholib/MachO.py", line 161, in load
    header = self.mach_header.from_fileobj(fh, **kw)

File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/macholib/ptypes.py", line 44, in from_fileobj
    return cls.from_str(f.read(cls._size_), **kw)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/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 32

Change History (5)

comment:1 Changed 15 years ago by jmroot (Joshua Root)

Keywords: LP64 added; SnowLeopard py2app macholib python26 removed
Owner: changed from macports-tickets@… to jmr@…
Port: py26-macholib added; py2app removed

Looks like an upstream issue to me.

comment:2 Changed 15 years ago by jmroot (Joshua Root)

Does py26-py2app 0.4.2 with py26-macholib 1.2.1 work correctly?

comment:3 Changed 15 years ago by torsten@…

Cc: torsten@… added

Cc Me!

comment:4 Changed 15 years ago by xbenlau@…

Cc: xbenlau@… added

Cc Me!

comment:5 Changed 15 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.