- Notifications
You must be signed in to change notification settings - Fork34
✅ Add TruffleRuby and JRuby to CI#470
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
eregon commentedMay 5, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I had a quick look through the failures athttps://github.com/ruby/net-imap/actions/runs/14711726747/job/41285563407?pr=470 That looks like an issue of Data#inspect or #to_s in truffleruby not calling inspect on the values. For the other failures I don't see anything obvious, I think they'll need investigation with some debugging, I suggest to do that later and so omit these 9 failures for now. |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
2b8ac4d tof098a98Compareeregon commentedMay 8, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
One thought I had given this gem is 3.1+ would be to use Struct (which exists since forever) instead of Data (+ freeze it, BTW thanks forthis issue, should be an easy quick fix). But you're saying there are other issues with Struct too? |
nevans commentedMay 8, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
That's fair. Idid consider going that route. But I also wanted the more constrained API of Data vs Struct. I originally started down the path of building a facade over Struct. And then a switched from that to just a PORO. But the API I wanted turned out to be the Data-API. So in the end, I just used Data. And I'd already done much of the work for several features using Data... but I was waiting for v0.6.0 (which will require ruby > 3.2) before merging them.
So I was originally going to hold off on mergingany new data structures until v0.6.0, just to avoid these issues. But work priorities bumped up the schedule for#333 and#329, which were both features I'd already mostly completed on my own time, based on
great! 👍🏻
My intention has always been (see#352 (comment)) for v0.6.0 to delete While working on this ticket, I briefly considered keeping it in v0.6.0, just for TruffleRuby and JRuby... but... I'm not gonna do that. 😉 I expect the JRuby and TruffleRuby bugfixes to come faster than my 0.6.0 release plans. 🙂
Yep. If you don't get to it first, I'll open TruffleRuby issue for it later today. But the failing And, to me, they seem very similar to the Data issues. My intuition may be completely wrong, but I would not be surprised if the fixes for |
nevans commentedMay 8, 2025
On further investigation, I suspect the Struct issue is not inheritance related, but a difference in how Struct handles mixed positional and keyword arguments. I createdtruffleruby/truffleruby#3855. |
nevans commentedMay 8, 2025
@eregon here's the issue I saw with #!/usr/bin/env rubyputs ?=*72puts"Ruby Engine:#{RUBY_ENGINE}#{RUBY_ENGINE_VERSION}"require'bundler/inline'gemfiledogem"stringio",">= 3.1.7"endrequire"stringio"puts"Using StringIO#{StringIO::VERSION}"io=StringIO.new("123456789\r\n123456789\r\n")ppstringio:io.gets("\r\n",10)r,w=IO.pipew.write"123456789\r\n123456789\r\n"w.closeppio_pipe:r.gets("\r\n",10)__END__$ ruby test.rb && RBENV_VERSION=truffleruby-24.2.1 ruby test.rb========================================================================Ruby Engine: ruby 3.4.2Using StringIO 3.1.7{stringio: "123456789\r"}{io_pipe: "123456789\r"}========================================================================Ruby Engine: truffleruby 24.2.1Using StringIO 3.0.1{:stringio=>"123456789\r\n"}{:io_pipe=>"123456789\r"} I didn't make a TruffleRuby ticket for this. I'm guessing this is already a known issue, given that it silently failed to use a newer version of |
eregon commentedMay 8, 2025
Thank you for reporting those and your work on adding TruffleRuby & JRuby in CI! Using Struct was just a quick idea, thank you for the detailed reply, I didn't expect that much details but it's good context. Re the StringIO issue, you are right, currently StringIO on TruffleRuby always usesour internal pure-Ruby implementation of it. But we should fix it to match the gem, so I created an issue from your comment:truffleruby/truffleruby#3856 |
This pushes `ensure state_logout!` from the receiver's `Thread.start`down into `#receive_responses`. As a side-effect, this also pullsthe state change inside the receiver thread's exception handling. Butthat's fine: it fits better inside `receive_responses`, and`state_logout!` really should never raise an exception anyway.
Using jruby-head to get unreleased parser bugfix.
Perhaps this will improve compatibility with JRuby and TruffleRuby?I tried to use `defined?(::Data.define)`, but that didn't work for somereason. 🤷Co-authored-by: Benoit Daloze <eregontp@gmail.com>
This should _not_ be merged into main. 😉It's only temporary, until bugs in TruffleRuby and JRuby are addressed:*jruby/jruby#8829*truffleruby/truffleruby#3846*truffleruby/truffleruby#3847The JRuby bug is a showstopper. The TruffleRuby bugs are cosmetic(inspect "nil" vs "") or academic (we never create recursive Data).
This is a real edge-case... one which I included only for completeness.We _should not_ be making any recursive `Data` objects in `Net::IMAP`.
bb04982 tofd2fd33Comparenevans commentedMay 14, 2025
All of the currently failing JRuby tests were passing for me locally. Oh well. Maybe it's some sort of race condition when calling But, |
eregon commentedJun 2, 2025
All the TruffleRuby issues are fixed now, excepttruffleruby/truffleruby#3858 where for AGE it's not currently planned to be fixed. |
nevans commentedJun 2, 2025
Excellent! Great work. 🙂
Yes! I'll clean this up and merge it (or a subset of it) before the 0.5.9 release (sometime this week). |
nevans commentedJun 9, 2025
@eregon I did discover one more issue:truffleruby/truffleruby/issues/3892. I'd had tests for it already, but forgot about them when I was making test cases for the others. |
nevans commentedOct 9, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Willfix#454 (once it's passing)
net-imapissues/PRs#inspect)#disconnectJRuby issues/PRs
net-imaptest code.TruffleRuby issues/PRs:
::Datamethods in abstract class truffleruby/truffleruby#3892Misc
get_tagged_responseandreceive_responses?)Datapolyfill. Rather than just check RUBY_ENGINE and RUBY_ENGINE_VERSION and defined?(::Data) and ::Data.respond_to?(:define), it tries to use all of the features that were causing tests to fail. If anything looks off, it prints a warning and falls back to the polyfill. I'm not going tomerge this feature check. But it's in the branch. 😉net-imapv0.6.0 will still be deletingDataLite.