Skip to content

Introduce basic compatibility with JRuby 10 #273

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: monthly
groups:
actions-deps:
patterns: [ "*" ]
- package-ecosystem: maven
directory: "/"
schedule:
interval: monthly
groups:
maven-deps:
dependency-type: "production"
maven-dev-deps:
dependency-type: "development"
- package-ecosystem: bundler
directories:
- "/"
schedule:
interval: monthly
allow:
- dependency-type: all
groups:
ruby-deps:
patterns: [ "*" ]
72 changes: 31 additions & 41 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,22 @@ jobs:

strategy:
matrix:
jruby_version: [ '9.3.15.0', '9.4.12.0' ]
jruby_version: [ '9.3.15.0', '9.4.12.1', '10.0.0.1' ]
java_version: [ '8', '11', '17', '21' ]
exclude:
- jruby_version: '10.0.0.1'
java_version: '8' # JRuby 10 requires Java 21
- jruby_version: '10.0.0.1'
java_version: '11' # JRuby 10 requires Java 21
- jruby_version: '10.0.0.1'
java_version: '17' # JRuby 10 requires Java 21
fail-fast: false

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up JDK
uses: actions/setup-java@v4
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
java-version: ${{ matrix.java_version }}
distribution: 'temurin'
Expand All @@ -32,7 +39,7 @@ jobs:

# Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
uses: advanced-security/maven-dependency-submission-action@aeab9f885293af501bae8bdfe88c589528ea5e25 # v4.1.2
if: github.head_ref == 'refs/heads/master' && matrix.java_version == '8' && startsWith(matrix.jruby_version, '9.4')

appraisals:
Expand All @@ -42,66 +49,49 @@ jobs:

strategy:
matrix:
jruby_version: [ '9.3.15.0', '9.4.12.0' ]
jruby_version: [ '9.3.15.0', '9.4.12.1', '10.0.0.1' ]
java_version: [ '8', '11', '17', '21' ]
appraisal: [ 'rails50', 'rails52', 'rails60', 'rails61', 'rails70', 'rails71', 'rails72' ]
appraisal: [ 'rails50', 'rails52', 'rails60', 'rails61', 'rails70', 'rails71', 'rails72', 'rails80' ]
exclude:
- jruby_version: '9.3.15.0'
java_version: '8'
appraisal: 'rails70' # Requires Ruby 2.7 compatibility, which JRuby 9.3 does not support
- jruby_version: '9.3.15.0'
java_version: '8'
appraisal: 'rails71' # Requires Ruby 2.7 compatibility, which JRuby 9.3 does not support
- jruby_version: '9.3.15.0'
java_version: '8'
appraisal: 'rails72' # Requires Ruby 3.1 compatibility, which JRuby 9.3 does not support
- jruby_version: '9.3.15.0'
java_version: '11'
appraisal: 'rails70' # Requires Ruby 2.7 compatibility, which JRuby 9.3 does not support
- jruby_version: '9.3.15.0'
java_version: '11'
appraisal: 'rails71' # Requires Ruby 2.7 compatibility, which JRuby 9.3 does not support
- jruby_version: '9.3.15.0'
java_version: '11'
appraisal: 'rails72' # Requires Ruby 3.1 compatibility, which JRuby 9.3 does not support
- jruby_version: '9.3.15.0'
java_version: '17'
appraisal: 'rails70' # Requires Ruby 2.7 compatibility, which JRuby 9.3 does not support
- jruby_version: '9.3.15.0'
java_version: '17'
appraisal: 'rails71' # Requires Ruby 2.7 compatibility, which JRuby 9.3 does not support
- jruby_version: '9.3.15.0'
java_version: '17'
appraisal: 'rails72' # Requires Ruby 3.1 compatibility, which JRuby 9.3 does not support
- jruby_version: '9.3.15.0'
java_version: '21'
appraisal: 'rails70' # Requires Ruby 2.7 compatibility, which JRuby 9.3 does not support
- jruby_version: '9.3.15.0'
java_version: '21'
appraisal: 'rails71' # Requires Ruby 2.7 compatibility, which JRuby 9.3 does not support
- jruby_version: '9.3.15.0'
java_version: '21'
appraisal: 'rails72' # Requires Ruby 3.1 compatibility, which JRuby 9.3 does not support
appraisal: 'rails80' # Requires Ruby 3.4 compatibility, which JRuby 9.3 does not support
- jruby_version: '9.4.12.1'
appraisal: 'rails80' # Requires Ruby 3.4 compatibility, which JRuby 9.4 does not support
- jruby_version: '10.0.0.1'
java_version: '8' # JRuby 10 requires Java 21
- jruby_version: '10.0.0.1'
java_version: '11' # JRuby 10 requires Java 21
- jruby_version: '10.0.0.1'
java_version: '17' # JRuby 10 requires Java 21
fail-fast: false

env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.appraisal }}.gemfile
JRUBY_VERSION: ${{ matrix.jruby_version }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up JDK
uses: actions/setup-java@v4
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
java-version: ${{ matrix.java_version }}
distribution: 'temurin'
cache: maven

- name: Setup JRuby
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@e34163cd15f4bb403dcd72d98e295997e6a55798 # v1.238.0
with:
ruby-version: jruby-${{ matrix.jruby_version }}
bundler: 2.3.27 # use version that is OK for JRuby 9.3
bundler-cache: 'false' # Need to install later so we can vary from Gemfile.lock as required for JRuby version compatibility
bundler: ${{ startsWith(matrix.jruby_version, '9.3') && '2.3.27' || 'Gemfile.lock' }}

- name: Run appraisal for ${{ matrix.appraisal }}
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.appraisal }}.gemfile
run: bundle install && bundle exec rake spec

4 changes: 4 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ end
appraise "rails72" do
gem "rails", "~> 7.2.0"
end

appraise "rails80" do
gem "rails", "~> 8.0.0"
end
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ GEM
bundler
rake
thor (>= 0.14.0)
diff-lcs (1.6.0)
rack (2.2.13)
diff-lcs (1.6.2)
rack (2.2.15)
rake (13.2.1)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.3)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
rspec-expectations (3.13.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.2)
rspec-mocks (3.13.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.2)
rspec-support (3.13.3)
thor (1.3.2)

PLATFORMS
Expand Down
3 changes: 2 additions & 1 deletion History.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 1.2.3

- update (bundled) rack to 2.2.13
- Adds basic compatibility with JRuby 10.0
- update (bundled) rack to 2.2.15
- Corrects Rack 2.x compatibility when used with modern Rails, and requires Rack 2.x going forward
- forward ports all 1.1.x fixes to the 1.2.x stream which were omitted in 1.2.2 release (#262)
- fixes regression NoMethodError undefined method get_header (#259)
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ as context init parameters in web.xml or as VM-wide system properties.
sub-path of the main servlet context root.
- `gem.path`: Relative path to the bundled gem repository. Defaults to
*/WEB-INF/gems*.
- `jruby.compat.version`: Set to "1.8" or "1.9" to make JRuby run a specific
version of Ruby (same as the --1.8 / --1.9 command line flags).
- `jruby.min.runtimes`: For non-threadsafe Rails applications using a runtime
pool, specify an integer minimum number of runtimes to hold in the pool.
- `jruby.max.runtimes`: For non-threadsafe Rails applications, an integer
Expand Down
11 changes: 4 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,15 @@ end
directory 'target/classes'

desc "Compile classes"
task(:compile => 'target/classes') { sh 'mvn compile -Dmdep.skip=true' }
task(:compile => 'target/classes') do
sh "mvn compile #{ENV['JRUBY_VERSION'] ? "-Djruby.version=#{ENV['JRUBY_VERSION']}" : ""}"
end

directory 'target/test-classes'

desc "Compile test classes"
task(:test_compile => 'target/test-classes') { sh 'mvn test-compile -Dmdep.skip=true' }

desc "Copy .jar dependencies for (local) testing"
task(:test_jars) { sh 'mvn test-compile' }

task(:test_prepare => ['target/classes', 'target/test-classes']) do
sh 'mvn test-compile'
sh "mvn test-compile #{ENV['JRUBY_VERSION'] ? "-Djruby.version=#{ENV['JRUBY_VERSION']}" : ""}"
end

desc "Unpack the rack gem"
Expand Down
2 changes: 1 addition & 1 deletion examples/rails3/config/boot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
2 changes: 1 addition & 1 deletion gemfiles/rails50.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem "rspec", group: :test
gem "rails", "~> 5.0.0"

group :default do
gem "rack", "~> 2.2", "< 3.0"
gem "rack", "~> 2.2"
end

group :development do
Expand Down
24 changes: 13 additions & 11 deletions gemfiles/rails50.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ GEM
concurrent-ruby (1.3.5)
crass (1.0.6)
date (3.4.1-java)
diff-lcs (1.6.0)
diff-lcs (1.6.2)
erubis (2.7.0)
globalid (1.1.0)
activesupport (>= 5.0)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
loofah (2.24.0)
logger (1.7.0)
loofah (2.24.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
Expand All @@ -63,8 +64,8 @@ GEM
net-smtp
method_source (1.1.0)
mini_mime (1.1.5)
minitest (5.25.4)
net-imap (0.5.6)
minitest (5.25.5)
net-imap (0.5.8)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -74,10 +75,10 @@ GEM
net-smtp (0.5.1)
net-protocol
nio4r (2.7.4-java)
nokogiri (1.18.3-java)
nokogiri (1.18.8-java)
racc (~> 1.4)
racc (1.8.1-java)
rack (2.2.11)
rack (2.2.15)
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.7.2)
Expand Down Expand Up @@ -112,15 +113,16 @@ GEM
rspec-mocks (~> 3.13.0)
rspec-core (3.13.3)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
rspec-expectations (3.13.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.2)
rspec-mocks (3.13.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.2)
sprockets (4.2.1)
rspec-support (3.13.3)
sprockets (4.2.2)
concurrent-ruby (~> 1.0)
logger
rack (>= 2.2.4, < 4)
sprockets-rails (3.2.2)
actionpack (>= 4.0)
Expand All @@ -143,7 +145,7 @@ PLATFORMS

DEPENDENCIES
appraisal
rack (~> 2.2, < 3.0)
rack (~> 2.2)
rails (~> 5.0.0)
rake (~> 13.2)
rspec
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails52.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem "rspec", group: :test
gem "rails", "~> 5.2.0"

group :default do
gem "rack", "~> 2.2", "< 3.0"
gem "rack", "~> 2.2"
end

group :development do
Expand Down
24 changes: 13 additions & 11 deletions gemfiles/rails52.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ GEM
concurrent-ruby (1.3.5)
crass (1.0.6)
date (3.4.1-java)
diff-lcs (1.6.0)
diff-lcs (1.6.2)
erubi (1.13.1)
globalid (1.1.0)
activesupport (>= 5.0)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
loofah (2.24.0)
logger (1.7.0)
loofah (2.24.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
Expand All @@ -69,8 +70,8 @@ GEM
marcel (1.0.4)
method_source (1.1.0)
mini_mime (1.1.5)
minitest (5.25.4)
net-imap (0.5.6)
minitest (5.25.5)
net-imap (0.5.8)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -80,10 +81,10 @@ GEM
net-smtp (0.5.1)
net-protocol
nio4r (2.7.4-java)
nokogiri (1.18.3-java)
nokogiri (1.18.8-java)
racc (~> 1.4)
racc (1.8.1-java)
rack (2.2.11)
rack (2.2.15)
rack-test (2.2.0)
rack (>= 1.3)
rails (5.2.8.1)
Expand Down Expand Up @@ -119,15 +120,16 @@ GEM
rspec-mocks (~> 3.13.0)
rspec-core (3.13.3)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
rspec-expectations (3.13.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.2)
rspec-mocks (3.13.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.2)
sprockets (4.2.1)
rspec-support (3.13.3)
sprockets (4.2.2)
concurrent-ruby (~> 1.0)
logger
rack (>= 2.2.4, < 4)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
Expand All @@ -151,7 +153,7 @@ PLATFORMS

DEPENDENCIES
appraisal
rack (~> 2.2, < 3.0)
rack (~> 2.2)
rails (~> 5.2.0)
rake (~> 13.2)
rspec
Expand Down
Loading