Issue #6590 has been updated by Eregon (Benoit Daloze).


@hsbt I wonder, is there a plan for addressing this?
There are now many default gems as shown by https://stdgems.org/, a fair amount of them being C extensions and not pure-Ruby.

Basically, there will be similar situations with TruffleRuby, where users try to install/update a default gem (there were not many user-submitted issues related to this yet, though).
The difference being TruffleRuby can support C extensions, although some gems will need some work to run on TruffleRuby (e.g., currently `bigdecimal` doesn't `gem install` on TruffleRuby).

For some of these gems such as `stringio` and `fiddle`, I think it might be better for TruffleRuby to keep TruffleRuby's mostly pure-Ruby implementations instead of using a C extension.
This would be possible with e.g., some `RUBY_ENGINE` check in both extconf.rb and the main library file, similar to how it's done for the FFI gem:
https://github.com/ffi/ffi/blob/cb3aaca588c6645b5c8186505fb42f809811055f/ext/ffi_c/extconf.rb#L3
https://github.com/ffi/ffi/blob/master/lib/ffi.rb
However, that has the downside to be potentially not fully API-compatible if there are additions in the default gem compared to the latest MRI release.

For the rest of the gems, it would probably be best for TruffleRuby to use the C extension, to reduce maintenance efforts and make sure to be compatible with MRI's version. However, that might require significant work for C extension compatibility, so it's trade-off if there is already a pure-Ruby implementation.

To give some idea, TruffleRuby can currently run these C extension default gems:
etc, json, openssl, psych and zlib.
And these are untested and probably don't work yet:
bigdecimal, date, *dbm, fcntl, fiddle, io-console, stringio, strscan.

----------------------------------------
Feature #6590:  Dealing with bigdecimal, etc gems in JRuby
https://bugs.ruby-lang.org/issues/6590#change-78030

* Author: headius (Charles Nutter)
* Status: Assigned
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Target version: 
----------------------------------------
 Hello!
 
 http://jira.codehaus.org/browse/JRUBY-6704
 
 We have a need to make the "bigdecimal" gem work for JRuby, so that
 distros (like Red Hat, mentioned in the above bug) and users can have
 the same gemspec for JRuby with updated bigdecimal gem references.
 
 I'm not sure the best way to proceed.
 
 The bigdecimal source and gemspec all come from MRI source, and are
 not versioned separately. That means we can't simply share a
 repository for the JRuby bits. We could maintain a forked version in
 our forked "jruby/ruby" repository, but that wouldn't be part of the
 bigdecimal release cycle then.
 
 So I'm looking to you for guidance.
 
 The BigDecimal lib is here in JRuby:
 https://github.com/jruby/jruby/tree/master/src/org/jruby/ext/bigdecimal
 
 It might be simplest if for now there's a dummy "bigdecimal" gem
 pushed for JRuby that does not contain anything, since we would have
 other complications if we tried to remove BigDecimal from JRuby proper
 (it is referenced elsewhere int eh code, etc).
 
 Thoughts?
 
 - Charlie

---Files--------------------------------
noname (500 Bytes)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>