Releases: oracle/truffleruby
TruffleRuby - GraalVM Community Edition 22.2.0
TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
The Ruby language component can be added to GraalVM using the gu
utility.
More information is available on the website: http://www.graalvm.org/ruby/
Changelog
New features:
- Add support for
darwin-aarch64
(Apple Silicon) (#2181, @lewurm, @chrisseaton, @eregon). - Add support for OpenSSL 3.0.0 by updating the openssl gem (@aardvark179, @eregon).
Bug fixes:
- Fix
rb_id2name
to ensure the native string will have the same lifetime as the id (#2630, @aardvark179). - Fix
MatchData#[]
exception when passing a length argument larger than the number of match values (#2636, @nirvdrum). - Fix
MatchData#[]
exception when supplying a large negative index along with a length argument (@nirvdrum). - Fix capacity computation for huge
Hash
(#2635, @eregon). - Fix aliased methods to return the correct owner when method is from a superclass (@bjfish).
- Fix
String#[Regexp, Integer]
when the capture group exists but is not matched (@eregon). - Fix
File.open
mode string parsing when binary option is the third character (@bjfish). - Fix
rb_scan_args_kw
macro to avoid shadowing variables (#2649, @aardvark179). - Fix
String#unpack("Z")
to not advance after the null byte, like CRuby (#2659, @aardvark179). - Fix
Float#round
to avoid losing precision during the rounding process (@aardvark179). - Fix
String#insert
to not call a subclassed string method (@bjfish). - Fix
rb_obj_call_init
to pass any block argument to theinitialize
method (#2675, @aardvark179). - Fix issue with feature loading not detecting a previously loaded feature (#2677, @bjfish).
- Fix
/#{...}/o
to evaluate only once per context when splitting happens (@eregon). - Fix
Kernel#sprintf
formatting of floats to be like CRuby (@aardvark179). - Fix
Process.egid=
to acceptString
s (#2615, @ngtban) - Fix optional assignment to only evaluate index arguments once (#2658, @aardvark179).
Compatibility:
- Updated to Ruby 3.0.3. The 3 CVEs did not affect TruffleRuby, this is to bring the stdlib and gem updates (@eregon).
- Fix
Marshal.dump
to raise an error when an object has singleton methods (@bjfish). Exception#full_message
now defaults the order to:top
like CRuby 3+ (@eregon).- Fix
Process.wait2
to returnnil
when theWNOHANG
flag is given and the child process is still running (@bjfish). - Disable most
nokogiri
C extension patches when system libraries are not being used (#2693, @aardvark179). - Implement
rb_gc_mark_maybe
andrb_global_variable
to ensureVALUE
stay live in C extensions (@aardvark179). - Implement
rb_imemo_tmpbuf
allocation forripper
(@aardvark179). - Implement
inherit
argument forModule#class_variables
(#2653, @bjfish). - Fix
Float#/
when dividing byRational
(@bjfish). Process.euid=
should accept String (#2615, @ngtban).- Fix
instance_variable_get
andinstance_variable_set
for immutable objects (@bjfish). Thread#raise(exc, message)
now callsexc.exception
in the target thread like CRuby (@eregon).- Define
Process::{CLOCK_BOOTTIME,CLOCK_BOOTTIME_ALARM,CLOCK_REALTIME_ALARM}
(#1480, @eregon). - Improve support of
:chomp
keyword argument inIO
andStringIO
methods (#2650, @andrykonchin). - Implement specializations for immutable ruby objects for ObjectSpace methods (@bjfish).
- Use
$PAGER
for--help
and--help*
, similar to CRuby (#2542, @Strech). - Ensure all headers are warnings-free (#2662, @eregon).
- All
IO
instances should haveT_FILE
as theirrb_type()
, not onlyFile
instances (#2662, @eregon). - Make
rb_fd_select
retry onEINTR
(#1584, @aardvark179).
Performance:
- Reimplement
Float#to_s
for better performance (#1584, @aardvark179). - Improve reference processing by making C object free functions and other finalizers more lightweight (@aardvark179).
- Improve performance of
RSTRING_PTR
for interned strings (@aardvark179). - Cache constant argument formats used with
rb_scan_args_kw
(@aardvark179).
Changes:
TruffleRuby - GraalVM Community Edition 22.1.0
TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
The Ruby language component can be added to GraalVM using the gu
utility.
More information is available on the website: http://www.graalvm.org/ruby/
Changelog
New features:
- Foreign exceptions are now fully integrated and have most methods of
Exception
(@eregon). - Foreign exceptions can now be rescued with
rescue Polyglot::ForeignException
orrescue foreign_meta_object
(#2544, @eregon).
Bug fixes:
- Guard against unterminated ranges in file matching patterns (#2556, @aardvark179).
- Fixed
rb_proc_new
to return a proc that will pass all required arguments to C (#2556, @aardvark179). - Fixed
String#split
to return empty array when splitting all whitespace on whitespace (#2565, @bjfish). - Raise
RangeError
forTime.at(bignum)
(#2580, @eregon). - Fix
Integer#{<<,>>}
with RHS bignum and long (@eregon). - Fix a resource leak from allocators defined in C extensions (@aardvark179).
SIGINT
/Interrupt
/Ctrl+C
now shows the backtrace and exits as signaled, like CRuby (@eregon).- Update patch feature finding to prefer the longest matching load path (#2605, @bjfish).
- Fix
Hash#{to_s,inspect}
for keys whose#inspect
return a frozen String (#2613, @eregon). - Fix
Array#pack
withx*
to not output null characters (#2614, @bjfish). - Fix
Random#rand
not returning random floats when given float ranges (#2612, @bjfish). - Fix
Array#sample
for[]
when called withoutn
and aRandom
is given (#2612, @bjfish). - Fix
Module#const_get
to raise aNameError
when nested modules do not exist (#2610, @bjfish). - Ensure native
VALUE
s returned from C are unwrapped before the objects can be collected (@aardvark179). - Fix
Enumerator::Lazy#with_index
to start with new index for multiple enumerations (@bjfish). - Fix
rb_id2name
to ensure the native string will have the same lifetime as the id (#2630, @aardvark179). - Fix
MatchData#[]
exception when passing a length argument larger than the number of match values (#2636, @nirvdrum). - Fix
MatchData#[]
exception when supplying a large negative index along with a length argument (@nirvdrum). - Fix
Integer#fdiv
andRational#to_f
for largeInteger
values (#2631, @bjfish).
Compatibility:
- Implement full Ruby 3 keyword arguments semantics (#2453, @eregon, @chrisseaton).
- Implement
ruby_native_thread_p
for compatibility (#2556, @aardvark179). - Add
rb_argv0
for thetk
gem. (#2556, @aardvark179). - Implement more correct conversion of array elements by
Array#pack
(#2503, #2504, @aardvark179). - Implement
Pathname#{empty?, glob}
(#2559, @bjfish) - Fixed
Rational('')
to raise error like MRI (#2566, @aardvark179). - Freeze instances of
Range
but not subclasses, like CRuby (#2570, @MattAlp). - When writing to STDOUT redirected to a closed pipe, no broken pipe error message will be shown now. (#2532, @gogainda).
- Use
#to_a
for convertinglist
inrescue *list
(#2572, @eregon). - Implement 'rb_str_buf_append' (@bjfish).
- Add patch for
digest
so that TruffleRuby implementation is not overridden (@bjfish). - Handle encoding conversion errors when reading directory entries (@aardvark179).
- Follow symlinks when processing
*/
directory glob patterns. (#2589, @aardvark179). - Set
@gem_prelude_index
variable on the default load paths (#2586 , @bjfish) - Do not call
IO#flush
dynamically fromIO#close
(#2594, @gogainda). - Implement
rb_str_new_static
for C extensions that use it (@aardvark179). - Rewrote
ArrayEachIteratorNode
and re-introducedeach
specs for MRI parity when mutating arrays whilst iterating, rather than crashing (#2587, @MattAlp) - Update
String#rindex
to only acceptRegexp
or objects convertable toString
as the first parameter (#2608, @bjfish). - Update
String#<<
to require one argument (#2609, @bjfish). - Update
String#split
to raiseTypeError
when false is given (#2606, @bjfish). - Update
String#lstrip!
to remove leading null characters (#2607, @bjfish). - Update
File.utime
to return the number of file names in the arguments (#2616, @bjfish). - Update
Dir.foreach
to accept anencoding
parameter (#2627, @bjfish). - Update
IO.readlines
to ignore negative limit parameters (#2625 , @bjfish). - Update
Math.sqrt
to raise aMath::DomainError
for negative numbers (#2621, @bjfish). - Update
Enumerable#inject
to raise anArgumentError
if no block or symbol are given (#2626, @bjfish). - Fix
Marshal.dump
to raise an error when an object has singleton methods (@bjfish).
Performance:
- Increase dispatch limit for string library to handle mutable, immutable and non-strings (@aardvark179)
- Switch to
Arrays.mismatch()
in string comparison for better performance (@aardvark179). - Removed extra array allocations for method calls in the interpreter to improve warmup performance (@aardvark179).
- Optimize
Dir[]
by sorting entries as they are found and grouping syscalls (#2092, @aardvark179). - Reduce memory footprint by tracking
VALUE
s created during C extension init separately (@aardvark179). - Rewrote
ArrayEachIteratorNode
to optimize performance for a constant-sized array and reduce specializations to 1 general case (#2587, @MattAlp) - Reduce conversion of
VALUE
s to native handle during common operations in C extensions (@aardvark179). - Improved performance of regex boolean matches (e.g.,
Regexp#match?
) by avoiding match data allocation in TRegex (#2588, @nirvdrum). - Remove overhead when getting using
RDATA_PTR
(@aardvark179). - Additional copy operations have been reduced when performing IO (#2536, @aardvark179).
Changes:
- Foreign exceptions are no longer translated to
RuntimeError
but instead remain as foreign exceptions, see the documentation for how to rescue them (@eregon).
TruffleRuby - GraalVM Community Edition 22.0.0.2
TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
The Ruby language component can be added to GraalVM using the gu
utility.
More information is available on the website: http://www.graalvm.org/ruby/
Changelog
New features:
Bug fixes:
- Fix File.utime to use nanoseconds (#2448, @bjfish).
- Capture the intercepted feature path during patching to reuse during patch require (#2441, @bjfish).
- Update Module#constants to filter invalid constant identifiers (#2452, @bjfish).
- Fixed -0.0 <=> 0.0 and -0.0 <=> 0 to return 0 like on CRuby (#1391, @eregon).
- Fixed Range#step to return correct class with begin-less range (@ccocchi, #2516).
- Fixed exception creation when an Errno is sub-classed (@bjfish, #2521).
- Fixed String#[]= to use the negotiated encoding (@bjfish, #2545).
Compatibility:
- Implement rb_sprintf in our format compiler to provide consistent formatting across C standard libraries (@eregon).
- Update defined? to return frozen strings (#2450, @bjfish).
- Use compensated summation for {Array,Enumerable}#sum when floating point values are included (@eregon).
- Module#attr_* methods now return an array of method names (#2498, @gogainda).
- Fixed Socket#(local|remote)_address to retrieve family and type from the file descriptor (#2444, @larskanis).
- Add Thread.ignore_deadlock accessor (#2453, @bjfish).
- Allow Hash#transform_keys to take a hash argument (@ccocchi, #2464).
- Add Enumerable#grep{_v} optimization for Regexp (#2453, @bjfish).
- Update IO#write to accept multiple arguments (#2501, @bjfish).
- Do not warn when uninitialized instance variable is accessed (#2502, @andrykonchin).
- Remove TRUE, FALSE, and NIL constants like CRuby 3.0 (#2505, @andrykonchin).
- Symbol#to_proc now returns a lambda like in Ruby 3 (#2508, @andrykonchin).
- Kernel#lambda now warns if called without a literal block (#2500, @andrykonchin).
- Implement Hash#except (#2463, @wildmaples).
- Remove special $SAFE global and related C API methods (#2453, @bjfish).
- Assigning to a numbered parameter raises SyntaxError (#2506, @andrykonchin).
- Implement --backtrace-limit option (#2453, @bjfish).
- Update String methods to return String instances when called on a subclass (#2453, @bjfish).
- Update String#encode to support the :fallback option (#1391, @aardvark179).
- Module#alias_method now returns the defined alias as a symbol(#2499, @gogainda).
- Implement Symbol#name (#2453, @bjfish).
- Update Module#{public, protected, private, public_class_method, private_class_method} and top-level private and public methods to accept single array argument with a list of method names (#2453, @bjfish).
- Constants deprecated by Module#deprecate_constant only warn if Warning[:deprecated] is true (@eregon).
- All Array methods now return Array instances and not subclasses (#2510, @Strech).
- Integer#zero? overrides Numeric#zero? for optimization (#2453, @bjfish).
- Default Kernel#eval source file and line to (eval):1 like CRuby 3 (#2453, @aardvark179).
- Add GC.auto_compact accessors for compatibility (#2453, @bjfish).
- Update accessing a class variable from the top-level scope to be a RuntimeError (#2453, @bjfish).
- Update interpolated strings to not be frozen (#2453, @bjfish).
- Add WERRORFLAG to RbConfig (#2519, @bjfish).
- Update MatchData methods to return String instances when called on a subclass (#2453, @bjfish).
- Implement Proc#{==,eql?} (#2453, @bjfish).
- Implement all StringScanner methods (#2520, @eregon).
- Handle Kernel#clone(freeze: true) (#2512, @andrykonchin).
- Relax Fiber#transfer limitations (#2453, @bjfish).
- Implement Fiber#blocking? like CRuby 3 (#2453, @aardvark179).
- Sort by default for Dir.{glob,[]} and add sort: keyword argument (#2523, @Strech).
- Implement rb_str_locktmp and rb_str_unlocktmp (#2524, @bjfish).
- Update Kernel#instance_variables to return insertion order (@bjfish).
- Fixed rb_path2class() to not error for a module (#2511, @eregon).
- Update Kernel#print to print $_ when no arguments are given (#2531, @bjfish).
- Add category kwarg to Kernel.warn and Warning.warn (#2533, @Strech).
- Implement GC.{measure_total_time, total_time} and update GC.stat to update provided hash (#2535, @bjfish).
- Implement Array#slice with ArithmeticSequence (#2526, @ccocchi).
- Update Hash#each to consistently yield a 2-element array (#2453, @bjfish).
- Remove Hash#{store, index} methods for compatibility (#2546, @bjfish).
- Implement more correct conversion of array elements by Array#pack (#2503, #2504, @aardvark179).
- Update String#split to raise a RangeError when limit is larger than int (@bjfish).
Performance:
- Regexp objects are now interned in a similar way to symbols (@aardvark179).
- Improve performance of regexps using POSIX bracket expressions (e.g., [[:lower:]]) matching against ASCII-only strings (#2447, @nirvdrum).
- String#sub, sub!, gsub, and gsub! have been refactored for better performance (@aardvark179).
- Don't allocate a MatchData object when Regexp#match? or String#match? is used (#2509, @nirvdrum).
- Add ENV.except (#2507, @Strech).
- Fully inline the Integer#+ and Integer#- logic for interpreter speed (#2518, @smarr).
- Remove unnecessary work in negotiating the encoding to use in a Regexp match (#2522, @nirvdrum).
- Add new fast paths for encoding negotiation between strings with different encodings, but which match common default cases (#2522, @nirvdrum).
- Reduce footprint by removing unnecessary nodes for accessing the FrameOnStackMarker (#2530, @smarr).
Changes:
- TruffleRuby now requires Java 11+ and no longer supports Java 8 (@eregon).
TruffleRuby - GraalVM Community Edition 21.3.0
TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby 2.7.3, MRI.
The Ruby support is not available in GraalVM by default and should be installed: gu install ruby
.
More information is available on the website: http://www.graalvm.org/ruby/
Changelog
New features:
- TRegex is now used by default, which provides large speedups for matching regular expressions (@jirkamarsik).
- Add
Polyglot.languages
to expose the list of available languages. - Add
Polyglot::InnerContext
to eval code in any available language in an inner isolated context (#2169, @eregon). - Foreign objects now have a dynamically-generated class based on their interop traits like
ForeignArray
and are better integrated with Ruby objects (#2149, @eregon and @rbotafogo). - Foreign arrays now have all methods of Ruby
Enumerable
and many methods ofArray
(#2149, @eregon and @rbotafogo). - Foreign hashes now have all methods of Ruby
Enumerable
and many methods ofHash
(#2149). - Foreign iterables (
InteropLibrary#hasIterator
) now have all methods of RubyEnumerable
(#2149). - Foreign objects now implement
#instance_variables
(readable non-invocable members) and#methods
(invocable members + Ruby methods).
Bug fixes:
- Fix
Marshal.load
of multipleSymbols
with an explicit encoding (#1624). - Fix
rb_str_modify_expand
to preserve existing bytes (#2392, @bjfish). - Fix
String#scrub
when replacement is frozen (#2398, @LillianZ). - Fix
Dir.mkdir
error handling forPathname
paths (#2397). BasicSocket#*_nonblock(exception: false)
now only return:wait_readable/:wait_writable
forEAGAIN
/EWOULDBLOCK
like MRI (#2400).- Fix issue with
strspn
used in thedate
C extension compiled as a macro on older glibc and then missing the__strspn_c1
symbol on newer glibc (#2406). - Fix constant lookup when loading the same file multiple times (#2408).
- Fix handling of
break
,next
andredo
indefine_method(name, &block)
methods (#2418). - Fix handling of incompatible types in
Float#<=>
(#2432, @chrisseaton). - Fix issue with escaping curly braces for
Dir.glob
(#2425). - Fix
base64
decoding issue with missing output (#2435). - Fix
StringIO#ungetbyte
to treat a byte as a byte, not a code point (#2436, @aardvark179). - Fix
defined?(yield)
when used inside a block (#2446). - Fix a couple issues related to native memory allocation and release.
- Capture the intercepted feature path during patching to reuse during patch require (#2441).
Compatibility:
- Implement
Process::Status.wait
(#2378). - Update
rb_str_modify
andrb_str_modify_expand
to raise aFrozenError
when given a frozen string (#2392). - Implement
rb_fiber_*
functions (#2402). - Implement
rb_str_vcatf
. - Add support for tracing allocations from C functions (#2403, @chrisseaton).
- Implement
rb_str_catf
. - Search the executable in the passed env
PATH
for subprocesses (#2419). - Accept a string as the pattern argument to
StringScanner#scan
andStringScanner#check
(#2423).
Performance:
- Moved most of
MonitorMixin
to primitives to deal with interrupts more efficiently (#2375). - Improved the performance of
rb_enc_from_index
by adding cached lookups (#2379, @nirvdrum). - Improved the performance of many
MatchData
operations (#2384, @nirvdrum). - Significantly improved performance of TRegex calls by allowing Truffle splitting (#2389, @nirvdrum).
- Improved
String#gsub
performance by adding a fast path for thestring_byte_index
primitive (#2380, @nirvdrum). - Improved
String#index
performance by adding a fast path for thestring_character_index
primitive (#2383, @LillianZ). - Optimized conversion of strings to integers if the string contained a numeric value (#2401, @nirvdrum).
- Use Truffle's
ContextThreadLocal
to speedup access to thread-local data. - Provide a new fast path for
rb_backref*
andrb_lastline*
functions from C extensions.
Changes:
foreign_object.class
on foreign objects is no longer special and usesKernel#class
(it used to return thejava.lang.Class
object for a Java type orgetMetaObject()
, but that is too incompatible with Ruby code).Java.import name
imports a Java class in the enclosing module instead of always as a top-level constant.foreign_object.keys
no longer returns members, useforeign_object.instance_variables
orforeign_object.methods
instead.foreign_object.respond_to?(:class)
is now always true (before it was only for Java classes), since the method is always defined.
Security:
- Updated to Ruby 2.7.4 to fix CVE-2021-31810, CVE-2021-32066 and CVE-2021-31799.
TruffleRuby - GraalVM Community Edition 21.2.0.1
TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
The Ruby language component can be added to GraalVM using the gu
utility.
More information is available on the website: http://www.graalvm.org/ruby/
Changelog
Bug fixes:
- Fix issue with
strspn
used in thedate
C extension compiled as a macro on older glibc and then missing the__strspn_c1
symbol on newer glibc (#2406).
TruffleRuby - GraalVM Community Edition 21.2.0
TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
The Ruby language component can be added to GraalVM using the gu
utility.
More information is available on the website: http://www.graalvm.org/ruby/
Changelog
New features:
- New
TruffleRuby::ConcurrentMap
data structure for use inconcurrent-ruby
(#2339, @wildmaples).
Bug fixes:
- Fix of different values of self in different scopes (@entlicher).
Truffle::POSIX.select
was being redefined repeatedly (#2332, @eregon).- Fix the
--backtraces-raise
and--backtraces-rescue
options in JVM mode (#2335). - Fix
File.{atime, mtime, ctime}
to include nanoseconds (#2337). - Fix
Array#[a, b] = "frozen string literal".freeze
(#2355). rb_funcall()
now releases the C-extension lock (similar to MRI).- Fix
rb_str_modify_expand
to preserve existing bytes (#2392). - Fix
Marshal.load
of multipleSymbols
with an explicit encoding (#1624). - Fix
String#scrub
when replacement is frozen (#2398, @LillianZ).
Compatibility:
- Updated to Ruby 2.7.3. The
resolv
stdlib was not updated (resolv
in 2.7.3 has bugs). - Make interpolated strings frozen for compatibility with Ruby 2.7 (#2304, @kirs).
require 'socket'
now also requires'io/wait'
like CRuby (#2326).- Support precision when formatting strings (#2281, @kirs).
- Make rpartition compatible with Ruby 2.7 (#2320, @gogainda).
- Include the type name in exception messages from
rb_check_type
(#2307). - Fix
Hash#rehash
to remove duplicate keys after modifications (#2266, @MattAlp) - Only fail
rb_check_type
for typed data, not wrapped untyped structs (#2331, @aardvark179). - Decide the visibility in
Module#define_method
based onself
and the default definee (#2334). - Configure
mandir
value inRbConfig::CONFIG
andRbConfig::MAKEFILE_CONFIG
(#2315, @bjfish). - TruffleRuby now supports the Truffle polyglot Hash interop API (@norswap).
- Implement
Fiber#raise
(#2338). - Update
File.basename
to return newString
instances (#2343). - Allow
Fiber#raise
afterFiber#transfer
like Ruby 3.0 (#2342). - Fix
ObjectSpace._id2ref
for Symbols and frozen String literals (#2358). - Implemented
Enumerator::Lazy#filter_map
(#2356). - Fix LLVM toolchain issue on macOS 11.3 (#2352, oracle/graal#3383).
- Implement
IO#set_encoding_by_bom
(#2372, pawandubey). - Implemented
Enumerator::Lazy#with_index
(#2356). - Implement
rb_backref_set
. - Fix
Float#<=>
when comparingInfinity
to other#infinite?
values. - Implement
date
library as a C extension to improve compatibility (#2344). - Update
rb_str_modify
andrb_str_modify_expand
to raise aFrozenError
when given a frozen string (#2392).
Performance:
- Make
#dig
iterative to make it faster and compile better for calls with 3+ arguments (#2301, @chrisseaton, @jantnovi). - Make
Struct#dig
faster in interpreter by avoiding exceptions (#2306, @kirs). - Reduce the number of AST nodes created for methods and blocks (#2261).
- Fiber-local variables are much faster now by using less synchronization.
- Improved the performance of the exceptional case of
String#chr
(#2318, @chrisseaton). - Improved the performance of
IO#read_nonblock
when no data is available to be read. TruffleSafepoint
is now used instead of custom logic, which no longer invalidates JITed code for guest safepoints (e.g.,Thread#{backtrace,raise,kill}
,ObjectSpace
, etc)- Significantly improved performance of
Time#strftime
for common formats (#2361, @wildmaples, @chrisseaton). - Faster solution for lazy integer length (#2365, @lemire, @chrisseaton).
- Speedup
rb_funcallv*()
by directly unwrapping the C arguments array instead of going through a RubyArray
(#2089).
Changes:
rb_iterate()
(deprecated since 1.9) no longer magically passes the block torb_funcall()
, userb_block_call()
instead.
Security:
- Updated to Ruby 2.7.3 to fix CVE-2021-28965 and CVE-2021-28966.
TruffleRuby - GraalVM Community Edition 21.1.0
TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
The Ruby language support can be added to GraalVM using the gu utility.
More information is available on the GraalVM website: https://www.graalvm.org/ruby/
Changelog
21.1.0
New features:
- Access to local variables of the interactive Binding via language bindings is now supported:
context.getBindings("ruby").putMember("my_var", 42);
(#2030). VALUE
s in C extensions now expose the Ruby object when viewed in the debugger, as long as they have not been converted to native values (@aardvark179).- Signal handlers can now be run without triggering multi-threading (@eregon).
- Fibers no longer trigger Truffle multi-threading.
Bug fixes:
Range#to_a
wasn't working forlong
ranges (#2198, @tomstuart and @LillianZ).- Show the interleaved host and guest stacktrace for host exceptions (#2226).
- Fix the label of the first location reported by
Thread#backtrace_locations
(#2229). - Fix
Thread.handle_interrupt
to defer non-pure interrupts until the end of thehandle_interrupt
block (#2219). - Clear and restore errinfo on entry and normal return from methods in C extensions (#2227).
- Fix extra whitespace in squiggly heredoc with escaped newline (#2238, @wildmaples and @norswap).
- Fix handling of signals with
--single-threaded
(#2265). - Fix
Enumerator::Lazy#{chunk_while, slice_before, slice_after, slice_when}
to return instances ofEnumerator::Lazy
(#2273, @bjfish). - Fix
Truffle::Interop.source_location
to return unavailable source sections for modules instead of null (#2257). - Fix usage of
Thread.handle_interrupt
inMonitorMixin#mon_synchronize
. - Fixed
TruffleRuby.synchronized
to handle guest safepoints (#2277). - Fix control flow bug when assigning constants using ||= (#1489).
- Fix
Kernel#raise
argument handling for hashes (#2298). - Set errinfo when
rb_protect
captures a Ruby exception (#2245). - Fixed handling of multiple optional arguments and keywords when passed a positional
Hash
(#2302).
Compatibility:
- Prepend the GraalVM LLVM Toolchain to
PATH
when installing gems (#1974, #1088, #1343, #1400, #1947, #1931, #1588). - Installing the
nokogiri
gem now defaults to use the vendoredlibxml2
andlibxslt
, similar to CRuby, which means the corresponding system packages are no longer needed (#62). - Implemented
$LOAD_PATH.resolve_feature_path
. - Add
Pathname#/
alias toPathname#+
(#2178). - Fixed issue with large
Integer
s inMath.log
(#2184). - Updated
Regexp.last_match
to supportSymbol
andString
parameter (#2179). - Added support for numbered block parameters (
_1
etc). - Fixed
String#upto
issue with non-ascii strings (#2183). - Implemented partial support for pattern matching (#2186).
- Make
File.extname
return'.'
if the path ends with one (#2192, @tomstuart). - Include fractional seconds in
Time#inspect
output (#2194, @tomstuart). - Add support for
Integer#[Range]
andInteger#[start, length]
(#2182, @gogainda). - Allow private calls with
self
as an explicit receiver (#2196, @wildmaples). - Fixed
:perm
parameter forFile.write
. - Implemented
Time#floor
and#ceil
(#2201, @wildmaples). - Allow
Range#include?
and#member?
withTime
(#2202, @wildmaples). - Implemented
Comparable#clamp(Range)
(#2200, @wildmaples). - Added a
Array#minmax
to overrideEnumerable#minmax
(#2199, @wildmaples). - Implemented
chomp
parameter forIO.{readlines, foreach}
(#2205). - Implemented the Debug Inspector C API.
- Added beginless range support for
Range#{new, bsearch, count, each, equal_value, first, inspect, max, min, size, cover?, include?, ===}
. - Added beginless range support for
Array#{[], []=, slice, slice!, to_a, fill, values_at}
(#2155, @LillianZ). - Added beginless range support for
String#{byteslice, slice, slice!}
andSymbol#slice
(#2211, @LillianZ). - Added beginless range support for
Kernel#{caller, caller_locations}
andThread#backtrace_locations
(#2211, @LillianZ). - Make rand work with exclusive range with Float (#1506, @gogainda)
- Fixed
String#dump
's formatting of escaped unicode characters (#2217, @meganniu). - Switched to the io-console C extension from C ruby for better performance and compatibility in
irb
. - Coerce the message to a
String
forBasicSocket#send
(#2209, @HoneyryderChuck). - Support buffer argument for
UDPSocket#recvfrom_nonblock
(#2209, @HoneyryderChuck). - Fixed
Integer#digits
implementation to handle more bases (#2224, #2225). - Support the
inherit
parameter forModule#{private, protected, public}_method_defined?
. - Implement
Thread.pending_interrupt?
andThread#pending_interrupt?
(#2219). - Implement
rb_lastline_set
(#2170). - Implemented
Module#const_source_location
(#2212, @tomstuart and @wildmaples). - Do not call
File.exist?
inDir.glob
asFile.exist?
is often mocked (#2236, @gogainda). - Coerce the inherit argument to a boolean in
Module#const_defined?
andModule#const_get
(#2240). - Refinements take place at
Object#method
andModule#instance_method
(#2004, @ssnickolay). - Add support for
rb_scan_args_kw
in C API (#2244, @LillianZ). - Update random implementation layout to be more compatible (#2234).
- Set
RbConfig::CONFIG['LIBPATHFLAG'/'RPATHFLAG']
like MRI to let$LIBPATH
changes inextconf.rb
work. - Access to path and mode via
rb_io_t
from C has been changed to improve compatibility for io-console. - Implemented the
Time.at
in:
parameter. - Implemented
Kernel#raise
cause
parameter. - Improved compatibility of
Signal.trap
andKernel#trap
(#2287, @chrisseaton). - Implemented
GC.stat(:total_allocated_objects)
as0
(#2292, @chrisseaton). ObjectSpace::WeakMap
now supports immediate and frozen values as both keys and values (#2267).- Call
divmod
when coercion toFloat
fails for#sleep
(#2289, @LillianZ).
Performance:
- Multi-Tier compilation is now enabled by default, which improves warmup significantly.
- Improve the performance of checks for recursion (#2189, @LillianZ).
- Improve random number generation performance by avoiding synchronization (#2190, @ivoanjo).
- We now create a single call target per block by default instead of two.
- Some uses of class variables are now much better optimized (#2259, @chrisseaton).
- Several methods that need the caller frame are now always inlined in their caller, which speeds up the interpreter and reduces footprint.
- Pasting code in IRB should be reasonably fast, by updating to
irb
1.3.3 andreline
0.2.3 (#2233).
Changes:
- Standalone builds of TruffleRuby are now based on JDK11 (they used JDK8 previously). There should be no user-visible changes. Similarly, JDK11 is now used by default in development instead of JDK8.
- The deprecated
Truffle::System.synchronized
has been removed. Java.synchronized
has been removed, it did not work on host objects.
TruffleRuby - GraalVM Community Edition 21.0.0.2
TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
The Ruby language support can be added to GraalVM using the gu utility.
More information is available on the GraalVM website: http://www.graalvm.org/ruby/
No changes in Ruby, see https://www.graalvm.org/release-notes/21_0/#21002
TruffleRuby - GraalVM Community Edition 21.0.0
TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
The Ruby language support can be added to GraalVM using the gu utility.
More information is available on the GraalVM website: http://www.graalvm.org/ruby/
Changelog
21.0.0
Release notes:
- The new IRB is quite slow when copy/pasting code into it. This is due to an inefficient
io/console
implementation which will be addressed in the next release. A workaround is to useirb --readline
, which disables some IRB features but is much faster for copy/pasting code.
New features:
- Updated to Ruby 2.7.2 (#2004, @eregon, @chrisseaton).
Bug fixes:
- Fix error message when the method name is not a Symbol or String for
Kernel#respond_to?
(#2132, @ssnickolay) - Fixed setting of special variables in enumerators and enumerables (#1484, @aardvark179).
- Fixed return value of
Enumerable#count
andEnumerable#uniq
with multiple yielded arguments (#2145, @LillianZ). - Fixed
String#unpack
forw*
format (#2143, @bjfish). - Fixed issue with
Kernel#`
when invalid UTF-8 given (#2118). - Fixed issue with
Method#to_proc
and special variable storage (#2156). - Add missing
offset
parameter forFFI::Pointer#put_array_of_*
(#1525). - Fixed issue with different
Struct
s having the same hash values (#2214).
Compatibility:
- Implement
String#undump
(#2131, @kustosz) Errno
constants with the sameerrno
number are now the same class.- Implement
Enumerable#tally
andEnumerable#filter_map
(#2144 and #2152, @LillianZ). - Implement
Range#minmax
. - Pass more
Enumerator::Lazy#uniq
andEnumerator::Lazy#chunk
specs (#2146, @LillianZ). - Implement
Enumerator#produce
(#2160, @zverok) - Implement
Complex#<=>
(#2004, @ssnickolay). - Add warning for
proc
without block (#2004, @ssnickolay). - Implemented
FrozenError#receiver
. Proc#<<
andProc#>>
raises TypeError if passed not callable object (#2004, @ssnickolay).- Support time and date related messages for
Time
(#2166). - Updated
Dir.{glob,[]}
to raiseArgumentError
for nul-separated strings. Kernel#lambda
with no block in a method called with a block raises an exception (#2004, @ssnickolay).- Implemented
BigDecimal
as C extension to improve compatibility. - Comment lines can be placed between fluent dot now (#2004, @ssnickolay).
- Implemented
rb_make_exception
. **kwargs
now accept non-Symbol keys like Ruby 2.7.- Updated the Unicode Emoji version (#2173, @wildmaples).
- Added
Enumerator::Yielder#to_proc
. - Implemented
Enumerator::Lazy#eager
. - Updated
Method#inspect
to include paremeter information. - Update
Module#name
to return the same frozen string.
Performance:
- Refactor and implement more performant
MatchData#length
(#2147, @LillianZ). - Refactor and implement more performant
Array#sample
(#2148, @LillianZ). String#inspect
is now more efficient.
Changes:
- All
InteropLibrary
messages are now exposed consistently as methods onTruffle::Interop
(#2139). Some methods were renamed to match the scheme described in the documentation.
TruffleRuby - GraalVM Community Edition 20.3.0
TruffleRuby is a high-performance implementation of the Ruby programming language.
TruffleRuby aims to be fully compatible with the standard implementation of Ruby, MRI.
The Ruby language support can be added to GraalVM using the gu utility.
More information is available on the GraalVM website: http://www.graalvm.org/docs/reference-manual/ruby/
Changelog
20.3.0
Bug fixes:
- Handle foreign null object as falsy value (#1902, @ssnickolay)
- Fixed return value of
Enumerable#first
with multiple yielded arguments (#2056, @LillianZ). - Improve reliability of the post install hook by disabling RubyGems (#2075, @eregon).
- Fixed top level exception handler to print exception cause (#2013, @bjfish).
- Fixed issue when extending FFI from File (#2094).
- Fixed issue with
Kernel#freeze
not freezing singleton class (#2093). - Fixed
String#encode
with options issue (#2091, #2095, @LillianZ) - Fixed issue with
spawn
when:close
redirect is used (#2097). - Fixed
coverage
issue when*eval
is used (#2078). - Use expanded load paths for feature matching (#1501).
- Fixed handling of post arguments for
super()
(#2111). - Fixed
SystemStackError
sometimes replaced by an internal JavaNoClassDefFoundError
on JVM (#1743). - Fixed constant/identifier detection in lexer for non-ASCII encodings (#2079, #2102, @ivoanjo).
- Fixed parsing of
--jvm
as an application argument (#2108). - Fix
rb_rescue2
to ignore the end marker(VALUE)0
(#2127, #2130). - Fix
String#{chomp, chomp!}
issue with invalid encoded strings (#2133). - Fix status and output when SystemExit is subclassed and raised (#2128)
Compatibility:
- Run
at_exit
handlers even if parsing the main script fails (#2047). - Load required libraries (
-r
) before parsing the main script (#2047). String#split
supports block (#2052, @ssnickolay)- Implemented
String#{grapheme_clusters, each_grapheme_cluster}
. - Fix the caller location for
#method_added
(#2059). - Fix issue with
Float#round
whenself
is-0.0
. - Fix
String#unpack
issue withm0
format (#2065). - Fix issue with
File.absolute_path
returning a path to current directory (#2062). - Update
Range#cover?
to handleRange
parameter. - Fix
String#{casecmp, casecmp?}
parameter conversion. - Fix
Regexp
issue which raised syntax error instead ofRegexpError
(#2066). - Handle
Object#autoload
when autoload itself (#1616, @ssnickolay) - Skip upgraded default gems while loading RubyGems (#2075).
- Verify that gem paths are correct before loading RubyGems (#2075).
- Implement
rb_ivar_count
. - Implemented
rb_yield_values2
. - Implemented
Digest::Base#{update, <<}
(#2100). - Pass the final
super
specs (#2104, @chrisseaton). - Fix arity for arguments with optional kwargs (#1669, @ssnickolay)
- Fix arity for
Proc
(#2098, @ssnickolay) - Check bounds for
FFI::Pointer
accesses when the size of the memory behind is known. - Implement negative line numbers for eval (#1482).
- Support refinements for
#to_s
called by string interpolation (#2110, @ssnickolay) - Module#using raises error in method scope (#2112, @ssnickolay)
File#path
now returns a new mutable String on every call like MRI (#2115).- Avoid infinite recursion when redefining
Warning#warn
and callingKernel#warn
(#2109). - Convert objects with
#to_path
in$LOAD_PATH
(#2119). - Handle the functions being native for
rb_thread_call_without_gvl()
(#2090). - Support refinements for Kernel#respond_to? (#2120, @ssnickolay)
- JCodings has been updated from 1.0.45 to 1.0.55.
- Joni has been updated from 2.1.30 to 2.1.40.
Performance:
- Calls with a literal block are no longer always split but instead the decision is made by the Truffle splitting heuristic.
Symbol#to_proc
is now AST-inlined in order to not rely on splitting and to avoid needing the caller frame to find refinements which apply.Symbol#to_proc
is now globally cached per Symbol and refinements, to avoid creating many redundantCallTargets
.- Setting and access to the special variables
$~
and$_
has been refactored to require less splitting (@aardvark179).
Changes:
- Migrated from JLine 2 to JLine 3 for the
readline
standard library.