From dc9c86876b3dafa85ea4e9312c33012154cee0ec Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Mon, 11 Sep 2017 09:42:31 +0200 Subject: [PATCH 1/6] Support JRuby 9.1.7.0 --- .travis.yml | 1 + lib/ruby_dep/ruby_version.rb | 1 + lib/ruby_dep/travis.rb | 1 + lib/ruby_dep/travis/ruby_version.rb | 17 ++++++++++++----- spec/lib/ruby_dep/travis/ruby_version_spec.rb | 7 +++++++ spec/lib/ruby_dep/travis_spec.rb | 7 +++++++ 6 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 67acebd..7a474b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ rvm: - 2.2.5 - 2.3.1 - jruby-9.1.2.0 + - jruby-9.1.8.0 before_install: gem install bundler -v 1.12.5 cache: bundler diff --git a/lib/ruby_dep/ruby_version.rb b/lib/ruby_dep/ruby_version.rb index da9acbc..d6eb2ae 100644 --- a/lib/ruby_dep/ruby_version.rb +++ b/lib/ruby_dep/ruby_version.rb @@ -36,6 +36,7 @@ def recommended(status) }, 'jruby' => { + '2.3.1' => :unknown, # jruby-9.1.7.0, jruby-9.1.8.0 '2.3.0' => :unknown, # jruby-9.1.2.0, jruby-9.1.0.0 '2.2.3' => :buggy, # jruby-9.0.5.0 '2.2.0' => :insecure diff --git a/lib/ruby_dep/travis.rb b/lib/ruby_dep/travis.rb index 5176a5a..d11b193 100644 --- a/lib/ruby_dep/travis.rb +++ b/lib/ruby_dep/travis.rb @@ -1,3 +1,4 @@ +require 'tmpdir' require 'yaml' require 'ruby_dep/travis/ruby_version' diff --git a/lib/ruby_dep/travis/ruby_version.rb b/lib/ruby_dep/travis/ruby_version.rb index 275aec4..8935e6a 100644 --- a/lib/ruby_dep/travis/ruby_version.rb +++ b/lib/ruby_dep/travis/ruby_version.rb @@ -47,12 +47,19 @@ def version_for(travis_version_string) match[:version] # if match[:engine] == 'ruby' end + JRUBY_VERSIONS = { + '9.1.8.0' => '2.3.1', + '9.1.7.0' => '2.3.1', + '9.1.2.0' => '2.3.0', + '9.1.0.0' => '2.3.0', + '9.0.5.0' => '2.2.3', + '9.0.4.0' => '2.2.2' + }.freeze + def jruby_version(version) - return '2.3.0' if version == '9.1.2.0' - return '2.3.0' if version == '9.1.0.0' - return '2.2.3' if version == '9.0.5.0' - return '2.2.2' if version == '9.0.4.0' - raise Error::Unrecognized::JRubyVersion, version + JRUBY_VERSIONS.fetch(version) do + raise Error::Unrecognized::JRubyVersion, version + end end end end diff --git a/spec/lib/ruby_dep/travis/ruby_version_spec.rb b/spec/lib/ruby_dep/travis/ruby_version_spec.rb index 0d02530..dd6fe2b 100644 --- a/spec/lib/ruby_dep/travis/ruby_version_spec.rb +++ b/spec/lib/ruby_dep/travis/ruby_version_spec.rb @@ -88,5 +88,12 @@ expect(subject.segments).to eq([2, 3, 0]) end end + + context 'with JRuby 9.1.7.0' do + let(:travis_version_string) { 'jruby-9.1.7.0' } + it 'returns the Ruby implementation version segments' do + expect(subject.segments).to eq([2, 3, 1]) + end + end end end diff --git a/spec/lib/ruby_dep/travis_spec.rb b/spec/lib/ruby_dep/travis_spec.rb index cafb967..e5a2f9b 100644 --- a/spec/lib/ruby_dep/travis_spec.rb +++ b/spec/lib/ruby_dep/travis_spec.rb @@ -76,6 +76,13 @@ expect(subject.version_constraint).to eq(['~> 2.3', '>= 2.3.0']) end end + + context 'with version 9.1.7.0' do + let(:yml) { YAML.dump('rvm' => %w(jruby-9.1.7.0)) } + it 'pessimistically locks with correct initial supported version' do + expect(subject.version_constraint).to eq(['~> 2.3', '>= 2.3.1']) + end + end end context 'with multiple versions' do From 68bfab3024a3e1993c95273b681486c1e3b6b91c Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Mon, 11 Sep 2017 09:47:07 +0200 Subject: [PATCH 2/6] Support JRuby 9.1.10.0, JRuby 9.1.12.0, JRuby 9.1.13.0 --- lib/ruby_dep/travis/ruby_version.rb | 3 +++ spec/lib/ruby_dep/travis/ruby_version_spec.rb | 6 +++--- spec/lib/ruby_dep/travis_spec.rb | 7 +++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/ruby_dep/travis/ruby_version.rb b/lib/ruby_dep/travis/ruby_version.rb index 8935e6a..e231c18 100644 --- a/lib/ruby_dep/travis/ruby_version.rb +++ b/lib/ruby_dep/travis/ruby_version.rb @@ -48,6 +48,9 @@ def version_for(travis_version_string) end JRUBY_VERSIONS = { + '9.1.13.0' => '2.3.3', + '9.1.12.0' => '2.3.3', + '9.1.10.0' => '2.3.3', '9.1.8.0' => '2.3.1', '9.1.7.0' => '2.3.1', '9.1.2.0' => '2.3.0', diff --git a/spec/lib/ruby_dep/travis/ruby_version_spec.rb b/spec/lib/ruby_dep/travis/ruby_version_spec.rb index dd6fe2b..75d8430 100644 --- a/spec/lib/ruby_dep/travis/ruby_version_spec.rb +++ b/spec/lib/ruby_dep/travis/ruby_version_spec.rb @@ -89,10 +89,10 @@ end end - context 'with JRuby 9.1.7.0' do - let(:travis_version_string) { 'jruby-9.1.7.0' } + context 'with JRuby 9.1.13.0' do + let(:travis_version_string) { 'jruby-9.1.13.0' } it 'returns the Ruby implementation version segments' do - expect(subject.segments).to eq([2, 3, 1]) + expect(subject.segments).to eq([2, 3, 3]) end end end diff --git a/spec/lib/ruby_dep/travis_spec.rb b/spec/lib/ruby_dep/travis_spec.rb index e5a2f9b..2416feb 100644 --- a/spec/lib/ruby_dep/travis_spec.rb +++ b/spec/lib/ruby_dep/travis_spec.rb @@ -83,6 +83,13 @@ expect(subject.version_constraint).to eq(['~> 2.3', '>= 2.3.1']) end end + + context 'with version 9.1.13.0' do + let(:yml) { YAML.dump('rvm' => %w(jruby-9.1.13.0)) } + it 'pessimistically locks with correct initial supported version' do + expect(subject.version_constraint).to eq(['~> 2.3', '>= 2.3.3']) + end + end end context 'with multiple versions' do From 1f5afa0d636170c4aaa609fff2a3c641035911b7 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Mon, 11 Sep 2017 10:01:55 +0200 Subject: [PATCH 3/6] Describe new 2.3.3 JRuby versions as :unknown --- lib/ruby_dep/ruby_version.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ruby_dep/ruby_version.rb b/lib/ruby_dep/ruby_version.rb index d6eb2ae..7731560 100644 --- a/lib/ruby_dep/ruby_version.rb +++ b/lib/ruby_dep/ruby_version.rb @@ -36,6 +36,7 @@ def recommended(status) }, 'jruby' => { + '2.3.3' => :unknown, # jruby-9.1.10.0, jruby-9.1.12.0, jruby-9.1.13.0 '2.3.1' => :unknown, # jruby-9.1.7.0, jruby-9.1.8.0 '2.3.0' => :unknown, # jruby-9.1.2.0, jruby-9.1.0.0 '2.2.3' => :buggy, # jruby-9.0.5.0 From 531642cca05d32217551a739cf803667ea4c8767 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Mon, 4 Jun 2018 10:04:49 +0200 Subject: [PATCH 4/6] Support JRuby 9.2.0.0 --- lib/ruby_dep/ruby_version.rb | 1 + lib/ruby_dep/travis/ruby_version.rb | 5 +++++ spec/lib/ruby_dep/travis_spec.rb | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/lib/ruby_dep/ruby_version.rb b/lib/ruby_dep/ruby_version.rb index 7731560..ccaf450 100644 --- a/lib/ruby_dep/ruby_version.rb +++ b/lib/ruby_dep/ruby_version.rb @@ -36,6 +36,7 @@ def recommended(status) }, 'jruby' => { + '2.5.0' => :unknown, # jruby-9.2.0.0 '2.3.3' => :unknown, # jruby-9.1.10.0, jruby-9.1.12.0, jruby-9.1.13.0 '2.3.1' => :unknown, # jruby-9.1.7.0, jruby-9.1.8.0 '2.3.0' => :unknown, # jruby-9.1.2.0, jruby-9.1.0.0 diff --git a/lib/ruby_dep/travis/ruby_version.rb b/lib/ruby_dep/travis/ruby_version.rb index e231c18..7abb88e 100644 --- a/lib/ruby_dep/travis/ruby_version.rb +++ b/lib/ruby_dep/travis/ruby_version.rb @@ -48,6 +48,11 @@ def version_for(travis_version_string) end JRUBY_VERSIONS = { + '9.2.0.0' => '2.5.0', + '9.1.17.0' => '2.3.3', + '9.1.16.0' => '2.3.3', + '9.1.15.0' => '2.3.3', + '9.1.14.0' => '2.3.3', '9.1.13.0' => '2.3.3', '9.1.12.0' => '2.3.3', '9.1.10.0' => '2.3.3', diff --git a/spec/lib/ruby_dep/travis_spec.rb b/spec/lib/ruby_dep/travis_spec.rb index 2416feb..84dedda 100644 --- a/spec/lib/ruby_dep/travis_spec.rb +++ b/spec/lib/ruby_dep/travis_spec.rb @@ -90,6 +90,13 @@ expect(subject.version_constraint).to eq(['~> 2.3', '>= 2.3.3']) end end + + context 'with version 9.2.0.0' do + let(:yml) { YAML.dump('rvm' => %w(jruby-9.2.0.0)) } + it 'pessimistically locks with correct initial supported version' do + expect(subject.version_constraint).to eq(['~> 2.5', '>= 2.5.0']) + end + end end context 'with multiple versions' do From 9cacc7f028039e730337755341283d153bbda4fa Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Mon, 4 Jun 2018 12:40:49 +0200 Subject: [PATCH 5/6] Workaround the _JAVA_OPTIONS issue - https://github.com/travis-ci/travis-ci/issues/8408 --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 7a474b6..dabe7ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,7 @@ rvm: - jruby-9.1.8.0 before_install: gem install bundler -v 1.12.5 +before_script: + - _JAVA_OPTIONS= + cache: bundler From 87492e9b3d479f704c94a3a974f0c92cf8517305 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Mon, 4 Jun 2018 13:41:57 +0200 Subject: [PATCH 6/6] Travis: try to workaround with blank _JAVA_OPTIONS - see https://docs.travis-ci.com/user/environment-variables/#Global-Variables for details on structure --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index dabe7ff..dd3276a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,10 @@ sudo: false language: ruby bundler_args: --without development -env: JRUBY_OPTS='--server -Xcompile.invokedynamic=false' +env: + global: + - JRUBY_OPTS='--server -Xcompile.invokedynamic=false' + - _JAVA_OPTIONS= rvm: - 2.2.5 - 2.3.1 @@ -9,7 +12,5 @@ rvm: - jruby-9.1.8.0 before_install: gem install bundler -v 1.12.5 -before_script: - - _JAVA_OPTIONS= cache: bundler