Skip to content

Small string fixes for encoding compatibility issues #124

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

Merged
merged 5 commits into from
Mar 24, 2025

Conversation

headius
Copy link
Contributor

@headius headius commented Mar 24, 2025

See ruby/rake#619. The first two fixes here are in service of fixing that failure, but are not the actual bug fix. See jruby/jruby#8711 for the actual fix.

The other two fixes get jruby-head running green in CI.

  • Don't re-raise catString exceptions as a Java RuntimeException. This caused the ugly output in Bump ruby/setup-ruby from 1.222.0 to 1.227.0 rake#619.
  • Re-get the encoding when the string to be written in write must be converted first, since it may be negotiated to something other than its original encoding.
  • Add setup-java to jruby-head targets to ensure Java 21 is in PATH for JRuby 10.
  • Fix modifiable check for null StringIO (from eb4ee49).

headius added 3 commits March 24, 2025 14:32
We expect exceptions from catString, so just re-raise directly.

This caused the ugly internal RuntimeException trace in
ruby/rake#619. This does not fix that issue, but it properly lets
the original Ruby exception propagate.
These builds compile the extension, so they need to also have the
command line `javac` be Java 21 when building against JRuby 10.
@headius headius force-pushed the no_runtime_exception branch from 9ac74f4 to f63359b Compare March 24, 2025 19:32
@headius
Copy link
Contributor Author

headius commented Mar 24, 2025

These fixes should be released ASAP once green. The bad null StringIO code will not segfault on JRuby, but it will produce an internal Java NullPointerException when checking modifiability (which we consider equivalent to a "crash").

@headius headius merged commit b50e756 into ruby:master Mar 24, 2025
48 checks passed
@headius headius deleted the no_runtime_exception branch March 24, 2025 19:56
@headius
Copy link
Contributor Author

headius commented Mar 24, 2025

All set!

@hsbt @nobu @kou Hello! I would like a release if possible, or I can do a release if you permit me.

@kou
Copy link
Member

kou commented Mar 25, 2025

I can do but how about you try it?
Here is the current release procedure:

  1. Add a release note to NEWS.md something like f8fcaa8
  2. Push it
  3. Run rake release (gems are published from GitHub Actions)

@headius
Copy link
Contributor Author

headius commented Mar 25, 2025

@kou I will give it a try and let you know when it's done.

@headius
Copy link
Contributor Author

headius commented Mar 25, 2025

@kou Apparently I do not have push rights for the gem and rake release does not build and push the -java version. Help?

@headius
Copy link
Contributor Author

headius commented Mar 25, 2025

Actually it looks like it tries to release but fails during the build: https://github.com/ruby/stringio/actions/runs/14066275506/job/39389435498#step:3:278

I'm not sure what this error is so I'll have to investigate separately. We need to get the -java gem out there now though.

@kou
Copy link
Member

kou commented Mar 25, 2025

No problem. I'll fix it and release a new version.

@kou
Copy link
Member

kou commented Mar 25, 2025

It worked when I re-run the job: https://github.com/ruby/stringio/actions/runs/14066275506/job/39408925962

@kou
Copy link
Member

kou commented Mar 25, 2025

BTW, let's run the CI jobs with pull request to detect problems before we release a new version: #127

@headius
Copy link
Contributor Author

headius commented Mar 26, 2025

BTW, let's run the CI jobs with pull request to detect problems before we release a new version: #127

Great idea!

Thanks for your help!

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.

2 participants