Ok, so I have a rubycocoa application with source freely available. So lets try to bootstrap it into MacRuby and see what happens. So first, lets copy the Xcode project file, since it seems like at this point there's no way to embed MacRuby directly so I'll have to tweak some settings in the project, and I don't want to have to undo them later when I go back to Rubycocoa. Or at least that's what I had to do last time. Let's make a new project in Xcode to get the settings I need since they don't seem to be documented in the Wiki. Hmmm... Making a new Ruby-Core Data application made what looks like a RubyCocoa app. Ah, there's a new thing called User Templates now. Must be a tweak because I'm using the iPhone SDK release of XCode. Ok, there's a Mac Ruby template project, loading that. Bringing up project settings to look for the settings... Hmmm... Don't see any. There were references to /usr/local last time I tried this. Well, lets run it and see what happens... No joy, can't find MacRuby/MacRuby.h Ok, the project template is broken. Maybe there's a developer example I can steal from instead. Trying DotView. Same problem. Ok, searching for the most recent xcoderproject version. Hmm. ABPresence looks newer. Nope, doesn't build either. Hmmm.. There's a MacRuby.framework listed in the project files, there didn't used to be. Trying to find it via locate.... no joy. Ok, ls /Library/Framework. I see it there. ls /Library/Framework/MacRuby/Framework Hmmm... I even see MacRuby.h: more /Library/Frameworks/MacRuby.framework/Headers/MacRuby.h #define RUBY_INCLUDED_AS_FRAMEWORK 1 #include "ruby/ruby.h" Hmm... Pretty short. Ok, so unlike the last time I tried, MacRuby is now just a framework to link against. Removing RubyCocoa.framework. Adding MacRuby.framework Opening the old main.m, saving it as main-mr.m, (which updates the project to point at the new file), editing it to call macruby_main. Hmmm... Same problem, never heard of MacRuby/MacRuby.h Well, I'll just comment out the import for now. Works in ABPresence, now lets try my app. ok, its building everything...I get a warning about macruby_main being implicitly defined, yadda, yadda. Running... Hmmm.... [Session started at 2008-03-31 09:46:42 -0700.] Assertion failed: (__auto_zone != NULL), function ruby_xmalloc, file gc.c, line 296. The Debugger has exited due to signal 6 (SIGABRT).The Debugger has exited due to signal 6 (SIGABRT). I'm guessing, but I bet that I have to turn GC on, because it has to be OFF for RubyCocoa, but ON for MacRuby. Someone should put a useful message on that assertion like "Hey dummy, turn on GC". Ok, changing that to "supported" Doesn't like Sparkle, because I built it without GC. Ok, turning that on and rebuilding Sparkle. Now where did I put that? Ah, there it is. Changing garb to supported. Hmm... Its grumping about osx/cocoa getting included in rb_main.rb. Ok, doing my save-as trick again. Ah, that doesn't work because I have to change main-mr.m as well. Hmm... More problems because I'm using OSX:: Hey, I'm being a dummy, I can just copy rb_main.rb from Address book. Ok, doing that, changing InstantMessage to CoreData. Sigh, another complaint on a different OSX.require_Framework. Let's try this hack: class OSX def OSX.require_framework(foo) framework foo end end before the requires. Ok, running... That seems to work. But now I get: [Session started at 2008-03-31 09:58:55 -0700.] /Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ Resources/rb_main-mr.rb:13: [BUG] unresolved bridgesupport constant `CFBinaryHeapCompareContext' not in cache MacRuby version 0.1 (ruby 1.9.0 2008-03-01) [universal-darwin9.0] -- control frame ---------- c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :framework c:0003 p:0019 s:0007 b:0007 l:000006 d:000006 TOP /Users/pierce/ svnProjects/build/Debug/Frictionless.app/Contents/Resources/rb_main- mr.rb:13 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH :inherited c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP --------------------------- DBG> : "/Users/pierce/svnProjects/build/Debug/Frictionless.app/ Contents/Resources/rb_main-mr.rb:13:in `<main>'" -- backtrace of native function call (Use addr2line) -- 0x2a2146 0x1d60dc 0x1d611b 0x2acb0d 0x27e8d7 0x1cd9e4 0x2af0f4 0x2b2f93 0x2b2bcc 0x2b2bcc 0x2b5517 0x2a9f3a 0x2927c5 0x2a0510 0x299d92 0x29f71c 0x29f9f1 0x1d9afa 0x1df0df 0x2aa8cb 0x2561 0x2506 ------------------------------------------------------- The Debugger has exited due to signal 6 (SIGABRT).The Debugger has exited due to signal 6 (SIGABRT). Well, that's as far as I can get. Let me know if anyone wants all the necessary pieces zipped up somewhere. the rb_main.rb:13 above looks like a red herring though, because the code in that looks like this: framework 'Cocoa' framework 'AddressBook' <--- line 13 Pierce
Hi Pierce, On Mar 31, 2008, at 10:04 AM, Pierce T. Wetter III wrote:
Ok, so I have a rubycocoa application with source freely available. So lets try to bootstrap it into MacRuby and see what happens.
That's courageous of you :-)
So first, lets copy the Xcode project file, since it seems like at this point there's no way to embed MacRuby directly so I'll have to tweak some settings in the project, and I don't want to have to undo them later when I go back to Rubycocoa. Or at least that's what I had to do last time.
Let's make a new project in Xcode to get the settings I need since they don't seem to be documented in the Wiki.
Hmmm... Making a new Ruby-Core Data application made what looks like a RubyCocoa app.
Ah, there's a new thing called User Templates now. Must be a tweak because I'm using the iPhone SDK release of XCode.
Ok, there's a Mac Ruby template project, loading that.
Bringing up project settings to look for the settings...
Hmmm... Don't see any. There were references to /usr/local last time I tried this.
Well, lets run it and see what happens...
No joy, can't find MacRuby/MacRuby.h
Ok, the project template is broken. Maybe there's a developer example I can steal from instead.
Trying DotView.
Same problem. Ok, searching for the most recent xcoderproject version. Hmm. ABPresence looks newer.
Nope, doesn't build either.
Hmmm.. There's a MacRuby.framework listed in the project files, there didn't used to be.
Trying to find it via locate.... no joy. Ok, ls /Library/Framework.
I see it there. ls /Library/Framework/MacRuby/Framework
Hmmm... I even see MacRuby.h:
more /Library/Frameworks/MacRuby.framework/Headers/MacRuby.h #define RUBY_INCLUDED_AS_FRAMEWORK 1 #include "ruby/ruby.h"
Hmm... Pretty short.
Ok, so unlike the last time I tried, MacRuby is now just a framework to link against.
Since 0.1 actually, MacRuby can build as a framework, if you pass the "--enable-framework" option to configure. I think I will make this default in 0.2.
Removing RubyCocoa.framework. Adding MacRuby.framework
Opening the old main.m, saving it as main-mr.m, (which updates the project to point at the new file), editing it to call macruby_main.
Hmmm... Same problem, never heard of MacRuby/MacRuby.h
Well, I'll just comment out the import for now. Works in ABPresence, now lets try my app.
ok, its building everything...I get a warning about macruby_main being implicitly defined, yadda, yadda.
Running...
Hmmm....
[Session started at 2008-03-31 09:46:42 -0700.] Assertion failed: (__auto_zone != NULL), function ruby_xmalloc, file gc.c, line 296.
The Debugger has exited due to signal 6 (SIGABRT).The Debugger has exited due to signal 6 (SIGABRT).
I'm guessing, but I bet that I have to turn GC on, because it has to be OFF for RubyCocoa, but ON for MacRuby. Someone should put a useful message on that assertion like "Hey dummy, turn on GC".
Excellent suggestion, I will do that. Could you file an entry in the tracker?
Ok, changing that to "supported"
Doesn't like Sparkle, because I built it without GC.
Ok, turning that on and rebuilding Sparkle. Now where did I put that?
Ah, there it is. Changing garb to supported.
Hmm... Its grumping about osx/cocoa getting included in rb_main.rb. Ok, doing my save-as trick again.
Ah, that doesn't work because I have to change main-mr.m as well.
Hmm... More problems because I'm using OSX:: Hey, I'm being a dummy, I can just copy rb_main.rb from Address book.
Ok, doing that, changing InstantMessage to CoreData.
Sigh, another complaint on a different OSX.require_Framework. Let's try this hack:
class OSX
def OSX.require_framework(foo) framework foo end end
before the requires.
It is my objective to provide a RubyCocoa compatible layer on top of MacRuby, so that things like the OSX module or the underscore syntax would be temporarily supported. But I don't think I will do that for 0.2. At least I will provide more documentation in the wiki.
Ok, running... That seems to work. But now I get:
[Session started at 2008-03-31 09:58:55 -0700.] /Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ Resources/rb_main-mr.rb:13: [BUG] unresolved bridgesupport constant `CFBinaryHeapCompareContext' not in cache MacRuby version 0.1 (ruby 1.9.0 2008-03-01) [universal-darwin9.0]
-- control frame ---------- c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :framework c:0003 p:0019 s:0007 b:0007 l:000006 d:000006 TOP /Users/pierce/ svnProjects/build/Debug/Frictionless.app/Contents/Resources/rb_main- mr.rb:13 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH :inherited c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP --------------------------- DBG> : "/Users/pierce/svnProjects/build/Debug/Frictionless.app/ Contents/Resources/rb_main-mr.rb:13:in `<main>'" -- backtrace of native function call (Use addr2line) -- 0x2a2146 0x1d60dc 0x1d611b 0x2acb0d 0x27e8d7 0x1cd9e4 0x2af0f4 0x2b2f93 0x2b2bcc 0x2b2bcc 0x2b5517 0x2a9f3a 0x2927c5 0x2a0510 0x299d92 0x29f71c 0x29f9f1 0x1d9afa 0x1df0df 0x2aa8cb 0x2561 0x2506 -------------------------------------------------------
The Debugger has exited due to signal 6 (SIGABRT).The Debugger has exited due to signal 6 (SIGABRT).
That is a weird crash. In theory this message should be print only when you want to access a bridge support constant whose value hasn't been cached by the parser (which is definitely a bug, because the constant shouldn't be defined then). I suppose you're not accessing CFBinaryHeapCompareContext directly in your code. Do you reproduce this all the time? If you could get a gdb backtrace it would be very helpful, or, if it's possible, please send me a copy of your project offlist and I will have a look at it. Thanks for trying all of this, of course MacRuby is currently under heavy development, and I hope all these problems will disappear when we release a stable version. Laurent
On Mar 31, 2008, at 10:22 AM, Laurent Sansonetti wrote:
Hi Pierce,
On Mar 31, 2008, at 10:04 AM, Pierce T. Wetter III wrote:
Ok, so I have a rubycocoa application with source freely available. So lets try to bootstrap it into MacRuby and see what happens.
That's courageous of you :-)
Well, Frictionless seems kind of sluggish to me, and I'm expecting that MacRuby will make it kick ass. Of course, it could very will be coding stupidity on my part that makes it sluggish (a highly recursive data model can do that), but I couldn't quite figure out how to use Instruments/XRay to profile the ruby side. But I use bindings/CoreData everywhere, so it wouldn't surprise me if bridge crossings are killing me.
[Session started at 2008-03-31 09:46:42 -0700.] Assertion failed: (__auto_zone != NULL), function ruby_xmalloc, file gc.c, line 296.
The Debugger has exited due to signal 6 (SIGABRT).The Debugger has exited due to signal 6 (SIGABRT).
I'm guessing, but I bet that I have to turn GC on, because it has to be OFF for RubyCocoa, but ON for MacRuby. Someone should put a useful message on that assertion like "Hey dummy, turn on GC".
Excellent suggestion, I will do that. Could you file an entry in the tracker?
Done, its #43
It is my objective to provide a RubyCocoa compatible layer on top of MacRuby, so that things like the OSX module or the underscore syntax would be temporarily supported. But I don't think I will do that for 0.2.
At least I will provide more documentation in the wiki.
Ok, running... That seems to work. But now I get: The Debugger has exited due to signal 6 (SIGABRT).The Debugger has exited due to signal 6 (SIGABRT).
That is a weird crash. In theory this message should be print only when you want to access a bridge support constant whose value hasn't been cached by the parser (which is definitely a bug, because the constant shouldn't be defined then). I suppose you're not accessing CFBinaryHeapCompareContext directly in your code.
Nope.
Do you reproduce this all the time? If you could get a gdb backtrace it would be very helpful, or, if it's possible, please send me a copy of your project offlist and I will have a look at it.
Yeah, it repeated itself twice when I did it, though XCode didn't stop appropriately, the debugger just quit. Oh, no wait, it did, I was just confused: #0 0x942ce0ea in __kill () #1 0x942ce0dd in kill$UNIX2003 () #2 0x943453f2 in raise () #3 0x943549af in abort () #4 0x001d6120 in rb_bug (fmt=0x2c3e58 "unresolved bridgesupport constant `%s' not in cache") at error.c:226 #5 0x002acb0d in rb_objc_resolve_const_value (v=17353872, klass=16863952, id=10917) at objc.m:1587 #6 0x0027e8d7 in rb_const_get_0 (klass=16863952, id=13, exclude=0, recurse=2) at variable.c:1484 #7 0x001cd9e4 in <unknown function> [inlined] () at :0 #8 rb_define_class (name=0x9225280 "CFBinaryHeapCompareContext", super=17354096) at class.c:0 #9 0x002af0f4 in <unknown function> [inlined] () at :0 #10 bs_parse_cb (path=0xbfffb1ec "/System/Library/Frameworks/ CoreFoundation.framework/Resources/BridgeSupport/ CoreFoundation.bridgesupport", type=BS_ELEMENT_STRUCT, value=0x2aa5, ctx=0x0) at objc.m:0 #11 0x002b2f93 in _bs_parse (path=0xbfffb1ec "/System/Library/ Frameworks/CoreFoundation.framework/Resources/BridgeSupport/ CoreFoundation.bridgesupport", loaded_paths=0xbfffd770, options=BS_PARSE_DEFAULT, callback=0x2aece0 <bs_parse_cb>, context=0x0, error=0xbfffec00) at bs.c:1078 #12 0x002b2bcc in _bs_parse (path=0xbfffcf3c "/System/Library/ Frameworks/Foundation.framework/Resources/BridgeSupport/ Foundation.bridgesupport", loaded_paths=0xbfffd770, options=BS_PARSE_DEFAULT, callback=0x2aece0 <bs_parse_cb>, context=0x0, error=0xbfffec00) at bs.c:484 #13 0x002b2bcc in _bs_parse (path=0xbfffe800 "/System/Library/ Frameworks/AddressBook.framework/Resources/BridgeSupport/ AddressBook.bridgesupport", loaded_paths=0xbfffd770, options=BS_PARSE_DEFAULT, callback=0x2aece0 <bs_parse_cb>, context=0x0, error=0xbfffec00) at bs.c:484 #14 0x002b5517 in bs_parse (path=0xbfffe800 "/System/Library/ Frameworks/AddressBook.framework/Resources/BridgeSupport/ AddressBook.bridgesupport", options=BS_PARSE_DEFAULT, callback=0, context=0x0, error=0x0) at bs.c:1101 #15 0x002a9f3a in rb_require_framework (argc=0, argv=0x0, recv=16893536) at objc.m:2158 #16 0x002927c5 in call_cfunc (func=0x2a99f0 <rb_require_framework>, recv=16893536, len=<value temporarily unavailable, due to optimizations>, argc=1, argv=0x370050) at vm_insnhelper.c:282 #17 0x002a0510 in vm_call_method (th=0x1013c70, cfp=0x3eff88, num=1, blockptr=0x1, flag=2145, id=9032, mn=0x107dde0, recv=16893536, klass=16893568) at vm_insnhelper.c:372 #18 0x00299d92 in vm_eval (th=0x1013c70, initial=0) at insns.def:1085 #19 0x0029f71c in vm_eval_body (th=0x1013c70) at vm.c:1149 #20 0x0029f9f1 in rb_iseq_eval (iseqval=17508880) at vm.c:1358 #21 0x001d9afa in ruby_exec_node (n=0x10b26b0, file=0x10b0e71 "/Users/ pierce/svnProjects/build/Debug/Frictionless.app/Contents/Resources/ rb_main-mr.rb") at eval.c:237 #22 0x001df0df in ruby_run_node (n=0x10b26b0) at eval.c:265 #23 0x002aa8cb in macruby_main (path=0x31474 "rb_main-mr.rb", argc=3, argv=0x40f090) at objc.m:2753 #24 0x00002561 in main (argc=1, argv=0xbffff790) at /Users/pierce/ svnProjects/Frictionless/RubyFrictionless/main-mr.m:13 (gdb) I'll send you the project as well. Pass it along to whoever you like.
Thanks for trying all of this, of course MacRuby is currently under heavy development, and I hope all these problems will disappear when we release a stable version.
I'm hoping the more poking around I do, the faster it gets done. :-) Hell, maybe Frictionless can become one of the standard samples. Pierce
Goofing around during lunch, I did the following: So my rb_main-mr.rb file had this: framework 'Cocoa' framework 'AddressBook' framework 'CoreData' I tried changing it to this: framework 'Cocoa' framework 'CoreData' framework 'AddressBook' and I get the same error, just when loading CoreData instead of AddressBook. Commenting out 'Cocoa' on the theory that is because its loading it twice or something that's the problem: #framework 'Cocoa' framework 'CoreData' framework 'AddressBook' I get a bus error: /Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ Resources/Action.rb:8:in `<class:Action>'Program received signal: “EXC_BAD_ACCESS”. (the line of ruby code) @@dueColor = NSColor .redColor.blendedColorWithFraction_ofColor(0.5,NSColor.blackColor) (the backtrace) #0 0x0027dc43 in fc_i (key=11709, value=17353872, res=<value temporarily unavailable, due to optimizations>) at variable.c:89 #1 0x001efdb8 in foreach_safe_i (key=11709, value=17353872, arg=0xbfffea94) at hash.c:117 #2 0x0025e478 in st_foreach (table=0x1015350, func=0x1efd90 <foreach_safe_i>, arg=3221219988) at st.c:654 #3 0x001efe08 in st_foreach_safe (table=0x5, func=0, a=0) at hash.c:132 #4 0x0027bd26 in find_class_path (klass=24077440) at variable.c:130 #5 0x0027df37 in classname (klass=24077440) at variable.c:169 #6 0x0027e478 in rb_class_path (klass=24077440) at variable.c:191 #7 0x0027e5e2 in rb_class2name (klass=24077440) at variable.c:288 #8 0x0020c76d in rb_any_to_s (obj=24077408) at object.c:304 #9 0x002a0d78 in vm_call0 (th=0x1013c70, klass=16867808, recv=24077408, id=784, oid=0, argc=0, argv=0x0, body=0x1017360, nosuper=0) at vm.c:457 #10 0x001dcac9 in rb_call0 (klass=16867808, recv=24077408, mid=784, argc=0, argv=0x0, scope=3, self=24077408) at eval.c:1468 #11 0x001dcc99 in rb_call (klass=<value temporarily unavailable, due to optimizations>, recv=<value temporarily unavailable, due to optimizations>, mid=<value temporarily unavailable, due to optimizations>, argc=0, argv=0x0, scope=0) at eval.c:1484 #12 0x001dcd2f in rb_funcall (recv=24077408, mid=784, n=0) at eval.c: 1576 #13 0x0020e790 in rb_obj_inspect (obj=24077408) at object.c:400 #14 0x002a0d78 in vm_call0 (th=0x1013c70, klass=16867808, recv=24077408, id=792, oid=0, argc=0, argv=0x0, body=0x1017440, nosuper=0) at vm.c:457 #15 0x001dcac9 in rb_call0 (klass=16867808, recv=24077408, mid=792, argc=0, argv=0x0, scope=3, self=24079552) at eval.c:1468 #16 0x001dcc99 in rb_call (klass=<value temporarily unavailable, due to optimizations>, recv=<value temporarily unavailable, due to optimizations>, mid=<value temporarily unavailable, due to optimizations>, argc=0, argv=0x0, scope=0) at eval.c:1484 #17 0x001dcd2f in rb_funcall (recv=24077408, mid=792, n=0) at eval.c: 1576 #18 0x0020c812 in rb_inspect (obj=0) at object.c:316 #19 0x001da1d2 in rb_protect (proc=0x20c7e0 <rb_inspect>, data=24077408, state=0x0) at eval.c:1187 #20 0x001d83ba in name_err_mesg_to_str (obj=24077408) at error.c:770 #21 0x002a0d78 in vm_call0 (th=0x1013c70, klass=16983728, recv=24079552, id=3264, oid=0, argc=0, argv=0x0, body=0x10329b0, nosuper=0) at vm.c:457 #22 0x001dcac9 in rb_call0 (klass=16983728, recv=24079552, mid=3264, argc=0, argv=0x0, scope=3, self=24079632) at eval.c:1468 #23 0x001dcc99 in rb_call (klass=<value temporarily unavailable, due to optimizations>, recv=<value temporarily unavailable, due to optimizations>, mid=<value temporarily unavailable, due to optimizations>, argc=0, argv=0x0, scope=0) at eval.c:1484 #24 0x001dce1b in rb_funcall (recv=24079552, mid=3264, n=0) at eval.c: 1576 #25 0x0020d7fc in convert_type (val=24079552, tname=0x2b870d "String", method=<value temporarily unavailable, due to optimizations>, raise=2) at object.c:1932 #26 0x0020e139 in rb_type [inlined] () at ruby.h:1941 #27 rb_convert_type (val=24079552, type=7, tname=0x2b870d "String", method=0x2bb244 "to_str") at object.c:1942 #28 0x0025f7c4 in rb_str_to_str (str=0) at string.c:587 #29 0x002652d8 in rb_string_value (ptr=0xcc0) at string.c:1045 #30 0x001d8c61 in name_err_to_s (exc=24079632) at error.c:679 #31 0x002a0d78 in vm_call0 (th=0x1013c70, klass=16982896, recv=24079632, id=784, oid=0, argc=0, argv=0x0, body=0x1032650, nosuper=0) at vm.c:457 #32 0x001dcac9 in rb_call0 (klass=16982896, recv=24079632, mid=784, argc=0, argv=0x0, scope=3, self=24079632) at eval.c:1468 #33 0x001dcc99 in rb_call (klass=<value temporarily unavailable, due to optimizations>, recv=<value temporarily unavailable, due to optimizations>, mid=<value temporarily unavailable, due to optimizations>, argc=0, argv=0x0, scope=0) at eval.c:1484 #34 0x001dce1b in rb_funcall (recv=24079632, mid=784, n=0) at eval.c: 1576 #35 0x001d6380 in exc_message (exc=0) at error.c:433 #36 0x002a0d78 in vm_call0 (th=0x1013c70, klass=16971216, recv=24079632, id=3816, oid=0, argc=0, argv=0x0, body=0x102fa30, nosuper=0) at vm.c:457 #37 0x001dcac9 in rb_call0 (klass=16971216, recv=24079632, mid=3816, argc=0, argv=0x0, scope=3, self=4) at eval.c:1468 #38 0x001dcc99 in rb_call (klass=<value temporarily unavailable, due to optimizations>, recv=<value temporarily unavailable, due to optimizations>, mid=<value temporarily unavailable, due to optimizations>, argc=0, argv=0x0, scope=0) at eval.c:1484 #39 0x001dce1b in rb_funcall (recv=24079632, mid=3816, n=0) at eval.c: 1576 #40 0x001de4d7 in error_print () at eval_error.c:132 #41 0x001debb8 in error_handle (ex=<value temporarily unavailable, due to optimizations>) at eval_error.c:282 #42 0x001def60 in ruby_cleanup (ex=6) at eval.c:184 #43 0x002aa8cb in macruby_main (path=0x31474 "rb_main-mr.rb", argc=3, argv=0x40f0b0) at objc.m:2753 #44 0x00002561 in main (argc=1, argv=0xbffff790) at /Users/pierce/ svnProjects/Frictionless/RubyFrictionless/main-mr.m:13
Hi Pierce, A different person reported me the same problem a few minutes ago, and it turns out that the problem is not reproducible in trunk. I now remember that I fixed a few days ago a GC-related bug in the magic constants, which hasn't been backported into the testing branch yet. Could you by any chance try to reproduce your problem on trunk? That would be very useful. Laurent On Mar 31, 2008, at 12:50 PM, Pierce T. Wetter III wrote:
Goofing around during lunch, I did the following:
So my rb_main-mr.rb file had this:
framework 'Cocoa' framework 'AddressBook' framework 'CoreData'
I tried changing it to this:
framework 'Cocoa' framework 'CoreData' framework 'AddressBook'
and I get the same error, just when loading CoreData instead of AddressBook.
Commenting out 'Cocoa' on the theory that is because its loading it twice or something that's the problem:
#framework 'Cocoa' framework 'CoreData' framework 'AddressBook'
I get a bus error:
/Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ Resources/Action.rb:8:in `<class:Action>'Program received signal: “EXC_BAD_ACCESS”.
(the line of ruby code)
@@dueColor = NSColor .redColor.blendedColorWithFraction_ofColor(0.5,NSColor.blackColor)
(the backtrace)
#0 0x0027dc43 in fc_i (key=11709, value=17353872, res=<value temporarily unavailable, due to optimizations>) at variable.c:89 #1 0x001efdb8 in foreach_safe_i (key=11709, value=17353872, arg=0xbfffea94) at hash.c:117 #2 0x0025e478 in st_foreach (table=0x1015350, func=0x1efd90 <foreach_safe_i>, arg=3221219988) at st.c:654 #3 0x001efe08 in st_foreach_safe (table=0x5, func=0, a=0) at hash.c: 132 #4 0x0027bd26 in find_class_path (klass=24077440) at variable.c:130 #5 0x0027df37 in classname (klass=24077440) at variable.c:169 #6 0x0027e478 in rb_class_path (klass=24077440) at variable.c:191 #7 0x0027e5e2 in rb_class2name (klass=24077440) at variable.c:288 #8 0x0020c76d in rb_any_to_s (obj=24077408) at object.c:304 #9 0x002a0d78 in vm_call0 (th=0x1013c70, klass=16867808, recv=24077408, id=784, oid=0, argc=0, argv=0x0, body=0x1017360, nosuper=0) at vm.c:457 #10 0x001dcac9 in rb_call0 (klass=16867808, recv=24077408, mid=784, argc=0, argv=0x0, scope=3, self=24077408) at eval.c:1468 #11 0x001dcc99 in rb_call (klass=<value temporarily unavailable, due to optimizations>, recv=<value temporarily unavailable, due to optimizations>, mid=<value temporarily unavailable, due to optimizations>, argc=0, argv=0x0, scope=0) at eval.c:1484 #12 0x001dcd2f in rb_funcall (recv=24077408, mid=784, n=0) at eval.c: 1576 #13 0x0020e790 in rb_obj_inspect (obj=24077408) at object.c:400 #14 0x002a0d78 in vm_call0 (th=0x1013c70, klass=16867808, recv=24077408, id=792, oid=0, argc=0, argv=0x0, body=0x1017440, nosuper=0) at vm.c:457 #15 0x001dcac9 in rb_call0 (klass=16867808, recv=24077408, mid=792, argc=0, argv=0x0, scope=3, self=24079552) at eval.c:1468 #16 0x001dcc99 in rb_call (klass=<value temporarily unavailable, due to optimizations>, recv=<value temporarily unavailable, due to optimizations>, mid=<value temporarily unavailable, due to optimizations>, argc=0, argv=0x0, scope=0) at eval.c:1484 #17 0x001dcd2f in rb_funcall (recv=24077408, mid=792, n=0) at eval.c: 1576 #18 0x0020c812 in rb_inspect (obj=0) at object.c:316 #19 0x001da1d2 in rb_protect (proc=0x20c7e0 <rb_inspect>, data=24077408, state=0x0) at eval.c:1187 #20 0x001d83ba in name_err_mesg_to_str (obj=24077408) at error.c:770 #21 0x002a0d78 in vm_call0 (th=0x1013c70, klass=16983728, recv=24079552, id=3264, oid=0, argc=0, argv=0x0, body=0x10329b0, nosuper=0) at vm.c:457 #22 0x001dcac9 in rb_call0 (klass=16983728, recv=24079552, mid=3264, argc=0, argv=0x0, scope=3, self=24079632) at eval.c:1468 #23 0x001dcc99 in rb_call (klass=<value temporarily unavailable, due to optimizations>, recv=<value temporarily unavailable, due to optimizations>, mid=<value temporarily unavailable, due to optimizations>, argc=0, argv=0x0, scope=0) at eval.c:1484 #24 0x001dce1b in rb_funcall (recv=24079552, mid=3264, n=0) at eval.c:1576 #25 0x0020d7fc in convert_type (val=24079552, tname=0x2b870d "String", method=<value temporarily unavailable, due to optimizations>, raise=2) at object.c:1932 #26 0x0020e139 in rb_type [inlined] () at ruby.h:1941 #27 rb_convert_type (val=24079552, type=7, tname=0x2b870d "String", method=0x2bb244 "to_str") at object.c:1942 #28 0x0025f7c4 in rb_str_to_str (str=0) at string.c:587 #29 0x002652d8 in rb_string_value (ptr=0xcc0) at string.c:1045 #30 0x001d8c61 in name_err_to_s (exc=24079632) at error.c:679 #31 0x002a0d78 in vm_call0 (th=0x1013c70, klass=16982896, recv=24079632, id=784, oid=0, argc=0, argv=0x0, body=0x1032650, nosuper=0) at vm.c:457 #32 0x001dcac9 in rb_call0 (klass=16982896, recv=24079632, mid=784, argc=0, argv=0x0, scope=3, self=24079632) at eval.c:1468 #33 0x001dcc99 in rb_call (klass=<value temporarily unavailable, due to optimizations>, recv=<value temporarily unavailable, due to optimizations>, mid=<value temporarily unavailable, due to optimizations>, argc=0, argv=0x0, scope=0) at eval.c:1484 #34 0x001dce1b in rb_funcall (recv=24079632, mid=784, n=0) at eval.c: 1576 #35 0x001d6380 in exc_message (exc=0) at error.c:433 #36 0x002a0d78 in vm_call0 (th=0x1013c70, klass=16971216, recv=24079632, id=3816, oid=0, argc=0, argv=0x0, body=0x102fa30, nosuper=0) at vm.c:457 #37 0x001dcac9 in rb_call0 (klass=16971216, recv=24079632, mid=3816, argc=0, argv=0x0, scope=3, self=4) at eval.c:1468 #38 0x001dcc99 in rb_call (klass=<value temporarily unavailable, due to optimizations>, recv=<value temporarily unavailable, due to optimizations>, mid=<value temporarily unavailable, due to optimizations>, argc=0, argv=0x0, scope=0) at eval.c:1484 #39 0x001dce1b in rb_funcall (recv=24079632, mid=3816, n=0) at eval.c:1576 #40 0x001de4d7 in error_print () at eval_error.c:132 #41 0x001debb8 in error_handle (ex=<value temporarily unavailable, due to optimizations>) at eval_error.c:282 #42 0x001def60 in ruby_cleanup (ex=6) at eval.c:184 #43 0x002aa8cb in macruby_main (path=0x31474 "rb_main-mr.rb", argc=3, argv=0x40f0b0) at objc.m:2753 #44 0x00002561 in main (argc=1, argv=0xbffff790) at /Users/pierce/ svnProjects/Frictionless/RubyFrictionless/main-mr.m:13
On Mar 31, 2008, at 3:16 PM, Laurent Sansonetti wrote:
Hi Pierce,
A different person reported me the same problem a few minutes ago, and it turns out that the problem is not reproducible in trunk. I now remember that I fixed a few days ago a GC-related bug in the magic constants, which hasn't been backported into the testing branch yet. Could you by any chance try to reproduce your problem on trunk? That would be very useful.
Wow, I'm so cool Laurent told me to use Trunk instead of that skanky old testing branch! I rule! Ok, testing... svn co http://svn.macosforge.org/repository/ruby/MacRuby/trunk MacRubyTrunk ... lots of downloading to do... Checked out revision 124. $ cd MacRubyTrunk $ autoconf $ ./configure --enable-framework --enable-fat-binary --program- prefix=mac $ make $ sudo make install <--- Bwa Ha Ha, you said rdoc was fixed in trunk! Hey, looks like its fixed. I'm getting a different error now: /Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ Resources/Action.rb:8:in `<class:Action>': undefined method `blendedColorWithFraction_ofColor' for #<NSCachedRGBColor:0x17e6890> (NoMethodError) from /Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ Resources/Action.rb:4:in `<top (required)>' from /Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ Resources/rb_main-mr.rb:28:in `require' from /Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ Resources/rb_main-mr.rb:28:in `block in <main>' from /Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ Resources/rb_main-mr.rb:26:in `each' from /Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ Resources/rb_main-mr.rb:26:in `<main>' Generated by this line: @@dueColor = NSColor .redColor.blendedColorWithFraction_ofColor(0.5,NSColor.blackColor) Hmmm... Is that because I'm using rubyCocoa style calls? Trying: @@dueColor=NSColor.redColor.blendedColorWithFraction(0.5, ofColor:NSColor.blackColor) Ok, that worked. Oh, so I have to change all my old calls? Hmmm... That's going to be exhausting. I'll have to think about that one, since it means a total code migration, 5700 lines to edit. Question, the docs imply that: person.setFirstName(first, lastName:last) Can't be written as: person.setFirstName(first, lastName: last) Is that true? Pierce
On Mar 31, 2008, at 4:56 PM, Pierce T. Wetter III wrote:
On Mar 31, 2008, at 3:16 PM, Laurent Sansonetti wrote:
Hi Pierce,
A different person reported me the same problem a few minutes ago, and it turns out that the problem is not reproducible in trunk. I now remember that I fixed a few days ago a GC-related bug in the magic constants, which hasn't been backported into the testing branch yet. Could you by any chance try to reproduce your problem on trunk? That would be very useful.
Wow, I'm so cool Laurent told me to use Trunk instead of that skanky old testing branch!
I rule!
Well it seems that trunk it now stable (but not for very long) :-)
Ok, testing...
svn co http://svn.macosforge.org/repository/ruby/MacRuby/trunk MacRubyTrunk
... lots of downloading to do...
Checked out revision 124.
$ cd MacRubyTrunk $ autoconf $ ./configure --enable-framework --enable-fat-binary --program- prefix=mac $ make $ sudo make install <--- Bwa Ha Ha, you said rdoc was fixed in trunk!
Hey, looks like its fixed. I'm getting a different error now:
/Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ Resources/Action.rb:8:in `<class:Action>': undefined method `blendedColorWithFraction_ofColor' for #<NSCachedRGBColor:0x17e6890> (NoMethodError) from /Users/pierce/svnProjects/build/Debug/Frictionless.app/ Contents/Resources/Action.rb:4:in `<top (required)>' from /Users/pierce/svnProjects/build/Debug/Frictionless.app/ Contents/Resources/rb_main-mr.rb:28:in `require' from /Users/pierce/svnProjects/build/Debug/Frictionless.app/ Contents/Resources/rb_main-mr.rb:28:in `block in <main>' from /Users/pierce/svnProjects/build/Debug/Frictionless.app/ Contents/Resources/rb_main-mr.rb:26:in `each' from /Users/pierce/svnProjects/build/Debug/Frictionless.app/ Contents/Resources/rb_main-mr.rb:26:in `<main>'
Generated by this line:
@@dueColor = NSColor .redColor.blendedColorWithFraction_ofColor(0.5,NSColor.blackColor)
Hmmm... Is that because I'm using rubyCocoa style calls?
Trying:
@@dueColor=NSColor.redColor.blendedColorWithFraction(0.5, ofColor:NSColor.blackColor)
Ok, that worked. Oh, so I have to change all my old calls?
Hmmm... That's going to be exhausting. I'll have to think about that one, since it means a total code migration, 5700 lines to edit.
Yes, you will have to change all your calls. This won't definitely be a trivial operation, that's why I would like to work on a RubyCocoa-compatible layer, so that the RubyCocoa semantics would be temporarily preserved, and developers can therefore migrate to the new semantics.
Question, the docs imply that:
person.setFirstName(first, lastName:last)
Can't be written as:
person.setFirstName(first, lastName: last)
Is that true?
It is. $ macirb irb(main):001:0> class Person irb(main):002:1> def setFirstName(first, lastName:last) irb(main):003:2> @first, @last = first, last irb(main):004:2> end irb(main):005:1> end => nil irb(main):006:0> p = Person.new => #<Person:0x1669890> irb(main):007:0> p.setFirstName('foo', lastName:'bar') => ["foo", "bar"] irb(main):008:0> p.setFirstName('foo', lastName: 'bar') => ["foo", "bar"] irb(main):009:0> p.setFirstName 'foo', lastName: 'bar' => ["foo", "bar"] irb(main):011:0> p.setFirstName 'foo', :lastName => 'bar' => ["foo", "bar"] So, glad to know that the original problem seems to really be fixed in trunk. I am going to fix more bugs in trunk, then migrate the changes to the testing branch. The new Array class is now pretty functional. Laurent
So, glad to know that the original problem seems to really be fixed in trunk. I am going to fix more bugs in trunk, then migrate the changes to the testing branch. The new Array class is now pretty functional.
Cool. So I get demoted back to testing then. I'll survive. :-) BTW, if you could drop a bug in the ear of the Instruments guys to implement a ruby aware Sampler/stack trace, that would be cool. I figured out how to write an instrument to time calls, but it turns out to be pretty hard to use without an aggregator. Pierce
On Mar 31, 2008, at 5:22 PM, Laurent Sansonetti wrote:
Question, the docs imply that:
person.setFirstName(first, lastName:last)
Can't be written as:
person.setFirstName(first, lastName: last)
Is that true?
It is.
$ macirb irb(main):001:0> class Person irb(main):002:1> def setFirstName(first, lastName:last) irb(main):003:2> @first, @last = first, last irb(main):004:2> end irb(main):005:1> end => nil irb(main):006:0> p = Person.new => #<Person:0x1669890> irb(main):007:0> p.setFirstName('foo', lastName:'bar') => ["foo", "bar"] irb(main):008:0> p.setFirstName('foo', lastName: 'bar') => ["foo", "bar"] irb(main):009:0> p.setFirstName 'foo', lastName: 'bar' => ["foo", "bar"] irb(main):011:0> p.setFirstName 'foo', :lastName => 'bar' => ["foo", "bar"]
So, glad to know that the original problem seems to really be fixed in trunk. I am going to fix more bugs in trunk, then migrate the changes to the testing branch. The new Array class is now pretty functional.
Er, your example implies its not true, as lastName: 'bar' seemed to work just fine. T But I'm guessing that's just a case of too many double negatives. So: name( arg1, selector:arg2) (no space before arg2 works) name(arg1, selector: arg2) (extra space works) name arg1, selector: arg2 (no () works, with extra spaces) name arg1, :selector => arg2 ( : in front and => works) Pierce
On Apr 1, 2008, at 12:33 PM, Pierce T. Wetter III wrote:
Er, your example implies its not true, as lastName: 'bar' seemed to work just fine. T
But I'm guessing that's just a case of too many double negatives.
Oops indeed, mea culpa :)
So:
name( arg1, selector:arg2) (no space before arg2 works) name(arg1, selector: arg2) (extra space works) name arg1, selector: arg2 (no () works, with extra spaces)
name arg1, :selector => arg2 ( : in front and => works)
Yes. Note that name(arg1, selector :arg2) (extra space at the left side) won't work, as you would expected I guess . Laurent
Ok, rewriting things as I go to use the new call syntax. Not as bad as I thought it would be because there are a lot of single parameter or zero-parameter methods I use. Hmmm... framework 'PDFKit" doesn't work, have to use framework "Quartz" kvc_accessor is gone... ib_outlets is now ib_outlet Hmmm.. NSRect has changed: /Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ Resources/NoteTitleBarView.rb:19:in `new': wrong number of arguments (4 for 2) (ArgumentError) from /Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ Resources/NoteTitleBarView.rb:19:in `<class:NoteTitleBarView>' CLOSE_BOX = NSRect.new(3, 2, 8, 8) Ok, Wiki says I have to make a Point and a Size now I guess: CLOSE_BOX = NSRect.new(NSPoint.new(3, 2_), NSSize.new(8, 8)) Hmmm.. No: objc_method Not necessary I guess. Can't find 'CoreGraphics' Hmmm... Can't find a Framework I copied into Resources? (i.e. framework 'ILCrashReporter') isn't working. Ok, removing that for now... Doh! Roadblock: /Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ruby/1.9.0/ openssl.rb:17:in `require': can't freeze pure objc object ` [:TLSv1 , :TLSv1_server , :TLSv1_client , :SSLv2 , :SSLv2_server , :SSLv2_client , :SSLv3 , :SSLv3_server , :SSLv3_client , :SSLv23, :SSLv23_server, :SSLv23_client]' (RuntimeError) from /Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ruby/ 1.9.0/openssl.rb:17:in `<top (required)>' from /Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ruby/ 1.9.0/net/https.rb:102:in `require' from /Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ruby/ 1.9.0/net/https.rb:102:in `<top (required)>' from /Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ Resources/toodledo/session.rb:6:in `require'
On Mar 31, 2008, at 5:34 PM, Pierce T. Wetter III wrote:
Ok, rewriting things as I go to use the new call syntax. Not as bad as I thought it would be because there are a lot of single parameter or zero-parameter methods I use.
Hmmm...
framework 'PDFKit"
doesn't work, have to use
framework "Quartz"
Yes, because PDFKit is not a main framework but a framework part of Quartz, as you noticed. RubyCocoa has a builtin shortcut when you require PDFKit, because it also has to load the bridge support file for it. In MacRuby, in theory all the dependent bridge support files should automatically be read when you require a framework. $ macruby -e "framework 'Quartz'; p PDFView" PDFView By default, Quartz won't be loaded because Cocoa doesn't explicitly depend of it (it only depends on QuartzCore).
kvc_accessor is gone...
Ultimately pure Ruby accessors will work in this case. http://trac.macosforge.org/projects/ruby/ticket/40
ib_outlets is now ib_outlet
Same here, I will most probably remove ib_outlet form MacRuby and suggest people to write Ruby accessors instead.
Hmmm.. NSRect has changed:
/Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ Resources/NoteTitleBarView.rb:19:in `new': wrong number of arguments (4 for 2) (ArgumentError) from /Users/pierce/svnProjects/build/Debug/Frictionless.app/ Contents/Resources/NoteTitleBarView.rb:19:in `<class:NoteTitleBarView>'
CLOSE_BOX = NSRect.new(3, 2, 8, 8)
Ok, Wiki says I have to make a Point and a Size now I guess:
CLOSE_BOX = NSRect.new(NSPoint.new(3, 2_), NSSize.new(8, 8))
I will support the RubyCocoa way, because currently it's too painful to construct an NSRect. Also, notice that NSMakeRect is currently not supported (because it's an inline function, and that the bridgesupport dylib files that ship with Leopard have not been compiled for GC).
Hmmm.. No:
objc_method
Not necessary I guess.
I will introduce a way to retype a given Ruby method in the runtime, but in theory this shouldn't be needed by most (all?) developers. All Ruby methods are currently registered in the runtime.
Can't find 'CoreGraphics'
Because it's part of QuartzCore, which is pre-loaded when you require Cocoa. $ macruby -e "framework 'Cocoa'; p CGRect" CGRect
Hmmm... Can't find a Framework I copied into Resources?
(i.e. framework 'ILCrashReporter') isn't working.
That's an annoying bug, could you file it in the tracker?
Ok, removing that for now...
Doh! Roadblock:
/Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ruby/ 1.9.0/openssl.rb:17:in `require': can't freeze pure objc object ` [:TLSv1 , :TLSv1_server , :TLSv1_client , :SSLv2 , :SSLv2_server , :SSLv2_client , :SSLv3 , :SSLv3_server , :SSLv3_client , :SSLv23, :SSLv23_server, :SSLv23_client]' (RuntimeError) from /Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ ruby/1.9.0/openssl.rb:17:in `<top (required)>' from /Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ ruby/1.9.0/net/https.rb:102:in `require' from /Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ ruby/1.9.0/net/https.rb:102:in `<top (required)>' from /Users/pierce/svnProjects/build/Debug/Frictionless.app/ Contents/Resources/toodledo/session.rb:6:in `require'
Should be fixed in trunk/r127 :-) Laurent
kvc_accessor is gone...
Ultimately pure Ruby accessors will work in this case.
Don't you have to do the willChangeValueForKey, etc. stuff then?
Hmmm.. No:
objc_method
Not necessary I guess.
I will introduce a way to retype a given Ruby method in the runtime, but in theory this shouldn't be needed by most (all?) developers.
All Ruby methods are currently registered in the runtime.
Ah, ok. I had to have this for some reason in RC, because the objc side didn't know about something I'd added.
Hmmm... Can't find a Framework I copied into Resources?
(i.e. framework 'ILCrashReporter') isn't working.
That's an annoying bug, could you file it in the tracker?
Will do.
Ok, removing that for now...
Doh! Roadblock:
/Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ruby/ 1.9.0/openssl.rb:17:in `require': can't freeze pure objc object ` [:TLSv1 , :TLSv1_server , :TLSv1_client , :SSLv2 , :SSLv2_server , :SSLv2_client , :SSLv3 , :SSLv3_server , :SSLv3_client , :SSLv23, :SSLv23_server, :SSLv23_client]' (RuntimeError) from /Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ ruby/1.9.0/openssl.rb:17:in `<top (required)>' from /Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ ruby/1.9.0/net/https.rb:102:in `require' from /Library/Frameworks/MacRuby.framework/Versions/0.2/usr/lib/ ruby/1.9.0/net/https.rb:102:in `<top (required)>' from /Users/pierce/svnProjects/build/Debug/Frictionless.app/ Contents/Resources/toodledo/session.rb:6:in `require'
Should be fixed in trunk/r127 :-)
Confirmed. Next up: Reading defaults #<#<Class:0x1aa2c60>:0x1aa2c50> 2008-04-01 12:37:43.873 Frictionless[58071:813] fetching password www.twitter.com obastard 2008-04-01 12:37:44.043 Frictionless[58071:813] fetchedpassword 2008-04-01 12:37:44.553 Frictionless[58071:813] SyncServices assertion failure (nil != pDefaultManager) in [ISyncManager sharedManager], / SourceCache/SyncServices2/SyncServices2-389.1/SyncServices/ ISyncManager.m:2602 ObjC runtime error: ISyncManager was never initialized /Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ Resources/RubyFrictionlessAppDelegate-mr.rb:163:in `sharedManager': NSInvalidArgumentException: [ISyncManager sharedManager]: ObjC runtime error: ISyncManager was never initialized (RuntimeError) Mini script to reproduce: rb(main):001:0> framework 'SyncServices' => true irb(main):002:0> print ISyncManager.sharedManager #<ISyncConcreteManager:0x12baed0>=> nil i.e.: framework 'SyncServices' print ISyncManager.sharedManager I'm guessing the framework isn't initializing? Pierce
On Apr 1, 2008, at 12:41 PM, Pierce T. Wetter III wrote:
kvc_accessor is gone...
Ultimately pure Ruby accessors will work in this case.
Don't you have to do the willChangeValueForKey, etc. stuff then?
I think we can avoid that, but otherwise, yes we will do that. I want this to be the most transparent possible for the developer.
Hmmm... Can't find a Framework I copied into Resources?
(i.e. framework 'ILCrashReporter') isn't working.
That's an annoying bug, could you file it in the tracker?
Will do.
Thanks :)
Next up:
Reading defaults #<#<Class:0x1aa2c60>:0x1aa2c50> 2008-04-01 12:37:43.873 Frictionless[58071:813] fetching password www.twitter.com obastard 2008-04-01 12:37:44.043 Frictionless[58071:813] fetchedpassword 2008-04-01 12:37:44.553 Frictionless[58071:813] SyncServices assertion failure (nil != pDefaultManager) in [ISyncManager sharedManager], /SourceCache/SyncServices2/SyncServices2-389.1/ SyncServices/ISyncManager.m:2602 ObjC runtime error: ISyncManager was never initialized /Users/pierce/svnProjects/build/Debug/Frictionless.app/Contents/ Resources/RubyFrictionlessAppDelegate-mr.rb:163:in `sharedManager': NSInvalidArgumentException: [ISyncManager sharedManager]: ObjC runtime error: ISyncManager was never initialized (RuntimeError)
Mini script to reproduce:
rb(main):001:0> framework 'SyncServices' => true irb(main):002:0> print ISyncManager.sharedManager #<ISyncConcreteManager:0x12baed0>=> nil
i.e.:
framework 'SyncServices' print ISyncManager.sharedManager
I'm guessing the framework isn't initializing?
That's weird, I do not reproduce this in my environment (trunk) $ macruby -e "framework 'SyncServices'; p ISyncManager.sharedManager" #<ISyncConcreteManager:0x28a00b0> $ macirb irb(main):001:0> framework 'SyncServices' => true irb(main):002:0> ISyncManager.sharedManager => #<ISyncConcreteManager:0x2aa47b0> irb(main):003:0> ISyncManager.sharedManager.enabled? => true irb(main):004:0> Laurent
On Apr 1, 2008, at 2:20 PM, Laurent Sansonetti wrote:
On Apr 1, 2008, at 12:41 PM, Pierce T. Wetter III wrote:
kvc_accessor is gone...
Ultimately pure Ruby accessors will work in this case.
Don't you have to do the willChangeValueForKey, etc. stuff then?
I think we can avoid that, but otherwise, yes we will do that. I want this to be the most transparent possible for the developer.
Use the same keywords that objc uses then. (i.e. "property")
That's weird, I do not reproduce this in my environment (trunk)
$ macruby -e "framework 'SyncServices'; p ISyncManager.sharedManager" #<ISyncConcreteManager:0x28a00b0>
$ macirb irb(main):001:0> framework 'SyncServices' => true irb(main):002:0> ISyncManager.sharedManager => #<ISyncConcreteManager:0x2aa47b0> irb(main):003:0> ISyncManager.sharedManager.enabled? => true irb(main):004:0>
Ah. Worked after a "make clean; make; make install-nodoc" Note to self, do "make clean" after "svn update". Note to dev team: Makefile dependencies not all they could be. Investigate make dependency generator. pierce
That's weird, I do not reproduce this in my environment (trunk)
$ macruby -e "framework 'SyncServices'; p ISyncManager.sharedManager" #<ISyncConcreteManager:0x28a00b0>
$ macirb irb(main):001:0> framework 'SyncServices' => true irb(main):002:0> ISyncManager.sharedManager => #<ISyncConcreteManager:0x2aa47b0> irb(main):003:0> ISyncManager.sharedManager.enabled? => true irb(main):004:0>
Ah. Worked after a "make clean; make; make install-nodoc"
Hmmm... Spoke too soon. It worked from the command line, not from inside my app. I also have two macruby processes hanging around I can't seem to kill. Ok, Restarting! Trying again: Ok, I've figured out that print ISyncManager.sharedManager prints out: #<ISyncConcreteManager:0x12baed0>=> nil The nil was misleading, because: ISyncManager.sharedManager.enabled? works. So that was my bad. It does work from the command line. Still not working in my app though. Adding: framework 'SyncServices' ISyncManager.sharedManager to rb_main.rb in my app.. Nope, still dies. Adding: framework 'SyncServices' ISyncManager.sharedManager to rb_main.rb in ABPresence. Hmm... Works there. Hmmm... Something unique to my app. Trying: print framework 'SyncServices' ISyncManager.sharedManager I get "true". Ah! It's because I listed SyncServices in my project. Adding SyncServices to ABPresence. Yep, breaks there now too. So: 1. Change rb_main.rb to have this at the top: framework 'Cocoa' framework 'AddressBook' framework 'InstantMessage' framework 'SyncServices' ISyncManager.sharedManager 2. Add SyncServices to the list of Frameworks in ABPresense 3. Run. Pierce
On Apr 01, 2008, at 19:19, Pierce T. Wetter III wrote:
Ah. Worked after a "make clean; make; make install-nodoc"
Note to self, do "make clean" after "svn update".
Note to dev team: Makefile dependencies not all they could be. Investigate make dependency generator.
pierce
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/macruby-devel
Although I am not on the dev team I have looked at MacRuby a bit, including the Makefiles and such. I think that part of the problem is that I don't know how much comes from ruby proper versus just this project. Also there are two ways to build a universal binary: -arch <arch_one> -arch <arch_two> This is the way that MacRuby does it right now but generating dependency files for this won't work since the gcc backend is being executed multiple times to make the .o files universal. -arch <arch_one> -arch <arch_two> then use lipo this way should be better at dependency tracking since you could have the Makefile system track dependencies per arch, but this isn't being used right now. I hope I haven't missed something but I think that pretty much sums up the current situation.
participants (4)
-
Jordan Breeding
-
Laurent Sansonetti
-
Pierce T. Wetter III
-
Pierce T. Wetter III