-
Couldn't load subscription status.
- Fork 35
All tests passing on JRuby extension #116
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
Conversation
Iterators might close this StringIO so check each loop.
|
@nobu Hello! Maybe you can help me figure out this last failure, because it has me stumped. I've traced through the code in JRuby and CRuby and the first example here eventually gets to these lines in At this point, str1 is the blank Windows-31J string inside the StringIO, and str2 is the UTF-8 But |
|
@nobu After teaching myself how to step-debug CRuby again I figured out the problem: my version always passed str1 as the first argument to I have a hack coming to duplicate this behavior in StringIO for JRuby until JRuby can add a version of |
The version of this method in JRuby does not support passing an encoding for the first argument, which means downstream code in enc_compatible_latter will not reject cases StringIO is expected to reject. This patch hacks a version of rb_enc_check that works with current JRuby versions and exhibits the behavior required. A future JRuby update will improve this API and this hack should become a fallback at that point (for older JRuby versions).
5a489e4 to
247173b
Compare
f607392 to
4ed7b05
Compare
|
Oddly enough, the JRuby on macos job failed so I only added JRuby on windows to CI. I have filed jruby/jruby#8642 for the issue. @nobu @hsbt This can be merged and released any time, let me know if you have any comments. |
|
I just discovered some regressions and additional failures I can fix. Please wait to merge. |
The stringio library depends on being able to pass an encoding only as the first argument to rb_enc_check, which causes the downstream enc_compatible_latter to reject incompatible encodings regardless of the first string being blank. Part of fixes to pass stringio tests in ruby/stringio#116.
Specs trigger off the Ruby version currently running, assuming that the stringio version will be that which is typically shipped at that Ruby version level. However the gem can be upgraded, and will be upgraded in JRuby master (3.1 compat) once ruby#116 is merged and released, so support both versions of behavior here.
String data might be shared, so modify to ensure we have a writable version.
This method is added to JRuby in 9.4.13.0 and avoids the overhead of creating a fake CodeRangeable. See jruby/jruby#8643
b69b547 to
88d5e0c
Compare
|
I have pushed the remaining fixes needed to have all tests and all specs green. Everything here and in ruby/spec will be green once jruby/jruby#8643 has been merged to JRuby master and deployed as jruby-head. I tried to move that process along, but it may take another day to settle. Once everything runs green this can be merged and released. |
|
I'll release a new version in a few days. |
|
Done. |
|
@kou Thank you! |
This updates stringio to 3.1.4, which includes all the fixes from ruby/stringio#116. All CRuby tests and ruby/spec specs for stringio are now green. Tests are from v3.1.4 of the ruby/stringio repo.
This updates stringio to 3.1.5, which includes all the fixes from ruby/stringio#116 and the regression ruby/stringio#119 fixed by ruby/stringio#121. All CRuby tests and ruby/spec specs for stringio are now green. Tests are from v3.1.5 of the ruby/stringio repo.
This PR fixes all fixable test failures in the stringio test suite when running on JRuby with the Java-based extension.