datamapper / do

DataObjects
147 stars 73 forks source link

do_mysql and do_postgres don't run in ruby 2.2 #74

Closed jeremyevans closed 9 years ago

jeremyevans commented 9 years ago

Ruby 2.2 removes rb_thread_select, which breaks do_mysql and do_postgres. Are there plans to update these gems for ruby 2.2, or are they considered legacy?

koffeinfrei commented 9 years ago

It should be possible to replace rb_thread_select by rb_thread_fd_select, according to https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/CAPI_obsolete_definitions. This should be ok for ruby >= 1.9.3.

lucidrains commented 9 years ago

Yes please

postmodern commented 9 years ago

I say go for it and see if the tests pass.

zachad commented 9 years ago

Is it really just a drop-in replacement, or has the API changed at all?

koffeinfrei commented 9 years ago

According to the source the parameter arity and the parameter names are still the same. Only the type fd_set has changed to rb_fdset_t: https://github.com/ruby/ruby/blob/e396ba84fb098812e52c6da9042e46b1ec17a82b/include/ruby/intern.h#L308-L311.

old rb_thread_select:

https://github.com/ruby/ruby/blob/ruby_1_9_3/thread.c#L2724-L2726

int rb_thread_select(int max, fd_set * read, fd_set * write, fd_set * except, struct timeval *timeout)

new rb_thread_fd_select https://github.com/ruby/ruby/blob/ruby_1_9_3/thread.c#L2768-L2769

int rb_thread_fd_select(int max, rb_fdset_t * read, rb_fdset_t * write, rb_fdset_t * except, struct timeval *timeout)
stephankaag commented 9 years ago

Any progress?