Skip to content

Import JRuby extension #99

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 3 commits into
base: master
Choose a base branch
from
Open

Import JRuby extension #99

wants to merge 3 commits into from

Conversation

headius
Copy link

@headius headius commented Jun 25, 2025

This follows the model of the Psych library, but keeps all JRuby-specific code under ext/java including the lib/zlib.rb loading
stub and lib/zlib/versions.rb which contains the version string for the jzlib library we use.

The jzlib library is installed and loaded via jar_dependencies in the same way that snakeyaml-engine is installed and loaded for Psych.

This is based on the JRuby 10 version of code and as such only supports JRuby 10+ and Java 21+. JRuby 9.4 would not be able to use this gem, but it does not support loading zlib from a gem in any case.

Because of the odd way the build matrix is set up, I added a separate job to test on JRuby. It is not green, but the failures reflect the same zlib test excludes we have in the JRuby repository.

Fixes #38.

headius added 2 commits June 25, 2025 13:25
This follows the model of the Psych library, but keeps all JRuby-
specific code under ext/java including the lib/zlib.rb loading
stub and lib/zlib/versions.rb which contains the version string
for the jzlib library we use.

The jzlib library is installed and loaded via jar_dependencies in
the same way that snakeyaml-engine is installed and loaded for
Psych.

This is based on the JRuby 10 version of code and as such only
supports JRuby 10+ and Java 21+. JRuby 9.4 would not be able to
use this gem, but it does not support loading zlib from a gem in
any case.
@headius headius mentioned this pull request Jun 25, 2025
@headius
Copy link
Author

headius commented Jun 25, 2025

This turned out to be easier than expected. There's a couple open questions:

  • How to handle the failures?

These failures are known and excluded in JRuby's suite. I can make an effort to fix some of them, but others may be hard-to-fix incompatibilities with the jzlib library we use and maintain. Anything we can't or won't fix will need an exclude of some kind, which could perhaps just be a skip in the test?

  • Is this CI ok?

I introduced a new job for the JRuby build since it can be tested once and it won't matter what platform it is run on. The other job has multiple combinations of platform and Ruby implementation.

@hsbt
Copy link
Member

hsbt commented Jun 25, 2025

How to handle the failures?
which could perhaps just be a skip in the test?

I'm +1 to that.

Is this CI ok?

It's okay at the initial step. we can add CI like windows + jruby + build artifact in the future.

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

Successfully merging this pull request may close these issues.

JRuby support
2 participants