Skip to content

Native extension use in Gemfile prevents bundling on JRuby #2432

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
headius opened this issue Apr 25, 2025 · 0 comments
Open

Native extension use in Gemfile prevents bundling on JRuby #2432

headius opened this issue Apr 25, 2025 · 0 comments

Comments

@headius
Copy link

headius commented Apr 25, 2025

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant