Giter Site home page Giter Site logo

hotcocoa's People

Contributors

dj2 avatar ferrous26 avatar richkilmer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hotcocoa's Issues

hotconsole segfaults

start hotconsole and try:

window

you'll get a nice stack trace like that:

Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 com.apple.WebCore 0x00007fff866154eb void std::__push_heap<WebCore::TimerHeapIterator, int, WebCore::TimerHeapElement>(WebCore::TimerHeapIterator, int, int, WebCore::TimerHeapElement) + 283
1 com.apple.WebCore 0x00007fff8665ddba void std::__adjust_heap<WebCore::TimerHeapIterator, int, WebCore::TimerHeapElement>(WebCore::TimerHeapIterator, int, int, WebCore::TimerHeapElement) + 298
2 com.apple.WebCore 0x00007fff8665dc73 WebCore::TimerBase::heapPopMin() + 115
3 com.apple.WebCore 0x00007fff865ab20a WebCore::TimerBase::setNextFireTime(double) + 410
4 com.apple.WebCore 0x00007fff865ccbb5 WebCore::Document::unscheduleStyleRecalc() + 101
5 com.apple.WebCore 0x00007fff865c5718 WebCore::Document::recalcStyle(WebCore::Node::StyleChange) + 360
6 com.apple.WebCore 0x00007fff86679cb4 WebCore::FrameView::layout(bool) + 1780
7 com.apple.WebCore 0x00007fff86609bcf WebCore::FrameView::updateControlTints() + 271
8 com.apple.Foundation 0x00007fff82c79647 __NSThreadPerformPerform + 219
9 com.apple.CoreFoundation 0x00007fff82874271 __CFRunLoopDoSources0 + 1361
10 com.apple.CoreFoundation 0x00007fff82872469 __CFRunLoopRun + 873
11 com.apple.CoreFoundation 0x00007fff82871c2f CFRunLoopRunSpecific + 575
12 com.apple.HIToolbox 0x00007fff88702a4e RunCurrentEventLoopInMode + 333
13 com.apple.HIToolbox 0x00007fff88702853 ReceiveNextEventCommon + 310
14 com.apple.HIToolbox 0x00007fff8870270c BlockUntilNextEventMatchingListInMode + 59
15 com.apple.AppKit 0x00007fff805081f2 _DPSNextEvent + 708
16 com.apple.AppKit 0x00007fff80507b41 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 155
17 com.apple.AppKit 0x00007fff804cd747 -[NSApplication run] + 395
18 ??? 0x0000000106c2524f 0 + 4408365647
19 ??? 0x0000000106c155ec 0 + 4408301036
20 ??? 0x0000000101187f85 0 + 4313350021
21 ??? 0x00000001011896e8 0 + 4313356008
22 ??? 0x0000000106c0fee7 0 + 4408278759

Thread 1: Dispatch queue: com.apple.libdispatch-manager
0 libSystem.B.dylib 0x00007fff88520bba kevent + 10
1 libSystem.B.dylib 0x00007fff88522a85 _dispatch_mgr_invoke + 154
2 libSystem.B.dylib 0x00007fff8852275c _dispatch_queue_invoke + 185
3 libSystem.B.dylib 0x00007fff88522286 _dispatch_worker_thread2 + 244
4 libSystem.B.dylib 0x00007fff88521bb8 _pthread_wqthread + 353
5 libSystem.B.dylib 0x00007fff88521a55 start_wqthread + 13

Thread 2:
0 libSystem.B.dylib 0x00007fffffe010a5 memset_pattern + 165
1 libmacruby.dylib 0x000000010054959c llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 524
2 libmacruby.dylib 0x000000010054c13b llvm::SelectionDAGISel::FinishBasicBlock() + 5467
3 libmacruby.dylib 0x000000010054cd29 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function&, llvm::MachineFunction&, llvm::MachineModuleInfo
, llvm::DwarfWriter
, llvm::TargetInstrInfo const&) + 1545
4 libmacruby.dylib 0x000000010054dd3d llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 1581
5 libmacruby.dylib 0x0000000100626d0b llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 91
6 libmacruby.dylib 0x00000001008de53a llvm::FPPassManager::runOnFunction(llvm::Function&) + 458
7 libmacruby.dylib 0x00000001008deb54 llvm::FunctionPassManagerImpl::run(llvm::Function&) + 164
8 libmacruby.dylib 0x00000001008dee92 llvm::FunctionPassManager::run(llvm::Function&) + 82
9 libmacruby.dylib 0x00000001005ac04a llvm::JIT::runJITOnFunctionUnlocked(llvm::Function_, llvm::MutexGuard const&) + 42
10 libmacruby.dylib 0x00000001005ad4ef llvm::JIT::getPointerToFunction(llvm::Function_) + 943
11 libmacruby.dylib 0x000000010017a405 RoxorCore::compile(llvm::Function_) + 149 (vm.cpp:487)
12 libmacruby.dylib 0x000000010017e7ca RoxorCore::resolve_method(objc_class_, objc_selector_, llvm::Function_, rb_vm_arity_t const&, int, objc_object* ()(objc_object, objc_selector_, ...), objc_method_) + 810 (vm.cpp:1830)
13 libmacruby.dylib 0x000000010017e8cb RoxorCore::resolve_methods(std::map<objc_class*, rb_vm_method_source_t*, std::less<objc_class*>, std::allocator<std::pair<objc_class* const, rb_vm_method_source_t*> > >, objc_class, objc_selector_) + 203 (stl_tree.h:192)
14 libmacruby.dylib 0x0000000100184bb7 rb_vm_resolve_method + 391 (vm.cpp:1932)
15 libmacruby.dylib 0x0000000100184bfc resolveInstanceMethod_imp(void_, objc_selector_, objc_selector_) + 12 (vm.cpp:4697)
16 libobjc.A.dylib 0x00007fff87cb5937 _class_resolveMethod + 324
17 libmacruby.dylib 0x000000010017011f rb_vm_dispatch + 815 (dispatcher.cpp:588)
18 ??? 0x0000000106c2edad 0 + 4408405421
19 ??? 0x0000000106c1e1de 0 + 4408336862

Thread 3: JavaScriptCore: FastMalloc scavenger
0 libSystem.B.dylib 0x00007fff885429ee __semwait_signal + 10
1 libSystem.B.dylib 0x00007fff885467f1 _pthread_cond_wait + 1286
2 com.apple.JavaScriptCore 0x00007fff801102b3 WTF::TCMalloc_PageHeap::scavengerThread() + 515
3 com.apple.JavaScriptCore 0x00007fff801102f9 WTF::TCMalloc_PageHeap::runScavengerThread(void*) + 9
4 libSystem.B.dylib 0x00007fff88540f8e _pthread_start + 331
5 libSystem.B.dylib 0x00007fff88540e41 thread_start + 13

Thread 4:
0 libSystem.B.dylib 0x00007fff885219da __workq_kernreturn + 10
1 libSystem.B.dylib 0x00007fff88521dec _pthread_wqthread + 917
2 libSystem.B.dylib 0x00007fff88521a55 start_wqthread + 13

Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000118559f80 rbx: 0x0000000000000000 rcx: 0x00007fff5fbfa770 rdx: 0x0000000000000000
rdi: 0x0000000000000115 rsi: 0x0000000000000000 rbp: 0x00007fff5fbfa740 rsp: 0x00007fff5fbfa700
r8: 0x000000008fc8d0d0 r9: 0x0000000000000001 r10: 0x000000000000003f r11: 0x000000011850c658
r12: 0x0000000001000000 r13: 0x0000000000000000 r14: 0x0000000000000000 r15: 0x0000000000000000
rip: 0x00007fff866154eb rfl: 0x0000000000010202 cr2: 0x0000000001000018

hotcocoa/application_builder.rb and macrake fails on 64-bit OS

This looks similar to an existing bug. I have posted the issue and solution below.

Issue:
when running macrake on a vanilla hotcocoa created project and directory tree, it fails.
Why: macrake calls hotcocoa/application_builder.rb. This file compiles an executable using the following logic...
RUBY_ARCH.include?('ppc') ? '-arch ppc' : '-arch i386 -arch x86_64'
However, on a x86_64 machine, the compiler will try to also create a 32 bit version. This 32 bit executable
cannot link to the rest of the objects as they are 64 bit only (at least on my machine), so it fails.

Solution:
I simply removed the reference to 32 bit in the application_builder.rb file. I am not sure if this is the "best" solution
as it may break 32 bit compiles on other machines. For my 64 bit host, it works great.
RUBY_ARCH.include?('ppc') ? '-arch ppc' : ' -arch x86_64'

Dump/Error output:

[macpro:~/src/macruby/my_first_app] macrake run

(in /Users/nbrand/src/macruby/my_first_app)
ld: warning: ignoring file /Library/Frameworks//MacRuby.framework/MacRuby, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
"_macruby_main", referenced from:
_main in ccTmkyxO.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/bx/bxsDMQkhFGCnAlLx4sEiEE+++TM/-Tmp-//ccDFJISw.out (No such file or directory)

/bin/sh: ./My First App.app/Contents/MacOS/MyFirstApp: No such file or directory

standard_rake_tasks Sefault

Not sure if this is the place to post tickets, but the following code segfaults for me when running with macrake:

In Rakfile

require 'rubygems'
require 'hotcocoa/standard_rake_tasks'

plist patch?

I noticed that the read_plist method in HotCocoa 0.5.1 is on the HotCocoa module as an instance method which would mean I would need to include HotCocoa in Hash, Array, etc. to call it on one of those classes, so I did the following to be sure I had both methods on Object itself:

# HotCocoa 0.5.1 puts a to_plist on Object but a from_plist on HotCocoa. Having to include HotCocoa in your object in order to call read_plist is not intuitive and
# may cause adverse effects if having to extend Hash, Array, or Object with include HotCocoa. So instead, we add the same implementation plus a few lines to support
# reading from files, etc. like from_json/from_xml in ActiveSupport implementations do. While at first Object doesn't seem an appropriate place to put this method,
# it allows any object to have a from_plist class method as a companion to the to_plist instance method, which is intuitive. Examples:
# Hash.from_plist({:data=>'mydata'}.to_plist), Array.from_plist(['x','y','z'].to_plist), AnObject.from_plist(an_object.to_plist)
class Object

 # from_plist is the same as the HotCocoa 0.5.1 version. Could remove it, but keeping it here for now, in case need to debug.
 def self.from_plist(data, mutability=:all)
   # not sure if this will work
   if data.respond_to?(:read)
     data = data.read
   end
   mutability = case mutability
     when :none
       NSPropertyListImmutable
     when :containers_only
       NSPropertyListMutableContainers
     when :all
       NSPropertyListMutableContainersAndLeaves
     else
       raise ArgumentError, "invalid mutability `#{mutability}'"
   end
   if data.is_a?(String)
     data = data.dataUsingEncoding(NSUTF8StringEncoding)
     if data.nil?
       raise ArgumentError, "cannot convert string `#{data}' to data"
     end
   end
   #error = Pointer.new(:object)
   result = NSPropertyListSerialization.propertyListFromData(data,
     mutabilityOption:mutability,
     format:nil,
     errorDescription:nil)
   #raise error[0] if error[0].to_s.size > 0
 end

 # NSPropertyListSerialization can only take NSData, NSString, NSNumber, NSDate, NSArray, or NSDictionary object. Container objects must also contain only these kinds of objects.
 # So you must convert everything to either these types or hashes, arrays, strings, and other simple types before to_plist.
 def to_plist(format=:xml)
   format = case format
     when :xml
       NSPropertyListXMLFormat_v1_0
     when :binary
       NSPropertyListBinaryFormat_v1_0
     when :open_step
       NSPropertyListOpenStepFormat
     else
       raise ArgumentError, "invalid format `#{format}'"
   end
   #error = Pointer.new(:object)
   data = NSPropertyListSerialization.dataFromPropertyList(self,
     format:format,
     errorDescription:nil)
   #raise error[0] if error[0].to_s.size > 0
   NSMutableString.alloc.initWithData(data, encoding:NSUTF8StringEncoding)
 end

end

I also tried out those lines commented above to get the errors currently swallowed from NSPropertyListSerialization, but didn't get much out of that.

I also learned that those methods on NSPropertyListSerialization don't support nils or custom class instances, so I ended up writing some methods to convert my data into a hash containing array of hashes without any nil values in order to be able to have the to_plist and from_plist work. It would be nice if this supported custom types (custom class instances) and nils the way that activesupport's to_xml/from_xml do (I think), but I didn't have time to work out a solution to that.

KCGColorSpaceGenericRGB

I get the following message whenever I try to instantiate a Gradient.

/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/ruby/Gems/1.9.0/gems/hotcocoa-0.5.1/lib/hotcocoa/graphics/gradient.rb:25:in `initialize:': uninitialized constant HotCocoa::Graphics::Gradient::KCGColorSpaceGenericRGB (NameError)

HotCocoa Graphics can't be required

>> require 'hotcocoa/graphics'
NoMethodError: private method `define_method' called for Class:Class
from core:in `require:'
from (irb):3:in `<main>'
from core:in `eval:'
from core:in `evaluate:

Embedding MacRuby without the standard library

Hey Guys,

In my latest app this is how I packaged HotCocoa without the standard library: http://isaac.kearse.co.nz/2010/02/01/packaging-hotcocoa/

I'm more than happy to patch HotCocoa to support this but not quite sure how to go about it, or even if its a good idea.

In particular I don't think "macrake embed" is a very intuitive way to support this option, but its the best I could come up. "macrake deploy" & "macrake deploy:nostdlib" would be one option, or we could just stick with "macrake deploy" and specify whether to include the stdlib in config/build.yml. Actually now that I think about it I like the idea of adding this to the config, what does everyone else think?

Cheers,
Isaac

RuntimeError using hotcoca 0.5.1 and MacRuby 0.6

When following the 'Getting Started' Tutorial the auto-generated application fails to start, whereby displaying the following message:

2010-06-20 15:13:27.246 Postie[1668:607] +[NSATSGlyphGenerator initialize] invocation.  The class is deprecated.
2010-06-20 15:13:29.396 Postie[1668:607] *** Assertion failure in -[LayoutView initWithFrame:], /SourceCache/AppKit/AppKit-1038.32/AppKit.subproj/NSView.m:1289

Unfortunately I did not find a solution, only a Gist with the same problem (http://gist.github.com/292411). I tried running the application.rb via macruby and so received a bit more information:

2010-06-20 15:25:55.958 macruby[1777:903] +[NSATSGlyphGenerator initialize] invocation.  The class is deprecated.
2010-06-20 15:25:58.040 macruby[1777:903] *** Assertion failure in -[LayoutView initWithFrame:], /SourceCache/AppKit/AppKit-1038.32/AppKit.subproj/NSView.m:1289
/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/ruby/Gems/1.9.0/gems/hotcocoa-0.5.1/lib/hotcocoa/layout_view.rb:227:in `initWithFrame:': NSInternalInconsistencyException: Frame containing non-finite values {{0, 0}, {nan, nan}} passed to [LayoutView initWithFrame:] (RuntimeError)
from /Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/ruby/Gems/1.9.0/gems/hotcocoa-0.5.1/lib/hotcocoa/mappings/window.rb:37:in `init_with_options:'
from /Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/ruby/Gems/1.9.0/gems/hotcocoa-0.5.1/lib/hotcocoa/mapper.rb:43:in `block'
from /private/tmp/Postie/lib/application.rb:12:in `block'
from /Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/ruby/Gems/1.9.0/gems/hotcocoa-0.5.1/lib/hotcocoa/mappings/application.rb:8:in `handle_block:'
from /Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/ruby/Gems/1.9.0/gems/hotcocoa-0.5.1/lib/hotcocoa/mapper.rb:43:in `block'
from /private/tmp/Postie/lib/application.rb:11:in `start'
from /private/tmp/Postie/lib/application.rb:1:in `<main>'

Has somebody else seen this problem already and knows a solution? Or is it a bad combination of MacRuby 0.6 and hotcocoa 0.5.1 that's causing this?

Thanks for your help

kvo_array not working

This is with macruby 0.6 and hotcocoa 0.5.1

require 'rubygems'
require 'hotcocoa'
class Foo
kvo_array :stuff do
def size
3
end
def
i
end
end
end

results in
.rvm/gems/macruby-0.6/gems/hotcocoa-0.5.1/lib/hotcocoa/kvo_accessors.rb:34:in `block': wrong argument type UnboundMethod (expected Proc/Method) (TypeError)

the claculator example crashes

Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x00007fff87cb311c objc_msgSend + 40
1 libmacruby.dylib 0x00000001000bc280 rb_reg_search2 + 144 (re.c:1490)
2 libmacruby.dylib 0x00000001000f49ed str_gsub + 157 (string.c:2059)
3 libmacruby.dylib 0x0000000100171952 rb_vm_dispatch + 7010 (dispatcher.cpp:433)
4 ??? 0x0000000101113a71 0 + 4312873585

Thread 1: Dispatch queue: com.apple.libdispatch-manager
0 libSystem.B.dylib 0x00007fff88520bba kevent + 10
1 libSystem.B.dylib 0x00007fff88522a85 _dispatch_mgr_invoke + 154
2 libSystem.B.dylib 0x00007fff8852275c _dispatch_queue_invoke + 185
3 libSystem.B.dylib 0x00007fff88522286 _dispatch_worker_thread2 + 244
4 libSystem.B.dylib 0x00007fff88521bb8 _pthread_wqthread + 353
5 libSystem.B.dylib 0x00007fff88521a55 start_wqthread + 13

Thread 2:
0 libSystem.B.dylib 0x00007fff885219da __workq_kernreturn + 10
1 libSystem.B.dylib 0x00007fff88521dec _pthread_wqthread + 917
2 libSystem.B.dylib 0x00007fff88521a55 start_wqthread + 13

standard_rake_tasks Sefault

Not sure if this is the place to post tickets, but the following code segfaults for me when running with macrake:

In Rakfile

require 'rubygems'
require 'hotcocoa/standard_rake_tasks'

I should add that I'm using the nightly version of Macruby 0.6.
(Sorry this is a duplicate ticket - I closed the old one by mistake)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.