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

fails to build on windows #25

Closed
emiltin opened this issue Feb 10, 2022 · 9 comments
Closed

fails to build on windows #25

emiltin opened this issue Feb 10, 2022 · 9 comments

Comments

@emiltin
Copy link

emiltin commented Feb 10, 2022

this is from a github action runnning on windows-latest, with ruby 3.1.0

C:\Windows\system32\cmd.exe /D /S /C "C:\hostedtoolcache\windows\Ruby\3.1.0\x64\bin\bundle.bat config --local path D:\a\async-hang\async-hang\vendor\bundle"
  C:\Windows\system32\cmd.exe /D /S /C "C:\hostedtoolcache\windows\Ruby\3.1.0\x64\bin\bundle.bat config --local deployment true"
  Cache key: setup-ruby-bundler-cache-v3-windows-2019-ruby-3.1.0-Gemfile.lock-c01e36ffebc073b3320fc1053a331fff213317425c24ae14464503749f8799d2
  Received 343734 of 343734 (100.0%), 5.0 MBs/sec
  Cache Size: ~0 MB (343734 B)
  C:\msys64\usr\bin\tar.exe --use-compress-program "zstd -d" -xf D:/a/_temp/a817aad9-0da0-43c2-b8c9-017ec771bdcb/cache.tzst -P -C D:/a/async-hang/async-hang --force-local
  Cache restored successfully
  Found cache for key: setup-ruby-bundler-cache-v3-windows-2019-ruby-3.1.0-Gemfile.lock-fd679d11dc75adc6a3324870f1163baf9e229e200f0dfba3638bca1fcf8a6fbe
  C:\Windows\system32\cmd.exe /D /S /C "C:\hostedtoolcache\windows\Ruby\3.1.0\x64\bin\bundle.bat install --jobs 4"
  Fetching gem metadata from https://rubygems.org/...
  Using bundler 2.3.6
  Using fiber-local 1.0.0
  Using timers 4.3.3
  Fetching io-event 1.0.2
  Using console 1.14.0
  Installing io-event 1.0.2 with native extensions
  Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
  
  current directory:
  D:/a/async-hang/async-hang/vendor/bundle/ruby/3.1.0/gems/io-event-1.0.2/ext
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/bin/ruby.exe -I
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/3.1.0 -r
  ./siteconf20220210-4604-7h5gfw.rb extconf.rb
  checking for rb_ext_ractor_safe()... yes
  checking for &rb_fiber_transfer()... yes
  checking for -luring... no
  checking for sys/epoll.h... no
  checking for sys/event.h... no
  checking for sys/eventfd.h... no
  checking for rb_io_descriptor()... yes
  checking for &rb_process_status_wait()... no
  checking for rb_fiber_current()... yes
  checking for &rb_fiber_raise()... yes
  checking for ruby/io/buffer.h... yes
  creating extconf.h
  creating Makefile
  
  current directory:
  D:/a/async-hang/async-hang/vendor/bundle/ruby/3.1.0/gems/io-event-1.0.2/ext
  make.exe DESTDIR\= clean
  
  current directory:
  D:/a/async-hang/async-hang/vendor/bundle/ruby/3.1.0/gems/io-event-1.0.2/ext
  make.exe DESTDIR\=
  generating IO_Event-x64-mingw-ucrt.def
  compiling ./io/event/event.c
  compiling ./io/event/selector/selector.c
  ./io/event/selector/selector.c: In function 'IO_Event_Selector_nonblock_set':
  ./io/event/selector/selector.c:83:44: error: 'F_GETFL' undeclared (first use in
  this function); did you mean 'F_SETFL'?
     83 |         int flags = fcntl(file_descriptor, F_GETFL, 0);
        |                                            ^~~~~~~
        |                                            F_SETFL
  ./io/event/selector/selector.c:83:44: note: each undeclared identifier is
  reported only once for each function it appears in
  make: *** [Makefile:246: selector.o] Error 1
  
  make failed, exit code 2
  
  Gem files will remain installed in
  D:/a/async-hang/async-hang/vendor/bundle/ruby/3.1.0/gems/io-event-1.0.2 for
  inspection.
  Results logged to
  D:/a/async-hang/async-hang/vendor/bundle/ruby/3.1.0/extensions/x64-mingw-ucrt/3.1.0/io-event-1.0.2/gem_make.out
  
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:95:in
  `run'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:44:in
  `block in make'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:36:in
  `each'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:36:in
  `make'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:63:in
  `block in build'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/3.1.0/tempfile.rb:317:in
  `open'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:26:in
  `build'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:161:in
  `build_extension'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:195:in
  `block in build_extensions'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in
  `each'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in
  `build_extensions'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/3.1.0/rubygems/installer.rb:847:in
  `build_extensions'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.6/lib/bundler/rubygems_gem_installer.rb:71:in
  `build_extensions'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.6/lib/bundler/rubygems_gem_installer.rb:28:in
  `install'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.6/lib/bundler/source/rubygems.rb:204:in
  `install'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.6/lib/bundler/installer/gem_installer.rb:54:in
  `install'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.6/lib/bundler/installer/gem_installer.rb:16:in
  `install_from_spec'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.6/lib/bundler/installer/parallel_installer.rb:186:in
  `do_install'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.6/lib/bundler/installer/parallel_installer.rb:177:in
  `block in worker_pool'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.6/lib/bundler/worker.rb:62:in
  `apply_func'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.6/lib/bundler/worker.rb:57:in
  `block in process_queue'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.6/lib/bundler/worker.rb:54:in
  `loop'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.6/lib/bundler/worker.rb:54:in
  `process_queue'
  C:/hostedtoolcache/windows/Ruby/3.1.0/x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.6/lib/bundler/worker.rb:91:in
  `block (2 levels) in create_threads'
  
  An error occurred while installing io-event (1.0.2), and Bundler cannot
  continue.
  
  In Gemfile:
    async-io was resolved to 1.32.2, which depends on
      async was resolved to 2.0.0, which depends on
        io-event
  Took  23.43 seconds
@ioquatix
Copy link
Member

ioquatix commented Feb 13, 2022

I guess the native extension won't build on windows but IO.select might work in some cases. Event-driven IO on windows is supported very poorly. We probably need a dedicated implementation that uses IOCP or even better https://windows-internals.com/ioring-vs-io_uring-a-comparison-of-windows-and-linux-implementations/

@emiltin
Copy link
Author

emiltin commented Feb 13, 2022

does this mean async 2.0 cannot yet be used on windows?

@ioquatix
Copy link
Member

Does the gem install without the native extensions or does the build failure prevent it? If so we just need to skip the native extension on Windows and it should work somewhat.

@emiltin
Copy link
Author

emiltin commented Feb 14, 2022

bundler reports:
An error occurred while installing io-event (1.0.2), and Bundler cannot continue.

I would think that means the native extensions are required?

@ioquatix
Copy link
Member

@MSP-Greg do are more of an expert at Windows than me, do you have any suggestions how we can bypass building the extensions on Windows, or build a different set (e.g. ones for the native windows URing).

@MSP-Greg
Copy link

how we can bypass building the extensions on Windows

Maybe the same way nio4r does?

build a different set (e.g. ones for the native windows URing).

That's pretty much beyond my c skills, especially Windows specific code...

@ioquatix
Copy link
Member

@MSP-Greg
Copy link

Otherwise, the only thing to do is remove spec.extensions from the gemspec, which would require a Windows specific release, just like JRuby. I.think.

@ioquatix
Copy link
Member

This is now fixed, all the tests are passing, it's added to the GH Actions, and you can install v1.1.1 on 3.1 and 3.2 when it's released.

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

No branches or pull requests

3 participants