JRuby 1.7.x compatibility
ryanfb opened this issue · 1 comments
Currently, a lot of the standalone scripts and tasks may fail if run under JRuby 1.7.x instead of (EOL'd) 1.6.8.
The big difference between the two is that 1.7.x defaults to Ruby 1.9 compat mode, while 1.6.8 defaults to Ruby 1.8 compat. You can get JRuby 1.7.x to run in Ruby 1.8 compat mode with e.g. jruby -Xcompat.version=1.8 -S bundle exec [command goes here]
, which may fix certain things. But we should probably upgrade things so they can run fine in 1.9 mode (with an eventual eye to 2.0 mode and JRuby 9.x).
The big changes between 1.8 and 1.9 (for this project) are how character encoding is handled and some differences in REXML (which JRuby compat modes may not completely account for).
For example, tests that pass under ruby 1.6.8 fail under 1.7.26.
$ cd ~/scratch
$ git clone git@github.com:papyri/xsugar.git
Cloning into 'xsugar'...
remote: Counting objects: 3852, done.
remote: Total 3852 (delta 0), reused 0 (delta 0), pack-reused 3852
Receiving objects: 100% (3852/3852), 3.13 MiB | 2.05 MiB/s, done.
Resolving deltas: 100% (1989/1989), done.
$ cd xsugar
$ more .ruby-version
jruby-1.6.8
$ bundle exec rake
/Users/paregorios/.rbenv/versions/jruby-1.6.8/bin/jruby -I"lib:test" -I"/Users/paregorios/.rbenv/versions/jruby-1.6.8/lib/ruby/gems/1.8/gems/rake-10.3.2/lib" "/Users/paregorios/.rbenv/versions/jruby-1.6.8/lib/ruby/gems/1.8/gems/rake-10.3.2/lib/rake/rake_test_loader.rb" "test/test_assertions.rb" "test/test_commentary_assertions.rb" "test/test_commentary_grammar.rb" "test/test_commentary_helper.rb" "test/test_grammar.rb" "test/test_helper.rb" "test/test_translation_assertions.rb" "test/test_translation_grammar.rb" "test/test_translation_helper.rb"
Loaded suite /Users/paregorios/.rbenv/versions/jruby-1.6.8/lib/ruby/gems/1.8/gems/rake-10.3.2/lib/rake/rake_test_loader
Started
...........................................................................................................
Finished in 129.317 seconds.
107 tests, 6134 assertions, 0 failures, 0 errors
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
$ mv .ruby-version ruby-version.bak
$ echo "jruby-1.7.26" > .ruby-version
$ bundle exec rake
The signal IOT is in use by the JVM and will not work correctly on this platform
The signal CLD is in use by the JVM and will not work correctly on this platform
The signal EXIT is in use by the JVM and will not work correctly on this platform
/Users/paregorios/.rbenv/versions/jruby-1.7.26/bin/jruby -I"lib:test" -I"/Users/paregorios/.rbenv/versions/jruby-1.7.26/lib/ruby/gems/shared/gems/rake-10.3.2/lib" "/Users/paregorios/.rbenv/versions/jruby-1.7.26/lib/ruby/gems/shared/gems/rake-10.3.2/lib/rake/rake_test_loader.rb" "test/test_assertions.rb" "test/test_commentary_assertions.rb" "test/test_commentary_grammar.rb" "test/test_commentary_helper.rb" "test/test_grammar.rb" "test/test_helper.rb" "test/test_translation_assertions.rb" "test/test_translation_grammar.rb" "test/test_translation_helper.rb"
SyntaxError: /Users/paregorios/scratch/xsugar/test/test_translation_grammar.rb:28: invalid multibyte char (US-ASCII)
require at org/jruby/RubyKernel.java:1040
(root) at /Users/paregorios/.rbenv/versions/jruby-1.7.26/lib/ruby/gems/shared/gems/rake-10.3.2/lib/rake/rake_test_loader.rb:15
select at org/jruby/RubyArray.java:2470
(root) at /Users/paregorios/.rbenv/versions/jruby-1.7.26/lib/ruby/gems/shared/gems/rake-10.3.2/lib/rake/rake_test_loader.rb:4
rake aborted!
SignalException: 1
Tasks: TOP => default => test
(See full trace by running task with --trace)
$ jruby -Xcompat.version=1.8 -S bundle exec rake
The signal IOT is in use by the JVM and will not work correctly on this platform
The signal CLD is in use by the JVM and will not work correctly on this platform
The signal EXIT is in use by the JVM and will not work correctly on this platform
/Users/paregorios/.rbenv/versions/jruby-1.7.26/bin/jruby -I"lib:test" -I"/Users/paregorios/.rbenv/versions/jruby-1.7.26/lib/ruby/gems/shared/gems/rake-10.3.2/lib" "/Users/paregorios/.rbenv/versions/jruby-1.7.26/lib/ruby/gems/shared/gems/rake-10.3.2/lib/rake/rake_test_loader.rb" "test/test_assertions.rb" "test/test_commentary_assertions.rb" "test/test_commentary_grammar.rb" "test/test_commentary_helper.rb" "test/test_grammar.rb" "test/test_helper.rb" "test/test_translation_assertions.rb" "test/test_translation_grammar.rb" "test/test_translation_helper.rb"
SyntaxError: /Users/paregorios/scratch/xsugar/test/test_translation_grammar.rb:28: invalid multibyte char (US-ASCII)
require at org/jruby/RubyKernel.java:1040
(root) at /Users/paregorios/.rbenv/versions/jruby-1.7.26/lib/ruby/gems/shared/gems/rake-10.3.2/lib/rake/rake_test_loader.rb:15
select at org/jruby/RubyArray.java:2470
(root) at /Users/paregorios/.rbenv/versions/jruby-1.7.26/lib/ruby/gems/shared/gems/rake-10.3.2/lib/rake/rake_test_loader.rb:4
rake aborted!
SignalException: 1
Tasks: TOP => default => test
(See full trace by running task with --trace)