https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112012-06-14T13:21:26ZRuby Issue Tracking SystemRuby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=272402012-06-14T13:21:26Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>mrkn (Kenta Murata)</i></li></ul> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=274802012-06-26T22:06:44Zmrkn (Kenta Murata)muraken@gmail.com
<ul></ul><p>I'm sorry I don't understand JRuby.</p> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=274812012-06-26T22:07:05Zmrkn (Kenta Murata)muraken@gmail.com
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Third Party's Issue</i></li></ul> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=274872012-06-27T00:59:02Zmarcandre (Marc-Andre Lafortune)marcandre-ruby-core@marc-andre.ca
<ul><li><strong>Status</strong> changed from <i>Third Party's Issue</i> to <i>Open</i></li><li><strong>Assignee</strong> changed from <i>mrkn (Kenta Murata)</i> to <i>nahi (Hiroshi Nakamura)</i></li></ul><p>If JRuby has problems because of the new bundled gems, should we not try to find a solution?</p>
<p>Maybe Nahi can help?</p> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=275052012-06-27T09:13:08Zhasari (Hiro Asari)asari.ruby@gmail.com
<ul></ul><p>I feel that a shim for JRuby would do the job for now. Whether or not JRuby can RubyBigDecimal.java into a gem is a separate issue; I feel that this might be a case where behavioral difference between MRI and JRuby is tolerated.</p> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=275562012-06-29T14:47:33Zvo.x (Vit Ondruch)v.ondruch@tiscali.cz
<ul></ul><p>mrkn (Kenta Murata) wrote:</p>
<blockquote>
<p>I'm sorry I don't understand JRuby.</p>
</blockquote>
<p>You don't have to understand JRuby. You just need to allow the JRuby team to upload the Java version of BigDecimal. So if they do "gem install bigdecimal" using JRuby, the proper (Java) version is installed.</p> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=276552012-07-01T16:22:59Zmrkn (Kenta Murata)muraken@gmail.com
<ul></ul><p>I don't know how do I allow the JRuby team to uload the Java version of BigDecimal.<br>
What should I do?</p> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=277162012-07-02T23:53:12ZAnonymous
<ul><li><strong>File</strong> <a href="/attachments/2867">noname</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/2867/noname">noname</a> added</li></ul><p>On Sun, Jul 01, 2012 at 04:22:59PM +0900, mrkn (Kenta Murata) wrote:</p>
<blockquote>
<p>Issue <a class="issue tracker-2 status-8 priority-4 priority-default closed" title="Feature: Dealing with bigdecimal, etc gems in JRuby (Third Party's Issue)" href="https://redmine.ruby-lang.org/issues/6590">#6590</a> has been updated by mrkn (Kenta Murata).</p>
<p>I don't know how do I allow the JRuby team to uload the Java version of BigDecimal.<br>
What should I do?</p>
</blockquote>
<p>You can add headius like this:</p>
<p>$ gem owner -a <a href="mailto:headius@example.org" class="email">headius@example.org</a> bigdecimal</p>
<p>But you need his rubygems.org email address.</p>
<p>Charlie, would this be a sufficient solution for now? I suspect that<br>
all stdlib gems suffer from this same problem. We should think about a<br>
better solution. Whenever a CRuby stdlib gem with native code is released,<br>
an equivalent JRuby gem should be released too. How can we accomplish<br>
that?</p>
<p>--<br>
Aaron Patterson<br>
<a href="http://tenderlovemaking.com/" class="external">http://tenderlovemaking.com/</a></p> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=277372012-07-03T11:59:14Zkosaki (Motohiro KOSAKI)kosaki.motohiro@gmail.com
<ul></ul><p>On Mon, Jul 2, 2012 at 10:51 AM, Aaron Patterson<br>
<a href="mailto:tenderlove@ruby-lang.org" class="email">tenderlove@ruby-lang.org</a> wrote:</p>
<blockquote>
<p>On Sun, Jul 01, 2012 at 04:22:59PM +0900, mrkn (Kenta Murata) wrote:</p>
<blockquote>
<p>Issue <a class="issue tracker-2 status-8 priority-4 priority-default closed" title="Feature: Dealing with bigdecimal, etc gems in JRuby (Third Party's Issue)" href="https://redmine.ruby-lang.org/issues/6590">#6590</a> has been updated by mrkn (Kenta Murata).</p>
<p>I don't know how do I allow the JRuby team to uload the Java version of BigDecimal.<br>
What should I do?</p>
</blockquote>
<p>You can add headius like this:</p>
<p>$ gem owner -a <a href="mailto:headius@example.org" class="email">headius@example.org</a> bigdecimal</p>
<p>But you need his rubygems.org email address.</p>
<p>Charlie, would this be a sufficient solution for now? I suspect that<br>
all stdlib gems suffer from this same problem. We should think about a<br>
better solution. Whenever a CRuby stdlib gem with native code is released,<br>
an equivalent JRuby gem should be released too. How can we accomplish<br>
that?</p>
</blockquote>
<p>I dislike this idea at all. If we take it, bigdecimal gem evetually<br>
has c, java, C#,<br>
haskel, pascal, etc implementations when we get more and more various<br>
ruby interpreter.</p>
<p>Actually, this is not bigdecimal issue. It is gem discovery issue. MRI<br>
support two extension types,<br>
C and Ruby. JRuby also support two extension types, Java and Ruby. gem<br>
loader should realized<br>
the fact and prefer to look up Java implementation when used from<br>
JRuby. I think.</p> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=277422012-07-03T13:35:03Zvo.x (Vit Ondruch)v.ondruch@tiscali.cz
<ul></ul><p>kosaki (Motohiro KOSAKI) wrote:</p>
<blockquote>
<p>Actually, this is not bigdecimal issue. It is gem discovery issue. MRI<br>
support two extension types,<br>
C and Ruby. JRuby also support two extension types, Java and Ruby. gem<br>
loader should realized<br>
the fact and prefer to look up Java implementation when used from<br>
JRuby. I think.</p>
</blockquote>
<p>Actually that is exactly what RubyGems do and what Aaron is proposing. Take nokogiri [1] for example. If you are using MRI, then the nokogiri gem is taken. If it happens you are windows user, then RubyGems downloads nokogiri-x86-mingw32 and if you are JRuby user, then the nokogiri-java version is prefered. They are all just nokogiris, so RubyGems takes the gems from one location. So the MRI gem will be uploaded by mkrn and the JRuby version by headius. It should be just somehow synchronized when new gem version is released.</p>
<p>[1] <a href="https://rubygems.org/gems/nokogiri" class="external">https://rubygems.org/gems/nokogiri</a></p> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=277462012-07-03T17:23:11Zkosaki (Motohiro KOSAKI)kosaki.motohiro@gmail.com
<ul></ul><p>On Tue, Jul 3, 2012 at 12:35 AM, vo.x (Vit Ondruch)<br>
<a href="mailto:v.ondruch@tiscali.cz" class="email">v.ondruch@tiscali.cz</a> wrote:</p>
<blockquote>
<p>Issue <a class="issue tracker-2 status-8 priority-4 priority-default closed" title="Feature: Dealing with bigdecimal, etc gems in JRuby (Third Party's Issue)" href="https://redmine.ruby-lang.org/issues/6590">#6590</a> has been updated by vo.x (Vit Ondruch).</p>
<p>kosaki (Motohiro KOSAKI) wrote:</p>
<blockquote>
<p>Actually, this is not bigdecimal issue. It is gem discovery issue. MRI<br>
support two extension types,<br>
C and Ruby. JRuby also support two extension types, Java and Ruby. gem<br>
loader should realized<br>
the fact and prefer to look up Java implementation when used from<br>
JRuby. I think.</p>
</blockquote>
<p>Actually that is exactly what RubyGems do and what Aaron is proposing. Take nokogiri [1] for example. If you are using MRI, then the nokogiri gem is taken. If it happens you are windows user, then RubyGems downloads nokogiri-x86-mingw32 and if you are JRuby user, then the nokogiri-java version is prefered. They are all just nokogiris, so RubyGems takes the gems from one location. So the MRI gem will be uploaded by mkrn and the JRuby version by headius. It should be just somehow synchronized when new gem version is released.</p>
</blockquote>
<p>I disagree. JRuby bigdecimal is not equal with mrkn bigdecimal. It is<br>
a forked gem. They were<br>
maintained different maintainer and different repository. We can't<br>
synchronized them anytime. So, No. Please drop f*cking insane idea. It<br>
doesn work at all.</p> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=277482012-07-03T18:02:48Zvo.x (Vit Ondruch)v.ondruch@tiscali.cz
<ul></ul><p>kosaki (Motohiro KOSAKI) wrote:</p>
<blockquote>
<p>On Tue, Jul 3, 2012 at 12:35 AM, vo.x (Vit Ondruch)<br>
<a href="mailto:v.ondruch@tiscali.cz" class="email">v.ondruch@tiscali.cz</a> wrote:</p>
<blockquote>
<p>Issue <a class="issue tracker-2 status-8 priority-4 priority-default closed" title="Feature: Dealing with bigdecimal, etc gems in JRuby (Third Party's Issue)" href="https://redmine.ruby-lang.org/issues/6590">#6590</a> has been updated by vo.x (Vit Ondruch).</p>
<p>kosaki (Motohiro KOSAKI) wrote:</p>
<blockquote>
<p>Actually, this is not bigdecimal issue. It is gem discovery issue. MRI<br>
support two extension types,<br>
C and Ruby. JRuby also support two extension types, Java and Ruby. gem<br>
loader should realized<br>
the fact and prefer to look up Java implementation when used from<br>
JRuby. I think.</p>
</blockquote>
<p>Actually that is exactly what RubyGems do and what Aaron is proposing. Take nokogiri [1] for example. If you are using MRI, then the nokogiri gem is taken. If it happens you are windows user, then RubyGems downloads nokogiri-x86-mingw32 and if you are JRuby user, then the nokogiri-java version is prefered. They are all just nokogiris, so RubyGems takes the gems from one location. So the MRI gem will be uploaded by mkrn and the JRuby version by headius. It should be just somehow synchronized when new gem version is released.</p>
</blockquote>
<p>I disagree. JRuby bigdecimal is not equal with mrkn bigdecimal. It is<br>
a forked gem. They were<br>
maintained different maintainer and different repository. We can't<br>
synchronized them anytime. So, No. Please drop f*cking insane idea. It<br>
doesn work at all.</p>
</blockquote>
<p>It is interesting to see you position, since such collaboration works for JSON gem for example (if I am not mistaken).</p>
<p>Yes, you are right, the JRuby's BigDecimal is fork, but I see no reason why it shouldn't be merged, as long as people can communicate.</p> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=277512012-07-03T18:53:49Zregularfry (Alex Young)alex@blackkettle.org
<ul></ul><p>On 02/07/12 15:51, Aaron Patterson wrote:</p>
<blockquote>
<p>On Sun, Jul 01, 2012 at 04:22:59PM +0900, mrkn (Kenta Murata) wrote:</p>
<blockquote>
<p>Issue <a class="issue tracker-2 status-8 priority-4 priority-default closed" title="Feature: Dealing with bigdecimal, etc gems in JRuby (Third Party's Issue)" href="https://redmine.ruby-lang.org/issues/6590">#6590</a> has been updated by mrkn (Kenta Murata).</p>
<p>I don't know how do I allow the JRuby team to uload the Java version of BigDecimal.<br>
What should I do?</p>
</blockquote>
<p>You can add headius like this:</p>
<p>$ gem owner -a <a href="mailto:headius@example.org" class="email">headius@example.org</a> bigdecimal</p>
<p>But you need his rubygems.org email address.</p>
<p>Charlie, would this be a sufficient solution for now? I suspect that<br>
all stdlib gems suffer from this same problem. We should think about a<br>
better solution. Whenever a CRuby stdlib gem with native code is released,<br>
an equivalent JRuby gem should be released too. How can we accomplish<br>
that?</p>
</blockquote>
<p>Surely it's only necessary to coordinate both when the API changes? If<br>
it's just bug-fixes, they should be independent.</p>
<p>--<br>
Alex</p> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=277702012-07-04T08:12:17Zheadius (Charles Nutter)headius@headius.com
<ul></ul><p>Facts:</p>
<ul>
<li>JRuby's bigdecimal implementation is separate from MRI's</li>
<li>bigdecimal is shipped as a gem for MRI now, preinstalled by default but possible to upgrade and set as a gem dependency</li>
<li>Users who want the most current bigdecimal implementation on MRI may set bigdecimal as a dependency</li>
<li>Libraries may also set bigdecimal as a dependency</li>
<li>Without a gem that is installable on JRuby, those users and libraries will fail to install dependencies</li>
<li>BigDecimal is depended on by JRuby internals and cannot be separated from JRuby (i.e. JRuby can't run without BigDecimal library built in</li>
</ul>
<p>All we are really looking for is a way for "bigdecimal" and other preinstalled (on MRI) gem dependencies to work on JRuby. The easiest way would be to have -java platform stub gems for the native extensions in MRI.</p>
<p>We do not currently see any value in attempting to maintain our native extensions alongside MRI's native extensions since they are completely different codebases.</p> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=280872012-07-14T18:36:05Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li></ul> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=336822012-11-24T09:10:38Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Target version</strong> set to <i>2.6</i></li></ul> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=687892017-12-25T18:15:06Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Target version</strong> deleted (<del><i>2.6</i></del>)</li></ul> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=780242019-05-15T12:53:04Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<ul><li><strong>Assignee</strong> changed from <i>nahi (Hiroshi Nakamura)</i> to <i>hsbt (Hiroshi SHIBATA)</i></li></ul> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=780302019-05-15T20:33:35ZEregon (Benoit Daloze)
<ul></ul><p><a class="user active user-mention" href="https://redmine.ruby-lang.org/users/572">@hsbt (Hiroshi SHIBATA)</a> I wonder, is there a plan for addressing this?<br>
There are now many default gems as shown by <a href="https://stdgems.org/" class="external">https://stdgems.org/</a>, a fair amount of them being C extensions and not pure-Ruby.</p>
<p>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).<br>
The difference being TruffleRuby can support C extensions, although some gems will need some work to run on TruffleRuby (e.g., currently <code>bigdecimal</code> doesn't <code>gem install</code> on TruffleRuby).</p>
<p>For some of these gems such as <code>stringio</code> and <code>fiddle</code>, I think it might be better for TruffleRuby to keep TruffleRuby's mostly pure-Ruby implementations instead of using a C extension.<br>
This would be possible with e.g., some <code>RUBY_ENGINE</code> check in both extconf.rb and the main library file, similar to how it's done for the FFI gem:<br>
<a href="https://github.com/ffi/ffi/blob/cb3aaca588c6645b5c8186505fb42f809811055f/ext/ffi_c/extconf.rb#L3" class="external">https://github.com/ffi/ffi/blob/cb3aaca588c6645b5c8186505fb42f809811055f/ext/ffi_c/extconf.rb#L3</a><br>
<a href="https://github.com/ffi/ffi/blob/master/lib/ffi.rb" class="external">https://github.com/ffi/ffi/blob/master/lib/ffi.rb</a><br>
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.</p>
<p>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.</p>
<p>To give some idea, TruffleRuby can currently run these C extension default gems:<br>
etc, json, openssl, psych and zlib.<br>
And these C extensions default gems are untested and probably don't work yet:<br>
bigdecimal, date, *dbm, fcntl, fiddle, io-console, stringio, strscan.</p> Ruby master - Feature #6590: Dealing with bigdecimal, etc gems in JRubyhttps://redmine.ruby-lang.org/issues/6590?journal_id=1014582023-01-25T08:57:21Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Third Party's Issue</i></li></ul><p>We can work bigdecimal for JRuby like</p>
<ul>
<li>
<a href="https://github.com/ruby/psych" class="external">https://github.com/ruby/psych</a> (psych contained java implementation and publish jar file)</li>
</ul>
<p>or</p>
<ul>
<li>
<a href="https://github.com/ruby/date" class="external">https://github.com/ruby/date</a> (date contained empty file for JRuby)</li>
</ul>
<p>or other approach. We should move this issue to <a href="https://github.com/ruby/bigdecimal/issues/169" class="external">https://github.com/ruby/bigdecimal/issues/169</a>.</p>