ruby / ruby.wasm

ruby.wasm is a collection of WebAssembly ports of the CRuby.
https://ruby.github.io/ruby.wasm/
MIT License
687 stars 55 forks source link

Ruby Head compatibility #556

Open palkan opened 2 days ago

palkan commented 2 days ago

I'm actively experimenting with the head Ruby builds (mostly due to #555) and collecting some compatibility issues compared to 3.3 release here.

Gem/lib versions:


This commit broke loading tempfile.rb: https://github.com/ruby/ruby/commit/136cbf04419acf993357701e54712f921a294355

require "tempfile"

# => 'File#initialize': No such file or directory @ rb_sysopen - /dev/null (Errno::ENOENT)

Not sure how to properly handle /dev/null in Wasm, though; maybe, we should return nil for IO::NULL and check for nil-ness whenever it's used 🤔

require "digest/sha1"

#=> <internal:/usr/local/lib/ruby/3.4.0+0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require': rb_digest_wrap_metadata not found (LoadError)
<internal:/usr/local/lib/ruby/3.4.0+0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
eval:3:in '<main>'
-e:in 'Kernel.eval'

Worked fine in 3.3.

palkan commented 1 day ago

I've bisected the second problem (digest): https://github.com/ruby/ruby/commit/0619312bb53cb64dedbfbf30eafd3a708b72588e

kateinoigakukun commented 21 hours ago

Thanks! I've made patches for those issues: https://github.com/ruby/tempfile/pull/38, https://github.com/ruby/digest/pull/71