-
Notifications
You must be signed in to change notification settings - Fork 29
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
Import JRuby's stringio impl #21
Conversation
I have reviewed the current code and we would need confirmation from the following individuals to relicense. Contributors listed below: please respond in a comment with the following, assuming you consent: "I consent to having my contributions relicensed under the Ruby license and the BSD 2-clause license." For me: I consent to having my contributions relicensed under the Ruby license and the BSD 2-clause license. |
I consent to having my contributions relicensed under the Ruby license and the BSD 2-clause license. |
1 similar comment
I consent to having my contributions relicensed under the Ruby license and the BSD 2-clause license. |
I consent to having my contributions to JRuby's stringio relicensed under the Ruby license and the BSD 2-clause license. |
I consent to having my contributions relicensed under the Ruby license and the BSD 2-clause license. Also.. wtf.. LOL |
@dragonsinth Thank you for your contribution! 😀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I consent to having my contributions relicensed under the Ruby license and the BSD 2-clause license.
The fields in JRuby must be deleted since the StringIO class will move out of the codebase. Do not depend on them.
Enumerator methods like #take will bail out before returning normally from the yield, avoiding the position increment.
Most of the fixes here are of the following types: * Encoding handling in StringIO construction * Proper checking for open/closed/read/write * Style fixes to arity-split more methods The three remaining excludes are as follows: * Two that test overflow conditions that are different or not relevant on JRuby's JVM-based String * One where we fail to reject trancoding UTF-8 to Windows-31J, somewhere in mixed-encoding negotiation logic
I have pushed an update to stringio that fixes all but three failures, adds JRuby to CI, rebases on current master, and tweaks Rakefile and Gemfile for the JRuby extension. The remaining three failures may need to be masked out.
Testing this will require a new jruby-head build until we have a preview gem we can use. Still waiting for consent to relicense from @orikremer. I'm going to remove the draft from this because I'd like to get some input from the maintainers. |
Thanks. I confirmed this with It seems that we have a bootstrap issue. rake-compiler requires I can fix this problem because I'm a rake-compiler maintainer. I'll do it later. Can we build |
I'm still searching for @orikremer. |
@kou Are we doing that for the regular gem right now? It's a good idea to have it build, and when we tag off a release we'll just download and push the built gems. |
I consent to having my contributions relicensed under the Ruby license and the BSD 2-clause license. |
@orikremer Thank you! All contributors have now given consent to relicense! |
This will allow saving the built gem (mostly for JRuby) so it can be uploaded without requiring a local Java install.
@kou I pushed a commit that builds the .gem file as the last step of successful GHA workflow, and indeed ran into the rake-compiler stringio.jar issue. Other than that I think it should work fine and saving the How would you like to proceed? |
Because yaml requires stringio implicitly. If stringio is required, we can't use rake-compiler for stringio. See also: ruby/stringio#21 (comment)
@headius Thanks! I've released rake-compiler with a fix for this. Now, we can build and test with JRuby. There are some warnings and tests failures/errors: https://github.com/ruby/stringio/runs/6034412008?check_suite_focus=true Should we fix them in this pull request or defer them for follow-up pull requests? For building gem in CI, we need to use https://github.com/actions/upload-artifact or https://github.com/softprops/action-gh-release to upload the built gem. I can take over it because I did it in other projects. |
@hsbt Could you add me to https://rubygems.org/gems/stringio 's owners to push a new release? |
@kou Sure, I send an invitation to you. |
@hsbt Thanks! Accepted. |
@kou I believe these are failing because jruby-head still ships its own built-in stringio and will not honor the version from the gem. I mentioned that in this comment and noted that three of these tests will probably not be fixable on JRuby before release (unsupported or broken due to unrelated JRuby issues). We will need to push a preview gem for jruby-head to start using the gem. We can do that before this PR is merged if you would like to see it closer to green first! We have done that before with io-wait to allow testing jruby-head (cc @hsbt). |
OK. |
@headius I've released 3.0.2.pre1https://rubygems.org/gems/stringio/versions/3.0.2.pre1-java but CI is still failing: https://github.com/ruby/stringio/runs/6043413008?check_suite_focus=true Could you confirm it? |
I have pushed a PR for JRuby to use the gem: jruby/jruby#7178 Note most of these suites fail because we are finishing 2.7-3.1 features currently. When this is complete and doesn't regress, I will push a snapshot build that should get picked up by the setup-ruby process after tonight. |
This will eventually import JRuby's stringio implementation. Initial import mirrors how the strscan impl was imported in ruby/strscan#25. I will get the failing tests passing and make sure the gem builds properly for the
java
platform.java
gem