oracle / truffleruby

A high performance implementation of the Ruby programming language, built on GraalVM.
https://www.graalvm.org/ruby/
Other
3.02k stars 185 forks source link

The tk gem does not install #2556

Closed eregon closed 2 years ago

eregon commented 2 years ago

From Michael Aponte on Slack (https://graalvm.slack.com/archives/CMY63522F/p1639877980162600):

/usr/lib/jvm/java-11-graalvm/languages/ruby/lib/gems/gems/tk-0.4.0/ext/tk/tcltklib.c:10924:in `Init_tcltklib': External LLVMFunction is_ruby_native_thread cannot be found. (com.oracle.truffle.llvm.runtime.except.LLVMLinkerException) (RuntimeError)
Translated to internal error
    from /usr/lib/jvm/java-11-graalvm/languages/ruby/lib/mri/rubygems/core_ext/kernel_require.rb:83:in `gem_original_require'
    from /usr/lib/jvm/java-11-graalvm/languages/ruby/lib/mri/rubygems/core_ext/kernel_require.rb:83:in `require'
    from /usr/lib/jvm/java-11-graalvm/languages/ruby/lib/gems/gems/tk-0.4.0/lib/tk.rb:7:in `<top (required)>'
    from <internal:core> core/kernel.rb:234:in `gem_original_require'
    from /usr/lib/jvm/java-11-graalvm/languages/ruby/lib/mri/rubygems/core_ext/kernel_require.rb:158:in `require'
    from <internal:core> core/unbound_method.rb:18:in `bind_call'
    from <internal:core> core/kernel.rb:272:in `require'
    from hello.rb:14:in `<main>'
<internal:core> core/kernel.rb:236:in `gem_original_require': cannot load such file -- tk (LoadError)
    from /usr/lib/jvm/java-11-graalvm/languages/ruby/lib/mri/rubygems/core_ext/kernel_require.rb:83:in `require'
    from <internal:core> core/unbound_method.rb:18:in `bind_call'
    from <internal:core> core/kernel.rb:272:in `require'
    from hello.rb:14:in `<main>'

Note: 8.5 TCL AND TK are needed, not 8.6 (https://github.com/ruby/tk/commit/247f01adf981abe11283dc24cc7afd2173e62108)


I found that is_ruby_native_thread is an old name for ruby_native_thread_p, so likely we should define ruby_native_thread_p() on TruffleRuby to solve that specific issue. https://github.com/ruby/ruby/search?q=ruby_native_thread_p Let's start with that.

eregon commented 2 years ago

tk should work now with the fixes in https://github.com/oracle/truffleruby/commit/eda7198072ca7b79af1e8758cba0c15a59493cd5