jruby icon indicating copy to clipboard operation
jruby copied to clipboard

Remaining Ruby 2.6 work

Open headius opened this issue 6 years ago • 21 comments

This issue is a catch-all for the unimplemented and tagged items during Ruby 2.6 compatibility work.

Original issue is #5576.

See also other incomplete issues #6149, #6157, #6158. #6159.

Language changes

  • [ ] Refinements take place at block passing Feature #14223
  • [ ] Refinements take place at Kernel#public_send Feature #15326
  • [ ] Refinements take place at Kernel#respond_to? Feature #15327
  • [x] Non-Symbol keys in a keyword arguments hash cause an exception. (This was later reverted as it was problematic to make such a change in 2.6. The larger change to kwarg handling was deferred until Ruby 3.0, with some changes and warnings in 2.7. See #6878.)
  • [x] The “shadowing outer local variable” warning is removed. Feature #12490
  • [x] Print cause of the exception if the exception is not caught and printed its backtraces and error message. Feature #8257 (https://github.com/jruby/jruby/pull/6889)

Core classes updates (outstanding ones only)

Exception

  • [ ] Exception#full_message takes :highlight and :order options. Bug #14324

NameError

  • [x] NameError.new accepts a :receiver option to set receiver in Ruby code. Feature #14313

NoMethodError

  • [x] NoMethodError.new accepts a :receiver option to set receiver in Ruby code. Feature #14313

TracePoint

Coverage

  • [x] A oneshot_lines mode is added. Feature #15022
  • [x] Add :oneshot_lines keyword argument to Coverage.start.
  • [ ] Add :stop and :clear keyword arguments to Coverage.result. If clear is true, it clears the counters to zero. If stop is true, it disables coverage measurement.
  • [x] Coverage.line_stub, which is a simple helper function that creates the “stub” of line coverage from a given source code.

NKF

  • [ ] Upgrade to nkf v2.1.5

Compatibility issues (excluding feature bug fixes)

Dir

  • [ ] Dir.glob with '\0'-separated pattern list will be deprecated, and is now warned. Feature #14643

File

  • [x] File.read, File.binread, File.write, File.binwrite, File.foreach, and File.readlines do not invoke external commands even if the path starts with the pipe character '|'. Feature #14245

Stdlib compatibility issues (excluding feature bug fixes)

These standard libraries have been promoted to default gems.

  • [x] matrix
  • [x] ostruct
  • [x] prime
  • [x] tracer

BigDecimal

  • [x] BigDecimal.new will be removed in version 2.0.
  • [x] BigDecimal creation with exception: false never raises exception (still failing on master)

Pathname

  • [x] Pathname#read, Pathname#binread, Pathname#write, Pathname#binwrite, Pathname#each_line and Pathname#readlines do not invoke external commands even if the path starts with the pipe character '|'. This follows Feature #14245

headius avatar Apr 02 '20 08:04 headius

@headius please review PR(https://github.com/jruby/jcodings/pull/31) This PR fixes caseMap for Georgian. I think you can remove the following exlclude tag.

 test/mri/excludes/TestCaseMappingPreliminary.rb 

 exclude :test_georgian_capitalize, "unfinished in initial 2.6 work, #6161"

Thank you.

k77ch7 avatar Apr 04 '20 05:04 k77ch7

@k77ch7 Looks like @lopex included this in the jcodings 1.0.47 update. I'll confirm and remove the exclude. Thank you!

headius avatar Apr 06 '20 20:04 headius

Exclude removed in 59a956975d.

headius avatar Apr 06 '20 20:04 headius

The prime and tracer gems have been released:

  • https://rubygems.org/gems/prime
  • https://rubygems.org/gems/tracer

headius avatar Apr 07 '20 12:04 headius

@headius @lopex please review PR(jruby/jcodings#32) This PR fixes treeStart for From_UTF8_MAC_Transcoder I think you can remove the following exlclude tag.

TestTranscode.rb 
exclude :test_utf8_mac, "needs investigation"

&

TestCSVEncodings.rb 
exclude :test_reading_with_most_encodings, "needs investigation, #6157"
exclude :test_regular_expression_escaping, "needs investigation, #6157"

these tests fail when UTF8-MAC encoding.

k77ch7 avatar Apr 19 '20 07:04 k77ch7

@k77ch7 Good find! I was wondering why we failed those CSV tests.

jcodings has been released with your fix and I'll push an update to JRuby shortly.

headius avatar Apr 20 '20 19:04 headius

@headius @lopex please review PR(jruby/jcodings#33) This updates UTF32Encoding. I think you can remove the following exlclude tag.

TestUTF32.rb
exclude :test_mbc_newline, "Java ArrayIndex error"

k77ch7 avatar Apr 28 '20 14:04 k77ch7

Coverage's oneshot_lines mode was added in #6180. The missing line_stub method was added in #6185.

headius avatar Apr 29 '20 01:04 headius

@k77ch7 Updated jcodings and encoding excludes in 8a848bdb5d.

headius avatar Apr 29 '20 01:04 headius

@headius Thank you.

k77ch7 avatar Apr 29 '20 12:04 k77ch7

I create 2 PR(jruby/jcodings#34 and jruby/jcodings#35) to reduce TestTranscode failures.

k77ch7 avatar May 05 '20 16:05 k77ch7

@k77ch7 😍

headius avatar May 05 '20 22:05 headius

@k77ch7 It looks like the jcodings changes have been merged, so we could do another release. Do you have any other patches in the works that we should wait for?

headius avatar May 05 '20 22:05 headius

@headius No, I don't have any patches now. But I'm investigating other encoding test cases.

k77ch7 avatar May 06 '20 13:05 k77ch7

@k77ch7 @lopex jcodings has been released and updated on JRuby master.

headius avatar May 08 '20 23:05 headius

@headius I create #6211 and jruby/jcodings#36 . I believe these will fix test/mri/ruby/test_transcode.rb failures.

k77ch7 avatar May 11 '20 15:05 k77ch7

The matrix gem has a new release (ruby/matrix#12) so I've switched us back to using the gem.

  • https://rubygems.org/gems/matrix

ostruct is the only remaining default gem for which we don't have a release.

@marcandre Thank you for getting an updated matrix release out! Only one to go!

headius avatar May 11 '20 22:05 headius

Bugger... apparently just linking an issue to a PR willl close that issue. Bad design.

headius avatar May 11 '20 22:05 headius

@headius I create jruby/jcodings#37 to reduce EncodingTest failures again.

k77ch7 avatar May 30 '20 11:05 k77ch7

@k77ch7 I'll get it merged in, thanks!

headius avatar Jun 04 '20 00:06 headius

@k77ch7 Nice, those two tests have no excludes now!

headius avatar Jun 04 '20 01:06 headius

Detargeting; a few of these are not supportable, and some others have their own issues. We'll leave this in place as a record of the bits we have not finished.

headius avatar Feb 09 '24 18:02 headius

Actually most of the remaining items have been implemented or moved to their own issues.

headius avatar Feb 09 '24 20:02 headius