Closed Sauraus closed 11 years ago
I don't have a Windows machine to test on/develop on or know much about Windows, so any assistance here is appreciated /cc @luislavena
I've narrowed down the problem to a missing lib reference in the Makefile for win32/mingw configs most likely pthread.
So the missing symbols are gone, but now its mingw32 which is being a pain:
linking shared-object nio4r_ext.so c:/ruby/ruby200/sdk/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/lib/../lib/libpthread.dll.a: could not read symbols: Archive has no index; run ranlib to add one collect2.exe: error: ld returned 1 exit status make: *\ [nio4r_ext.so] Error 1
Gem files will remain installed in C:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/nio4r-0.4.6 for inspection. Results logged to C:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/nio4r-0.4.6/ext/nio4r/gem_make.out
@tarcieri is there a chance you can update the embedded libev to version 4.15? That version contains a few fixes for Windows too.
The problem here is caused by mingw-w64 headers defining at some point HAVE_CLOCK_GETTIME
, which I reported a bit ago to mingw-w64 project and should be fixed in their next release of headers.
In libev 4.15, there is no need for EV_SELECT_IS_WINSOCKET 1
in libev.h
, so I ended doing this instead:
#ifdef _WIN32
#define EV_USE_MONOTONIC 0
#define EV_USE_REALTIME 0
#endif
(replacing existing block)
And no longer playing with FD_SETSIZE
since it causes a redefinition warning (because is happening too late in the process) and Ruby 1.9.x already have it set to 2048.
With the above changes and libev 4.15, specs passes except for two pipe-related failures:
Finished in 2.78 seconds
43 examples, 2 failures, 4 pending
Failed examples:
rspec ./spec/support/selectable_examples.rb:23 # IO.pipe behaves like an NIO selectable does not select unwritable objects
rspec ./spec/nio/selector_spec.rb:68 # NIO::Selector timeouts waits for a timeout when selecting
Tested against:
ruby 2.0.0p247 (2013-06-27) [i386-mingw32]
ruby 2.0.0p247 (2013-06-27) [x64-mingw32]
@luislavena yeah I can, it's a little tricky because I modify libev to perform a GVL unlock
@tarcieri yeah, I saw it and did it manually, just saving all the HACKY
comment blocks around :wink:
There are lot of warnings and small issues related to Windows solved in it, that is why I was asking :smile:
Thank you!
@luislavena have this code somewhere? I'd be happy to merge it upstream.
The pipe-related failures might be a bit of a problem as nio4r uses pipes as a wakeup mechanism for selectors. Perhaps there's something similar we can use on Windows?
have this code somewhere? I'd be happy to merge it upstream.
local hack, not pushed anywhere. Will do it tonight if you want.
The pipe-related failures might be a bit of a problem as nio4r uses pipes as a wakeup mechanism for selectors. Perhaps there's something similar we can use on Windows?
I'll look into this, I remember having some issues with pipes and MRI but don't quite remember the specifics.
Hi, are there any news regarding this topic? I'm trying to install berkshelf which has this project as a dependency - but I'm failing.
Are there any workarounds?
@luislavena can you post your local hack if nothing else? ;)
@mmisztal1980 don't use Ruby 2.x, I moved back to 1.9.3 and everything is just fine.
Tried that as well. Ruby 1.9.3 works
@tarcieri sorry, was a bit busy and forgot to commit and push.
I've open a pull request for this, please let me know your thoughts.
+1, just ran into this on Windows 8 x64 w/ Ruby 2x64
@chiefy try nio4r master. Things should be fixed there.
Release forthcoming
@tarcieri super! :) thanks!
@tarcieri thanks, i will give it a go.
This is fixed on master. Release forthcoming, hopefully tonight!
C:\rbxops\Vagrant> gem install nio4r Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing nio4r: ERROR: Failed to build gem native extension.
checking for rb_thread_blocking_region()... yes checking for sys/select.h... no checking for poll.h... no checking for sys/epoll.h... no checking for sys/event.h... no checking for port.h... no checking for sys/resource.h... no creating Makefile
make generating nio4r_ext-i386-mingw32.def compiling monitor.c In file included from nio4r.h:10:0, from monitor.c:6: c:/Ruby/Ruby200/include/ruby-2.0.0/ruby/backward/rubyio.h:2:2: warning: #warning use "ruby/io.h" instead of "rubyio.h" [-Wcpp] In file included from nio4r.h:11:0, from monitor.c:6: libev.h:5:0: warning: "FD_SETSIZE" redefined [enabled by default]