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
[pyxpcom] libpyloader and @executable_path
by Philip Semanchuk other posts by this author
Jun 11 2008 1:16PM messages near this date
view in the new Beta List Site
Re: [pyxpcom] Python Mozilla extension (pyxpcomext) updated | Re: [pyxpcom] libpyloader and @executable_path
Hi all,
I'm having an OS X-specific problem with libpyloader. I have a crude  
solution and I'm hoping that someone can shed some light on how  
libpyloader and other libraries like, say, libxpcom are loaded so that  
I can find an elegant solution.

My problem is that my simple Python component fails because  
libpyloader won't load. I'm 95% sure the reason is because  
libpyloader's references to other modules are based on  
@executable_path, e.g. --

    @executable_path/libxpcom.dylib (compatibility version 1.0.0,  
current version 1.0.0)
    @executable_path/XUL (compatibility version 1.0.0, current version  
1.0.0)
    @executable_path/libplds4.dylib (compatibility version 1.0.0,  
current version 1.0.0)
    @executable_path/libplc4.dylib (compatibility version 1.0.0,  
current version 1.0.0)
    @executable_path/libnspr4.dylib (compatibility version 1.0.0,  
current version 1.0.0)


When I invoke my app via Finder, @executable_path = ~/MyApp.app/ 
Contents/MacOS/ and so it is not surprising that these references fail.

The crude solution is to copy /Library/Frameworks/XUL.framework/ 
Versions/Current to ~/MyApp.app/Contents/MacOS/. A nicer solution that  
I think would work (haven't tried it yet) is to use install_name_tool  
to alter the references in libpyloader to this:
    @executable_path/../Frameworks/XUL.framework/Versions/Current/ 
foo.dylib

Which would still require me to make a copy of the XUL framework but  
at least I could put it in a reasonable place inside my app bundle.

What mystifies me is that I also notice that other libraries  
(libxpcom.dylib for example) refer to their subcomponents with  
@executable_path and don't have the same problem as libpyloader on my  
system. I thought that if I could understand why they load properly I  
could maybe get libpyloader to do the same. Any hints/suggestions on  
this topic would be much appreciated.

THanks


PS - I found a similar posting by Scott Robertson here:
http://aspn.activestate.com/ASPN/Mail/Message/pyxpcom/3412662




_______________________________________________
pyxpcom mailing list
pyxpcom@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Philip Semanchuk
Atul Varma
Philip Semanchuk
Atul Varma
Shane Caraveo
Philip Semanchuk

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