Opened 12 years ago

Closed 3 years ago

#37256 closed defect (fixed)

gobject-introspection: building non-universal i386 fails when python27 is installed universal i386 x86_64

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: dbevans (David B. Evans)
Priority: Low Milestone:
Component: ports Version: 2.1.2
Keywords: Cc: cooljeanius (Eric Gallager)
Port: gobject-introspection

Description

This one's interesting. Installing gobject-introspection without the universal variant fails when build_arch is i386 (i.e. on Leopard, presumably on Tiger too) on a 64-bit Mac if python27 is already installed universal for i386 and x86_64. (I changed my universal_archs to this in macports.conf.) The error message is:

Traceback (most recent call last):
  File "./g-ir-scanner", line 44, in <module>
    from giscanner.scannermain import scanner_main
  File "./giscanner/scannermain.py", line 34, in <module>
    from giscanner.dumper import compile_introspection_binary
  File "./giscanner/dumper.py", line 28, in <module>
    from .gdumpparser import IntrospectionBinary
  File "./giscanner/gdumpparser.py", line 31, in <module>
    from .transformer import TransformerException
  File "./giscanner/transformer.py", line 27, in <module>
    from .girparser import GIRParser
  File "./giscanner/girparser.py", line 26, in <module>
    from .girwriter import COMPATIBLE_GIR_VERSION
  File "./giscanner/girwriter.py", line 25, in <module>
    from .xmlwriter import XMLWriter
  File "./giscanner/xmlwriter.py", line 74, in <module>
    from _giscanner import collect_attributes
  File "./giscanner/libtoolimporter.py", line 66, in load_module
    mod = imp.load_module(name, open(realpath), realpath, (extension, 'rb', 3))
ImportError: dlopen(./.libs/_giscanner.so, 2): no suitable image found.  Did find:
	./.libs/_giscanner.so: mach-o, but wrong architecture
make[2]: *** [GLib-2.0.gir] Error 1

The problem is that 64-bit is considered better than 32-bit so python27 runs 64-bit, then is surprised when it cannot find a 64-bit _giscanner.so. The workaround I used was to install gobject-introspection universal as well.

Perhaps it's an esoteric case, since most users aren't on Leopard anymore and most of those that are haven't changed their universal_archs, but I wanted to at least document the problem and the workaround.

Change History (3)

comment:1 Changed 12 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:2 Changed 4 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to dbevans
Status: newassigned

comment:3 Changed 3 years ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: assignedclosed

Let us know if this is still an issue, after updating to the latest version (1.70.0).

Note: See TracTickets for help on using tickets.