Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please update intree copy of libev #220

Closed
darix opened this issue Aug 21, 2019 · 11 comments · Fixed by #222
Closed

Please update intree copy of libev #220

darix opened this issue Aug 21, 2019 · 11 comments · Fixed by #222
Milestone

Comments

@darix
Copy link

darix commented Aug 21, 2019

the version that you have right now fails for some distros.

https://build.opensuse.org/package/live_build_log/home:darix:apps/rubygem-nio4r/openSUSE_Tumbleweed/x86_64

while our newer libev copy just works

https://build.opensuse.org/package/live_build_log/openSUSE:Factory/libev/standard/x86_64

@tarcieri
Copy link
Contributor

@ioquatix can you take care of this? I can provide some instructions (which I should probably write down somewhere better than this issue but):

  1. Download the latest libev
  2. Copy the files that are in-tree over the existing ones. You shouldn't need any of the files that aren't currently in-tree
  3. Look for the labeled patches to ev.c and apply them (sorry I don't have a proper patch file or way of generating one automatically at the moment): https://github.com/socketry/nio4r/search?q=patchery&unscoped_q=patchery
  4. Apply any other previous changes: 785ab43

Not the greatest process. Perhaps we can look at writing a rake task that automates this or something.

@ioquatix
Copy link
Member

Sure - I did this recently - but is there a newer update? I'll check.

@darix
Copy link
Author

darix commented Aug 28, 2019

your patching introduces a bug:

ev_backend_poll

../libev/ev.c:3643:1: error: no return statement in function returning non-void [-Werror=return-type]

and it also complains about:

 In file included from /usr/include/ruby-2.6.0/ruby/ruby.h:29,                                                                                                                                 
                  from /usr/include/ruby-2.6.0/ruby.h:33,                                                                                                                                      
                  from nio4r.h:9,                                                                                                                                                              
                  from nio4r_ext.c:6:                                                                                                                                                          
 nio4r_ext.c: In function ‘Init_nio4r_ext’:                                                                                                                                                    
 /usr/include/ruby-2.6.0/ruby/defines.h:211:18: warning: passing argument 1 of ‘ev_set_allocator’ from incompatible pointer type [-Wincompatible-pointer-types]                                
   211 | #define xrealloc ruby_xrealloc                                                                                                                                                        
       |                  ^~~~~~~~~~~~~                                                                                                                                                        
       |                  |                                                                                                                                                                    
       |                  void * (*)(void *, size_t) {aka void * (*)(void *, long unsigned int)}                                                                                               
 nio4r_ext.c:15:22: note: in expansion of macro ‘xrealloc’                                                                                                                                     
    15 |     ev_set_allocator(xrealloc);                                                                                                                                                       
       |                      ^~~~~~~~                                                                                                                                                         
 In file included from nio4r_ext.c:7:                                                                                                                                                          
 ../libev/ev.c:1776:27: note: expected ‘void * (*)(void *, long int)’ but argument is of type ‘void * (*)(void *, size_t)’ {aka ‘void * (*)(void *, long unsigned int)’}                       
  1776 | ev_set_allocator (void *(*cb)(void *ptr, long size) EV_NOEXCEPT) EV_NOEXCEPT                                                                                                          
       |                   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                   

@darix
Copy link
Author

darix commented Aug 28, 2019

just adding return 0 at the end would make it build but i am almost sure that is not what you want there :)

@darix
Copy link
Author

darix commented Sep 24, 2019 via email

@ioquatix
Copy link
Member

ioquatix commented Sep 24, 2019

Hmmm it looks like issues with libev, if you have a few minutes you can rewrite long size to size_t and I don’t know about the other issue will need to review code.

@ioquatix
Copy link
Member

return Qnil should be sufficient for the second issue. I’m on mobile phone and have meetings for the rest of the day, but can review later.

@darix
Copy link
Author

darix commented Sep 24, 2019 via email

@ioquatix
Copy link
Member

Yes agreed

ioquatix added a commit that referenced this issue Sep 24, 2019
`rb_thread_call_without_gvl` expects return type `void*`. Fixes #220.
ioquatix added a commit that referenced this issue Sep 24, 2019
Improve compatibility of `ruby_xrealloc`. Fixes #220.
@ioquatix ioquatix added this to the v2.5.2 milestone Sep 24, 2019
@ioquatix
Copy link
Member

ioquatix commented Sep 24, 2019

Okay this has been released in v2.5.2. It was live streamed https://youtu.be/YqYYrpvGWo4

In the future please create new issues for bugs like this.

@darix
Copy link
Author

darix commented Sep 30, 2019

confirmed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants