Thread: [Pyobjc-dev] Unable to compile universal binary for non-leopard macs
Brought to you by:
ronaldoussoren
|
From: Bruce L. <lic...@gm...> - 2008-01-29 22:02:01
|
Hello, I have written a simple program which has been a pain to compile properly; that is to say, when using x-code it compiles to a small (500 kB) not self-contained application that crashes on opening on every system that does not have pyobjc installed. I have gotten it to work stably on two systems running Leopard and pyobjc, and figured out how to get a setup-file to create what should be a universal binary (now ~12 MB). Unfortunately, it fails to open on 10.4 systems, raising an error about _class_addIvar being missing after being called by _objc.so (dynamically). The only reference I have found for the _class_addIvar related to 10.4 and pyobjc is the objc-runtime-compat.h file. I don't know how to either force this file to be compiled with the program or properly change my objc function calls. I tried the recommendation in the header, but unfortunately, for some reason, this brings up an error related to the undefined nature of PyObjC_ functions. I suspect that my pyobjc installation is incomplete (particularly since I have no PyObjC folder created after the installation ends -- attempting to use the python setup.py bdist_mpkg --open command brings up the same 'ValueError: group admin not found' on both of my computers before it terminates. The sh install file seems to work (with large numbers of errors (on an Intel iMac) or failures (on a PowerBook)) and has gotten me this far... Any and all help will be appreciated, Bruce Lichtenstein |
|
From: Bruce L. <lic...@gm...> - 2008-01-30 00:31:17
|
I would like to clarify... The error from attempting to use the package building command is actually due to the fact that there is no longer a /usr/bin/nidump (sh cannot find it). On Jan 29, 2008 5:02 PM, Bruce Lichtenstein <lic...@gm...> wrote: > Hello, > I have written a simple program which has been a pain to compile properly; > that is to say, when using x-code it compiles to a small (500 kB) not > self-contained application that crashes on opening on every system that does > not have pyobjc installed. I have gotten it to work stably on two systems > running Leopard and pyobjc, and figured out how to get a setup-file to > create what should be a universal binary (now ~12 MB). Unfortunately, it > fails to open on 10.4 systems, raising an error about _class_addIvar being > missing after being called by _objc.so (dynamically). > > The only reference I have found for the _class_addIvar related to 10.4 and > pyobjc is the objc-runtime-compat.h file. I don't know how to either force > this file to be compiled with the program or properly change my objc > function calls. I tried the recommendation in the header, but unfortunately, > for some reason, this brings up an error related to the undefined nature of > PyObjC_ functions. > > I suspect that my pyobjc installation is incomplete (particularly since I > have no PyObjC folder created after the installation ends -- attempting to > use the python setup.py bdist_mpkg --open command brings up the same > 'ValueError: group admin not found' on both of my computers before it > terminates. The sh install file seems to work (with large numbers of errors > (on an Intel iMac) or failures (on a PowerBook)) and has gotten me this > far... > > Any and all help will be appreciated, > > Bruce Lichtenstein > |
|
From: Bruce L. <lic...@gm...> - 2008-01-30 04:14:28
|
Sorry to flood the list with my comments...
I fixed the sh /usr/bin/nidump problem for installing via a binary
package by re-downloading the source code for the bdist_mpkg package
and modifying the tools.py code as follows:
in the get_gid method
replace:
for line in os.popen('/usr/bin/nidump group .'):
fields = line.split(':')
if len(fields) >= 3:
_cache[fields[0]] = int(fields[2])
with:
for line in os.popen('dscl . -list /Groups PrimaryGroupID'):
fields = (line.split(' ',1))
fields[0].strip()
fields[1].strip()
if len(fields) == 2:
_cache[fields[0]] = int(fields[1])
i am not sure if this fix is already out there...
I still haven't been able to get a fully self-contained program, so
any help will still be appreciated...
Thanks,
Bruce
|
|
From: Ronald O. <ron...@ma...> - 2008-01-30 19:52:21
Attachments:
smime.p7s
|
On 30 Jan, 2008, at 4:24, Bruce Lichtenstein wrote:
> Sorry to flood the list with my comments...
>
>
> I fixed the sh /usr/bin/nidump problem for installing via a binary
> package by re-downloading the source code for the bdist_mpkg package
> and modifying the tools.py code as follows:
"easy_install bdist_mpkg==dev" should also work. Bob commited a fix
for this a while back, I commited a better fix more recently (using
the 'grp' module instead of running a commandline tool).
Ronald
>
>
> in the get_gid method
>
> replace:
> for line in os.popen('/usr/bin/nidump group .'):
> fields = line.split(':')
> if len(fields) >= 3:
> _cache[fields[0]] = int(fields[2])
>
>
>
> with:
>
> for line in os.popen('dscl . -list /Groups PrimaryGroupID'):
> fields = (line.split(' ',1))
> fields[0].strip()
> fields[1].strip()
> if len(fields) == 2:
> _cache[fields[0]] = int(fields[1])
>
> i am not sure if this fix is already out there...
>
> I still haven't been able to get a fully self-contained program, so
> any help will still be appreciated...
>
>
> Thanks,
>
> Bruce
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Pyobjc-dev mailing list
> Pyo...@li...
> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
|
|
From: Bruce L. <lic...@gm...> - 2008-01-31 04:47:15
|
Ronald, Thanks for the response. It seems I am still not able to avoid getting the _class_addIvar is missing error when attempting to run my program on Tiger. Is this method called by the objc.ivar() method? Is there a way to compile or otherwise force this _class_addIvar method into the final standalone application? It would seem this would be a common problem, no? Is there something I am not doing? Thanks, Bruce |
|
From: Bruce L. <lic...@gm...> - 2008-02-03 07:07:15
|
Ronald, Thanks again for the info again. I still cannot find a way to get my program compile on Leopard to run on Tiger. The program either crashes or gives the same error about being unable to find class_addIvar referenced in the _objc.so file. As far as I know I have made no specific calls to the class_addIvar method, unless objc.ivar() calls it. Is there a way for me to make a program that uses objc.ivar() backwards compatible? Thanks, Bruce |
|
From: Ronald O. <ron...@ma...> - 2008-02-03 13:05:19
Attachments:
smime.p7s
|
On 3 Feb, 2008, at 8:07, Bruce Lichtenstein wrote: > Ronald, > > Thanks again for the info again. > > I still cannot find a way to get my program compile on Leopard to run > on Tiger. The program either crashes or gives the same error about > being unable to find class_addIvar referenced in the _objc.so file. As > far as I know I have made no specific calls to the class_addIvar > method, unless objc.ivar() calls it. Is there a way for me to make a > program that uses objc.ivar() backwards compatible? class_addIvar shouldn't be used on Leopard, appearently the objc-core module isn't Tiger safe yet. There should be a backward compatibility layer for the objective-C 2.0 runtime API in Modules/objc/objc-runtime- compat.[hm], but for some reason that isn't used in your program. Ronald |