ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pyxpcom
pyxpcom
Re: [pyxpcom] pyxpcom on mac, anyone?
by Trent Mick other posts by this author
Aug 19 2005 10:51AM messages near this date
view in the new Beta List Site
Re: [pyxpcom] pyxpcom on mac, anyone? | Re: [pyxpcom] pyxpcom on mac, anyone?
[Brendan O'Connor wrote]
>  Thanks for all the help!  I finally got it working, but weirdly, it
>  came down to how python's shared library loader works on OS X.
>  
>  A default python build on OS X uses Python/dynload_next.c (as in
>  NeXT), which knows how to load shared libraries that are "bundles". 
>  This loader is what fails to load _xpcom.so / lib_xpcom.dylib and
>  throws the ImportError, "Inappropriate file type for dynamic loading".
>   From what I gather from some apple docs, the functions used in
>  dynload_next.c can only load bundles, and but not load normal shared
>  libraries.  I can't believe this is right, since my dynload_next built
>  python uses all sorts of swig-wrapped shared libraries that don't look
>  like bundles, but whatever, it doesn't work for pyxpcom's shared
>  libraries.

Our custom Python build (the same ActivePython package that we build)
uses dynload_next.c as well.


>  Apple's build of python uses the library loader
>  Python/dynload_shlib.c, the standard unix-y one.  (Thank god for the
>  saved lib/python2.3/config/Makefile !)  If I build my own python using
>  that one via DYNLOADFILE=dynload_shlib.o, I can load _xpcom.so just
>  fine, and run the pyxpcomxul test extension!

Are you sure? The system Python on Panther (10.3) seems to use
dynload_next
    
    # /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/Makefile
    # line 157
    ...
    DYNLOADFILE=    dynload_next.o
    ...

Whoa, interesting, the system Python 2.3 build for Tiger (10.4) switched
to dynload_shlib.
    
    DYNLOADFILE=    dynload_shlib.o

However, the Python 2.4 distro from the MacPython guys uses
dynload_next.o. I couldn't find any relevant discussion from some quick
searching.
    

>  No one else has ever run into this thing?  I feel like I just spent a
>  ton of time with the most obscure problems ever..

PyXPCOM is working for us on Mac OS X (both on Panther and Tiger) using
dynload_next.o and Python 2.4. You seem to be using Python 2.3. Perhaps
there is something in that.

Trent

-- 
Trent Mick
TrentM@[...].com
_______________________________________________
pyxpcom mailing list
pyxpcom@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Brendan O'Connor
Shane Caraveo
Brendan O'Connor
Shane Caraveo
Trent Mick
Brendan O'Connor
Trent Mick
Brendan O'Connor
Brendan O'Connor

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved