Feature #6590

Dealing with bigdecimal, etc gems in JRuby

Added by Charles Nutter almost 2 years ago. Updated over 1 year ago.

[ruby-core:45604]
Status:Assigned
Priority:Normal
Assignee:Hiroshi Nakamura
Category:-
Target version:next minor

Description

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

noname (500 Bytes) Anonymous, 07/02/2012 11:53 PM


Related issues

Related to ruby-trunk - Bug #6124: remove the "spec-only gems" in Ruby 1.9.3 (was What is th... Assigned 03/07/2012

History

#1 Updated by Yui NARUSE almost 2 years ago

  • Status changed from Open to Assigned
  • Assignee set to Kenta Murata

#2 Updated by Kenta Murata almost 2 years ago

I'm sorry I don't understand JRuby.

#3 Updated by Kenta Murata almost 2 years ago

  • Status changed from Assigned to Third Party's Issue

#4 Updated by Marc-Andre Lafortune almost 2 years ago

  • Status changed from Third Party's Issue to Open
  • Assignee changed from Kenta Murata to Hiroshi Nakamura

If JRuby has problems because of the new bundled gems, should we not try to find a solution?

Maybe Nahi can help?

#5 Updated by Hiro Asari almost 2 years ago

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.

#6 Updated by Vit Ondruch almost 2 years ago

mrkn (Kenta Murata) wrote:

I'm sorry I don't understand JRuby.

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.

#7 Updated by Kenta Murata almost 2 years ago

I don't know how do I allow the JRuby team to uload the Java version of BigDecimal.
What should I do?

#8 Updated by Anonymous almost 2 years ago

On Sun, Jul 01, 2012 at 04:22:59PM +0900, mrkn (Kenta Murata) wrote:

Issue #6590 has been updated by mrkn (Kenta Murata).

I don't know how do I allow the JRuby team to uload the Java version of BigDecimal.
What should I do?

You can add headius like this:

$ gem owner -a headius@example.org bigdecimal

But you need his rubygems.org email address.

Charlie, would this be a sufficient solution for now? I suspect that
all stdlib gems suffer from this same problem. We should think about a
better solution. Whenever a CRuby stdlib gem with native code is released,
an equivalent JRuby gem should be released too. How can we accomplish
that?

--
Aaron Patterson
http://tenderlovemaking.com/

#9 Updated by Motohiro KOSAKI almost 2 years ago

On Mon, Jul 2, 2012 at 10:51 AM, Aaron Patterson
tenderlove@ruby-lang.org wrote:

On Sun, Jul 01, 2012 at 04:22:59PM +0900, mrkn (Kenta Murata) wrote:

Issue #6590 has been updated by mrkn (Kenta Murata).

I don't know how do I allow the JRuby team to uload the Java version of BigDecimal.
What should I do?

You can add headius like this:

$ gem owner -a headius@example.org bigdecimal

But you need his rubygems.org email address.

Charlie, would this be a sufficient solution for now? I suspect that
all stdlib gems suffer from this same problem. We should think about a
better solution. Whenever a CRuby stdlib gem with native code is released,
an equivalent JRuby gem should be released too. How can we accomplish
that?

I dislike this idea at all. If we take it, bigdecimal gem evetually
has c, java, C#,
haskel, pascal, etc implementations when we get more and more various
ruby interpreter.

Actually, this is not bigdecimal issue. It is gem discovery issue. MRI
support two extension types,
C and Ruby. JRuby also support two extension types, Java and Ruby. gem
loader should realized
the fact and prefer to look up Java implementation when used from
JRuby. I think.

#10 Updated by Vit Ondruch almost 2 years ago

kosaki (Motohiro KOSAKI) wrote:

Actually, this is not bigdecimal issue. It is gem discovery issue. MRI
support two extension types,
C and Ruby. JRuby also support two extension types, Java and Ruby. gem
loader should realized
the fact and prefer to look up Java implementation when used from
JRuby. I think.

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.

[1] https://rubygems.org/gems/nokogiri

#11 Updated by Motohiro KOSAKI almost 2 years ago

On Tue, Jul 3, 2012 at 12:35 AM, vo.x (Vit Ondruch)
v.ondruch@tiscali.cz wrote:

Issue #6590 has been updated by vo.x (Vit Ondruch).

kosaki (Motohiro KOSAKI) wrote:

Actually, this is not bigdecimal issue. It is gem discovery issue. MRI
support two extension types,
C and Ruby. JRuby also support two extension types, Java and Ruby. gem
loader should realized
the fact and prefer to look up Java implementation when used from
JRuby. I think.

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.

I disagree. JRuby bigdecimal is not equal with mrkn bigdecimal. It is
a forked gem. They were
maintained different maintainer and different repository. We can't
synchronized them anytime. So, No. Please drop f*cking insane idea. It
doesn work at all.

#12 Updated by Vit Ondruch almost 2 years ago

kosaki (Motohiro KOSAKI) wrote:

On Tue, Jul 3, 2012 at 12:35 AM, vo.x (Vit Ondruch)
v.ondruch@tiscali.cz wrote:

Issue #6590 has been updated by vo.x (Vit Ondruch).

kosaki (Motohiro KOSAKI) wrote:

Actually, this is not bigdecimal issue. It is gem discovery issue. MRI
support two extension types,
C and Ruby. JRuby also support two extension types, Java and Ruby. gem
loader should realized
the fact and prefer to look up Java implementation when used from
JRuby. I think.

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.

I disagree. JRuby bigdecimal is not equal with mrkn bigdecimal. It is
a forked gem. They were
maintained different maintainer and different repository. We can't
synchronized them anytime. So, No. Please drop f*cking insane idea. It
doesn work at all.

It is interesting to see you position, since such collaboration works for JSON gem for example (if I am not mistaken).

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.

#13 Updated by Alex Young almost 2 years ago

On 02/07/12 15:51, Aaron Patterson wrote:

On Sun, Jul 01, 2012 at 04:22:59PM +0900, mrkn (Kenta Murata) wrote:

Issue #6590 has been updated by mrkn (Kenta Murata).

I don't know how do I allow the JRuby team to uload the Java version of BigDecimal.
What should I do?

You can add headius like this:

$ gem owner -a headius@example.org bigdecimal

But you need his rubygems.org email address.

Charlie, would this be a sufficient solution for now? I suspect that
all stdlib gems suffer from this same problem. We should think about a
better solution. Whenever a CRuby stdlib gem with native code is released,
an equivalent JRuby gem should be released too. How can we accomplish
that?

Surely it's only necessary to coordinate both when the API changes? If
it's just bug-fixes, they should be independent.

--
Alex

#14 Updated by Charles Nutter almost 2 years ago

Facts:

  • JRuby's bigdecimal implementation is separate from MRI's
  • bigdecimal is shipped as a gem for MRI now, preinstalled by default but possible to upgrade and set as a gem dependency
  • Users who want the most current bigdecimal implementation on MRI may set bigdecimal as a dependency
  • Libraries may also set bigdecimal as a dependency
  • Without a gem that is installable on JRuby, those users and libraries will fail to install dependencies
  • BigDecimal is depended on by JRuby internals and cannot be separated from JRuby (i.e. JRuby can't run without BigDecimal library built in

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.

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.

#15 Updated by Yusuke Endoh almost 2 years ago

  • Status changed from Open to Assigned

#16 Updated by Yusuke Endoh over 1 year ago

  • Target version set to next minor

Also available in: Atom PDF