Skip to content

Native extension use in Gemfile prevents bundling on JRuby #2432

@headius

Description

@headius

There are dependencies on some native extensions not supported by JRuby (or supported, but not in the standard gems):

  • The dbm native extension library is not supported by JRuby, but it is a dependency in the stdlib tests section.
  • The pathname gem does not include native support for JRuby. We ship our own pure-Ruby pathname that has not been merged into the gem (JRuby support pathname#17).
  • rubocop-on-rbs gem has a dependency on zlib, which does not currently ship JRuby's extension (JRuby support zlib#38).
  • stackprof is a native extension specific to CRuby and not supported on JRuby.

Additionally, memory_profiler depends on CRuby-specific features and probably isn't useful on JRuby.

The following diff limits these gems to the ruby platform, but of course some tests fail when they are not available.

diff --git a/Gemfile b/Gemfile
index 095664ff..73cee00c 100644
--- a/Gemfile
+++ b/Gemfile
@@ -10,7 +10,7 @@ gem "test-unit"
 gem "rspec"
 gem "rubocop"
 gem "rubocop-rubycw"
-gem "rubocop-on-rbs"
+gem "rubocop-on-rbs", platform: :ruby
 gem "json"
 gem "json-schema"
 gem "goodcheck"
@@ -26,16 +26,16 @@ group :libs do
   gem "abbrev"
   gem "base64"
   gem "bigdecimal"
-  gem "dbm"
+  gem "dbm", platform: :ruby
   gem "mutex_m"
   gem "nkf"
-  gem "pathname"
+  gem "pathname", platform: :ruby
 end
 
 group :profilers do
   # Performance profiling and benchmarking
-  gem 'stackprof'
-  gem 'memory_profiler'
+  gem 'stackprof', platform: :ruby
+  gem 'memory_profiler', platform: :ruby
   gem 'benchmark-ips'
   gem "ruby_memcheck", platform: :ruby
 end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions