-
Notifications
You must be signed in to change notification settings - Fork 117
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
Enable JRuby and Rubinius 1.9 mode in Travis #24
Conversation
RBX looks good, but Travis seems to be failing on the JRuby in 1.9 mode.
@alindeman Any thoughts? |
Aha! There is a json dependency in lib/grocer/notification.rb and lib/grocer/notification_reader.rb that are missing! That gem is not explicitly listed as a dependency in the gemspec. Let me fix that now. |
Let's try that.. |
|
Ah, this latest failure points to JRuby's need for a gem to do SSL. We should add that conditionally in Thanks for pointing out that we are close on supporting JRuby. |
That's what I thought too. However, after a brand new install of JRuby 1.6.8 ☺ $ ruby --1.9 --version
jruby 1.6.8 (ruby-1.9.2-p312) (2012-09-18 1772b40) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_37) [darwin-x86_64-java]
☺ $ jruby --1.9 -S irb
irb: RUBY_VERSION
===> "1.9.2"
irb: RUBY_PLATFORM
===> "java"
irb: JSON
NameError: uninitialized constant JSON
from org/jruby/RubyModule.java:2647:in `const_missing'
from /Users/steven/.rbenv/versions/jruby-1.6.8/lib/ruby/1.9/rake.rb:2482:in `const_missing'
from (irb):3:in `evaluate'
from org/jruby/RubyKernel.java:1117:in `eval'
from org/jruby/RubyKernel.java:1439:in `loop'
from org/jruby/RubyKernel.java:1226:in `catch'
from org/jruby/RubyKernel.java:1226:in `catch'
from /Users/steven/.rbenv/versions/jruby-1.6.8/bin/jirb:13:in `(root)'
irb: require 'json'
LoadError: no such file to load -- json
from org/jruby/RubyKernel.java:1071:in `require'
from /Users/steven/.rbenv/versions/jruby-1.6.8/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from (irb):4:in `evaluate'
from org/jruby/RubyKernel.java:1117:in `eval'
from org/jruby/RubyKernel.java:1439:in `loop'
from org/jruby/RubyKernel.java:1226:in `catch'
from org/jruby/RubyKernel.java:1226:in `catch'
from /Users/steven/.rbenv/versions/jruby-1.6.8/bin/jirb:13:in `(root)'
irb: Then, after a ☺ $ jruby --1.9 -S irb
irb: JSON
NameError: uninitialized constant JSON
from org/jruby/RubyModule.java:2647:in `const_missing'
from /Users/steven/.rbenv/versions/jruby-1.6.8/lib/ruby/1.9/rake.rb:2482:in `const_missing'
from (irb):1:in `evaluate'
from org/jruby/RubyKernel.java:1117:in `eval'
from org/jruby/RubyKernel.java:1439:in `loop'
from org/jruby/RubyKernel.java:1226:in `catch'
from org/jruby/RubyKernel.java:1226:in `catch'
from /Users/steven/.rbenv/versions/jruby-1.6.8/bin/jirb:13:in `(root)'
irb: require 'json'
===> true
irb: JSON
===> JSON
irb: WTF? |
It seems that JRuby 1.7.0 (1.9.3p203) does include some version of |
I seem to remember tweeting at @headius about this a while ago but I'm having trouble digging it up. From what I remember, |
I will fix this shortly, thx for investigating! On Thursday, November 15, 2012, Andy Lindeman wrote:
|
Not to mention that we need to build two different versions of the gem, one for Ruby and one for JRuby so we can ensure the proper dependencies are installed. @alindeman mentioned using conditional dependencies, but those are only executed when the gem is built, not when it's installed. So if we really want JRuby support, we'll need to automate the job of building both the standard, Ruby-only, gem and then a Java-only version. Nokogiri does just that (plus some other hacking for Windows support). |
@stevenharman I don't believe Grocer interfaces the PKCS12 directly, but uses PEM instead? If it's just PEM then I think JRuby works fine. Here is the code snipping needed to do direct p12 processing via Ruby (with a command line shellout for JRuby): https://gist.github.com/3077989 |
@kyledrake |
@stevenharman The developer will be warned on jruby that they need to install jruby-openssl, correct. This is just for the Gemfile to fix the tests. Platform specific gemset dependencies are not really a concept yet unfortunately AFAICT. |
Agreed that Rubygems doesn't support platform-specific dependencies. I'd prefer a user to be able to install the gem and get all necessary dependencies installed - hence the need for two different gems: gem.platform = 'java' if RUBY_PLATFORM == 'java'
gem.add_runtime_dependency('jruby-openssl') if RUBY_PLATFORM == 'java' And then building the gem on both a Ruby-only platform, and then again on a JRuby platform. Of course, we should automate this. But perhaps that is outside the scope of what we're going for here? |
Yeah, I think that should be a separate thing and we should just merge this in for now. Most JRuby devs at this point will know about the jruby-openssl requirement. If this was a huge project the java version would be nice, but I think it's unneccessary here. I made a note about it in the README that will inform developers that are not aware of this. |
Sounds legit. |
Damn it... Closed with d4d4279 |
Thank you!! |
Thank you, sir! |
FWIW, JRuby 1.7+ ship jruby-openssl in the box, with optional updating via the gem. Targeting only 1.7+ would be completely fine as far as we're concerned...we want to get people off 1.6.x anyway. And if you run into any issues in the future, please let us know. |
@headius Thanks for the info! The one outstanding issue for us is this: jruby/jruby-ossl#8 We can't do p12 to pem conversion without a shell command in JRuby, which isn't the end of the world, but would be a nice feature to have. |
JRuby 1.7 and RBX 2.0.0rc1 seem to be stable for Grocer, so I thought it would be nice to try again and see if it passes on Travis as well. Multithreaded APNS FTW