Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to make oj work because of its runtime dependency on boxr. #3751

Closed
swapab opened this issue Mar 22, 2016 · 5 comments
Closed

Need to make oj work because of its runtime dependency on boxr. #3751

swapab opened this issue Mar 22, 2016 · 5 comments
Milestone

Comments

@swapab
Copy link

swapab commented Mar 22, 2016

Environment

  • JRuby version :
    jruby 9.0.0.0 (2.2.2) 2015-07-21 e10ec96 Java HotSpot(TM) 64-Bit Server VM 25.65-b01 on 1.8.0_65-b17 +jit [linux-amd64]

  • Operating system and platform

    ➜ trunk uname -a
    Linux swapnil-Lenovo-Z50-70 4.2.0-27-generic fix [JRUBY-5765]: cext build fails if 10.4 sdk installed #32-Ubuntu SMP Fri Jan 22 04:49:08 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

    ➜ trunk lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 15.10
    Release: 15.10
    Codename: wily

Relevant info:

This is not an issue, really. Just a situation.
I am using boxr to communicate with Box API.

boxr : I need oj. Runtime dependency you know.
jruby : Please Use alternatives(gson, json or json_pure instead)
boxr : I like Oj

Me : How can I make them both settle, so that everyone is happy ?

Error log:

Installing oj 2.12.9 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/home/swapnil/.rvm/rubies/jruby-9.0.0.0/bin/jruby -r ./siteconf20160322-8577-urgrdc.rb extconf.rb

NotImplementedError: C extensions are not supported
at /home/swapnil/.rvm/rubies/jruby-9.0.0.0/lib/ruby/stdlib/mkmf.rb:1
require at org/jruby/RubyKernel.java:940
(root) at /home/swapnil/.rvm/rubies/jruby-9.0.0.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
at extconf.rb:1

extconf failed, exit code 1

Gem files will remain installed in /home/swapnil/.rvm/gems/jruby-9.0.0.0@JayApp/gems/oj-2.12.9 for inspection.
Results logged to /home/swapnil/.rvm/gems/jruby-9.0.0.0@JayApp/extensions/universal-java-1.8/2.2.0/oj-2.12.9/gem_make.out

@kares
Copy link
Member

kares commented Mar 22, 2016

Swapnil, you have 2 options to make this work:

  1. create a "native" (JRuby ext) backend for oj gem so it works the same on JRuby
  2. avoid boxr direct dependending on oj (there used to be stuff such as multi_json which could maybe work with oj as the backend?)

NotImplementedError: C extensions are not supported won't go away - JRuby can not fix that.

@swapab
Copy link
Author

swapab commented Mar 22, 2016

Thanks @kares for the quick reply.

create a "native" (JRuby ext) backend for oj gem so it works the same on JRuby

Sounds exciting. Please excuse my knowledge in the native JRuby extension basics. But can you please guide me how to do that ?

avoid boxr direct dependending on oj (there used to be stuff such as multi_json which could maybe work with oj as the backend?)

This looks like an option I can try out. Make the json parser configurable in boxr itself (Oj/Multi_Json/) Again haven't tried this before will try though.

@kares kares added this to the Won't Fix milestone Mar 22, 2016
@kares
Copy link
Member

kares commented Mar 22, 2016

there's lots of gems out there that work as described in 1. (they do release 2 platform speficic gems for MRI and JRuby e.g. nokogiri) just do some research. there's also https://github.com/jruby/jruby-examples ... thanks for helping out on making gems work on JRuby!

@kares kares closed this as completed Mar 22, 2016
@enebo
Copy link
Member

enebo commented Mar 22, 2016

@kares @swapnilabnave I have in fact very infrequently been working on a native extension for oj. At this point I have most of the parsers ported but I am on the dumper (which is massive). Once the dumper is done I should be able to have a proper test run since results in tests require the dumper. At the point that is done I will try and merge it with oj assuming the author is happy.

@swapab
Copy link
Author

swapab commented Mar 22, 2016

Marvelous @enebo 👍 Looking forward to it 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants