socketry / nio4r

Cross-platform asynchronous I/O primitives for scalable network clients and servers.
Other
968 stars 86 forks source link

Add support for truffleruby #196

Closed ioquatix closed 4 years ago

ioquatix commented 5 years ago

I've added it to the travis test matrix, but there appear to be some issues.

https://travis-ci.org/socketry/nio4r/builds/466712901

cc @eregon (can you mention anyone else who might be able to help?)

eregon commented 5 years ago

Could you open an issue on https://github.com/oracle/truffleruby/issues ? That's the easiest way for the TruffleRuby team to track it.

It looks like https://github.com/oracle/truffleruby/issues is getting stuck on OpenSSL::SSL::SSLSocket behaves like an NIO selectable.

eregon commented 5 years ago

I think pinging @oracle/truffleruby should work now as well. It's still easier to have an issue in our repo to keep track of opened issues though.

eregon commented 5 years ago

Unfortunately, that doesn't work due to what seems to be a GitHub restriction.

Note: It is not possible to @mention teams in a different organization.

Source

ioquatix commented 5 years ago

I've added support for truffleruby in travis here 633a1422609422921429d9546428c1aab5b2bb27

ioquatix commented 5 years ago

I've added a separate build using NIO4R_PURE so we can track these independently.

ioquatix commented 5 years ago

@eregon any chance of making progress on this issue?

ioquatix commented 5 years ago

It won't even build at the moment: https://travis-ci.org/socketry/nio4r/jobs/477209885

eregon commented 5 years ago

@ioquatix That seems caused by the gem update --system in the .travis.yml added in https://github.com/socketry/nio4r/commit/7d923ff0b4959467f21da9914a16188c05c3ee6f. I wouldn't recommend running that in CI, the bundled RubyGems is likely to work better than an arbitrary new version.

ioquatix commented 5 years ago

I've had issues when I didn't do it... let me check if it's still a problem.

ioquatix commented 5 years ago

Okay I removed those lines, now getting hung up in OpenSSL specs.

OpenSSL::SSL::SSLSocket
  behaves like an NIO selectable
... hanging ...
eregon commented 5 years ago

OK, so this is the same bug as last time, could you mention it in https://github.com/oracle/truffleruby/issues/1527?

ioquatix commented 5 years ago

Seems like we made a lot of progress.

https://travis-ci.org/socketry/nio4r/jobs/555224139#L1020

Is I/O non-blocking or can we just ignore this? Or can you make it a no-op?

It looks like it's not stupid to make all I/O non-blocking. Ruby in theory handles this (i.e. IO#read is implemented as a loop anyway).

ioquatix commented 5 years ago

The plan is to eventually try and merge https://bugs.ruby-lang.org/issues/14968

eregon commented 5 years ago

rb_io_set_nonblock seems trivial to implement, it's probably enough to just call to Ruby: IO#nonblock= value.

ioquatix commented 4 years ago

It looks like this is working pretty well, congratulations on getting it working.