-
Notifications
You must be signed in to change notification settings - Fork 334
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
[fix] Ruby 2.5 compat with JRuby 9.2 #361
Conversation
@kares I just ran into this while testing oj and it seems to compare results with json gem. I may be underthinking this but can't we just use instanceof for RubyFixnum as a minimal fix here? We still internally use RubyFixnum for fixnums (so it should be forwards and backwards compatible). I believe the real issue with the code is that it uses object identity of metaclasses vs instanceof check of actual internal type. @headius not sure how hard this is to release but I would like to get this fixed so oj development does not need to work around this (this is only for testing but painful since it crashes part way through test runs without editing). |
@enebo arguably but there's the ugliness of Integer sub-class checking ... this seemed clearer |
... did have some more fixes (and performance improvement) e.g. BigDecimal isn't on par with C-code now, but someone needs to start merging |
@hsbt could you help us with our JRuby efforts for the json gem, or shall we ask someone else? |
@kares I think we should do whatever's the best for 9k+ and ditch 1.7. The instanceof check would also be fine; there's only two subclasses of Integer in 2.5. It would also be nice if you could move the non-bug-related commits to another PR. They're great, but they don't relate to this issue. @hsbt We will ping you when we think this is ready to go. I have push rights for the gem, but you probably should get them too... |
@kares Actually I'd almost prefer to just use instanceof for all the types, putting the most common ones at the top (string, integer, array, hash, etc). |
sorry about that - just ends up much more time spent on non-essential stuff for me. I'd like to have moved this forward and have more 'changes' around built on top - both fixes and refactorings (that I was hoping to get into whatever current stable is). did not see the other commits as harmful - they actually establish-ed a usable base line for me. if I made things hard to merge, I am sorry and will move them around.
once again I did not want to force breaking change for the 2.1 line, which I hoped this would end up at.
... is this the 'actual' thing blocking the merge here? |
slightly ugly but the only way to still compile under 1.7 once Ruby 1.9.3 gets dropped this should get ironed out ! resolves rubyGH-336
Hi folks, is there anything I can do to help get this merged? It looks like @kares addressed the feedback. It would would be great to see this make it into a JRuby release so we can upgrade our app from 9.1 to 9.2. |
@wezm There has not been a new release of this gem in two years, unfortunately, and I don't know how to make that happen. I have push rights for the gem, but I do not have push rights for this repository. I would hate to have to fork the repository so we can get fixes out, but this is getting kind of ridiculous. |
@skarmakar that is exactly what we're fixing here (a 9.2 issue)
9.2 with changes from the PR :
9.1.17 works fine with (also without) the patch :
|
@kares I am really sorry if it caused any confusion. Definitely want this fix to work and solve the issue. I used this branch in a rails project, but still was getting this same error. Is it something that even if we mention a different |
seems @flori landed the patch from this PR on master (for json 2.2.0). so we have JRuby progress, still not on par with the C code (BigDecimal warning) hopefully to happen later |
I have updated JRuby 9.2.7 to json 2.2.0. |
... also cleanup some pieces - mostly build tasks
wasn't possible to simply
rake test_ext
, now worksresolves GH-336